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 arguments object creation to bytecode #3432

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Oct 29, 2023

Moves creation of arguments object creation from function internal methods, this allows us to remove the checks for arguments object creation for functions that don't create it and would make #3194 easier since we can have arguments be moves into the stack and accessed as a fast local, instead of accessing it through environments.

While doing this I discovered a bug that happens when we create a function in eval, which was creating the functions and initializing the function, before the eval environment's PushDeclarativeEnvironment is executed. Fixed by delaying creation of function by adding the CreateGlobalFunctionBinding opcode.

@HalidOdat HalidOdat added technical debt execution Issues or PRs related to code execution Internal Category for changelog labels Oct 29, 2023
@github-actions
Copy link

github-actions bot commented Oct 29, 2023

Test262 conformance changes

Test result main count PR count difference
Total 95,609 95,609 0
Passed 76,518 76,518 0
Ignored 18,132 18,132 0
Failed 959 959 0
Panics 0 0 0
Conformance 80.03% 80.03% 0.00%

@HalidOdat HalidOdat marked this pull request as ready for review October 29, 2023 20:22
@HalidOdat HalidOdat requested a review from a team October 29, 2023 20:22
@codecov
Copy link

codecov bot commented Oct 29, 2023

Codecov Report

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

Comparison is base (2c12bae) 44.86% compared to head (1571404) 44.83%.

❗ Current head 1571404 differs from pull request most recent head ff6e79b. Consider uploading reports for the commit ff6e79b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3432      +/-   ##
==========================================
- Coverage   44.86%   44.83%   -0.04%     
==========================================
  Files         487      488       +1     
  Lines       50373    50390      +17     
==========================================
- Hits        22598    22590       -8     
- Misses      27775    27800      +25     
Files Coverage Δ
boa_engine/src/bytecompiler/mod.rs 68.03% <ø> (ø)
boa_engine/src/context/mod.rs 51.17% <100.00%> (-0.17%) ⬇️
boa_engine/src/object/internal_methods/function.rs 89.53% <ø> (-1.56%) ⬇️
boa_engine/src/vm/flowgraph/mod.rs 0.00% <ø> (ø)
boa_engine/src/vm/opcode/arguments.rs 100.00% <100.00%> (ø)
boa_engine/src/vm/opcode/mod.rs 5.00% <ø> (ø)
boa_engine/src/bytecompiler/declarations.rs 52.74% <50.00%> (+0.31%) ⬆️
boa_engine/src/vm/code_block.rs 25.44% <0.00%> (-1.05%) ⬇️
boa_engine/src/vm/opcode/define/mod.rs 42.85% <0.00%> (-14.84%) ⬇️

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

@HalidOdat HalidOdat changed the title Move arguments object creation to opcode Move arguments object creation to bytecode Oct 29, 2023
@HalidOdat HalidOdat added this to the v0.18.0 milestone Oct 30, 2023
@HalidOdat HalidOdat force-pushed the refactor/arguments-creation branch from 8371337 to 8365701 Compare October 30, 2023 19:36
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.

Thanks! I think this also puts us a step closer to separating codeblocks from the context, so that's good.

@HalidOdat HalidOdat force-pushed the refactor/arguments-creation branch from 8365701 to 37a333b Compare November 1, 2023 06:07
@HalidOdat HalidOdat requested a review from a team November 1, 2023 06:07
@HalidOdat HalidOdat force-pushed the refactor/arguments-creation branch from 37a333b to 1571404 Compare November 1, 2023 06:25
@HalidOdat HalidOdat force-pushed the refactor/arguments-creation branch from 1571404 to ff6e79b Compare November 1, 2023 06:28
@raskad raskad added this pull request to the merge queue Nov 1, 2023
Merged via the queue into main with commit 329bf3b Nov 1, 2023
14 checks passed
@raskad raskad deleted the refactor/arguments-creation branch November 1, 2023 13:17
ahaoboy pushed a commit to ahaoboy/boa that referenced this pull request Nov 15, 2023
ahaoboy pushed a commit to ahaoboy/boa that referenced this pull request Nov 15, 2023
sam-finch-tezos pushed a commit to trilitech/boa that referenced this pull request Nov 29, 2023
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