Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do guard elimination during scalar replacement
When an attribute is replaced with storage in a register, we can propagate type information that was not previously possible. This may allow for the elimination of guards placed after attribute reads. With this change, we now track hypothetical facts that, if we do a scalar replacement, allow us to eliminate the guards. We do this during the escape analysis pass, meaning we can not consider that a deopt point any longer, which is especially helpful given that we cannot yet cope with deopt. This is sufficient to do the first observed useful optimization: when we have a `new` call, it slurps the args into a low-level hash, and wraps that in a Perl 6 Hash instance. Then, BUILDALL unwraps it to get the low-level hash again, plus guards it. With this branch, the Hash wrapper object allocation goes away entirely, as does the guard, and the attribute accesses become simple `set` instructions. That's another 6% off an object construction benchmark.
- Loading branch information
Showing
2 changed files
with
163 additions
and
12 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