[Joafip-svn] SF.net SVN: joafip:[2916] trunk
Brought to you by:
luc_peuvrier
|
From: <luc...@us...> - 2011-10-11 04:30:14
|
Revision: 2916
http://joafip.svn.sourceforge.net/joafip/?rev=2916&view=rev
Author: luc_peuvrier
Date: 2011-10-11 04:30:04 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
direct field access checker WIP
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassEnhancer.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java
trunk/joafip/src/test/java/net/sf/joafip/entity/AbstractClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/BobForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel310/ClassTwo301bReplacement.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/AbstractClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/Bob300.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/ClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bug/ContrainteForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionArrayListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionVectorNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/AbstractTestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/AbstractBobSerialize.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1Substitute.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob2.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob3.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/BobString.java
trunk/joafip/src/test/resources/log4j.properties
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPLinkedTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PArrayList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PVector.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/arraylist/ArrayListSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupportNodeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/hash/LinkedHashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/tree/LinkedTreeSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linkedlist/LinkedListSupport.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java
Added Paths:
-----------
trunk/joafip/doc/byte_code_control_flow.txt
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeAloadThis.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X1.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX1.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeGet.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeLdc.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMultiANewArray.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePut.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeSwap.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/StackElement.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ICheckMethodListener.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/RuntimeEnhanceException.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/CheckMethodListener.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractToCheckClass.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ToCheckClass.java
Modified: trunk/joafip/doc/_todo.txt
===================================================================
--- trunk/joafip/doc/_todo.txt 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/doc/_todo.txt 2011-10-11 04:30:04 UTC (rev 2916)
@@ -21,6 +21,7 @@
- project divided on sub project
- export speed up
- kept in memory for object referenced by static field
+- check field access constraints, direct field access disallow to force use of getter and/or setter
minor changes:
- added search last in red black tree manager
@@ -75,8 +76,32 @@
currently:
-------------------------------------------------------------------------------------
+persistence constraint check at enhancement for proxy creation
+==> update http://joafip.sourceforge.net/presentation/ppojo.html#prules
+- check done at enhancement -> exception
+- private are intercepted, correct the doc
+
+upgrade Maven plugins :
+maven-jar-plugin ..................................... 2.3.1 -> 2.3.2
+[INFO] maven-javadoc-plugin ..................................... 2.7 -> 2.8
+[INFO] maven-release-plugin ................................... 2.1 -> 2.2.1
+[INFO] org.codehaus.mojo:build-helper-maven-plugin .............. 1.5 -> 1.7
+[INFO] org.codehaus.mojo:buildnumber-maven-plugin ........ 1.0-beta-4 -> 1.0
+[INFO] org.codehaus.mojo:exec-maven-plugin .................... 1.2 -> 1.2.1
+
+
export/import problem.
+garbage management error with jhupedom
+
+keptinmemory problem
+
+static field persistence problem
+
+joafip reflect project (see setAccessible )
+- joafip
+- joafip-log4j
+
changes for garbage management because of autosave
- tests to add
- test for state machine
@@ -96,6 +121,7 @@
a java agent to change "new Xxx" to call to newInstance proxied object factory for auto save
+collection apache and google
-------------------------------------------------------------------------------------
copier:
- case of enum field
Added: trunk/joafip/doc/byte_code_control_flow.txt
===================================================================
--- trunk/joafip/doc/byte_code_control_flow.txt (rev 0)
+++ trunk/joafip/doc/byte_code_control_flow.txt 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,109 @@
+Determining Basic Blocks
+We can use the following rules to determine the basic
+blocks, that is, by finding the set of leaders.
+
+- The first instruction of the method and each first
+instruction of every handler for the method are
+leaders.
+
+- Each instruction that is the target of an uncondi-
+tional branch (goto, goto_w, jsr, jsr_w, and ret)
+is a leader.
+
+- Each instruction that is the target of a condi-
+tional branch (ifeq, iflt, ifle, ifne, ifgt,
+ifge, ifnull, ifnonnull, if_icmpeq, if_icmpne,
+if_icmplt, if_icmpgt, if_icmple, if_icmpge,
+if_acmpeq, if_acmpne, lcmp, fcmpl, fcmpg,
+dcmpl, dcmpg) is a leader.
+
+- Each instruction that is one of the target of a
+compound conditional branch (tableswitch or
+lookupswitch) is a leader.
+
+- Each instruction that immediately follows a con-
+ditional or unconditional branch, or a <T>return
+(ireturn, lreturn, freturn, dreturn, areturn,
+and return), or a compound conditional branch
+instruction is a leader.
+
+- Now, each individual leader give rise to a basic block,
+consisting of all instructions up to the next leader or
+the end of the bytecode. Furthermore, we enclose each
+method invocation (invokevirtual, invokespecial,
+invokestatic, and invokeinterface) in a basic block
+of its own.
+
+
+ ----
+
+unconditional branch
+* goto
+* goto_w
+* jsr
+* jsr_w
+* ret end
+
+conditional branch
+* ifeq
+* iflt
+* ifle
+* ifne
+* ifgt,
+* ifge
+* ifnull
+* ifnonnull
+* if_icmpeq
+* if_icmpne
+* if_icmplt
+* if_icmpgt
+* if_icmple
+* if_icmpge
+* if_acmpeq
+* if_acmpne
+
+lcmp ? not a jump
+fcmpl ? not a jump
+fcmpg ? not a jump
+dcmpl ? not a jump
+dcmpg ? not a jump
+
+
+compound conditional branch
+* tableswitch end
+* lookupswitch end
+
+* ireturn end
+* lreturn end
+* freturn end
+* dreturn end
+* areturn end
+* return end
+* throw end ? missing
+
+Building the CFGs
+-----------------
+
+Once we divide instructions of a method into basic
+blocks, we can use the following rules to construct the
+CFG for the method. Let u 2 V and v 2 V be two basic
+blocks:
+
+An arc (u; v) is added to A if v follows u in the byte-
+code and u does not terminate in a unconditional
+branch.
+
+An arc (u; v) is added to A if the last instruction
+of u is a conditional or unconditional branch to the
+first instruction in v.
+
+An arc id added an arc (u; v) to A from the basic
+block of each tableswitch or lookupswitch to the
+basic block of each instruction that is defined as the
+target in the switch.
+
+For each subroutine call, two arcs are added to A:
+one from the basic block of the jsr or jsr_w to the
+basic block of target, and one from the basic block
+containing the corresponding ret to the basic block
+of the instruction that immediately follows the call.
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -16,6 +16,8 @@
*/
package net.sf.joafip.service;//NOPMD
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
@@ -648,6 +650,22 @@
}
@Override
+ public void addNotCheckedMethod(final Method method) {
+ store.addNotCheckedMethod(method);
+ }
+
+ @Override
+ public void addNotCheckedMethod(final Constructor<?> constructor) {
+ store.addNotCheckedMethod(constructor);
+ }
+
+ @Override
+ public void addNotCheckedMethod(final String objectClassName,
+ final String absoluteMethodName) {
+ store.addNotCheckedMethod(objectClassName, absoluteMethodName);
+ }
+
+ @Override
public void setObjectIOForClass(final Class<?> objectClass,
final Class<? extends IObjectInput> objectInputClass,
final Class<? extends IObjectOutput> objectOutputClass)
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -23,6 +23,7 @@
package net.sf.joafip.service;
import java.io.File;
+import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
@@ -95,6 +96,7 @@
if (toUseClassLoader == null || url == null) {
url = ClassLoader.getSystemResource(resourceName);
}
+
if (url == null) {
final URI uri = new File(resourceName).toURI();
url = uri.toURL();
@@ -102,6 +104,29 @@
return url;
}
+ public InputStream getResourceAsStream(final String resourceName) {
+ ClassLoader toUseClassLoader;
+ InputStream inputStream = null;
+ if (classLoader == null) {
+ toUseClassLoader = getCurrentThreadContextClassLoader();
+ if (toUseClassLoader != null) {
+ inputStream = toUseClassLoader
+ .getResourceAsStream(resourceName);
+ }
+ } else {
+ toUseClassLoader = classLoader;
+ inputStream = toUseClassLoader.getResourceAsStream(resourceName);
+ }
+ if (toUseClassLoader == null || inputStream == null) {
+ toUseClassLoader = ClassLoader.getSystemClassLoader();
+ inputStream = toUseClassLoader.getResourceAsStream(resourceName);
+ }
+ if (toUseClassLoader == null || inputStream == null) {
+ inputStream = toUseClassLoader.getResourceAsStream(resourceName);
+ }
+ return inputStream;
+ }
+
/**
* Get the Thread Context Loader which is a JDK 1.2 feature. If we are
* running under JDK 1.1 or anything else goes wrong the
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -16,6 +16,8 @@
*/
package net.sf.joafip.service;//NOPMD
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
@@ -610,6 +612,12 @@
*/
void setForceEnhance(String[] objectClassNames);
+ void addNotCheckedMethod(Method method);
+
+ void addNotCheckedMethod(Constructor<?> constructor);
+
+ void addNotCheckedMethod(String objectClassName, String absoluteMethodName);
+
/**
* set object input output manager for a class<br>
* if class not accessible see {@link #setObjectIOForClass(String, Class)}<br>
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -32,7 +32,9 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.TreeMap;
+import java.util.TreeSet;
import net.sf.joafip.DeprecatedInStoreClass;
import net.sf.joafip.NotStorableClass;
@@ -271,6 +273,8 @@
private final Exception creationTrace = new Exception("creation trace");
+ private final Set<String> notCheckedMethodSet = new TreeSet<String>();
+
/**
*
* @param objectClass
@@ -932,6 +936,10 @@
forceEnhance = true;
}
+ public void addNotCheckedMethod(final String absoluteMethodName) {
+ notCheckedMethodSet.add(absoluteMethodName);
+ }
+
public void setSubstitute(final ClassInfo substituteClassInfo,
final ISubstituteObjectManager substituteObjectManager) {
substituted = true;
@@ -966,6 +974,10 @@
return forceEnhance;
}
+ public Set<String> getNotCheckedMethod() {
+ return notCheckedMethodSet;
+ }
+
public boolean isNotStorable() {
return notStorable;
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -22,6 +22,9 @@
*/
package net.sf.joafip.store.entity.classinfo;
+import java.util.Set;
+import java.util.TreeSet;
+
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.store.service.objectio.manager.ISubsituteSynchronizer;
import net.sf.joafip.store.service.objectio.manager.ISubstituteObjectManager;
@@ -54,6 +57,8 @@
private boolean forceEnhance;
+ private final Set<String> notCheckedMethodSet = new TreeSet<String>();
+
private Class<?> substituteObjectClass;
private ISubstituteObjectManager substituteObjectManager;
@@ -136,10 +141,18 @@
forceEnhance = true;
}
+ public void addNotCheckedMethod(final String absoluteMethodName) {
+ notCheckedMethodSet.add(absoluteMethodName);
+ }
+
public boolean isForceEnhance() {
return forceEnhance;
}
+ public Set<String> getNotCheckedMethodSet() {
+ return notCheckedMethodSet;
+ }
+
public void setSubstituteObjectManager(
final Class<?> substituteObjectClass,
final ISubstituteObjectManager substituteObjectManager) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -67,9 +67,9 @@
// return false;
final KeptInMemoryObjectKey other = (KeptInMemoryObjectKey) obj;
if (key == null) {
- if (other.key != null)
+ if (other.getKey() != null)
return false;
- } else if (!key.equals(other.key))
+ } else if (!key.equals(other.getKey()))
return false;
return true;
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -57,9 +57,9 @@
@Override
public int compareTo(final SubstituteOfEnum other) {
- int compareTo = enumClassName.compareTo(other.enumClassName);
+ int compareTo = enumClassName.compareTo(other.getEnumClassName());
if (compareTo == 0) {
- compareTo = enumName.compareTo(other.enumName);
+ compareTo = enumName.compareTo(other.getEnumName());
}
return compareTo;
}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class DirectAccessInfo implements Comparable<DirectAccessInfo> {
+
+ private final String methodAbsoluteName;
+
+ private final String labeledAddress;
+
+ private final int sourceLineNumber;
+
+ public DirectAccessInfo(final String methodAbsoluteName,
+ final String labeledAddress, final int sourceLineNumber) {
+ super();
+ this.methodAbsoluteName = methodAbsoluteName;
+ this.labeledAddress = labeledAddress;
+ this.sourceLineNumber = sourceLineNumber;
+ }
+
+ public String getMethodAbsoluteName() {
+ return methodAbsoluteName;
+ }
+
+ public String getLabeledAddress() {
+ return labeledAddress;
+ }
+
+ public int getSourceLineNumber() {
+ return sourceLineNumber;
+ }
+
+ @Override
+ public String toString() {
+ return "in \"" + methodAbsoluteName + "\" opcode at " + labeledAddress
+ + ", source line number " + sourceLineNumber;
+ }
+
+ @Override
+ public int compareTo(final DirectAccessInfo other) {
+ int compareTo = methodAbsoluteName.compareTo(other
+ .getMethodAbsoluteName());
+ if (compareTo == 0) {
+ compareTo = sourceLineNumber - other.getSourceLineNumber();
+ }
+ return compareTo;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime
+ * result
+ + ((methodAbsoluteName == null) ? 0 : methodAbsoluteName
+ .hashCode());
+ result = prime * result + sourceLineNumber;
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return compareTo((DirectAccessInfo) obj) == 0;
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public enum EnumStackEltType {
+ /** no type */
+ VOID(0),
+ /** reference on object or array */
+ REF(1),
+ /**/
+ INT_SHORT_CHAR_BYTE_BOOL(1),
+ /**/
+ LONG_L(2), LONG_H(2),
+ /**/
+ FLOAT(1),
+ /**/
+ DOUBLE_L(2), DOUBLE_H(2),
+ /**/
+ OPCODE_ADDRESS(0);
+
+ private final int category;
+
+ private EnumStackEltType(final int category) {
+ this.category = category;
+ }
+
+ public int getCategory() {
+ return category;
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public enum EnumType {
+ /** no type */
+ VOID(0, EnumStackEltType.VOID, null),
+ /** reference on object or array */
+ REF(1, EnumStackEltType.REF, null),
+ /**/
+ INT(1, EnumStackEltType.INT_SHORT_CHAR_BYTE_BOOL, null),
+ /**/
+ LONG(2, EnumStackEltType.LONG_L, EnumStackEltType.LONG_H),
+ /**/
+ FLOAT(1, EnumStackEltType.FLOAT, null),
+ /**/
+ DOUBLE(2, EnumStackEltType.DOUBLE_L, EnumStackEltType.DOUBLE_H),
+ /**/
+ SHORT(1, EnumStackEltType.INT_SHORT_CHAR_BYTE_BOOL, null),
+ /**/
+ CHAR(1, EnumStackEltType.INT_SHORT_CHAR_BYTE_BOOL, null),
+ /**/
+ BYTE_BOOL(1, EnumStackEltType.INT_SHORT_CHAR_BYTE_BOOL, null),
+ /**/
+ OPCODE_ADDRESS(0, EnumStackEltType.OPCODE_ADDRESS, null);
+
+ private final int category;
+
+ private final EnumStackEltType lowType;
+
+ private final EnumStackEltType highType;
+
+ private EnumType(final int category, final EnumStackEltType lowType,
+ final EnumStackEltType highType) {
+ this.category = category;
+ this.lowType = lowType;
+ this.highType = highType;
+ }
+
+ public int getCategory() {
+ return category;
+ }
+
+ public EnumStackEltType getLowType() {
+ return lowType;
+ }
+
+ public EnumStackEltType getHighType() {
+ return highType;
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.asm.Label;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+import net.sf.joafip.store.service.bytecode.proxy.OpcodeInterpreter;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNode {
+
+ protected final static OpcodeInterpreter OPCODE_INTERPRETER = OpcodeInterpreter
+ .getInstance();
+
+ private final List<OpcodeNode> nextOpcodeNodeList = new LinkedList<OpcodeNode>();
+
+ private final int address;
+
+ protected final int opcode;
+
+ private final int lineNumber;
+
+ private StackElement beforeExecutionStackElement;
+
+ private StackElement afterExecutionStackElement;
+
+ private Label label;
+
+ /**
+ * construct a null opcode node
+ */
+ public OpcodeNode() {
+ super();
+ this.opcode = -1;
+ this.lineNumber = 0;
+ this.address = -1;
+ }
+
+ public OpcodeNode(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super();
+ this.opcode = opcode;
+ this.address = address;
+ this.lineNumber = lineNumber;
+ if (previousOpcode != null) {
+ previousOpcode.addNext(this);
+ }
+ }
+
+ public String getLabeledAddress() {
+ return (label == null ? "" : label.toString()) + "@" + address;
+ }
+
+ public int getAddress() {
+ return address;
+ }
+
+ public Label getLabel() {
+ return label;
+ }
+
+ public void setLabel(final Label label) {
+ this.label = label;
+ }
+
+ public void setBeforeExecutionStackElement(
+ final StackElement beforeExecutionStackElement) {
+ assert this.beforeExecutionStackElement == null;
+ this.beforeExecutionStackElement = beforeExecutionStackElement;
+ }
+
+ public StackElement getBeforeExecutionStackElement() {
+ return beforeExecutionStackElement;
+ }
+
+ public StackElement getAfterExecutionStackElement() {
+ return afterExecutionStackElement;
+ }
+
+ public void addNext(final OpcodeNode next) {
+ nextOpcodeNodeList.add(next);
+ }
+
+ public List<OpcodeNode> getNextOpcodeNodeList() {
+ return nextOpcodeNodeList;
+ }
+
+ public StackElement interprete() throws EnhanceException {
+ afterExecutionStackElement = interprete(beforeExecutionStackElement);
+ return afterExecutionStackElement;
+ }
+
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interprete(opcode, currentStackElement);
+ }
+
+ public boolean isDirectAccess() {
+ return false;
+ }
+
+ public int getLineNumber() {
+ return lineNumber;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder stringBuilder = new StringBuilder();
+ if (label != null) {
+ stringBuilder.append(label.toString());
+ }
+ stringBuilder.append('@');
+ stringBuilder.append(address);
+ stringBuilder.append(" opcode #");
+ stringBuilder.append(opcode);
+ stringBuilder.append(' ');
+ stringBuilder.append(mnemonic());
+ stringBuilder.append(" line #");
+ stringBuilder.append(lineNumber);
+ stringBuilder.append(" next ");
+ for (OpcodeNode next : nextOpcodeNodeList) {
+ final Label nextLabel = next.label;
+ if (nextLabel != null) {
+ stringBuilder.append(nextLabel.toString());
+ }
+ stringBuilder.append('@');
+ stringBuilder.append(next.address);
+ stringBuilder.append(' ');
+ }
+ stringBuilder.append('\n');
+ if (beforeExecutionStackElement == null) {
+ stringBuilder.append('?');
+ } else {
+ stringBuilder.append(beforeExecutionStackElement.toString());
+ }
+ stringBuilder.append("\n=> ");
+ if (afterExecutionStackElement == null) {
+ stringBuilder.append('?');
+ } else {
+ stringBuilder.append(afterExecutionStackElement.toString());
+ }
+ return stringBuilder.toString();
+ }
+
+ protected String mnemonic() {
+ return OPCODE_INTERPRETER.mnemonic(opcode);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeAloadThis.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeAloadThis.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeAloadThis.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeAloadThis extends OpcodeNode {
+
+ public OpcodeNodeAloadThis(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super(opcode, address, lineNumber, previousOpcode);
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ final StackElement stackElement = super.interprete(currentStackElement);
+ assert stackElement != null : "must has stack element for opcode "
+ + opcode;
+ assert EnumStackEltType.REF.equals(stackElement.getType());
+ stackElement.setIsThisRef();
+ return stackElement;
+ }
+
+ @Override
+ protected String mnemonic() {
+ return super.mnemonic() + " THIS";
+ }
+
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeDup extends OpcodeNode {
+
+ public OpcodeNodeDup(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super(opcode, address, lineNumber, previousOpcode);
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpreteDup(currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeDup2 extends OpcodeNode {
+
+ public OpcodeNodeDup2(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super(opcode, address, lineNumber, previousOpcode);
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpreteDup2(currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X1.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X1.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X1.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeDup2X1 extends OpcodeNode {
+
+ public OpcodeNodeDup2X1(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super(opcode, address, lineNumber, previousOpcode);
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpreteDup2X1(currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X2.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X2.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X2.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeDup2X2 extends OpcodeNode {
+
+ public OpcodeNodeDup2X2(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super(opcode, address, lineNumber, previousOpcode);
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpreteDup2X2(currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX1.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX1.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX1.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeDupX1 extends OpcodeNode {
+
+ public OpcodeNodeDupX1(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super(opcode, address, lineNumber, previousOpcode);
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpreteDupX1(currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX2.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX2.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX2.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeDupX2 extends OpcodeNode {
+
+ public OpcodeNodeDupX2(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super(opcode, address, lineNumber, previousOpcode);
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpreteDupX2(currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeGet.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeGet.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeGet.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.asm.Opcodes;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeGet extends OpcodeNode {
+
+ private final String desc;
+
+ private boolean directAccess;
+
+ public OpcodeNodeGet(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode,
+ final String desc) {
+ super(opcode, address, lineNumber, previousOpcode);
+ this.desc = desc;
+ }
+
+ @Override
+ public boolean isDirectAccess() {
+ return directAccess;
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ final StackElement pointer;
+ if (opcode == Opcodes.GETFIELD) {
+ pointer = OPCODE_INTERPRETER.pop(currentStackElement, EnumType.REF);
+ directAccess = true ^ currentStackElement.isThisReference();
+ } else {
+ pointer = currentStackElement;
+ directAccess = false;
+ }
+ return OPCODE_INTERPRETER.push(desc, pointer);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeLdc.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeLdc.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeLdc.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeLdc extends OpcodeNode {
+
+ private final Object cst;
+
+ public OpcodeNodeLdc(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode,
+ final Object cst) {
+ super(opcode, address, lineNumber, previousOpcode);
+ this.cst = cst;
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpreteLdc(cst, currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeMethod extends OpcodeNode {
+
+ private final String desc;
+
+ public OpcodeNodeMethod(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode,
+ final String desc) {
+ super(opcode, address, lineNumber, previousOpcode);
+ this.desc = desc;
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpreteInvoke(opcode, desc,
+ currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMultiANewArray.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMultiANewArray.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMultiANewArray.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodeMultiANewArray extends OpcodeNode {
+
+ private final int dims;
+
+ public OpcodeNodeMultiANewArray(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode,
+ final int dims) {
+ super(opcode, address, lineNumber, previousOpcode);
+ this.dims = dims;
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.multiANewArray(dims, currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class OpcodeNodePop extends OpcodeNode {
+
+ public OpcodeNodePop(final int opcode, final int address,
+ final int lineNumber, final OpcodeNode previousOpcode) {
+ super(opcode, address, lineNumber, previousOpcode);
+ }
+
+ @Override
+ protected StackElement interprete(final StackElement currentStackElement)
+ throws EnhanceException {
+ return OPCODE_INTERPRETER.interpretePop(currentStackElement);
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop2.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop2.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop2.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.stor...
[truncated message content] |