@Override public DynamicMethod dup() { return (DynamicMethod) clone(); }
@Override public DynamicMethod dup() { MixedModeIRMethod x = (MixedModeIRMethod) super.dup(); x.callCount = callCount; x.actualMethod = actualMethod; return x; }
@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; }
public ArgumentDescriptor[] getArgumentDescriptors() { ensureInstrsReady(); // Make sure method is minimally built before returning this info return ((IRMethod) method).getArgumentDescriptors(); }
IRMethod scopeToInline = (IRMethod) (targetMethod).getIRScope();
@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; }
public ArgumentDescriptor[] getArgumentDescriptors() { ensureInstrsReady(); // Make sure method is minimally built before returning this info return ((IRMethod) method).getArgumentDescriptors(); }
IRMethod scopeToInline = (IRMethod) (targetMethod).getIRScope();
/** * Additional metadata about this method. */ public MethodData getMethodData() { if (methodData == null) { List<String> ivarNames = new ArrayList<>(); InterpreterContext context = ensureInstrsReady(); for (Instr i : context.getInstructions()) { switch (i.getOperation()) { case GET_FIELD: ivarNames.add(((GetFieldInstr) i).getId()); break; case PUT_FIELD: ivarNames.add(((PutFieldInstr) i).getId()); break; } } methodData = new MethodData(method.getId(), method.getFile(), ivarNames); } return methodData; } }
@Override public DynamicMethod dup() { return (DynamicMethod) clone(); }
@Override public DynamicMethod dup() { MixedModeIRMethod x = (MixedModeIRMethod) super.dup(); x.callCount = callCount; x.actualMethod = actualMethod; return x; }
/** * Additional metadata about this method. */ public MethodData getMethodData() { if (methodData == null) { List<String> ivarNames = new ArrayList<>(); InterpreterContext context = ensureInstrsReady(); for (Instr i : context.getInstructions()) { switch (i.getOperation()) { case GET_FIELD: ivarNames.add(((GetFieldInstr) i).getId()); break; case PUT_FIELD: ivarNames.add(((PutFieldInstr) i).getId()); break; } } methodData = new MethodData(method.getId(), method.getFile(), ivarNames); } return methodData; } }
public AbstractIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass) { super(implementationClass, visibility, method.getId()); this.method = method; this.staticScope = method.getStaticScope(); this.staticScope.determineModule(); this.signature = staticScope.getSignature(); // -1 jit.threshold is way of having interpreter not promote full builds. if (Options.JIT_THRESHOLD.load() == -1) callCount = -1; // If we are printing, do the build right at creation time so we can see it if (IRRuntimeHelpers.shouldPrintIR(implementationClass.getRuntime())) { ensureInstrsReady(); } }
public AbstractIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass) { super(implementationClass, visibility, method.getId()); this.method = method; this.staticScope = method.getStaticScope(); this.staticScope.determineModule(); this.signature = staticScope.getSignature(); // -1 jit.threshold is way of having interpreter not promote full builds. if (Options.JIT_THRESHOLD.load() == -1) callCount = -1; // If we are printing, do the build right at creation time so we can see it if (IRRuntimeHelpers.shouldPrintIR(implementationClass.getRuntime())) { ensureInstrsReady(); } }