@Override public boolean merge(final Frame<? extends BasicValue> frame, final Interpreter<BasicValue> interpreter) throws AnalyzerException { if (force) { // uses the current frame return true; } if (frame instanceof ExtendedFrame && ((ExtendedFrame) frame).force) { init(frame); return true; } return super.merge(frame, interpreter); }
/** * Merges this frame with the given frame. * * @param frame * a frame. * @param interpreter * the interpreter used to merge values. * @return <tt>true</tt> if this frame has been changed as a result of the * merge operation, or <tt>false</tt> otherwise. * @throws AnalyzerException * if the frames have incompatible sizes. */ public boolean merge(final Frame<? extends V> frame, final Interpreter interpreter) throws AnalyzerException { if (top != frame.top) { throw new AnalyzerException(null, "Incompatible stack heights"); } boolean changes = false; for (int i = 0; i < locals + top; ++i) { V v = (V) interpreter.merge(values[i], frame.values[i]); if (!v.equals(values[i])) { values[i] = v; changes = true; } } return changes; }
public void execute(AbstractInsnNode insn, Interpreter interpreter) throws AnalyzerException { boolean never = false; if (never) { super.execute(insn, interpreter); return; } int insnOpcode = insn.getOpcode(); if (insnOpcode == Opcodes.MONITORENTER || insnOpcode == Opcodes.MONITOREXIT) { Value pop = pop(); interpreter.unaryOperation(insn, pop); int local = -1; for (int i = 0; i < getLocals(); i++) { if (getLocal(i) == pop) local = i; } if (local > -1) { if (insnOpcode == Opcodes.MONITORENTER) { monitorEnter(local); } else { monitorExit(local); } } } else { super.execute(insn, interpreter); } }
/** * Constructor. * * @param interpreter the interpreter to use */ public MethodAnalyzer(final Interpreter<V> interpreter) { super(interpreter); }