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

[Merged by Bors] - Fix update expressions getting values multiple times #2733

Closed
wants to merge 1 commit into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Mar 24, 2023

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.

@raskad raskad added bug Something isn't working execution Issues or PRs related to code execution labels Mar 24, 2023
@raskad raskad added this to the v0.17.0 milestone Mar 24, 2023
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 94,277 94,277 0
Passed 71,078 71,086 +8
Ignored 17,324 17,324 0
Failed 5,875 5,867 -8
Panics 2 2 0
Conformance 75.39% 75.40% +0.01%
Fixed tests (8):
test/language/expressions/postfix-decrement/S11.3.2_A6_T3.js [strict mode] (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A6_T3.js (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A6_T3.js [strict mode] (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A6_T3.js (previously Failed)
test/language/expressions/prefix-decrement/S11.4.5_A6_T3.js [strict mode] (previously Failed)
test/language/expressions/prefix-decrement/S11.4.5_A6_T3.js (previously Failed)
test/language/expressions/prefix-increment/S11.4.4_A6_T3.js [strict mode] (previously Failed)
test/language/expressions/prefix-increment/S11.4.4_A6_T3.js (previously Failed)

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #2733 (f9e0ab1) into main (e465743) will increase coverage by 0.10%.
The diff coverage is 54.11%.

@@            Coverage Diff             @@
##             main    #2733      +/-   ##
==========================================
+ Coverage   50.21%   50.31%   +0.10%     
==========================================
  Files         401      400       -1     
  Lines       40034    40011      -23     
==========================================
+ Hits        20103    20133      +30     
+ Misses      19931    19878      -53     
Impacted Files Coverage Δ
boa_engine/src/bytecompiler/expression/update.rs 55.68% <54.11%> (-44.32%) ⬇️

... and 8 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

Nice catch! This looks perfect to me!

Copy link
Member

@nekevss nekevss left a 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 😄

@nekevss
Copy link
Member

nekevss commented Mar 25, 2023

bors r+

bors bot pushed a commit that referenced this pull request Mar 25, 2023
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.
@bors
Copy link

bors bot commented Mar 25, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fix update expressions getting values multiple times [Merged by Bors] - Fix update expressions getting values multiple times Mar 25, 2023
@bors bors bot closed this Mar 25, 2023
@bors bors bot deleted the fix-update-ops branch March 25, 2023 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants