}
public YARVMachine.InstructionSequence getInstructionSequence(String name, String filename, String level) {
iseq = new YARVMachine.InstructionSequence(runtime, name, filename, level);
List l = new ArrayList();
Map jumps = new IdentityHashMap();
Map labels = new IdentityHashMap();
int real=0;
for (LinkElement elm = current_iseq; elm != null; elm = elm.next) {
if (elm instanceof Insn) {
Insn i = (Insn)elm;
if (isJump(i.i.bytecode)) jumps.put(i, i.i._tmp);
l.add(i.i);
real++;
} else if (elm instanceof Label) {
labels.put(elm, new Integer(real+1));
}
}
for(Iterator iter = jumps.keySet().iterator();iter.hasNext();) {
Insn k = (Insn)iter.next();
k.i.l_op0 = ((Integer)labels.get(jumps.get(k))).intValue() - 1;
k.i._tmp = null;
}
debugs("instructions: " + l);
iseq.body = (YARVMachine.Instruction[])l.toArray(new YARVMachine.Instruction[l.size()]);