Commit 91430386 authored by Lukáš Marek's avatar Lukáš Marek

Added new ASM version 4.0_RC2

Ported DiSL to the new ASM version
Added patched jborat in rev. 65
parent c28d2b62
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
<classpathentry kind="lib" path="lib/jborat-agent.jar"/> <classpathentry kind="lib" path="lib/jborat-agent.jar"/>
<classpathentry kind="lib" path="lib/jborat-runtime.jar"/> <classpathentry kind="lib" path="lib/jborat-runtime.jar"/>
<classpathentry kind="lib" path="lib/jborat.jar"/> <classpathentry kind="lib" path="lib/jborat.jar"/>
<classpathentry kind="lib" path="lib/asm-debug-all-4.0_RC1.jar"/> <classpathentry kind="lib" path="lib/asm-debug-all-4.0_RC2.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
asm.path=lib/asm-debug-all-4.0_RC1.jar asm.path=lib/asm-debug-all-4.0_RC2.jar
jborat.path=lib/jborat.jar jborat.path=lib/jborat.jar
jborat-runtime.path=lib/jborat-runtime.jar jborat-runtime.path=lib/jborat-runtime.jar
instr.jar.name=dislinstr.jar instr.jar.name=dislinstr.jar
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -255,6 +255,10 @@ public class DiSL implements Instrumentation { ...@@ -255,6 +255,10 @@ public class DiSL implements Instrumentation {
if (snippets == null) { if (snippets == null) {
throw new DiSLFatalException("DiSL was not initialized"); throw new DiSLFatalException("DiSL was not initialized");
} }
// AfterInitBodyMarker uses AdviceAdapter
// - check is required by ASM 4.0 guidelines
classNode.check(Opcodes.ASM4);
// report every exception within our code - don't let anyone mask it // report every exception within our code - don't let anyone mask it
try { try {
......
...@@ -3,9 +3,9 @@ package ch.usi.dag.disl.dislclass.snippet.marker; ...@@ -3,9 +3,9 @@ package ch.usi.dag.disl.dislclass.snippet.marker;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes; import org.objectweb.asm.Opcodes;
import org.objectweb.asm.commons.AdviceAdapter; import org.objectweb.asm.commons.AdviceAdapter;
import org.objectweb.asm.commons.EmptyVisitor;
import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
...@@ -13,6 +13,14 @@ import ch.usi.dag.disl.util.Constants; ...@@ -13,6 +13,14 @@ import ch.usi.dag.disl.util.Constants;
public class AfterInitBodyMarker implements Marker { public class AfterInitBodyMarker implements Marker {
// empty visitor for new AdviceAdapter
private static class EmptyMethodVisitor extends MethodVisitor {
public EmptyMethodVisitor() {
super(Opcodes.ASM4);
}
}
// Get the first valid mark of a method. // Get the first valid mark of a method.
// For a constructor, the return value will be the instruction after // For a constructor, the return value will be the instruction after
// the object initialization. // the object initialization.
...@@ -28,8 +36,9 @@ public class AfterInitBodyMarker implements Marker { ...@@ -28,8 +36,9 @@ public class AfterInitBodyMarker implements Marker {
// Similar to 'const boolean **trigger' in c. // Similar to 'const boolean **trigger' in c.
final boolean trigger[] = { false }; final boolean trigger[] = { false };
AdviceAdapter adapter = new AdviceAdapter(new EmptyVisitor(), AdviceAdapter adapter = new AdviceAdapter(Opcodes.ASM4,
method.access, method.name, method.desc) { new EmptyMethodVisitor(), method.access, method.name,
method.desc) {
public void onMethodEnter() { public void onMethodEnter() {
trigger[0] = true; trigger[0] = true;
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/DiSL"/> <classpathentry combineaccessrules="false" kind="src" path="/DiSL"/>
<classpathentry kind="lib" path="/DiSL/lib/asm-debug-all-4.0_RC1.jar"/> <classpathentry kind="lib" path="/DiSL/lib/asm-debug-all-4.0_RC2.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/DiSL"/> <classpathentry combineaccessrules="false" kind="src" path="/DiSL"/>
<classpathentry kind="lib" path="/DiSL/lib/jborat.jar"/> <classpathentry kind="lib" path="/DiSL/lib/jborat.jar"/>
<classpathentry kind="lib" path="/DiSL/lib/asm-debug-all-4.0_RC1.jar"/>
<classpathentry kind="lib" path="lib/stp.jar"/> <classpathentry kind="lib" path="lib/stp.jar"/>
<classpathentry kind="lib" path="/DiSL/lib/jborat-runtime.jar"/> <classpathentry kind="lib" path="/DiSL/lib/jborat-runtime.jar"/>
<classpathentry kind="lib" path="/DiSL/lib/asm-debug-all-4.0_RC2.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
# This is a sample configuration with relative paths # This is a sample configuration with relative paths
# you can use full path using file:/// format # you can use full path using file:/// format
../lib/asm-debug-all-4.0_RC1.jar ../lib/asm-debug-all-4.0_RC2.jar
../lib/jborat.jar ../lib/jborat.jar
../build/disl-unspec.jar ../build/disl-unspec.jar
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