Skip to content

Conversation

@HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Jun 13, 2023

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
  • Remove BasicBlock and redirect it's references
  • Insert BasicBlock and redirect it's references
  • Clean-up
  • Document

@HalidOdat HalidOdat added the performance Performance related changes and issues label Jun 13, 2023
@jedel1043
Copy link
Member

Nice! This'll also be really useful when we eventually implement JIT compilation

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

Great step :) I added a couple of comments, but I didn't do a full review yet

@HalidOdat HalidOdat force-pushed the control-flow-graph branch from e60cb81 to f572038 Compare June 15, 2023 17:30
@github-actions
Copy link

github-actions bot commented Jun 15, 2023

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
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

❌ Patch coverage is 79.01235% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.34%. Comparing base (0f82312) to head (126367f).
⚠️ Report is 627 commits behind head on main.

Files with missing lines Patch % Lines
...ore/engine/src/optimizer/control_flow_graph/mod.rs 90.15% 25 Missing ⚠️
cli/src/debug/optimizer.rs 0.00% 21 Missing ⚠️
...ne/src/optimizer/control_flow_graph/basic_block.rs 60.60% 13 Missing ⚠️
core/engine/src/vm/opcode/mod.rs 36.36% 7 Missing ⚠️
core/engine/src/vm/code_block.rs 0.00% 2 Missing ⚠️
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     

☔ 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.

@jedel1043
Copy link
Member

Coincidentally, I found this crate that could simplify the optimizer logic:
https://docs.rs/egg/0.9.5/egg

@HalidOdat
Copy link
Member Author

HalidOdat commented Jul 16, 2023

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).

@jedel1043 jedel1043 added the waiting-on-author Waiting on PR changes from the author label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance related changes and issues waiting-on-author Waiting on PR changes from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants