Build jump graph

This commit is contained in:
Adam
2014-12-01 12:16:51 -05:00
parent 44f018727f
commit df28895fc8
7 changed files with 74 additions and 2 deletions

View File

@@ -43,10 +43,26 @@ public class Instructions
}
assert pc == length;
buildJumpGraph();
}
private void buildJumpGraph()
{
for (Instruction i : instructions)
i.buildJumpGraph();
}
public Code getCode()
{
return code;
}
public Instruction findInstruction(int pc)
{
for (Instruction i : instructions)
if (i.getPc() == pc)
return i;
return null;
}
}