-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
[Merged by Bors] - Fix double property access on assignment ops #2551
Conversation
Test262 conformance changes
Fixed tests (28):
|
Codecov Report
@@ Coverage Diff @@
## main #2551 +/- ##
==========================================
- Coverage 49.99% 49.93% -0.06%
==========================================
Files 379 379
Lines 37642 37721 +79
==========================================
+ Hits 18819 18836 +17
- Misses 18823 18885 +62
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
A bit unfortunate that we can't share logic between simple accesses and assignments, but makes sense since they're special in the first place.
On another note, maybe we should split this function into compile_simple_assign
and compile_assign_op
, since they don't share any logic at all.
I thought this too. In the same change I would also refactor the AST to make it a bit typesafer. I'd like to push that in a follow up PR to keep the diff reasonable. |
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.
Sounds good!
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.
Looks good to me 😄
bors r+ |
Currently the compilation of assignment operators leads to a double object property access, both on the get and set access. While this refactor adds special access handling instead of using the existing `access_set` and `access_get` functions, it fixes the double access and should also make the resulting code more efficient.
Pull request successfully merged into main. Build succeeded: |
Currently update expressions get values multiple times. This can lead to multiple executions of object property getters. This is very similar to #2551. Unfortunateley it seems like we have to sacrifice some code duplication for correctness in these cases. But that is probably for the best, as we can generate more optimized bytecode for each of these `get/set` cases.
Currently the compilation of assignment operators leads to a double object property access, both on the get and set access.
While this refactor adds special access handling instead of using the existing
access_set
andaccess_get
functions, it fixes the double access and should also make the resulting code more efficient.