public synchronized BasicBlock[] prepareForCompilation() { if (!hasBeenBuilt()) lazilyAcquireInterpreterContext(); BasicBlock[] bbs = super.prepareForCompilation(); return bbs; }
public synchronized BasicBlock[] prepareForCompilation() { if (!hasBeenBuilt()) lazilyAcquireInterpreterContext(); BasicBlock[] bbs = super.prepareForCompilation(); return bbs; }
public String emitScope(IRScope scope, String name, int arity) { this.currentScope = scope; name = name + scope.getLineNumber(); jvm.pushmethod(name, arity); Tuple<Instr[], Map<Integer,Label[]>> t = scope.prepareForCompilation(); Instr[] instrs = t.a; Map<Integer, Label[]> jumpTable = t.b; IRBytecodeAdapter m = jvm.method(); for (int i = 0; i < instrs.length; i++) { Instr instr = instrs[i]; if (jumpTable.get(i) != null) { for (Label label : jumpTable.get(i)) m.mark(jvm.methodData().getLabel(label)); } visit(instr); } jvm.popmethod(); return name; }
public String emitScope(IRScope scope, String name, int arity) { this.currentScope = scope; name = name + scope.getLineNumber(); jvm.pushmethod(name, arity); Tuple<Instr[], Map<Integer,Label[]>> t = scope.prepareForCompilation(); Instr[] instrs = t.a; Map<Integer, Label[]> jumpTable = t.b; IRBytecodeAdapter m = jvm.method(); for (int i = 0; i < instrs.length; i++) { Instr instr = instrs[i]; if (jumpTable.get(i) != null) { for (Label label : jumpTable.get(i)) m.mark(jvm.methodData().getLabel(label)); } visit(instr); } jvm.popmethod(); return name; }
/** Run any necessary passes to get the IR ready for compilation (AOT and/or JIT) */ public synchronized BasicBlock[] prepareForCompilation() { if (optimizedInterpreterContext != null && optimizedInterpreterContext.buildComplete()) { return optimizedInterpreterContext.getLinearizedBBList(); } // Don't run if same method was queued up in the tiny race for scheduling JIT/Full Build OR // for any nested closures which got a a fullInterpreterContext but have not run any passes // or generated instructions. if (fullInterpreterContext != null && fullInterpreterContext.buildComplete()) return fullInterpreterContext.getLinearizedBBList(); for (IRScope scope: getClosures()) { scope.prepareForCompilation(); } prepareFullBuildCommon(); runCompilerPasses(getManager().getJITPasses(this), dumpToIGV()); BasicBlock[] bbs = fullInterpreterContext.linearizeBasicBlocks(); return bbs; }
/** Run any necessary passes to get the IR ready for compilation (AOT and/or JIT) */ public synchronized BasicBlock[] prepareForCompilation() { if (optimizedInterpreterContext != null && optimizedInterpreterContext.buildComplete()) { return optimizedInterpreterContext.getLinearizedBBList(); } // Don't run if same method was queued up in the tiny race for scheduling JIT/Full Build OR // for any nested closures which got a a fullInterpreterContext but have not run any passes // or generated instructions. if (fullInterpreterContext != null && fullInterpreterContext.buildComplete()) return fullInterpreterContext.getLinearizedBBList(); for (IRScope scope: getClosures()) { scope.prepareForCompilation(); } prepareFullBuildCommon(); runCompilerPasses(getManager().getJITPasses(this), dumpToIGV()); BasicBlock[] bbs = fullInterpreterContext.linearizeBasicBlocks(); return bbs; }
private void promoteToFullBuild(ThreadContext context) { if (context.runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't JIT during runtime boot if (callCount >= 0) { synchronized (this) { // check call count again if (callCount < 0) return; if (callCount++ >= Options.JIT_THRESHOLD.load()) { callCount = -1; // ensure we've got code ready for JIT ensureInstrsReady(); closure.getNearestTopLocalVariableScope().prepareForCompilation(); // if we don't have an explicit protocol, disable JIT if (!closure.hasExplicitCallProtocol()) { if (Options.JIT_LOGGING.load()) { LOG.info("JIT failed; no protocol found in block: " + closure); } return; } context.runtime.getJITCompiler().buildThresholdReached(context, this); } } } }
private void promoteToFullBuild(ThreadContext context) { if (context.runtime.isBooting() && !Options.JIT_KERNEL.load()) return; // don't JIT during runtime boot if (callCount >= 0) { synchronized (this) { // check call count again if (callCount < 0) return; if (callCount++ >= Options.JIT_THRESHOLD.load()) { callCount = -1; // ensure we've got code ready for JIT ensureInstrsReady(); closure.getNearestTopLocalVariableScope().prepareForCompilation(); // if we don't have an explicit protocol, disable JIT if (!closure.hasExplicitCallProtocol()) { if (Options.JIT_LOGGING.load()) { LOG.info("JIT failed; no protocol found in block: " + closure); } return; } context.runtime.getJITCompiler().buildThresholdReached(context, this); } } } }
currentScopeName = name + "_IRScope"; BasicBlock[] bbs = scope.prepareForCompilation();
currentScopeName = name + "_IRScope"; BasicBlock[] bbs = scope.prepareForCompilation();