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

Move FunctionKind to CodeBlock #3440

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Oct 30, 2023

Depends on #3439

Since the kind of the function is known at compile time, we can move it to CodeBlock's bitflags. This change allows us to simplify the logic of function creation. Remove GetAsyncArrowFunction, GetFunctionAsync and GetGeneratorAsync opcodes.

@HalidOdat HalidOdat changed the base branch from main to refactor/move-constructor-kind-to-codeblock October 30, 2023 11:34
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 95,609 95,609 0
Passed 75,978 75,978 0
Ignored 18,872 18,872 0
Failed 759 759 0
Panics 0 0 0
Conformance 79.47% 79.47% 0.00%

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

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

Comparison is base (4b8ca76) 45.39% compared to head (1d1e441) 45.45%.

❗ Current head 1d1e441 differs from pull request most recent head 62f2f25. Consider uploading reports for the commit 62f2f25 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3440      +/-   ##
==========================================
+ Coverage   45.39%   45.45%   +0.05%     
==========================================
  Files         483      483              
  Lines       49787    49715      -72     
==========================================
- Hits        22602    22599       -3     
+ Misses      27185    27116      -69     
Files Coverage Δ
boa_engine/src/bytecompiler/class.rs 16.33% <100.00%> (ø)
boa_engine/src/bytecompiler/function.rs 100.00% <100.00%> (ø)
boa_engine/src/bytecompiler/jump_control.rs 93.96% <100.00%> (ø)
boa_engine/src/bytecompiler/statement/mod.rs 91.17% <100.00%> (ø)
boa_engine/src/bytecompiler/statement/try.rs 91.20% <100.00%> (ø)
boa_engine/src/object/mod.rs 28.97% <ø> (ø)
boa_engine/src/vm/opcode/get/function.rs 54.83% <100.00%> (+12.90%) ⬆️
boa_engine/src/vm/opcode/mod.rs 5.00% <ø> (ø)
boa_engine/src/vm/opcode/push/class/mod.rs 66.66% <ø> (ø)
boa_engine/src/bytecompiler/mod.rs 67.60% <90.00%> (+0.80%) ⬆️
... and 9 more

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

@HalidOdat HalidOdat marked this pull request as ready for review October 30, 2023 11:54
@HalidOdat HalidOdat requested a review from a team October 30, 2023 11:54
@HalidOdat HalidOdat added technical debt execution Issues or PRs related to code execution Internal Category for changelog labels Oct 30, 2023
@HalidOdat HalidOdat added this to the v0.18.0 milestone Oct 30, 2023
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.

Very nice refactor!

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 fantastic! 😄 Really nice refactor!

Base automatically changed from refactor/move-constructor-kind-to-codeblock to main October 30, 2023 18:22
@HalidOdat HalidOdat force-pushed the refactor/move-function-kind-to-codeblock branch from 1d1e441 to 62f2f25 Compare October 30, 2023 18:23
@HalidOdat HalidOdat enabled auto-merge October 30, 2023 18:24
@HalidOdat HalidOdat added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit b4644a5 Oct 30, 2023
13 checks passed
@HalidOdat HalidOdat deleted the refactor/move-function-kind-to-codeblock branch October 30, 2023 19:02
ahaoboy pushed a commit to ahaoboy/boa that referenced this pull request Nov 15, 2023
* Move `FunctionKind` flag to CodeBlock

* Add `IS_ARROW` flag to codeblock

* Remove GetAsyncArrowFunction and GetFunctionAsync opcodes

* Remove GetGeneratorAsync opcode
ahaoboy pushed a commit to ahaoboy/boa that referenced this pull request Nov 15, 2023
* Move `FunctionKind` flag to CodeBlock

* Add `IS_ARROW` flag to codeblock

* Remove GetAsyncArrowFunction and GetFunctionAsync opcodes

* Remove GetGeneratorAsync opcode
sam-finch-tezos pushed a commit to trilitech/boa that referenced this pull request Nov 29, 2023
* Move `FunctionKind` flag to CodeBlock

* Add `IS_ARROW` flag to codeblock

* Remove GetAsyncArrowFunction and GetFunctionAsync opcodes

* Remove GetGeneratorAsync opcode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execution Issues or PRs related to code execution Internal Category for changelog technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants