public void computeScopeFlagsFromInstructions() { for (Instr instr : getInstructions()) { instr.computeScopeFlags(scope); } }
public void computeScopeFlagsFromInstructions() { for (Instr instr : getInstructions()) { instr.computeScopeFlags(scope); } }
@Override public List<Instr> decodeInstructionsAt(IRScope scope, int offset) { currentScope = scope; vars = new HashMap<>(); buf.position(offset); int numberOfInstructions = decodeInt(); if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("Number of Instructions: " + numberOfInstructions); List<Instr> instrs = new ArrayList<>(numberOfInstructions); for (int i = 0; i < numberOfInstructions; i++) { Instr decodedInstr = decodeInstr(); if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println(">INSTR = " + decodedInstr); // FIXME: It would be nice to not run this and just record flag state at encode time decodedInstr.computeScopeFlags(scope); instrs.add(decodedInstr); } return instrs; }
@Override public List<Instr> decodeInstructionsAt(IRScope scope, int offset) { currentScope = scope; vars = new HashMap<>(); buf.position(offset); int numberOfInstructions = decodeInt(); if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("Number of Instructions: " + numberOfInstructions); List<Instr> instrs = new ArrayList<>(numberOfInstructions); for (int i = 0; i < numberOfInstructions; i++) { Instr decodedInstr = decodeInstr(); if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println(">INSTR = " + decodedInstr); // FIXME: It would be nice to not run this and just record flag state at encode time decodedInstr.computeScopeFlags(scope); instrs.add(decodedInstr); } return instrs; }
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); } }
@Override public void computeScopeFlagsFromInstructions() { for (BasicBlock b: cfg.getBasicBlocks()) { for (Instr i: b.getInstrs()) { i.computeScopeFlags(getScope()); } } }
@Override public void computeScopeFlagsFromInstructions() { for (BasicBlock b: cfg.getBasicBlocks()) { for (Instr i: b.getInstrs()) { i.computeScopeFlags(getScope()); } } }
/** * This is called when building an IRMethod before it has completed the build and made an IC * yet. */ public void computeScopeFlagsEarly(List<Instr> instructions) { initScopeFlags(); bindingEscapedScopeFlagsCheck(); for (Instr i : instructions) { i.computeScopeFlags(this); } calculateClosureScopeFlags(); computeNeedsDynamicScopeFlag(); flagsComputed = true; }
/** * This is called when building an IRMethod before it has completed the build and made an IC * yet. */ public void computeScopeFlagsEarly(List<Instr> instructions) { initScopeFlags(); bindingEscapedScopeFlagsCheck(); for (Instr i : instructions) { i.computeScopeFlags(this); } calculateClosureScopeFlags(); computeNeedsDynamicScopeFlag(); flagsComputed = true; }
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); } }