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

Only pass on capture in sub split if it's there #3283

Merged

Conversation

MasterDuke17
Copy link
Contributor

Otherwise spesh can't intern the callsite and then the jit bails. Other
attempts (i.e., adding a new multi sub split($pat, Cool:D $target), or
adding that and also changing the |c in the other multi to *%h)
caused errors like Unexpected named argument 'v' passed and Ambiguous call to 'split(Str, Str, :v)'; these signatures all match::($pat, Cool:D $target):($pat, Cool:D $target, *%h). Found when playing around
with the code referenced in #3281 and makes it slightly faster.

Rakudo builds ok and passes make m-test m-spectest.

Otherwise spesh can't intern the callsite and then the jit bails. Other
attempts (i.e., adding a new `multi sub split($pat, Cool:D $target)`, or
adding that and also changing the `|c` in the other multi to `*%h`)
caused errors like `Unexpected named argument 'v' passed` and `Ambiguous
call to 'split(Str, Str, :v)'; these signatures all match::($pat,
Cool:D $target):($pat, Cool:D $target, *%h)`. Found when playing around
with the code referenced in rakudo#3281 and makes it slightly faster.
Copy link
Member

@jnthn jnthn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine; of course in the future it's nice if spesh handles this better. The EA branch in MoarVM probably will be able to get a bit more of a win here by being able to track the emptiness of the Capture (when it is empty, that is).

@jnthn jnthn merged commit 726c38f into rakudo:master Nov 7, 2019
@MasterDuke17 MasterDuke17 deleted the make_sub_split_a_bit_more_speshable branch November 10, 2019 15:12
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

Successfully merging this pull request may close these issues.

None yet

2 participants