Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a bind failure -> resumption mechanism
The assertparamcheck op is used in the binding code emitted by Rakudo, and so far has always triggered a signature binding error handler. This makes it possible to invoke some bytecode such that if there is a binding failure (that is, assertparamcheck is used with a zero value), then instead of calling the bind failure callback, the frame will be removed from the callstack and the `boot-resume` dispatcher will be invoked. This will resume the ongoing dispatch. This will be used in Rakudo for when we have multiple dispatch with things like `where` clauses, which needs a bind check. Today we always do all of the binding work twice in such a situation, which is rather wasteful. This will hopefully - after a little re-work in Rakudo - give us a way to avoid that in new-disp. The resumption dispatch has an inline cache stacked up at the location of the assertparamcheck op. Since such a bind failure will typically take us to the next multi candidate, this should hopefully end up being monomorphic (or only lightly polymorphic). This will also allow spesh to find out what typically happens after the bind check fails, which maybe offers some interesting future optimization opportunities. Even without that, it should mean that the only step between a `where` clause failing and us trying the next candidate is running a dispatch program, rather than having to run any bytecode, which is also, at least in theory, quite a win over the current situation too.
- Loading branch information
Showing
17 changed files
with
274 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.