Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method in class body too big to compile no longer interprets correctly #2059

Closed
headius opened this issue Oct 20, 2014 · 2 comments
Closed

Comments

@headius
Copy link
Member

headius commented Oct 20, 2014

This file attempts to JIT (with threshold=0) but fails and falls back to interpreter. However, the interpreter now fails after JIT has run.

Here's the code: https://gist.github.com/headius/6ef51542253cc3f0b786

Whether the JIT fails or not, the interpreter should still always be able to run the IR.

@headius headius added this to the JRuby 9000 milestone Oct 20, 2014
@headius
Copy link
Member Author

headius commented Oct 20, 2014

Run like this to see the failure:

~/projects/jruby $ jruby -Xjit.threshold=0 -Xjit.logging=true -e 'load "./format.rb"'
2014-10-20T09:32:55.175-05:00: Ruby: done compiling target script: -e
2014-10-20T09:32:55.245-05:00: JITCompiler: Could not compile; passes run: [org.jruby.ir.passes.OptimizeTempVarsPass@96737c1e, org.jruby.ir.passes.LocalOptimizationPass@584ed071, org.jruby.ir.passes.AddLocalVarLoadStoreInstructions@f8c40f9d, org.jruby.ir.passes.AddCallProtocolInstructions@87f2d916, org.jruby.ir.passes.EnsureTempsAssigned@cf6bb568]:Date.Date.Date at /Users/headius/projects/jruby/format.rb:3 because of: "Too many arguments in method signature in class file Users/headius/projects/jruby/format"
Compiler.java:66:in `__file__': java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
...
Caused by:
NativeMethodAccessorImpl.java:-2:in `invoke0': java.lang.reflect.InvocationTargetException
...
Caused by:
IRRuntimeHelpers.java:694:in `findInstanceMethodContainer': java.lang.RuntimeException: Should not get here! scopeType is SCRIPT_BODY
    from DefineInstanceMethodInstr.java:57:in `interpret'
    from Interpreter.java:508:in `processOtherOp'
    from Interpreter.java:598:in `interpret'
    from Interpreter.java:677:in `INTERPRET_METHOD'
    from InterpretedIRMethod.java:95:in `call'
    from ProcessModuleBodyInstr.java:73:in `interpret'
    from Interpreter.java:508:in `processOtherOp'
    from Interpreter.java:598:in `interpret'
    from Interpreter.java:643:in `INTERPRET_ROOT'
    from IRScriptBody.java:114:in `interpret'
    from Interpreter.java:135:in `execute'
    from Interpreter.java:27:in `execute'
    from IRTranslator.java:43:in `execute'
    from Ruby.java:820:in `runInterpreter'
    from Ruby.java:2842:in `loadFile'
...

@headius
Copy link
Member Author

headius commented Jan 15, 2015

This has been fixed through various changes, like keeping interpreted instructions from having JIT passes applied. We still have issues with too-big methods not JITing, but that's a different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant