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

JRuby+Truffle: Keyword Arguments - "illegal recursive call" #2541

Closed
fniephaus opened this issue Jan 30, 2015 · 2 comments
Closed

JRuby+Truffle: Keyword Arguments - "illegal recursive call" #2541

fniephaus opened this issue Jan 30, 2015 · 2 comments

Comments

@fniephaus
Copy link
Contributor

Hi folks,

If you run the following code with JRuby+Truffle:

def m(i:)
    i
end

50000.times.each do
  (1..100_000).each do |i|
    m i:i
  end
end

you'll get something similar to this:

jruby: using Graal Truffle Runtime
[truffle] opt fail  block in each:./core/kabench.rb:6 <split-0-U> |Reason com.oracle.graal.nodes.util.GraphUtil$2: Found illegal recursive call to HotSpotMethod<Class.getCanonicalName()>, must annotate such calls with @TruffleBoundary! 
[truffle] opt fail  m:./core/kabench.rb:1 <split-0-U>             |Reason com.oracle.graal.nodes.util.GraphUtil$2: This code path should never be part of a compilation. [] 
[truffle] opt fail  Range#each(core):core: Range#each <split-0-U> |Reason com.oracle.graal.nodes.util.GraphUtil$2: This code path should never be part of a compilation. [] 

I assume that there's just a TruffleBoundary missing somewhere as suggested by the error message. But unfortunately, I'm unable to tell if that's really the case and if yes how to fix it.
Any ideas?

Regards,
Fabio

@chrisseaton
Copy link
Contributor

Our current implementation of keyword arguments doesn't compile - it only works in the interpreter. You're supposed to get a nice error message telling you this, due to the notDesignedForCompilation directives (e.g.

) but for some reason the compiler here is failing before it gets a chance to report that error. That happens sometimes.

If you change m to have a keyword-rest argument, as in m(**i), you do get the nice compiler error.

The reason the keyword arguments don't compile is that we've taken shortcuts and used slow operations such as verySlowToKeyValues and Java's equals rather than setting up proper Ruby call sites yet.

@fniephaus
Copy link
Contributor Author

Closed, see #2567.

@enebo enebo added this to the 9.0.0.0.pre2 milestone Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants