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 spread arguments in function calls #2216

Closed
wants to merge 1 commit into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Aug 3, 2022

Currently we only spread spread-expressions if they are the last argument in the function call. With this fix all arguments are spread if needed. The downside is that an array object is allocated to store all arguments if the arguments contain a spread-expression. But with dense indexed properties inplemented in #2167 this should be reasonably fast.

@raskad raskad added bug Something isn't working execution Issues or PRs related to code execution labels Aug 3, 2022
@raskad raskad added this to the v0.16.0 milestone Aug 3, 2022
@github-actions
Copy link

github-actions bot commented Aug 3, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 91,573 91,573 0
Passed 64,752 64,828 +76
Ignored 14,606 14,606 0
Failed 12,215 12,139 -76
Panics 0 0 0
Conformance 70.71% 70.79% +0.08%
Fixed tests (76):
test/language/expressions/call/eval-spread-empty-leading.js [strict mode] (previously Failed)
test/language/expressions/call/eval-spread-empty-leading.js (previously Failed)
test/language/expressions/call/spread-mult-literal.js [strict mode] (previously Failed)
test/language/expressions/call/spread-mult-literal.js (previously Failed)
test/language/expressions/new/spread-mult-literal.js [strict mode] (previously Failed)
test/language/expressions/new/spread-mult-literal.js (previously Failed)
test/language/expressions/super/call-spread-mult-literal.js [strict mode] (previously Failed)
test/language/expressions/super/call-spread-mult-literal.js (previously Failed)
test/language/arguments-object/async-gen-named-func-expr-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/async-gen-named-func-expr-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-async-private-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-async-private-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-async-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-async-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-private-gen-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-private-gen-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-gen-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-gen-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-private-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-private-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-private-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-private-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-private-gen-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-private-gen-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/async-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/async-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/func-decl-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/func-decl-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-async-gen-func-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-async-gen-func-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-async-gen-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-async-gen-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-private-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-private-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-gen-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-gen-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-async-gen-func-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-async-gen-func-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-async-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-async-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/gen-func-expr-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/gen-func-expr-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/func-expr-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/func-expr-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-private-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-private-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-async-private-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-async-private-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-private-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-private-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-async-gen-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-async-gen-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-async-private-gen-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-async-private-gen-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-private-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-private-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-async-private-gen-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-async-private-gen-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/gen-func-decl-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/gen-func-decl-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-expr-meth-static-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-expr-meth-static-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/meth-args-trailing-comma-spread-operator.js (previously Failed)
test/language/arguments-object/cls-decl-gen-meth-args-trailing-comma-spread-operator.js [strict mode] (previously Failed)
test/language/arguments-object/cls-decl-gen-meth-args-trailing-comma-spread-operator.js (previously Failed)

@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

Merging #2216 (7018a0c) into main (5909e9a) will decrease coverage by 0.02%.
The diff coverage is 38.46%.

@@            Coverage Diff             @@
##             main    #2216      +/-   ##
==========================================
- Coverage   41.54%   41.51%   -0.03%     
==========================================
  Files         234      234              
  Lines       21891    21878      -13     
==========================================
- Hits         9094     9083      -11     
+ Misses      12797    12795       -2     
Impacted Files Coverage Δ
boa_engine/src/vm/code_block.rs 32.80% <ø> (ø)
boa_engine/src/vm/opcode.rs 50.00% <ø> (ø)
boa_engine/src/bytecompiler/mod.rs 29.35% <32.14%> (-0.10%) ⬇️
boa_engine/src/object/property_map.rs 27.34% <50.00%> (+0.18%) ⬆️
boa_engine/src/vm/mod.rs 46.63% <55.55%> (-0.09%) ⬇️

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

@Razican Razican 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 :)

@HalidOdat
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Aug 17, 2022
Currently we only spread spread-expressions if they are the last argument in the function call. With this fix all arguments are spread if needed. The downside is that an array object is allocated to store all arguments if the arguments contain a spread-expression. But with dense indexed properties inplemented in #2167 this should be reasonably fast.
@bors
Copy link

bors bot commented Aug 17, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fix spread arguments in function calls [Merged by Bors] - Fix spread arguments in function calls Aug 17, 2022
@bors bors bot closed this Aug 17, 2022
@bors bors bot deleted the fix-spread-calls branch August 17, 2022 11:23
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