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

Implement synthetic modules #3294

Merged
merged 3 commits into from Oct 15, 2023
Merged

Implement synthetic modules #3294

merged 3 commits into from Oct 15, 2023

Conversation

jedel1043
Copy link
Member

Depends on #3292.

This Pull Request closes #3224.

It changes the following:

  • Implements Synthetic Modules per the JSON modules proposal.
  • Improves some patterns by using Gc::new_cyclic.

@HalidOdat I had to do a weird hack to be able to push the ActiveRunnable without a CodeBlock available to create a CallFrame. Since you're currently refactoring the VM, I didn't want to modify the definition of CallFrame to accommodate this special case. I could leave it as it is, of course, but would there be another way to store the ActiveRunnable inside the callstack without having to create a dummy CodeBlock in the process?

@jedel1043 jedel1043 added enhancement New feature or request API labels Sep 21, 2023
@jedel1043 jedel1043 requested a review from a team September 21, 2023 10:07
@jedel1043 jedel1043 added this to the v0.18.0 milestone Sep 21, 2023
@HalidOdat
Copy link
Member

We could wrap CodeBlock in an optional, but we will have to .expect on every access to contents for ordinary functions.

We could take the v8 approach, and merge value stack with frame stack, have different types of call frames (though this may need some unsafe)

For now we can leave a TODO and resolve it once call refactor (#3295) is complete.

@jedel1043
Copy link
Member Author

For now we can leave a TODO and resolve it once call refactor (#3295) is complete.

Sounds good! I already left a TODO on it.

Base automatically changed from cyclic-gc to main September 21, 2023 23:28
@jedel1043 jedel1043 marked this pull request as ready for review September 30, 2023 20:52
@github-actions
Copy link

github-actions bot commented Sep 30, 2023

Test262 conformance changes

Test result main count PR count difference
Total 95,574 95,574 0
Passed 75,342 75,342 0
Ignored 19,482 19,482 0
Failed 750 750 0
Panics 0 0 0
Conformance 78.83% 78.83% 0.00%

@codecov
Copy link

codecov bot commented Sep 30, 2023

Codecov Report

Attention: 252 lines in your changes are missing coverage. Please review.

Comparison is base (afb9283) 46.05% compared to head (88874ae) 45.86%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3294      +/-   ##
==========================================
- Coverage   46.05%   45.86%   -0.20%     
==========================================
  Files         474      477       +3     
  Lines       48742    48944     +202     
==========================================
  Hits        22450    22450              
- Misses      26292    26494     +202     
Files Coverage Δ
boa_engine/src/lib.rs 73.33% <ø> (ø)
boa_examples/src/bin/modules.rs 0.00% <ø> (ø)
boa_engine/src/module/source.rs 0.00% <0.00%> (ø)
boa_engine/src/module/mod.rs 0.00% <0.00%> (-3.20%) ⬇️
boa_engine/src/module/loader.rs 10.90% <10.90%> (ø)
boa_examples/src/bin/synthetic.rs 0.00% <0.00%> (ø)
boa_engine/src/module/synthetic.rs 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jedel1043 jedel1043 force-pushed the synthetic-mods branch 2 times, most recently from 25c687e to 0094907 Compare October 3, 2023 02:33
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 work! Looks good to me! :)

Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

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

Nice work and great example :)

@jedel1043 jedel1043 added this pull request to the merge queue Oct 15, 2023
Merged via the queue into main with commit 3177540 Oct 15, 2023
14 checks passed
@jedel1043 jedel1043 deleted the synthetic-mods branch October 15, 2023 02:38
sam-finch-tezos pushed a commit to trilitech/boa that referenced this pull request Nov 29, 2023
* Implement synthetic modules

* Add example

* Fix example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Synthetic Modules
3 participants