boa
boa copied to clipboard
Implement control flow graph construction
This PR is a WIP implementation of control flow graph construction from bytecode, that will be used for many optimizations, like dead-code-elimination.
TODO
- [ ] Add instruction information like length, does it push/pop, is it a jump, etc
- [x] Remove
BasicBlock
and redirect it's references - [ ] Insert
BasicBlock
and redirect it's references - [ ] Clean-up
- [ ] Document
Nice! This'll also be really useful when we eventually implement JIT compilation
Test262 conformance changes
Test result | main count | PR count | difference |
---|---|---|---|
Total | 95,960 | 95,960 | 0 |
Passed | 76,534 | 76,534 | 0 |
Ignored | 18,477 | 18,477 | 0 |
Failed | 949 | 949 | 0 |
Panics | 0 | 0 | 0 |
Conformance | 79.76% | 79.76% | 0.00% |
Codecov Report
Attention: 68 lines
in your changes are missing coverage. Please review.
Comparison is base (
0f82312
) 48.88% compared to head (126367f
) 49.34%.
Additional details and impacted files
@@ Coverage Diff @@
## main #3037 +/- ##
==========================================
+ Coverage 48.88% 49.34% +0.46%
==========================================
Files 471 473 +2
Lines 48492 48814 +322
==========================================
+ Hits 23705 24088 +383
+ Misses 24787 24726 -61
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Coincidentally, I found this crate that could simplify the optimizer logic: https://docs.rs/egg/0.9.5/egg
Coincidentally, I found this crate that could simplify the optimizer logic: https://docs.rs/egg/0.9.5/egg
Looks interesting! But I think it would be better to create our own, because JS semantics are complex and it would be easier to extend.
I postponed this PR until #3059 is fully complete (currently refactoring generators, which are the remaining test262 failing tests).