Skip to content

feat(compiler): Generate single emit opcode for negative numbers#5305

Open
HalidOdat wants to merge 1 commit intoboa-dev:mainfrom
HalidOdat:optimization/minus-number-shortcut
Open

feat(compiler): Generate single emit opcode for negative numbers#5305
HalidOdat wants to merge 1 commit intoboa-dev:mainfrom
HalidOdat:optimization/minus-number-shortcut

Conversation

@HalidOdat
Copy link
Copy Markdown
Member

A small optimization that replaces the generated output for simple negative numbers, previously emitting StoreInt8 followed by Neg, with a single StoreInt8 instruction that directly emits the negative value.

@github-actions github-actions bot added the Waiting On Review Waiting on reviews from the maintainers label Apr 7, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Apr 7, 2026
@github-actions github-actions bot added C-Tests Issues and PRs related to the tests. C-Javascript Pull requests that update Javascript code C-VM Issues and PRs related to the Boa Virtual Machine. C-AST Issue surrounding the abstract syntax tree labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

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: 719bb68ef2597f77f34775f7dc4a9d21416a9954
Compare commits: 3f8a996...719bb68

@HalidOdat HalidOdat force-pushed the optimization/minus-number-shortcut branch from eee10fc to 0a10662 Compare April 7, 2026 19:17
@HalidOdat HalidOdat force-pushed the optimization/minus-number-shortcut branch 2 times, most recently from b3cec33 to 719bb68 Compare April 7, 2026 19:55
@HalidOdat HalidOdat marked this pull request as ready for review April 7, 2026 20:11
@HalidOdat HalidOdat requested a review from a team as a code owner April 7, 2026 20:11
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 23.07692% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.68%. Comparing base (6ddc2b4) to head (719bb68).
⚠️ Report is 945 commits behind head on main.

Files with missing lines Patch % Lines
core/ast/src/expression/literal/mod.rs 0.00% 5 Missing ⚠️
core/engine/src/bytecompiler/expression/unary.rs 37.50% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5305       +/-   ##
===========================================
+ Coverage   47.24%   59.68%   +12.43%     
===========================================
  Files         476      589      +113     
  Lines       46892    63661    +16769     
===========================================
+ Hits        22154    37994    +15840     
- Misses      24738    25667      +929     

☔ 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-AST Issue surrounding the abstract syntax tree C-Javascript Pull requests that update Javascript code C-Tests Issues and PRs related to the tests. 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