-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[compiler-v2] Ast generator from stackless bytecode, Source Gen from Ast #14494
Conversation
⏱️ 49m total CI duration on this PR
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14494 +/- ##
===========================================
- Coverage 72.6% 60.0% -12.6%
===========================================
Files 2400 856 -1544
Lines 485594 210624 -274970
===========================================
- Hits 352847 126555 -226292
+ Misses 132747 84069 -48678 ☔ View full report in Codecov by Sentry. |
f32211e
to
04a48c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to read astifier.rs, but here are a few comments.
d74e23c
to
18b921d
Compare
third_party/move/move-compiler-v2/tests/checking/typing/return_any_type.exp
Outdated
Show resolved
Hide resolved
third_party/move/move-compiler-v2/tests/checking/typing/main_call_entry.exp
Outdated
Show resolved
Hide resolved
third_party/move/move-compiler-v2/tests/checking/typing/constant_all_valid_types.exp
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
third_party/move/move-model/bytecode/src/stackless_control_flow_graph.rs
Outdated
Show resolved
Hide resolved
third_party/move/move-compiler-v2/tests/checking/typing/return_any_type.exp
Outdated
Show resolved
Hide resolved
third_party/move/move-compiler-v2/tests/checking/typing/main_call_entry.exp
Outdated
Show resolved
Hide resolved
third_party/move/move-compiler-v2/tests/checking/typing/constant_all_valid_types.exp
Show resolved
Hide resolved
b0238dd
to
4352c47
Compare
Converter from stackless bytecode into Model AST ('astifier'). (We already have one from binary format to stackless.) Also adds a converter from AST to source ('sourcifier'). This adds the major pieces for a working decompiler. However, the pieces are not fully connected to a tool yet, as more sidework needs to be done first. Specifically, this PR adds breaks/continues to labeled outer loops, which are not yet supported by the compiler. There are some tests in a new test crate `ast-generator-tests`. These call the v2 compiler to compile up to file format, then decompile from there into stackless bytecode, into AST, and via sourcifier back to source. However, desired execution roundtrip comparison tests can only be implemented once the full toolchain is ready. Another set of tests for the 'sourcifier' is via compiler-v2 baseline files. Where AST dump is requested in those tests, we dump now also the sourcified AST. This can live side-by-side for a while until we may decide to remove one of the outputs.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
Converter from stackless bytecode into Model AST ('astifier'). (We already have one from binary format to stackless.) Also adds a converter from AST to source ('sourcifier').
This adds the major pieces for a working decompiler. However, the pieces are not fully connected to a tool yet, as more sidework needs to be done first. Specifically, this PR adds breaks/continues to labeled outer loops, which are not yet supported by the compiler.
How is this tested
There are some tests in a new test crate
ast-generator-tests
. These call the v2 compiler to compile up to file format, then decompile from there into stackless bytecode, into AST, and via sourcifier back to source. However, desired execution roundtrip comparison tests can only be implemented once the full toolchain is ready.Another set of tests for the 'sourcifier' is via compiler-v2 baseline files. Where AST dump is requested in those tests, we dump now also the sourcified AST. This can live side-by-side for a while until we may decide to remove one of the outputs.
Type of Change
Which Components or Systems Does This Change Impact?