Commit 6f5faf6a authored by Yudi Zheng's avatar Yudi Zheng
Browse files

Invocation Marker, and a new constructor of MarkRegion

parent 6fd63d82
package ch.usi.dag.disl.marker;
import java.util.LinkedList;
import java.util.List;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
public class InvocationMarker implements Marker {
public List<MarkRegion> mark(MethodNode method) {
List<MarkRegion> regions = new LinkedList<MarkRegion>();
InsnList ilst = method.instructions;
for (AbstractInsnNode instruction : ilst.toArray())
if (instruction instanceof MethodInsnNode)
regions.add(new MarkRegion(instruction, instruction));
return regions;
......@@ -5,4 +5,14 @@ import org.objectweb.asm.tree.AbstractInsnNode;
public class MarkRegion {
public AbstractInsnNode start;
public AbstractInsnNode end;
public MarkRegion() {
this.start = null;
this.end = null;
public MarkRegion(AbstractInsnNode start, AbstractInsnNode end) {
this.start = start;
this.end = end;
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