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

Unify generator and ordinary function creation #3441

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Oct 30, 2023

Depends on #3440

Continuation of the refactor, split into smaller PRs for easier review :)

It changes the following:

  • Add flag to CodeBlockFlags::HAS_PROROTYPE_PROPERTY which arrow and object method functions don't have.
  • Remove GetGenerator and GetArrowFunction
  • Removes GetFunction is_method: bool operand
  • Remove create_generator_function_object() function.
  • Unify generator and ordinary function creation
  • Removes AsyncGeneratorFunction and GeneratorFunction ObjectKinds since we already have the kind stored in the CodeBlock as a bitflag

@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
@HalidOdat HalidOdat requested a review from a team October 30, 2023 15:02
@HalidOdat HalidOdat force-pushed the refactor/move-function-kind-to-codeblock branch from 1d1e441 to 62f2f25 Compare October 30, 2023 18:23
@HalidOdat HalidOdat force-pushed the refactor/unify-generator-and-ordinary-function branch 2 times, most recently from 526efae to 31d0412 Compare October 30, 2023 18:25
Base automatically changed from refactor/move-function-kind-to-codeblock to main October 30, 2023 19:02
@HalidOdat HalidOdat force-pushed the refactor/unify-generator-and-ordinary-function branch from 31d0412 to ad589c1 Compare October 30, 2023 19:04
@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 (b4644a5) 45.45% compared to head (ad589c1) 45.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3441      +/-   ##
==========================================
+ Coverage   45.45%   45.50%   +0.04%     
==========================================
  Files         483      482       -1     
  Lines       49715    49591     -124     
==========================================
- Hits        22599    22565      -34     
+ Misses      27116    27026      -90     
Files Coverage Δ
boa_engine/src/bytecompiler/function.rs 100.00% <100.00%> (ø)
boa_engine/src/object/mod.rs 28.70% <100.00%> (-0.27%) ⬇️
boa_engine/src/vm/mod.rs 56.37% <ø> (ø)
boa_engine/src/vm/opcode/mod.rs 5.00% <ø> (ø)
boa_engine/src/bytecompiler/mod.rs 68.03% <75.00%> (+0.43%) ⬆️
boa_engine/src/vm/flowgraph/mod.rs 0.00% <0.00%> (ø)
boa_engine/src/bytecompiler/declarations.rs 52.42% <33.33%> (+0.52%) ⬆️
boa_engine/src/context/intrinsics.rs 97.15% <75.00%> (-0.47%) ⬇️
boa_engine/src/vm/opcode/get/function.rs 57.14% <60.00%> (+2.30%) ⬆️
boa_engine/src/module/source.rs 0.00% <0.00%> (ø)
... and 3 more

... and 3 files with indirect coverage changes

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

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.

Great refactor too!

@raskad raskad requested a review from a team October 30, 2023 19:25
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Really nice to see the red line count go up :D

@jedel1043 jedel1043 added this pull request to the merge queue Oct 31, 2023
Merged via the queue into main with commit 2c12bae Oct 31, 2023
14 checks passed
@jedel1043 jedel1043 deleted the refactor/unify-generator-and-ordinary-function branch October 31, 2023 22:30
ahaoboy pushed a commit to ahaoboy/boa that referenced this pull request Nov 15, 2023
* Unify generator and ordinary function creation

* Remove GetGenerator opcode

* Remove GetArrowFunction opcode
ahaoboy pushed a commit to ahaoboy/boa that referenced this pull request Nov 15, 2023
* Unify generator and ordinary function creation

* Remove GetGenerator opcode

* Remove GetArrowFunction opcode
sam-finch-tezos pushed a commit to trilitech/boa that referenced this pull request Nov 29, 2023
* Unify generator and ordinary function creation

* Remove GetGenerator opcode

* Remove GetArrowFunction 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