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 @@
<classpathentry kind="src" path="disl/src/src-localvar"/>
<classpathentry kind="src" path="disl/src/src-scope"/>
<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="lib" path="output/lib/disl-bypass.jar"/>
<classpathentry kind="lib" path="lib/disl/log4j.jar" sourcepath="lib/devel/log4j-source.jar"/>
......
......@@ -18,6 +18,8 @@ src.disl.guard=src-guard
src.disl.localvar=src-localvar
src.disl.exception=src-exception
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.agent=src-disl-agent
src.shvm=src-shvm
......
......@@ -485,6 +485,8 @@
<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.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.main}"/>
......
......@@ -9,7 +9,7 @@ import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.processorcontext.ArgumentContext;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext;
import ch.usi.dag.disl.staticcontext.StaticContext;
public enum ContextKind {
......
......@@ -157,7 +157,7 @@ class IsolatedSnippetParser extends SnippetParser {
/**
* 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.
* @param type
* @return
......
......@@ -2,8 +2,6 @@ package ch.usi.dag.disl;
import java.lang.reflect.Method;
import ch.usi.dag.disl.staticcontext.StaticContext;
public class StaticContextMethod {
......
......@@ -9,7 +9,6 @@ import java.util.Set;
import ch.usi.dag.disl.guardcontext.GuardContext;
import ch.usi.dag.disl.processor.generator.ProcMethodInstance;
import ch.usi.dag.disl.processorcontext.ArgumentContext;
import ch.usi.dag.disl.staticcontext.StaticContext;
public abstract class GuardHelper {
......
......@@ -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.ProcInstance;
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.util.asm.ClassNodeHelper;
import ch.usi.dag.util.logging.Logger;
......
......@@ -3,8 +3,6 @@ package ch.usi.dag.disl;
import java.util.HashMap;
import java.util.Map;
import ch.usi.dag.disl.staticcontext.StaticContext;
public class SCResolver {
......
package ch.usi.dag.disl.staticcontext.uid;
package ch.usi.dag.disl;
import java.util.HashSet;
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.MethodNode;
import ch.usi.dag.disl.JavaNames;
public abstract class AbstractMethodUid extends AbstractUniqueId {
......
package ch.usi.dag.disl.staticcontext.uid;
import ch.usi.dag.disl.staticcontext.AbstractStaticContext;
package ch.usi.dag.disl;
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.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import ch.usi.dag.disl.StaticContextException;
// holds IDs
class IdHolder {
......
package ch.usi.dag.disl.staticcontext.uid;
package ch.usi.dag.disl;
import java.util.Random;
......
package ch.usi.dag.disl.staticcontext.uid;
import ch.usi.dag.disl.staticcontext.StaticContext;
package ch.usi.dag.disl;
/**
* 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 {
......
package ch.usi.dag.disl.staticcontext.uid;
import ch.usi.dag.disl.staticcontext.StaticContext;
package ch.usi.dag.disl;
/**
* 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
......
package ch.usi.dag.disl.staticcontext;
import ch.usi.dag.disl.Shadow;
package ch.usi.dag.disl;
/**
* 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 org.objectweb.asm.tree.AbstractInsnNode;
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;
......
package ch.usi.dag.disl.staticcontext;
package ch.usi.dag.disl;
/**
* Provides static context information about instrumented bytecode.
......
package ch.usi.dag.disl.staticcontext;
package ch.usi.dag.disl;
import org.objectweb.asm.Opcodes;
import ch.usi.dag.disl.JavaNames;
/**
* 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 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.InsnList;
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.tree.MethodInsnNode;
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.HashSet;
......@@ -8,8 +8,6 @@ import java.util.Set;
import org.objectweb.asm.tree.MethodNode;
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>
......
package ch.usi.dag.disl.staticcontext;
package ch.usi.dag.disl;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.disl.JavaNames;
/**
* 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.List;
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 {
......@@ -20,12 +12,12 @@ public class SCGenerator {
private final String methodId;
public StaticContextKey (final Shadow shadow, final String methodId) {
StaticContextKey (final Shadow shadow, final String methodId) {
this.shadow = shadow;
this.methodId = methodId;
}
public StaticContextKey (
StaticContextKey (
final Shadow shadow, final String className, final String methodName
) {
this (shadow, JavaNames.methodName (className, methodName));
......@@ -89,7 +81,7 @@ public class SCGenerator {
// Call static context for each snippet and each marked region and create
// a static info values
public static SCGenerator computeStaticInfo (
static SCGenerator computeStaticInfo (
final Map <Snippet, List <Shadow>> snippetMarkings
) throws ReflectionException, StaticContextGenException {
//
......
package ch.usi.dag.disl.staticcontext;
import ch.usi.dag.disl.Shadow;
package ch.usi.dag.disl;
/**
* <p>
......@@ -9,19 +7,19 @@ import ch.usi.dag.disl.Shadow;
* There is a list of already prepared static contexts.
* <ul>
* <li>
* {@link ch.usi.dag.disl.staticcontext.BasicBlockStaticContext
* {@link BasicBlockStaticContext
* BasicBLockStaticContext - experimental}</li>
* <li>
* {@link ch.usi.dag.disl.staticcontext.BytecodeStaticContext
* {@link BytecodeStaticContext
* BytecodeStaticContext}</li>
* <li>
* {@link ch.usi.dag.disl.staticcontext.FieldAccessStaticContext
* {@link FieldAccessStaticContext
* FieldAccessStaticContext}</li>
* <li>
* {@link ch.usi.dag.disl.staticcontext.MethodStaticContext
* {@link MethodStaticContext
* MethodStaticContext}</li>
* <li>
* {@link ch.usi.dag.disl.staticcontext.LoopStaticContext
* {@link LoopStaticContext
* LoopStaticContext - experimental}</li>
* </ul>
* <p>
......
......@@ -8,7 +8,7 @@ import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.Marker;
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;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.Marker;
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;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.Marker;
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;
import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
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;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.Marker;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext;
import ch.usi.dag.disl.staticcontext.StaticContext;
import ch.usi.dag.disl.StaticContext;
/**
......
......@@ -2,7 +2,7 @@ package ch.usi.dag.disl.dynamiccontext;
import ch.usi.dag.disl.annotation.After;
import ch.usi.dag.disl.annotation.AfterThrowing;
import ch.usi.dag.disl.staticcontext.FieldAccessStaticContext;
import ch.usi.dag.disl.FieldAccessStaticContext;
/**
......
......@@ -5,7 +5,7 @@ import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.disl.Reflection;
import ch.usi.dag.disl.Reflection.Class;
import ch.usi.dag.disl.Reflection.Method;
import ch.usi.dag.disl.staticcontext.AbstractStaticContext;
import ch.usi.dag.disl.AbstractStaticContext;
/**
......
......@@ -28,7 +28,7 @@ import ch.usi.dag.disl.Shadow;
import ch.usi.dag.disl.Shadow.WeavingRegion;
import ch.usi.dag.disl.Snippet;
import ch.usi.dag.disl.SnippetCode;
import ch.usi.dag.disl.staticcontext.generator.SCGenerator;
import ch.usi.dag.disl.SCGenerator;
import ch.usi.dag.disl.AsmHelper;
import ch.usi.dag.disl.AsmHelper.Insns;
import ch.usi.dag.disl.CodeTransformer;
......
......@@ -33,8 +33,8 @@ import ch.usi.dag.disl.processorcontext.ArgumentProcessorMode;
import ch.usi.dag.disl.Shadow;
import ch.usi.dag.disl.Snippet;
import ch.usi.dag.disl.SnippetCode;
import ch.usi.dag.disl.staticcontext.StaticContext;
import ch.usi.dag.disl.staticcontext.generator.SCGenerator;
import ch.usi.dag.disl.StaticContext;
import ch.usi.dag.disl.SCGenerator;
import ch.usi.dag.disl.AsmHelper;
import ch.usi.dag.disl.AsmHelper.Insns;
import ch.usi.dag.disl.FrameHelper;
......
......@@ -6,7 +6,7 @@ import ch.usi.dag.disl.annotation.After;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.annotation.ThreadLocal;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.staticcontext.uid.RandomMethodUid;
import ch.usi.dag.disl.RandomMethodUid;
import ch.usi.dag.disl.test.suite.after2.instr.runtime.Analysis;
public class DiSLClass {
......
package ch.usi.dag.disl.test.suite.after2.instr;
import ch.usi.dag.disl.annotation.GuardMethod;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
import ch.usi.dag.disl.MethodStaticContext;
public class NotInitNorClinit {
......
......@@ -3,7 +3,7 @@ package ch.usi.dag.disl.test.suite.after3.instr;
import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.annotation.AfterThrowing;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
import ch.usi.dag.disl.MethodStaticContext;
public class DiSLClass {
......
......@@ -3,8 +3,8 @@ package ch.usi.dag.disl.test.suite.afterinit2.instr;
import ch.usi.dag.disl.annotation.After;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.AfterInitBodyMarker;
import ch.usi.dag.disl.staticcontext.ClassStaticContext;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
import ch.usi.dag.disl.ClassStaticContext;
import ch.usi.dag.disl.MethodStaticContext;
public class DiSLClass {
......
......@@ -4,7 +4,7 @@ import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorContext;
import ch.usi.dag.disl.processorcontext.ArgumentProcessorMode;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
import ch.usi.dag.disl.MethodStaticContext;
public class DiSLClass {
......
......@@ -4,7 +4,7 @@ import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.BasicBlockMarker;
import ch.usi.dag.disl.marker.PreciseBasicBlockMarker;
import ch.usi.dag.disl.staticcontext.BasicBlockStaticContext;
import ch.usi.dag.disl.BasicBlockStaticContext;
public class DiSLClass {
......
......@@ -2,7 +2,7 @@ package ch.usi.dag.disl.test.suite.bytecodemarker.instr;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.BytecodeMarker;
import ch.usi.dag.disl.staticcontext.InstructionStaticContext;
import ch.usi.dag.disl.InstructionStaticContext;
public class DiSLClass {
......
......@@ -4,7 +4,7 @@ import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.annotation.After;
import ch.usi.dag.disl.annotation.ThreadLocal;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
import ch.usi.dag.disl.MethodStaticContext;
public class DiSLClass {
......
......@@ -2,7 +2,7 @@ package ch.usi.dag.disl.test.suite.classinfo.instr;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.staticcontext.ClassStaticContext;
import ch.usi.dag.disl.ClassStaticContext;
public class DiSLClass {
......
......@@ -2,7 +2,7 @@ package ch.usi.dag.disl.test.suite.dispatch.instr;
import org.objectweb.asm.tree.AbstractInsnNode;
import ch.usi.dag.disl.staticcontext.AbstractStaticContext;
import ch.usi.dag.disl.AbstractStaticContext;
public class CodeLengthSC extends AbstractStaticContext {
......
......@@ -4,7 +4,7 @@ import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.marker.BytecodeMarker;
import ch.usi.dag.disl.staticcontext.FieldAccessStaticContext;
import ch.usi.dag.disl.FieldAccessStaticContext;
import ch.usi.dag.disl.test.suite.dynamiccontext.app.TargetClass;
......
......@@ -5,7 +5,7 @@ import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.marker.BytecodeMarker;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
import ch.usi.dag.disl.MethodStaticContext;
public class DiSLClass {
......
......@@ -5,7 +5,7 @@ import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import ch.usi.dag.disl.staticcontext.AbstractStaticContext;