/** * looks for methods that contain a MONITORENTER opcodes * * @param method * the context object of the current method * @return if the class uses synchronization */ private boolean prescreen(Method method) { BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Constants.MONITORENTER)); }
/** * implement the visitor to reset the sync count, the stack, and gather some information * * @param obj * the context object for the currently parsed method */ @Override public void visitCode(Code obj) { Method m = getMethod(); if (prescreen(m)) { if (m.isSynchronized()) { syncPC = 0; } else { syncPC = -1; } isStatic = m.isStatic(); unsafeAliases.clear(); unsafeAliases.set(0); branchInfo.clear(); unsafeCallOccurred = false; stack.resetForMethodEntry(this); } }
String methodSig = getSigConstantOperand(); MethodInfo mi = Statistics.getStatistics().getMethodStatistics(getClassConstantOperand(), getNameConstantOperand(), methodSig); if (mi.getModifiesState()) { unsafeCallOccurred = true; 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; syncPC = getPC(); if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); syncPC = -1; } else if (syncPC >= 0) { processSyncBlockInstruction(seen);
int pc = getPC(); if ((pc - syncPC) > minSafeCodeLength) { for (Map.Entry<Integer, Integer> entry : branchInfo.entrySet()) {
String methodSig = getSigConstantOperand(); MethodInfo mi = Statistics.getStatistics().getMethodStatistics(getClassConstantOperand(), getNameConstantOperand(), methodSig); if (mi.getModifiesState()) { unsafeCallOccurred = true; unsafeCallOccurred = getDottedClassConstantOperand().equals(this.getClassContext().getJavaClass().getClassName()); } else if (((seen >= IFEQ) && (seen <= GOTO)) || (seen == GOTO_W)) { Integer from = Integer.valueOf(getPC()); Integer to = Integer.valueOf(getBranchTarget()); branchInfo.put(from, to); unsafeCallOccurred = false; syncPC = getPC(); if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); syncPC = -1; } else if (syncPC >= 0) { processSyncBlockInstruction(seen);
int pc = getPC(); if ((pc - syncPC) > minSafeCodeLength) { for (Map.Entry<Integer, Integer> entry : branchInfo.entrySet()) {
/** * implement the visitor to reset the sync count, the stack, and gather some information * * @param obj * the context object for the currently parsed method */ @Override public void visitCode(Code obj) { Method m = getMethod(); if (prescreen(m)) { if (m.isSynchronized()) { syncPC = 0; } else { syncPC = -1; } isStatic = m.isStatic(); unsafeAliases.clear(); unsafeAliases.set(0); branchInfo.clear(); unsafeCallOccurred = false; stack.resetForMethodEntry(this); } }
/** * looks for methods that contain a MONITORENTER opcodes * * @param method * the context object of the current method * @return if the class uses synchronization */ private boolean prescreen(Method method) { BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Const.MONITORENTER)); }