@Override public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] uses) { assert uses == null || uses.length == 1; return insts.MonitorInstruction(iindex, uses == null ? ref : uses[0], isEnter); }
@Override public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] uses) { assert uses == null || uses.length == 1; return insts.MonitorInstruction(iindex, uses == null ? ref : uses[0], isEnter); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) */ @Override public void visitMonitor(Monitor instruction) { int ref = workingState.getLocal(instruction.object); // int ref = workingState.pop(); emitInstruction(insts.MonitorInstruction(getCurrentInstructionIndex(), ref, instruction.enter)); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) */ @Override public void visitMonitor(Monitor instruction) { int ref = workingState.getLocal(instruction.object); // int ref = workingState.pop(); emitInstruction(insts.MonitorInstruction(getCurrentInstructionIndex(), ref, instruction.enter)); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) */ @Override public void visitMonitor(com.ibm.wala.shrikeBT.MonitorInstruction instruction) { int ref = workingState.pop(); emitInstruction(insts.MonitorInstruction(getCurrentInstructionIndex(), ref, instruction.isEnter())); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitMonitor(MonitorInstruction) */ @Override public void visitMonitor(com.ibm.wala.shrikeBT.MonitorInstruction instruction) { int ref = workingState.pop(); emitInstruction(insts.MonitorInstruction(getCurrentInstructionIndex(), ref, instruction.isEnter())); }
@Override protected boolean doVisit(CAstNode n, WalkContext wc, CAstVisitor<WalkContext> visitor) { if (n.getKind() == CAstNode.MONITOR_ENTER) { visitor.visit(n.getChild(0), wc, visitor); wc.cfg().addInstruction(insts.MonitorInstruction(wc.cfg().getCurrentInstruction(), wc.getValue(n.getChild(0)), true)); processExceptions(n, wc); return true; } else if (n.getKind() == CAstNode.MONITOR_EXIT) { visitor.visit(n.getChild(0), wc, visitor); wc.cfg().addInstruction(insts.MonitorInstruction(wc.cfg().getCurrentInstruction(), wc.getValue(n.getChild(0)), false)); processExceptions(n, wc); return true; } else { return super.doVisit(n, wc, visitor); } }
@Override protected boolean doVisit(CAstNode n, WalkContext wc, CAstVisitor<WalkContext> visitor) { if (n.getKind() == CAstNode.MONITOR_ENTER) { visitor.visit(n.getChild(0), wc, visitor); wc.cfg().addInstruction(insts.MonitorInstruction(wc.cfg().getCurrentInstruction(), wc.getValue(n.getChild(0)), true)); processExceptions(n, wc); return true; } else if (n.getKind() == CAstNode.MONITOR_EXIT) { visitor.visit(n.getChild(0), wc, visitor); wc.cfg().addInstruction(insts.MonitorInstruction(wc.cfg().getCurrentInstruction(), wc.getValue(n.getChild(0)), false)); processExceptions(n, wc); return true; } else { return super.doVisit(n, wc, visitor); } }