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); } }