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

[Truffle] Implement InvokeRubiniusPrimitiveNode annotation properties #2882

Closed
bjfish opened this issue Apr 27, 2015 · 4 comments
Closed

[Truffle] Implement InvokeRubiniusPrimitiveNode annotation properties #2882

bjfish opened this issue Apr 27, 2015 · 4 comments
Assignees

Comments

@bjfish
Copy link
Contributor

bjfish commented Apr 27, 2015

Rubinius.invoke_primitive should implement lowerFixnumParameters and needsSelf.

This is not yet implemented in the BodyTranslator.

@chrisseaton chrisseaton added this to the truffle-dev milestone Apr 30, 2015
@chrisseaton
Copy link
Contributor

Sorry I'm not really sure what you mean here. Can you rephrase or give an example of the problem?

@bjfish
Copy link
Contributor Author

bjfish commented May 1, 2015

@chrisseaton lowerFixnumParameteres works for Rubinius.primitive calls but not for Rubinius.invoke_primitive Does that make sense?

@bjfish
Copy link
Contributor Author

bjfish commented May 1, 2015

@chrisseaton A more concrete example:

./bin/jruby -X+T -e'a = [0,2**35];m = Rubinius::Mirror.reflect "test";m.copy_from self, a[0], 1, a[0]'
core:/core/rubinius/common/string_mirror.rb:53:in `copy_from': Truffle doesn't have a case for the org.jruby.truffle.nodes.rubinius.StringPrimitiveNodesFactory$StringCopyFromPrimitiveNodeFactory$StringCopyFromPrimitiveNodeGen node with values of type  String(org.jruby.truffle.runtime.core.RubyString) Object(org.jruby.truffle.runtime.core.RubyBasicObject) java.lang.Long=0 java.lang.Integer=1 java.lang.Long=0 (TypeError)
    from -e:1:in `<main>'

If I then add: lowerFixnumParameters = {2 , 3, 4} to StringCopyFromPrimitiveNode it still shows the same error. It looks like the translateRubiniusInvokePrimitive method in BodyTranslator doesn't implement the annotations.

@chrisseaton
Copy link
Contributor

I think this is fixed in 1a706b9, but I still can't run your test case because you are copying from self, which isn't a string, so there still isn't a suitable specialisation.

@chrisseaton chrisseaton self-assigned this May 9, 2015
@enebo enebo added this to the Invalid or Duplicate milestone Dec 7, 2017
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