-
-
Notifications
You must be signed in to change notification settings - Fork 925
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] Adding additional long handling for multiple specializations. #2848
Conversation
Anything that is a |
|
21d708d
to
9cf2c3f
Compare
I hate complicating this, but it looks on MRI, |
Yes casting Casting Note that |
@chrisseaton what would be the error to raise if the long is outside of the int range for a methods that only currently support int? could the the same raise exception be thrown from a primitive node? |
I think the key one is array indexing - as that is restricted to
For a
Note that you can index an array with some Short answer - I think it depends on the method! I would concentrate on the specs for now - if the specs cover a case then fix it. Otherwise I am working on some stress test utilities that will help us explore this problem space more in the future. Yeah primitives could have the lower annotation as well. |
9cf2c3f
to
9988e6a
Compare
I've updated the PR to just fix String#byteslice #2843. This is used a lot and fixes a stackoverflow. |
throw new RaiseException(getContext().getCoreLibrary().argumentError("index out of int range", this)); | ||
} | ||
return stringByteSubstring(string, (int) index, length); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just call the (long, long) version to avoid duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this to avoid the duplication.
9988e6a
to
d061cbc
Compare
[Truffle] Adding additional long handling for multiple specializations.
I believe somewhere while running the MRI tests an edge case is causing the AST to change to use some specialization which returns long frequently (possibly Fixnum#-). I’d like to add these specializations to handle long. I’ve added a TODO to indicate these should be reviewed later on for correctness.