@Override
    public void sawOpcode(int seen) {
        try {
            stack.precomputation(this);

            if (unsafeCallOccurred && OpcodeUtils.isAStore(seen)) {
                int storeReg = RegisterUtils.getAStoreReg(this, seen);
                if (storeReg >= 0) {
                    unsafeAliases.set(storeReg);
                }
            }

            if ((seen == Const.INVOKEVIRTUAL) || (seen == Const.INVOKESPECIAL) || (seen == Const.INVOKEINTERFACE) || (seen == Const.INVOKEDYNAMIC)) {
                String methodSig = getSigConstantOperand();

                MethodInfo mi = Statistics.getStatistics().getMethodStatistics(getClassConstantOperand(), getNameConstantOperand(), methodSig);
                if (mi.getModifiesState()) {
                    unsafeCallOccurred = true;
                } else {
                    if (!Values.SIG_VOID.equals(SignatureUtils.getReturnSignature(methodSig))) {
                        int parmCount = SignatureUtils.getNumParameters(methodSig);
                        if (stack.getStackDepth() > parmCount) {
                            OpcodeStack.Item itm = stack.getStackItem(parmCount);
                            unsafeCallOccurred = unsafeAliases.get(itm.getRegisterNumber());
                        } else {
                            unsafeCallOccurred = false;
                        }
                    } else {
                        unsafeCallOccurred = false;
                    }
                }
            } else if (seen == Const.INVOKESTATIC) {
                unsafeCallOccurred = getDottedClassConstantOperand().equals(this.getClassContext().getJavaClass().getClassName());
            } else if (((seen >= Const.IFEQ) && (seen <= Const.GOTO)) || (seen == Const.GOTO_W)) {
                Integer from = Integer.valueOf(getPC());
                Integer to = Integer.valueOf(getBranchTarget());
                branchInfo.put(from, to);
                unsafeCallOccurred = false;
            } else {
                unsafeCallOccurred = false;
            }

            if (seen == Const.MONITORENTER) {
                if (syncPC < 0) {
                    syncPC = getPC();
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item itm = stack.getStackItem(0);
                        int monitorReg = itm.getRegisterNumber();
                        if (monitorReg >= 0) {
                            unsafeAliases.set(monitorReg);
                        }
                    }
                }
            } else if (seen == Const.MONITOREXIT) {
                syncPC = -1;
            } else if (syncPC >= 0) {
                processSyncBlockInstruction(seen);
            }
        } finally {
            stack.sawOpcode(this, seen);
        }
    }
@ Override public void sawOpcode ( int seen ) { try { stack . precomputation ( this ) ; if ( unsafeCallOccurred && OpcodeUtils . isAStore ( seen ) ) { int storeReg = RegisterUtils . getAStoreReg ( this , seen ) ; if ( storeReg >= 0 ) { unsafeAliases . set ( storeReg ) ; } } if ( ( seen == Const . INVOKEVIRTUAL ) || ( seen == Const . INVOKESPECIAL ) || ( seen == Const . INVOKEINTERFACE ) || ( seen == Const . INVOKEDYNAMIC ) ) { String methodSig = getSigConstantOperand ( ) ; MethodInfo mi = Statistics . getStatistics ( ) . getMethodStatistics ( getClassConstantOperand ( ) , getNameConstantOperand ( ) , methodSig ) ; if ( mi . getModifiesState ( ) ) { unsafeCallOccurred = true ; } else { if ( ! Values . SIG_VOID . equals ( SignatureUtils . getReturnSignature ( methodSig ) ) ) { int parmCount = SignatureUtils . getNumParameters ( methodSig ) ; if ( stack . getStackDepth ( ) > parmCount ) { OpcodeStack . Item itm = stack . getStackItem ( parmCount ) ; unsafeCallOccurred = unsafeAliases . get ( itm . getRegisterNumber ( ) ) ; } else { unsafeCallOccurred = false ; } } else { unsafeCallOccurred = false ; } } } else if ( seen == Const . INVOKESTATIC ) { unsafeCallOccurred = getDottedClassConstantOperand ( ) . equals ( this . getClassContext ( ) . getJavaClass ( ) . getClassName ( ) ) ; } else if ( ( ( seen >= Const . IFEQ ) && ( seen <= Const . GOTO ) ) || ( seen == Const . GOTO_W ) ) { Integer from = Integer . valueOf ( getPC ( ) ) ; Integer to = Integer . valueOf ( getBranchTarget ( ) ) ; branchInfo . put ( from , to ) ; unsafeCallOccurred = false ; } else { unsafeCallOccurred = false ; } if ( seen == Const . MONITORENTER ) { if ( syncPC < 0 ) { syncPC = getPC ( ) ; if ( stack . getStackDepth ( ) > 0 ) { OpcodeStack . Item itm = stack . getStackItem ( 0 ) ; int monitorReg = itm . getRegisterNumber ( ) ; if ( monitorReg >= 0 ) { unsafeAliases . set ( monitorReg ) ; } } } } else if ( seen == Const . MONITOREXIT ) { syncPC = - 1 ; } else if ( syncPC >= 0 ) { processSyncBlockInstruction ( seen ) ; } } finally { stack . sawOpcode ( this , seen ) ; } }
implement the visitor to find bloated sync blocks. This implementation only checks the outer most block

@param seen
the opcode of the currently parsed instruction