public void addInstrAtBeginning(Instr i) { if (hasListener()) { IRScopeListener listener = manager.getIRScopeListener(); listener.addedInstr(this, i, 0); } instrList.add(0, i); }
public Operand build(Variable result, Node node) { if (node == null) return null; if (hasListener()) manager.getIRScopeListener().startBuildOperand(node, scope); Operand operand = buildOperand(result, node); if (hasListener()) manager.getIRScopeListener().endBuildOperand(node, scope, operand); return operand; }
public Operand build(Variable result, Node node) { if (node == null) return null; if (hasListener()) manager.getIRScopeListener().startBuildOperand(node, scope); Operand operand = buildOperand(result, node); if (hasListener()) manager.getIRScopeListener().endBuildOperand(node, scope, operand); return operand; }
public void addInstrAtBeginning(Instr i) { if (hasListener()) { IRScopeListener listener = manager.getIRScopeListener(); listener.addedInstr(this, i, 0); } instrList.add(0, i); }
public Operand build(Node node, IRScope s) { if (node == null) return null; if (s == null) { System.out.println("Got a null scope!"); throw new NotCompilableException("Unknown node encountered in builder: " + node); } if (hasListener()) { IRScopeListener listener = manager.getIRScopeListener(); listener.startBuildOperand(node, s); } Operand operand = buildOperand(node, s); if (hasListener()) { IRScopeListener listener = manager.getIRScopeListener(); listener.endBuildOperand(node, s, operand); } return operand; }
public void addInstr(Instr i) { // SSS FIXME: If more instructions set these flags, there may be // a better way to do this by encoding flags in its own object // and letting every instruction update it. if (i instanceof ThreadPollInstr) threadPollInstrsCount++; else if (i instanceof BreakInstr) this.hasBreakInstrs = true; else if (i instanceof NonlocalReturnInstr) this.hasNonlocalReturns = true; else if (i instanceof DefineMetaClassInstr) this.canReceiveNonlocalReturns = true; else if (i instanceof ReceiveKeywordArgInstr || i instanceof ReceiveKeywordRestArgInstr) this.receivesKeywordArgs = true; if (hasListener()) { IRScopeListener listener = manager.getIRScopeListener(); listener.addedInstr(this, i, instrList.size()); } instrList.add(i); }
public Operand build(Node node, IRScope s) { if (node == null) return null; if (s == null) { System.out.println("Got a null scope!"); throw new NotCompilableException("Unknown node encountered in builder: " + node); } if (hasListener()) { IRScopeListener listener = manager.getIRScopeListener(); listener.startBuildOperand(node, s); } Operand operand = buildOperand(node, s); if (hasListener()) { IRScopeListener listener = manager.getIRScopeListener(); listener.endBuildOperand(node, s, operand); } return operand; }
public void addInstr(Instr i) { // SSS FIXME: If more instructions set these flags, there may be // a better way to do this by encoding flags in its own object // and letting every instruction update it. if (i instanceof ThreadPollInstr) threadPollInstrsCount++; else if (i instanceof BreakInstr) this.hasBreakInstrs = true; else if (i instanceof NonlocalReturnInstr) this.hasNonlocalReturns = true; else if (i instanceof DefineMetaClassInstr) this.canReceiveNonlocalReturns = true; else if (i instanceof ReceiveKeywordArgInstr || i instanceof ReceiveKeywordRestArgInstr) this.receivesKeywordArgs = true; if (hasListener()) { IRScopeListener listener = manager.getIRScopeListener(); listener.addedInstr(this, i, instrList.size()); } instrList.add(i); }
public void addInstrAtBeginning(Instr instr) { // If we are building an ensure body, stash the instruction // in the ensure body's list. If not, add it to the scope directly. if (ensureBodyBuildStack.empty()) { instr.computeScopeFlags(scope); if (hasListener()) manager.getIRScopeListener().addedInstr(scope, instr, 0); instructions.add(0, instr); } else { ensureBodyBuildStack.peek().addInstrAtBeginning(instr); } }
public void addInstrAtBeginning(Instr instr) { // If we are building an ensure body, stash the instruction // in the ensure body's list. If not, add it to the scope directly. if (ensureBodyBuildStack.empty()) { instr.computeScopeFlags(scope); if (hasListener()) manager.getIRScopeListener().addedInstr(scope, instr, 0); instructions.add(0, instr); } else { ensureBodyBuildStack.peek().addInstrAtBeginning(instr); } }
public void addInstr(Instr instr) { if (needsLineNumInfo) { needsLineNumInfo = false; addInstr(manager.newLineNumber(_lastProcessedLineNum)); if (RubyInstanceConfig.FULL_TRACE_ENABLED) { addInstr(new TraceInstr(RubyEvent.LINE, methodNameFor(), getFileName(), _lastProcessedLineNum)); if (needsCodeCoverage()) { addInstr(new TraceInstr(RubyEvent.COVERAGE, methodNameFor(), getFileName(), _lastProcessedLineNum)); } } } // If we are building an ensure body, stash the instruction // in the ensure body's list. If not, add it to the scope directly. if (ensureBodyBuildStack.empty()) { if (instr instanceof ThreadPollInstr) scope.threadPollInstrsCount++; instr.computeScopeFlags(scope); if (hasListener()) manager.getIRScopeListener().addedInstr(scope, instr, instructions.size()); instructions.add(instr); } else { ensureBodyBuildStack.peek().addInstr(instr); } }
public void addInstr(Instr instr) { if (needsLineNumInfo) { needsLineNumInfo = false; addInstr(manager.newLineNumber(_lastProcessedLineNum)); if (RubyInstanceConfig.FULL_TRACE_ENABLED) { addInstr(new TraceInstr(RubyEvent.LINE, methodNameFor(), getFileName(), _lastProcessedLineNum)); if (needsCodeCoverage()) { addInstr(new TraceInstr(RubyEvent.COVERAGE, methodNameFor(), getFileName(), _lastProcessedLineNum)); } } } // If we are building an ensure body, stash the instruction // in the ensure body's list. If not, add it to the scope directly. if (ensureBodyBuildStack.empty()) { if (instr instanceof ThreadPollInstr) scope.threadPollInstrsCount++; instr.computeScopeFlags(scope); if (hasListener()) manager.getIRScopeListener().addedInstr(scope, instr, instructions.size()); instructions.add(instr); } else { ensureBodyBuildStack.peek().addInstr(instr); } }