public void deoptimizeReverseBranches ( ) { for ( Instruction instruction = pcHead ; instruction != null ; instruction = instruction . getNextPC ( ) ) { if ( instruction . isBranch ( ) ) { final Branch branch = instruction . asBranch ( ) ; if ( branch . isReverse ( ) ) { final Instruction target = branch . getTarget ( ) ; final LinkedList < Branch > list = target . getReverseUnconditionalBranches ( ) ; if ( ( list != null ) && ( list . size ( ) > 0 ) && ( list . get ( list . size ( ) - 1 ) != branch ) ) { final Branch unconditional = list . get ( list . size ( ) - 1 ) . asBranch ( ) ; branch . retarget ( unconditional ) ; } } } } }
Javac optimizes some branches to avoid goto - > goto branch - > goto etc .