private boolean checkForKnownValue ( Instruction obj ) { if ( trackValueNumbers ) { try { // See if the value number loaded here is a known value ValueNumberFrame vnaFrameAfter = vnaDataflow . getFactAfterLocation ( getLocation ( ) ) ; if ( vnaFrameAfter . isValid ( ) ) { ValueNumber tosVN = vnaFrameAfter . getTopValue ( ) ; IsNullValue knownValue = getFrame ( ) . getKnownValue ( tosVN ) ; if ( knownValue != null ) { // System.out.println("Produce known value!"); // The value produced by this instruction is known. // Push the known value. modelNormalInstruction ( obj , getNumWordsConsumed ( obj ) , 0 ) ; produce ( knownValue ) ; return true ; } } } catch ( DataflowAnalysisException e ) { // Ignore... } } return false ; }
Check given Instruction to see if it produces a known value . If so model the instruction and return true . Otherwise do nothing and return false . Should only be used for instructions that produce a single value on the top of the stack .