public void modelInstruction ( Instruction ins , int numWordsConsumed , int numWordsProduced , Value pushValue ) { if ( frame . getStackDepth ( ) < numWordsConsumed ) { try { throw new IllegalArgumentException ( " asked to pop " + numWordsConsumed + " stack elements but only " + frame . getStackDepth ( ) + " elements remain in " + frame + " while processing " + ins ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( " asked to pop " + numWordsConsumed + " stack elements but only " + frame . getStackDepth ( ) + " elements remain while processing " + ins ) ; } } try { while ( numWordsConsumed -- > 0 ) { frame . popValue ( ) ; } } catch ( DataflowAnalysisException e ) { throw new InvalidBytecodeException ( "Not enough values on the stack" , e ) ; } while ( numWordsProduced -- > 0 ) { frame . pushValue ( pushValue ) ; } }
Primitive to model the stack effect of a single instruction explicitly specifying the value to be pushed on the stack .