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 postfix increment and decrement return values #1913

Closed
wants to merge 1 commit into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Mar 8, 2022

This fixes a bug with the postfix increment and decrement. Before those operators would return the left-hand-side value, but the spec specifies they should return ToNumeric(left-had-side value).

@raskad raskad added bug Something isn't working vm Issues and PRs related to the Boa Virtual Machine. labels Mar 8, 2022
@raskad raskad added this to the v0.14.0 milestone Mar 8, 2022
@github-actions
Copy link

github-actions bot commented Mar 8, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 88,410 88,410 0
Passed 43,854 43,876 +22
Ignored 21,481 21,481 0
Failed 23,075 23,053 -22
Panics 0 0 0
Conformance 49.60% 49.63% +0.02%
Fixed tests (22):
test/language/expressions/postfix-decrement/S11.3.2_A4_T4.js [strict mode] (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A4_T4.js (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A4_T1.js [strict mode] (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A4_T1.js (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A4_T2.js [strict mode] (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A4_T2.js (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A2.2_T1.js [strict mode] (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A2.2_T1.js (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A4_T3.js [strict mode] (previously Failed)
test/language/expressions/postfix-decrement/S11.3.2_A4_T3.js (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A4_T3.js [strict mode] (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A4_T3.js (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A4_T2.js [strict mode] (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A4_T2.js (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A4_T1.js [strict mode] (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A4_T1.js (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A4_T4.js [strict mode] (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A4_T4.js (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A2.2_T1.js [strict mode] (previously Failed)
test/language/expressions/postfix-increment/S11.3.1_A2.2_T1.js (previously Failed)
test/language/types/object/S8.6_A2_T2.js [strict mode] (previously Failed)
test/language/types/object/S8.6_A2_T2.js (previously Failed)

@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #1913 (3520a6a) into main (92dbba6) will increase coverage by 0.02%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1913      +/-   ##
==========================================
+ Coverage   46.04%   46.07%   +0.02%     
==========================================
  Files         206      206              
  Lines       17005    17017      +12     
==========================================
+ Hits         7830     7840      +10     
- Misses       9175     9177       +2     
Impacted Files Coverage Δ
boa_engine/src/vm/code_block.rs 47.57% <ø> (ø)
boa_engine/src/vm/opcode.rs 42.85% <ø> (ø)
boa_engine/src/vm/mod.rs 70.95% <71.42%> (+<0.01%) ⬆️
boa_engine/src/bytecompiler.rs 37.14% <100.00%> (-0.09%) ⬇️
boa_engine/src/value/mod.rs 51.85% <0.00%> (+0.37%) ⬆️
boa_engine/src/string.rs 55.17% <0.00%> (+0.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92dbba6...3520a6a. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

Benchmark for 40387ea

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 461.5±17.81ns 465.5±23.07ns +0.87%
Arithmetic operations (Execution) 1925.3±147.45ns 1862.6±109.41ns -3.26%
Arithmetic operations (Parser) 4.7±0.29µs 4.4±0.19µs -6.38%
Array access (Compiler) 1185.3±60.37ns 1177.6±62.11ns -0.65%
Array access (Execution) 9.0±0.39µs 8.8±0.37µs -2.22%
Array access (Parser) 9.8±0.47µs 9.9±0.54µs +1.02%
Array creation (Compiler) 1637.6±76.71ns 1663.6±94.57ns +1.59%
Array creation (Execution) 3.0±0.13ms 2.8±0.10ms -6.67%
Array creation (Parser) 11.8±0.59µs 11.0±0.50µs -6.78%
Array pop (Compiler) 3.7±0.22µs 3.6±0.20µs -2.70%
Array pop (Execution) 1269.2±83.41µs 1220.0±54.07µs -3.88%
Array pop (Parser) 115.7±6.34µs 120.2±7.93µs +3.89%
Boolean Object Access (Compiler) 952.4±63.14ns 930.4±60.85ns -2.31%
Boolean Object Access (Execution) 5.3±0.22µs 5.5±0.27µs +3.77%
Boolean Object Access (Parser) 12.1±0.85µs 12.0±0.62µs -0.83%
Clean js (Compiler) 3.0±0.13µs 3.1±0.14µs +3.33%
Clean js (Execution) 1038.5±39.02µs 984.4±54.04µs -5.21%
Clean js (Parser) 24.5±1.30µs 24.6±1.49µs +0.41%
Create Realm 255.0±12.19ns 278.5±18.87ns +9.22%
Dynamic Object Property Access (Compiler) 1491.3±109.57ns 1704.8±74.43ns +14.32%
Dynamic Object Property Access (Execution) 6.2±0.48µs 6.2±0.30µs 0.00%
Dynamic Object Property Access (Parser) 8.7±0.33µs 8.6±0.31µs -1.15%
Fibonacci (Compiler) 2.1±0.09µs 2.0±0.07µs -4.76%
Fibonacci (Execution) 1650.5±113.22µs 1607.6±49.58µs -2.60%
Fibonacci (Parser) 13.5±0.62µs 13.4±0.65µs -0.74%
For loop (Compiler) 1794.2±95.09ns 1780.2±77.88ns -0.78%
For loop (Execution) 39.8±1.86µs 41.3±2.31µs +3.77%
For loop (Parser) 12.2±0.57µs 11.8±0.50µs -3.28%
Mini js (Compiler) 3.0±0.22µs 3.0±0.15µs 0.00%
Mini js (Execution) 936.8±43.73µs 920.5±47.25µs -1.74%
Mini js (Parser) 21.2±1.36µs 20.6±1.02µs -2.83%
Number Object Access (Compiler) 891.6±68.19ns 869.3±51.80ns -2.50%
Number Object Access (Execution) 4.1±0.16µs 4.2±0.26µs +2.44%
Number Object Access (Parser) 9.1±0.39µs 9.0±0.29µs -1.10%
Object Creation (Compiler) 1286.2±74.32ns 1356.3±119.77ns +5.45%
Object Creation (Execution) 5.6±0.25µs 5.6±0.24µs 0.00%
Object Creation (Parser) 7.6±0.37µs 8.0±0.70µs +5.26%
RegExp (Compiler) 1479.0±59.94ns 1536.4±119.11ns +3.88%
RegExp (Execution) 11.1±0.57µs 11.6±0.65µs +4.50%
RegExp (Parser) 8.4±0.41µs 8.7±0.76µs +3.57%
RegExp Creation (Compiler) 1289.2±80.82ns 1545.3±110.96ns +19.87%
RegExp Creation (Execution) 8.3±0.47µs 9.2±0.72µs +10.84%
RegExp Creation (Parser) 7.1±0.47µs 6.9±0.34µs -2.82%
RegExp Literal (Compiler) 1579.8±118.22ns 1828.6±149.27ns +15.75%
RegExp Literal (Execution) 10.9±0.43µs 11.5±0.80µs +5.50%
RegExp Literal (Parser) 6.7±0.33µs 6.8±0.48µs +1.49%
RegExp Literal Creation (Compiler) 1359.9±87.97ns 1398.4±120.08ns +2.83%
RegExp Literal Creation (Execution) 8.2±0.38µs 8.9±0.69µs +8.54%
RegExp Literal Creation (Parser) 5.2±0.25µs 5.2±0.27µs 0.00%
Static Object Property Access (Compiler) 1295.2±52.04ns 1364.9±110.68ns +5.38%
Static Object Property Access (Execution) 6.0±0.39µs 5.9±0.29µs -1.67%
Static Object Property Access (Parser) 8.2±0.33µs 8.1±0.37µs -1.22%
String Object Access (Compiler) 1232.0±51.72ns 1253.0±54.14ns +1.70%
String Object Access (Execution) 7.0±0.56µs 7.0±0.41µs 0.00%
String Object Access (Parser) 11.8±0.59µs 11.9±0.53µs +0.85%
String comparison (Compiler) 1945.1±116.85ns 2.1±0.07µs +7.96%
String comparison (Execution) 5.4±0.32µs 5.5±0.26µs +1.85%
String comparison (Parser) 9.2±0.39µs 9.0±0.30µs -2.17%
String concatenation (Compiler) 1527.7±87.74ns 1575.7±106.41ns +3.14%
String concatenation (Execution) 5.0±0.36µs 4.9±0.24µs -2.00%
String concatenation (Parser) 6.2±0.22µs 6.1±0.22µs -1.61%
String copy (Compiler) 1180.4±50.02ns 1200.8±47.78ns +1.73%
String copy (Execution) 4.3±0.18µs 4.3±0.23µs 0.00%
String copy (Parser) 4.6±0.18µs 4.5±0.15µs -2.17%
Symbols (Compiler) 981.3±53.63ns 829.5±36.59ns -15.47%
Symbols (Execution) 4.2±0.29µs 4.4±0.29µs +4.76%
Symbols (Parser) 3.5±0.16µs 3.4±0.12µs -2.86%

@raskad
Copy link
Member Author

raskad commented Mar 9, 2022

bors r+

bors bot pushed a commit that referenced this pull request Mar 9, 2022
This fixes a bug with the postfix increment and decrement. Before those operators would return the left-hand-side value, but the spec specifies they should return ToNumeric(left-had-side value).
@bors
Copy link

bors bot commented Mar 9, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fix postfix increment and decrement return values [Merged by Bors] - Fix postfix increment and decrement return values Mar 9, 2022
@bors bors bot closed this Mar 9, 2022
@bors bors bot deleted the fix-postfix-return branch March 9, 2022 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vm Issues and PRs related to the Boa Virtual Machine.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants