Commit 9da53e7b authored by Vít Kabele's avatar Vít Kabele
Browse files

Staticcontext package merged.

parent 824b5607
Pipeline #3376 passed with stages
in 2 minutes and 54 seconds
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
<classpathentry kind="src" path="disl/src/src-localvar"/> <classpathentry kind="src" path="disl/src/src-localvar"/>
<classpathentry kind="src" path="disl/src/src-scope"/> <classpathentry kind="src" path="disl/src/src-scope"/>
<classpathentry kind="src" path="disl-server/src"/> <classpathentry kind="src" path="disl-server/src"/>
<classpathentry kind="src" path="disl/src/src-staticcontext"/>
<classpathentry kind="src" path="disl/src/src-staticcontext-uid"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="output/lib/disl-bypass.jar"/> <classpathentry kind="lib" path="output/lib/disl-bypass.jar"/>
<classpathentry kind="lib" path="lib/disl/log4j.jar" sourcepath="lib/devel/log4j-source.jar"/> <classpathentry kind="lib" path="lib/disl/log4j.jar" sourcepath="lib/devel/log4j-source.jar"/>
......
...@@ -18,6 +18,8 @@ src.disl.guard=src-guard ...@@ -18,6 +18,8 @@ src.disl.guard=src-guard
src.disl.localvar=src-localvar src.disl.localvar=src-localvar
src.disl.exception=src-exception src.disl.exception=src-exception
src.disl.scope=src-scope src.disl.scope=src-scope
src.disl.staticcontext=src-staticcontext
src.disl.staticcontext-uid=src-staticcontext-uid
src.disl.bypass=src-disl-bypass src.disl.bypass=src-disl-bypass
src.disl.agent=src-disl-agent src.disl.agent=src-disl-agent
src.shvm=src-shvm src.shvm=src-shvm
......
...@@ -485,6 +485,8 @@ ...@@ -485,6 +485,8 @@
<src path="${src.disl.prefix}/src/${src.disl.guard}"/> <src path="${src.disl.prefix}/src/${src.disl.guard}"/>
<src path="${src.disl.prefix}/src/${src.disl.scope}"/> <src path="${src.disl.prefix}/src/${src.disl.scope}"/>
<src path="${src.disl.prefix}/src/${src.disl.localvar}"/> <src path="${src.disl.prefix}/src/${src.disl.localvar}"/>
<src path="${src.disl.prefix}/src/${src.disl.staticcontext}"/>
<src path="${src.disl.prefix}/src/${src.disl.staticcontext-uid}"/>
<src path="${src.disl.prefix}/src/${src.disl.util}"/> <src path="${src.disl.prefix}/src/${src.disl.util}"/>
<src path="${src.disl.prefix}/src/${src.disl.main}"/> <src path="${src.disl.prefix}/src/${src.disl.main}"/>
......
...@@ -9,7 +9,7 @@ import ch.usi.dag.disl.classcontext.ClassContext; ...@@ -9,7 +9,7 @@ import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext; import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.processorcontext.ArgumentContext; import ch.usi.dag.disl.processorcontext.ArgumentContext;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext; import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext;
import ch.usi.dag.disl.staticcontext.StaticContext;
public enum ContextKind { public enum ContextKind {
......
...@@ -157,7 +157,7 @@ class IsolatedSnippetParser extends SnippetParser { ...@@ -157,7 +157,7 @@ class IsolatedSnippetParser extends SnippetParser {
/** /**
* Recursively determine, if the given type extends one of the context types. * Recursively determine, if the given type extends one of the context types.
* Plus, if the argument extends (even transitively) the {@link ch.usi.dag.disl.staticcontext.StaticContext } * Plus, if the argument extends (even transitively) the {@link StaticContext }
* load all the unloaded classes to the VM for later execution. * load all the unloaded classes to the VM for later execution.
* @param type * @param type
* @return * @return
......
...@@ -2,8 +2,6 @@ package ch.usi.dag.disl; ...@@ -2,8 +2,6 @@ package ch.usi.dag.disl;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import ch.usi.dag.disl.staticcontext.StaticContext;
public class StaticContextMethod { public class StaticContextMethod {
......
...@@ -9,7 +9,6 @@ import java.util.Set; ...@@ -9,7 +9,6 @@ import java.util.Set;
import ch.usi.dag.disl.guardcontext.GuardContext; import ch.usi.dag.disl.guardcontext.GuardContext;
import ch.usi.dag.disl.processor.generator.ProcMethodInstance; import ch.usi.dag.disl.processor.generator.ProcMethodInstance;
import ch.usi.dag.disl.processorcontext.ArgumentContext; import ch.usi.dag.disl.processorcontext.ArgumentContext;
import ch.usi.dag.disl.staticcontext.StaticContext;
public abstract class GuardHelper { public abstract class GuardHelper {
......
...@@ -4,7 +4,6 @@ import ch.usi.dag.disl.processor.generator.PIResolver; ...@@ -4,7 +4,6 @@ import ch.usi.dag.disl.processor.generator.PIResolver;
import ch.usi.dag.disl.processor.generator.ProcGenerator; import ch.usi.dag.disl.processor.generator.ProcGenerator;
import ch.usi.dag.disl.processor.generator.ProcInstance; import ch.usi.dag.disl.processor.generator.ProcInstance;
import ch.usi.dag.disl.processor.generator.ProcMethodInstance; import ch.usi.dag.disl.processor.generator.ProcMethodInstance;
import ch.usi.dag.disl.staticcontext.generator.SCGenerator;
import ch.usi.dag.disl.weaver.Weaver; import ch.usi.dag.disl.weaver.Weaver;
import ch.usi.dag.util.asm.ClassNodeHelper; import ch.usi.dag.util.asm.ClassNodeHelper;
import ch.usi.dag.util.logging.Logger; import ch.usi.dag.util.logging.Logger;
......
...@@ -3,8 +3,6 @@ package ch.usi.dag.disl; ...@@ -3,8 +3,6 @@ package ch.usi.dag.disl;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import ch.usi.dag.disl.staticcontext.StaticContext;
public class SCResolver { public class SCResolver {
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.disl.JavaNames;
public abstract class AbstractMethodUid extends AbstractUniqueId { public abstract class AbstractMethodUid extends AbstractUniqueId {
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
import ch.usi.dag.disl.staticcontext.AbstractStaticContext;
public abstract class AbstractUniqueId extends AbstractStaticContext { public abstract class AbstractUniqueId extends AbstractStaticContext {
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import ch.usi.dag.disl.StaticContextException;
// holds IDs // holds IDs
class IdHolder { class IdHolder {
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
import java.util.Random; import java.util.Random;
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
import ch.usi.dag.disl.staticcontext.StaticContext;
/** /**
* Provides a {@link StaticContext} implementation that can be used to obtain a * Provides a {@link StaticContext} implementation that can be used to obtain a
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
public class SequenceId extends AbstractIdCalculator { public class SequenceId extends AbstractIdCalculator {
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
import ch.usi.dag.disl.staticcontext.StaticContext;
/** /**
* Provides a {@link StaticContext} implementation that can be used to obtain a * Provides a {@link StaticContext} implementation that can be used to obtain a
......
package ch.usi.dag.disl.staticcontext.uid; package ch.usi.dag.disl;
/** /**
* This class has been deprecated in favor of the {@link RandomMethodUid} and * This class has been deprecated in favor of the {@link RandomMethodUid} and
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import ch.usi.dag.disl.Shadow;
/** /**
* Provides a trivial {@link StaticContext} interface implementation, which just * Provides a trivial {@link StaticContext} interface implementation, which just
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.disl.Insn;
import ch.usi.dag.disl.Logging;
import ch.usi.dag.disl.BasicBlock;
import ch.usi.dag.disl.CtrlFlowGraph;
import ch.usi.dag.util.logging.Logger; import ch.usi.dag.util.logging.Logger;
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
/** /**
* Provides static context information about instrumented bytecode. * Provides static context information about instrumented bytecode.
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import org.objectweb.asm.Opcodes; import org.objectweb.asm.Opcodes;
import ch.usi.dag.disl.JavaNames;
/** /**
* Provides class related static context information for the method being * Provides class related static context information for the method being
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import org.objectweb.asm.tree.FieldInsnNode; import org.objectweb.asm.tree.FieldInsnNode;
import ch.usi.dag.disl.marker.BytecodeMarker; import ch.usi.dag.disl.marker.BytecodeMarker;
import ch.usi.dag.disl.JavaNames;
/** /**
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.InsnList;
import ch.usi.dag.disl.AsmHelper.Insns; import ch.usi.dag.disl.AsmHelper.Insns;
import ch.usi.dag.disl.Insn;
/** /**
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import org.objectweb.asm.Type; import org.objectweb.asm.Type;
import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodInsnNode;
import ch.usi.dag.disl.marker.BytecodeMarker; import ch.usi.dag.disl.marker.BytecodeMarker;
import ch.usi.dag.disl.Insn;
import ch.usi.dag.disl.JavaNames;
/** /**
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
...@@ -8,8 +8,6 @@ import java.util.Set; ...@@ -8,8 +8,6 @@ import java.util.Set;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TryCatchBlockNode; import org.objectweb.asm.tree.TryCatchBlockNode;
import ch.usi.dag.disl.BasicBlock;
import ch.usi.dag.disl.CtrlFlowGraph;
/** /**
* <b>NOTE: This class is work in progress</b> * <b>NOTE: This class is work in progress</b>
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import org.objectweb.asm.Opcodes; import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.disl.JavaNames;
/** /**
* Provides method related static context information for the method being * Provides method related static context information for the method being
......
package ch.usi.dag.disl.staticcontext.generator; package ch.usi.dag.disl;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import ch.usi.dag.disl.StaticContextMethod;
import ch.usi.dag.disl.ReflectionException;
import ch.usi.dag.disl.StaticContextGenException;
import ch.usi.dag.disl.SCResolver;
import ch.usi.dag.disl.Shadow;
import ch.usi.dag.disl.Snippet;
import ch.usi.dag.disl.staticcontext.StaticContext;
import ch.usi.dag.disl.JavaNames;
public class SCGenerator { public class SCGenerator {
...@@ -20,12 +12,12 @@ public class SCGenerator { ...@@ -20,12 +12,12 @@ public class SCGenerator {
private final String methodId; private final String methodId;
public StaticContextKey (final Shadow shadow, final String methodId) { StaticContextKey (final Shadow shadow, final String methodId) {
this.shadow = shadow; this.shadow = shadow;
this.methodId = methodId; this.methodId = methodId;
} }
public StaticContextKey ( StaticContextKey (
final Shadow shadow, final String className, final String methodName final Shadow shadow, final String className, final String methodName
) { ) {
this (shadow, JavaNames.methodName (className, methodName)); this (shadow, JavaNames.methodName (className, methodName));
...@@ -89,7 +81,7 @@ public class SCGenerator { ...@@ -89,7 +81,7 @@ public class SCGenerator {
// Call static context for each snippet and each marked region and create // Call static context for each snippet and each marked region and create
// a static info values // a static info values
public static SCGenerator computeStaticInfo ( static SCGenerator computeStaticInfo (
final Map <Snippet, List <Shadow>> snippetMarkings final Map <Snippet, List <Shadow>> snippetMarkings
) throws ReflectionException, StaticContextGenException { ) throws ReflectionException, StaticContextGenException {
// //
......
package ch.usi.dag.disl.staticcontext; package ch.usi.dag.disl;
import ch.usi.dag.disl.Shadow;
/** /**
* <p> * <p>
...@@ -9,19 +7,19 @@ import ch.usi.dag.disl.Shadow; ...@@ -9,19 +7,19 @@ import ch.usi.dag.disl.Shadow;
* There is a list of already prepared static contexts. * There is a list of already prepared static contexts.
* <ul> * <ul>
* <li> * <li>
* {@link ch.usi.dag.disl.staticcontext.BasicBlockStaticContext * {@link BasicBlockStaticContext
* BasicBLockStaticContext - experimental}</li> * BasicBLockStaticContext - experimental}</li>
* <li> * <li>
* {@link ch.usi.dag.disl.staticcontext.BytecodeStaticContext * {@link BytecodeStaticContext
* BytecodeStaticContext}</li> * BytecodeStaticContext}</li>
* <li> * <li>
* {@link ch.usi.dag.disl.staticcontext.FieldAccessStaticContext * {@link FieldAccessStaticContext
* FieldAccessStaticContext}</li> * FieldAccessStaticContext}</li>
* <li> * <li>
* {@link ch.usi.dag.disl.staticcontext.MethodStaticContext * {@link MethodStaticContext
* MethodStaticContext}</li> * MethodStaticContext}</li>
* <li> * <li>
* {@link ch.usi.dag.disl.staticcontext.LoopStaticContext * {@link LoopStaticContext
* LoopStaticContext - experimental}</li> * LoopStaticContext - experimental}</li>
* </ul> * </ul>
* <p> * <p>
......
...@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext; ...@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext; import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.Marker; import ch.usi.dag.disl.marker.Marker;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext; import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext;
import ch.usi.dag.disl.staticcontext.StaticContext; import ch.usi.dag.disl.StaticContext;
/** /**
......
...@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext; ...@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext; import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.Marker; import ch.usi.dag.disl.marker.Marker;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext; import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext;
import ch.usi.dag.disl.staticcontext.StaticContext; import ch.usi.dag.disl.StaticContext;
/** /**
......
...@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext; ...@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext; import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.Marker; import ch.usi.dag.disl.marker.Marker;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext; import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext;
import ch.usi.dag.disl.staticcontext.StaticContext; import ch.usi.dag.disl.StaticContext;
/** /**
......
...@@ -7,7 +7,7 @@ import java.lang.annotation.Target; ...@@ -7,7 +7,7 @@ import java.lang.annotation.Target;
import ch.usi.dag.disl.classcontext.ClassContext; import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext; import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.processorcontext.ArgumentContext; import ch.usi.dag.disl.processorcontext.ArgumentContext;
import ch.usi.dag.disl.staticcontext.StaticContext; import ch.usi.dag.disl.StaticContext;
/** /**
......
...@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext; ...@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext; import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.Marker; import ch.usi.dag.disl.marker.Marker;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext; import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext;