void assignDepthFirstNumbers(ControlFlowGraph cfg){
  int instructionCount=ir.countInstructions();
  regAllocState.initializeDepthFirstNumbering(instructionCount);
  int curDfn=instructionCount - 1;
  listOfBlocks=null;
  for (BasicBlock bb=reverseTopFirst; bb != null; bb=(BasicBlock)bb.sortedPrev) {
    bb.nextSorted=listOfBlocks;
    listOfBlocks=bb;
    Enumeration<Instruction> e=bb.reverseInstrEnumerator();
    while (e.hasMoreElements()) {
      Instruction inst=e.nextElement();
      regAllocState.setDFN(inst,curDfn);
      curDfn--;
    }
  }
  if (LinearScan.DEBUG) {
    regAllocState.printDfns(ir);
  }
}

void assignDepthFirstNumbers ( ControlFlowGraph cfg ) { int instructionCount = ir . countInstructions ( ) ; regAllocState . initializeDepthFirstNumbering ( instructionCount ) ; int curDfn = instructionCount - 1 ; listOfBlocks = null ; for ( BasicBlock bb = reverseTopFirst ; bb != null ; bb = ( BasicBlock ) bb . sortedPrev ) { bb . nextSorted = listOfBlocks ; listOfBlocks = bb ; Enumeration < Instruction > e = bb . reverseInstrEnumerator ( ) ; while ( e . hasMoreElements ( ) ) { Instruction inst = e . nextElement ( ) ; regAllocState . setDFN ( inst , curDfn ) ; curDfn -- ; } } if ( LinearScan . DEBUG ) { regAllocState . printDfns ( ir ) ; } }
this method processes all basic blocks , do the following to each block 1 ) add it to the begining of the " listofblocks " list 2 ) number the instructions 3 ) process the instructions that restrict physical register assignment
