Skip to content

feat(compiler): Generate optimized code for ToInt32 code patterns - #5307

Open
HalidOdat wants to merge 1 commit into
boa-dev:mainfrom
HalidOdat:optimization/to-uint32-shortcuts
Open

feat(compiler): Generate optimized code for ToInt32 code patterns#5307
HalidOdat wants to merge 1 commit into
boa-dev:mainfrom
HalidOdat:optimization/to-uint32-shortcuts

Conversation

@HalidOdat

Copy link
Copy Markdown
Member

This pull request introduces a new bytecode instruction, ToInt32, to the engine's virtual machine. The main purpose of this change is to optimize certain bitwise operations by emitting a specialized instruction for converting values to 32-bit integers, particularly for common JavaScript idioms like x | 0 and x & 0xFFFFFFFF.

@github-actions github-actions Bot added C-VM Issues and PRs related to the Boa Virtual Machine. Waiting On Review Waiting on reviews from the maintainers labels Apr 8, 2026
@github-actions github-actions Bot added this to the v1.0.0 milestone Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 53,125 53,125 0
Passed 51,049 51,049 0
Ignored 1,482 1,482 0
Failed 594 594 0
Panics 0 0 0
Conformance 96.09% 96.09% 0.00%

Tested main commit: 3f8a99641ea51f02dc0ede7fcb75468eb6531bfe
Tested PR commit: 62747cb3a6542cb4af0be05dd5a79acc564e6cd0
Compare commits: 3f8a996...62747cb

@HalidOdat
HalidOdat marked this pull request as ready for review April 8, 2026 17:40
@HalidOdat
HalidOdat requested a review from a team as a code owner April 8, 2026 17:40
@codecov

codecov Bot commented Apr 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.72%. Comparing base (6ddc2b4) to head (62747cb).
⚠️ Report is 1006 commits behind head on main.

Files with missing lines Patch % Lines
core/engine/src/vm/code_block.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5307       +/-   ##
===========================================
+ Coverage   47.24%   59.72%   +12.48%     
===========================================
  Files         476      589      +113     
  Lines       46892    63663    +16771     
===========================================
+ Hits        22154    38023    +15869     
- Misses      24738    25640      +902     

☔ View full report in Codecov by Harness.
📢 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.

@jedel1043 jedel1043 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cool optimization!

@jedel1043

Copy link
Copy Markdown
Member

(needs a rebase, but approving nonetheless)

@jedel1043 jedel1043 added Waiting On Author Waiting on PR changes from the author and removed Waiting On Review Waiting on reviews from the maintainers labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-VM Issues and PRs related to the Boa Virtual Machine. Waiting On Author Waiting on PR changes from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants