private void emitCode(){
  LinkedList<Instantiation> worklist=new LinkedList<Instantiation>();
  worklist.add(new Instantiation(null,mainSubroutine));
  InsnList newInstructions=new InsnList();
  List<TryCatchBlockNode> newTryCatchBlocks=new ArrayList<TryCatchBlockNode>();
  List<LocalVariableNode> newLocalVariables=new ArrayList<LocalVariableNode>();
  while (!worklist.isEmpty()) {
    Instantiation inst=worklist.removeFirst();
    emitSubroutine(inst,worklist,newInstructions,newTryCatchBlocks,newLocalVariables);
  }
  instructions=newInstructions;
  tryCatchBlocks=newTryCatchBlocks;
  localVariables=newLocalVariables;
}

private void emitCode ( ) { LinkedList < Instantiation > worklist = new LinkedList < Instantiation > ( ) ; worklist . add ( new Instantiation ( null , mainSubroutine ) ) ; InsnList newInstructions = new InsnList ( ) ; List < TryCatchBlockNode > newTryCatchBlocks = new ArrayList < TryCatchBlockNode > ( ) ; List < LocalVariableNode > newLocalVariables = new ArrayList < LocalVariableNode > ( ) ; while ( ! worklist . isEmpty ( ) ) { Instantiation inst = worklist . removeFirst ( ) ; emitSubroutine ( inst , worklist , newInstructions , newTryCatchBlocks , newLocalVariables ) ; } instructions = newInstructions ; tryCatchBlocks = newTryCatchBlocks ; localVariables = newLocalVariables ; }
creates the new instructions , inlining each instantiation of each subroutine until the code is fully elaborated .
