@ Override public void sawOpcode ( int seen ) { try { stack . precomputation ( this ) ; if ( OpcodeUtils . isStore ( seen ) || OpcodeUtils . isLoad ( seen ) ) { int reg = getRegisterOperand ( ) ; unusedParms . clear ( reg ) ; } else if ( OpcodeUtils . isReturn ( seen ) && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; int reg = item . getRegisterNumber ( ) ; if ( reg >= 0 ) { unusedParms . clear ( reg ) ; } } if ( unusedParms . isEmpty ( ) ) { throw new StopOpcodeParsingException ( ) ; } } finally { stack . sawOpcode ( this , seen ) ; } }
implements the visitor to look for usage of parmeter registers .