-
Notifications
You must be signed in to change notification settings - Fork 178
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
Array inject accept strings #3425
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
7131244
to
db797e6
Compare
db797e6
to
707c9de
Compare
Thank you for signing the OCA. |
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.
Thank you for the PR, I did an early review.
Some parameter names are rather confusing, could you try to clarify them? (some of them were already bad before though).
The major concern here is avoiding to increase the number of specializations.
I think we should introduce a IsSymbolOrString (inlined) node which accepts either and profiles accordingly, to use in the guards
. That would avoid increasing the number of specializations.
Like ToStringOrSymbolNode
but returning true/false.
Would you like to try that? Or should I do it?
loopProfile); | ||
} | ||
|
||
private Object injectSymbolHelper(VirtualFrame frame, RubyArray array, String symbolOrString, |
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.
private Object injectSymbolHelper(VirtualFrame frame, RubyArray array, String symbolOrString, | |
private Object injectSymbolHelper(VirtualFrame frame, RubyArray array, String method, |
VirtualFrame frame, | ||
RubyArray array, | ||
Object initialOrSymbolOrString, | ||
RubySymbol symbolOrString, |
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.
RubySymbol symbolOrString, | |
RubySymbol symbol, |
(or method
)
VirtualFrame frame, RubyArray array, Object initialOrSymbol, RubySymbol symbol, Nil block, | ||
VirtualFrame frame, | ||
RubyArray array, | ||
Object initialOrSymbolOrString, |
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.
Object initialOrSymbolOrString, | |
Object initial, |
VirtualFrame frame, RubyArray array, RubySymbol initialOrSymbol, NotProvided symbol, Nil block, | ||
VirtualFrame frame, | ||
RubyArray array, | ||
RubySymbol initialOrSymbolOrString, |
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.
symbol or method
I'd like to give it a try! May take some time to get back to this, hope that's alright |
Yes, that's fine, there is no urgency for this issue/PR. |
Attempt to address #2931. This expands the specialisations for InjectNode to accept strings in place of symbols.
Local test: