Commit 5b3f98ce authored by Vít Kabele's avatar Vít Kabele
Browse files

guard and localvars package merged and unnecessary public modifiers removed.

parent f4986923
......@@ -13,6 +13,8 @@
<classpathentry kind="src" path="disl/src/src-util"/>
<classpathentry kind="src" path="disl/src/src-snippet"/>
<classpathentry kind="src" path="disl/src/src-processor"/>
<classpathentry kind="src" path="disl/src/src-guard"/>
<classpathentry kind="src" path="disl/src/src-localvar"/>
<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"/>
......
......@@ -14,6 +14,8 @@ src.disl.coderep=src-coderep
src.disl.util=src-util
src.disl.snippet=src-snippet
src.disl.processor=src-processor
src.disl.guard=src-guard
src.disl.localvar=src-localvar
src.disl.exception=src-exception
src.disl.bypass=src-disl-bypass
src.disl.agent=src-disl-agent
......
......@@ -482,6 +482,8 @@
<src path="${src.disl.prefix}/src/${src.disl.coderep}"/>
<src path="${src.disl.prefix}/src/${src.disl.snippet}"/>
<src path="${src.disl.prefix}/src/${src.disl.processor}"/>
<src path="${src.disl.prefix}/src/${src.disl.guard}"/>
<src path="${src.disl.prefix}/src/${src.disl.localvar}"/>
<src path="${src.disl.prefix}/src/${src.disl.util}"/>
<src path="${src.disl.prefix}/src/${src.disl.main}"/>
<classpath>
......
......@@ -25,9 +25,6 @@ import org.objectweb.asm.tree.analysis.SourceValue;
import ch.usi.dag.disl.annotation.SyntheticLocal;
import ch.usi.dag.disl.annotation.SyntheticLocal.Initialize;
import ch.usi.dag.disl.annotation.ThreadLocal;
import ch.usi.dag.disl.localvar.LocalVars;
import ch.usi.dag.disl.localvar.SyntheticLocalVar;
import ch.usi.dag.disl.localvar.ThreadLocalVar;
import ch.usi.dag.disl.AsmHelper.Insns;
import ch.usi.dag.util.logging.Logger;
......
......@@ -15,8 +15,6 @@ import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.disl.annotation.Guarded;
import ch.usi.dag.disl.annotation.ProcessAlso;
import ch.usi.dag.disl.guard.GuardHelper;
import ch.usi.dag.disl.localvar.LocalVars;
import ch.usi.dag.util.Strings;
......
......@@ -8,7 +8,6 @@
*/
package ch.usi.dag.disl;
import ch.usi.dag.disl.localvar.LocalVars;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.ClassNode;
......
......@@ -6,7 +6,6 @@
package ch.usi.dag.disl;
import ch.usi.dag.disl.localvar.LocalVars;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
......
......@@ -8,7 +8,6 @@ import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AnnotationNode;
import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.disl.guard.GuardHelper;
import ch.usi.dag.disl.marker.Marker;
import ch.usi.dag.disl.marker.Parameter;
import ch.usi.dag.disl.scope.Scope;
......
......@@ -8,10 +8,6 @@ import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TryCatchBlockNode;
import ch.usi.dag.disl.localvar.LocalVars;
import ch.usi.dag.disl.localvar.SyntheticLocalVar;
import ch.usi.dag.disl.localvar.ThreadLocalVar;
/**
* Represents an analyzed and partially expanded code template. Instances of
......
......@@ -19,10 +19,6 @@ import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TryCatchBlockNode;
import ch.usi.dag.disl.localvar.AbstractLocalVar;
import ch.usi.dag.disl.localvar.LocalVars;
import ch.usi.dag.disl.localvar.SyntheticLocalVar;
import ch.usi.dag.disl.localvar.ThreadLocalVar;
import ch.usi.dag.disl.AsmHelper.Insns;
import ch.usi.dag.disl.util.cfg.CtrlFlowGraph;
......
package ch.usi.dag.disl.guard;
package ch.usi.dag.disl;
import ch.usi.dag.disl.processor.generator.ProcMethodInstance;
import ch.usi.dag.disl.processorcontext.ArgumentContext;
......@@ -9,7 +9,7 @@ class ArgumentContextImpl implements ArgumentContext {
private final ProcMethodInstance __pmi;
public ArgumentContextImpl (final ProcMethodInstance pmi) {
ArgumentContextImpl (final ProcMethodInstance pmi) {
__pmi = pmi;
}
......
package ch.usi.dag.disl.guard;
package ch.usi.dag.disl;
import ch.usi.dag.disl.GuardException;
import ch.usi.dag.disl.GuardRuntimeException;
import ch.usi.dag.disl.guardcontext.GuardContext;
import ch.usi.dag.disl.processorcontext.ArgumentContext;
import ch.usi.dag.disl.Shadow;
//used for guard invocation - reduced visibility
class GuardContextImpl implements GuardContext {
......@@ -12,7 +10,7 @@ class GuardContextImpl implements GuardContext {
private Shadow shadow;
private ArgumentContext ac;
public GuardContextImpl(Shadow shadow, ArgumentContext ac) {
GuardContextImpl(Shadow shadow, ArgumentContext ac) {
super();
this.shadow = shadow;
this.ac = ac;
......
package ch.usi.dag.disl.guard;
package ch.usi.dag.disl;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
......@@ -6,23 +6,15 @@ import java.util.Formatter;
import java.util.HashSet;
import java.util.Set;
import ch.usi.dag.disl.DiSLFatalException;
import ch.usi.dag.disl.GuardException;
import ch.usi.dag.disl.GuardRuntimeException;
import ch.usi.dag.disl.ReflectionException;
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.GuardMethod;
import ch.usi.dag.disl.GuardResolver;
import ch.usi.dag.disl.SCResolver;
import ch.usi.dag.disl.Shadow;
import ch.usi.dag.disl.staticcontext.StaticContext;
import ch.usi.dag.disl.ReflectionHelper;
public abstract class GuardHelper {
public static Method findAndValidateGuardMethod (
static Method findAndValidateGuardMethod (
final Class <?> guardClass, final Set <Class <?>> validArgs
) throws GuardException {
if (guardClass == null) {
......
package ch.usi.dag.disl.localvar;
package ch.usi.dag.disl;
import org.objectweb.asm.Type;
......@@ -17,7 +17,7 @@ public abstract class AbstractLocalVar {
//
public AbstractLocalVar (
AbstractLocalVar (
final String className, final String fieldName, final Type type
) {
this.className = className;
......
package ch.usi.dag.disl.localvar;
package ch.usi.dag.disl;
import java.util.Collections;
import java.util.HashMap;
......@@ -24,7 +24,7 @@ public final class LocalVars {
__syntheticLocals.put (slv.getID (), slv);
}
public Map <String, SyntheticLocalVar> getSyntheticLocals () {
Map <String, SyntheticLocalVar> getSyntheticLocals () {
return Collections.unmodifiableMap (__syntheticLocals);
}
......@@ -33,13 +33,13 @@ public final class LocalVars {
__threadLocals.put (tlv.getID (), tlv);
}
public Map <String, ThreadLocalVar> getThreadLocals () {
Map <String, ThreadLocalVar> getThreadLocals () {
return Collections.unmodifiableMap (__threadLocals);
}
//
public void putAll (final LocalVars other) {
void putAll (final LocalVars other) {
__syntheticLocals.putAll (other.__syntheticLocals);
__threadLocals.putAll (other.__threadLocals);
}
......
package ch.usi.dag.disl.localvar;
package ch.usi.dag.disl;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.InsnList;
......@@ -14,7 +14,7 @@ public class SyntheticLocalVar extends AbstractLocalVar {
//
public SyntheticLocalVar (
SyntheticLocalVar (
String className, String fieldName, Type type,
SyntheticLocal.Initialize initialize
) {
......@@ -36,7 +36,7 @@ public class SyntheticLocalVar extends AbstractLocalVar {
return initCode != null;
}
public void setInitCode (final InsnList initCode) {
void setInitCode (final InsnList initCode) {
this.initCode = initCode;
}
}
package ch.usi.dag.disl.localvar;
package ch.usi.dag.disl;
import org.objectweb.asm.Type;
......@@ -22,7 +22,7 @@ public final class ThreadLocalVar extends AbstractLocalVar {
/**
* @return the initial value of this thread local variable.
*/
public Object getInitialValue() {
Object getInitialValue() {
return __initialValue;
}
......@@ -31,7 +31,7 @@ public final class ThreadLocalVar extends AbstractLocalVar {
*
* @param value the value to initialize the variable to
*/
public void setInitialValue (final Object value) {
void setInitialValue (final Object value) {
__initialValue = value;
}
......@@ -42,7 +42,7 @@ public final class ThreadLocalVar extends AbstractLocalVar {
*
* @return {@code true} if the variable value is inheritable.
*/
public boolean isInheritable () {
boolean isInheritable () {
return __inheritable;
}
}
package ch.usi.dag.disl;
import ch.usi.dag.disl.localvar.SyntheticLocalVar;
import ch.usi.dag.disl.localvar.ThreadLocalVar;
import ch.usi.dag.disl.processor.generator.PIResolver;
import ch.usi.dag.disl.processor.generator.ProcGenerator;
import ch.usi.dag.disl.processor.generator.ProcInstance;
......
......@@ -9,8 +9,6 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.AdviceAdapter;
import ch.usi.dag.disl.localvar.ThreadLocalVar;
final class TLVInserter extends ClassVisitor {
......
......@@ -4,8 +4,6 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import ch.usi.dag.disl.localvar.LocalVars;
/**
* Argument processor is a collection of argument processor methods. Each method
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment