Skip to content

refactor(engine): encapsulate Context VM field access behind wrapper methods#5149

Open
hansl wants to merge 1 commit intoboa-dev:mainfrom
hansl:split-context-step-1
Open

refactor(engine): encapsulate Context VM field access behind wrapper methods#5149
hansl wants to merge 1 commit intoboa-dev:mainfrom
hansl:split-context-step-1

Conversation

@hansl
Copy link
Contributor

@hansl hansl commented Mar 19, 2026

Add context/vm_access.rs with 45 wrapper methods that delegate to Context's internal Vm field, then replace all ~600 direct context.vm.* accesses across 78 files with calls to these wrappers.

This is the first step toward extracting Context into its own crate (boa_context). By routing all external access through methods, the internal structure of Context can be changed without touching call sites.

…methods

Add `context/vm_access.rs` with 45 wrapper methods that delegate to
`Context`'s internal `Vm` field, then replace all ~600 direct
`context.vm.*` accesses across 78 files with calls to these wrappers.

This is the first step toward extracting Context into its own crate
(boa_context). By routing all external access through methods, the
internal structure of Context can be changed without touching call sites.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hansl hansl requested review from a team, jedel1043 and nekevss as code owners March 19, 2026 05:07
@github-actions github-actions bot added the Waiting On Review Waiting on reviews from the maintainers label Mar 19, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Mar 19, 2026
@github-actions github-actions bot added C-Builtins PRs and Issues related to builtins/intrinsics C-VM Issues and PRs related to the Boa Virtual Machine. C-Intl Changes related to the `Intl` implementation labels Mar 19, 2026
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 50,073 50,073 0
Ignored 2,072 2,072 0
Failed 818 818 0
Panics 0 0 0
Conformance 94.54% 94.54% 0.00%

Tested main commit: 055ee0958ce332f3f99af27536a7c6f9a91def27
Tested PR commit: 498b424578252944cbbfae90753e73f8c15149ae
Compare commits: 055ee09...498b424

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 76.82737% with 149 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.61%. Comparing base (6ddc2b4) to head (498b424).
⚠️ Report is 890 commits behind head on main.

Files with missing lines Patch % Lines
core/engine/src/object/builtins/jspromise.rs 0.00% 16 Missing ⚠️
core/engine/src/builtins/proxy/mod.rs 0.00% 11 Missing ⚠️
core/engine/src/vm/opcode/call/mod.rs 47.36% 10 Missing ⚠️
core/engine/src/vm/opcode/iteration/iterator.rs 61.53% 10 Missing ⚠️
core/engine/src/vm/opcode/environment/mod.rs 67.85% 9 Missing ⚠️
core/engine/src/vm/opcode/define/class/setter.rs 20.00% 8 Missing ⚠️
core/engine/src/vm/opcode/set/private.rs 20.00% 8 Missing ⚠️
core/engine/src/vm/opcode/set/property.rs 66.66% 8 Missing ⚠️
core/engine/src/vm/opcode/control_flow/jump.rs 76.66% 7 Missing ⚠️
core/engine/src/vm/opcode/push/class/private.rs 0.00% 7 Missing ⚠️
... and 23 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5149       +/-   ##
===========================================
+ Coverage   47.24%   59.61%   +12.36%     
===========================================
  Files         476      581      +105     
  Lines       46892    63218    +16326     
===========================================
+ Hits        22154    37685    +15531     
- Misses      24738    25533      +795     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Builtins PRs and Issues related to builtins/intrinsics C-Intl Changes related to the `Intl` implementation C-VM Issues and PRs related to the Boa Virtual Machine. Waiting On Review Waiting on reviews from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant