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

Interface 'Makrer' and an implementation of it 'BodyMarker'

parent e84aab98
package ch.usi.dag.disl.marker;
import java.util.LinkedList;
import java.util.List;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodNode;
public class BodyMarker implements Marker {
public List<MarkRegion> mark(MethodNode method) {
List<MarkRegion> regions = new LinkedList<MarkRegion>();
InsnList ilst = method.instructions;
MarkRegion region = new MarkRegion();
region.start = ilst.getFirst();
// FIXME Does the region contain the return-instruction?
// What about a try-finally block?
region.end = ilst.getLast();
return regions;
package ch.usi.dag.disl.marker;
import org.objectweb.asm.tree.AbstractInsnNode;
public class MarkRegion {
public AbstractInsnNode start;
public AbstractInsnNode end;
package ch.usi.dag.disl.marker;
import java.util.List;
import org.objectweb.asm.tree.MethodNode;
public interface Marker {
public List<MarkRegion> mark(MethodNode 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