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] - Implement missing vm operations #1697

Closed
wants to merge 7 commits into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Nov 2, 2021

This implements most of the missing vm operations and fixes most of the panics.

The early errors for declarations in for in and for of loops are moved to the parser. The content of those Nodes is changed accordingly.

@raskad raskad added the vm Issues and PRs related to the Boa Virtual Machine. label Nov 2, 2021
@codecov
Copy link

codecov bot commented Nov 2, 2021

Codecov Report

Merging #1697 (441a81a) into main (09ba9b9) will decrease coverage by 0.89%.
The diff coverage is 12.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1697      +/-   ##
==========================================
- Coverage   50.85%   49.95%   -0.90%     
==========================================
  Files         199      200       +1     
  Lines       17803    18130     +327     
==========================================
+ Hits         9053     9057       +4     
- Misses       8750     9073     +323     
Impacted Files Coverage Δ
boa/src/builtins/iterable/mod.rs 57.69% <ø> (ø)
boa/src/bytecompiler.rs 0.00% <0.00%> (ø)
boa/src/context.rs 44.91% <0.00%> (-0.28%) ⬇️
boa/src/object/operations.rs 58.18% <ø> (ø)
boa/src/syntax/ast/node/new/mod.rs 92.85% <ø> (ø)
boa/src/syntax/ast/node/template/mod.rs 57.89% <ø> (ø)
boa/src/vm/code_block.rs 0.00% <ø> (ø)
boa/src/vm/mod.rs 0.00% <ø> (ø)
...a/src/syntax/ast/node/iteration/for_of_loop/mod.rs 48.51% <31.37%> (+0.20%) ⬆️
...a/src/syntax/ast/node/iteration/for_in_loop/mod.rs 53.70% <39.21%> (-2.30%) ⬇️
... and 8 more

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 09ba9b9...441a81a. Read the comment docs.

@raskad
Copy link
Member Author

raskad commented Nov 2, 2021

Non-VM implementation

Test result main count PR count difference
Total 86,464 86,464 0
Passed 40,037 40,113 +76
Ignored 18,869 18,869 0
Failed 27,558 27,482 -76
Panics 0 0 0
Conformance 46.30% 46.39% +0.09%

VM implementation

Test result main count PR count difference
Total 86,464 86,464 0
Passed 6,677 39,656 +32,979
Ignored 18,869 18,869 0
Failed 60,918 27,939 -32,979
Panics 60,047 189 -59,858
Conformance 7.72% 45.86% +38.14%

@raskad
Copy link
Member Author

raskad commented Nov 2, 2021

Relevant for the review may be this change outside of the vm:

I moved the early error generation for declarations in for in and for of loops to the parser, as we have no way to throw early errors in the vm. The relevant files are:

boa/src/syntax/ast/node/iteration/for_in_loop/mod.rs
boa/src/syntax/ast/node/iteration/for_of_loop/mod.rs
boa/src/syntax/ast/node/iteration/mod.rs
boa/src/syntax/parser/statement/iteration/for_statement.rs

boa/src/vm/mod.rs Outdated Show resolved Hide resolved
boa/src/vm/mod.rs Outdated Show resolved Hide resolved
boa/src/bytecompiler.rs Outdated Show resolved Hide resolved
Copy link
Member

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

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

Reviewing just to indicate that the DefConst opcode should be removed.

@raskad raskad marked this pull request as ready for review November 14, 2021 12:06
@raskad
Copy link
Member Author

raskad commented Nov 16, 2021

bors r+

bors bot pushed a commit that referenced this pull request Nov 16, 2021
This implements most of the missing vm operations and fixes most of the panics.

The early errors for declarations in `for in` and `for of` loops are moved to the parser. The content of those `Node`s is changed accordingly.
@bors
Copy link

bors bot commented Nov 16, 2021

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Implement missing vm operations [Merged by Bors] - Implement missing vm operations Nov 16, 2021
@bors bors bot closed this Nov 16, 2021
@bors bors bot deleted the vm-implement-missing-operations branch November 16, 2021 22:41
@Razican Razican added this to the v0.14.0 milestone Feb 23, 2022
@RageKnify RageKnify added the enhancement New feature or request label Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 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