@SuppressWarnings("unchecked") protected void compile(JVMVisitorMethodContext context) { if (bytecode != null) return; // Time the compilation long start = System.nanoTime(); InterpreterContext ic = method.ensureInstrsReady(); int insnCount = ic.getInstructions().length; if (insnCount > Options.JIT_MAXSIZE.load()) { // methods with more than our limit of basic blocks are likely too large to JIT, so bail out throw new NotCompilableException("Could not compile " + method + "; instruction count " + insnCount + " exceeds threshold of " + Options.JIT_MAXSIZE.load()); } // This may not be ok since we'll end up running passes specific to JIT // CON FIXME: Really should clone scope before passes in any case bytecode = visitor.compileToBytecode(method.getIRScope(), context); // try { // java.io.FileOutputStream fos = new java.io.FileOutputStream(className + '#' + methodName + ".class"); // fos.write(bytecode); // fos.close(); // } catch (Exception e) { // e.printStackTrace(); // } compileTime = System.nanoTime() - start; }
@SuppressWarnings("unchecked") protected void compile(JVMVisitorMethodContext context) { if (bytecode != null) return; // Time the compilation long start = System.nanoTime(); InterpreterContext ic = method.ensureInstrsReady(); int insnCount = ic.getInstructions().length; if (insnCount > Options.JIT_MAXSIZE.load()) { // methods with more than our limit of basic blocks are likely too large to JIT, so bail out throw new NotCompilableException("Could not compile " + method + "; instruction count " + insnCount + " exceeds threshold of " + Options.JIT_MAXSIZE.load()); } // This may not be ok since we'll end up running passes specific to JIT // CON FIXME: Really should clone scope before passes in any case bytecode = visitor.compileToBytecode(method.getIRScope(), context); // try { // java.io.FileOutputStream fos = new java.io.FileOutputStream(className + '#' + methodName + ".class"); // fos.write(bytecode); // fos.close(); // } catch (Exception e) { // e.printStackTrace(); // } compileTime = System.nanoTime() - start; }
IRMethod scopeToInline = (IRMethod) (targetMethod).getIRScope();
IRMethod scopeToInline = (IRMethod) (targetMethod).getIRScope();