-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compiler-v2] Ast generator from stackless bytecode
Converter from stackless bytecode into Model AST. We already have one from binary format to stackless. This will be useful in many places in the stack, not at least for debugging, but also as a potential different approach to decompilation. For the later, we still need to create an AST -> Move translator, today we have only debug dump. Most of the logic is contained in the single new file `ast_generator.rs`. There is some longer module description, and I refer to there for whats provided. This is still a prototype, but I'd like to land for iteration. 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, and into AST. However, the best way to test this functionality is to actually integrate it into an `compile-execute == compile-decompile-compile-execute` test on many of our existing tests, and even the framework.
- Loading branch information
Showing
25 changed files
with
3,889 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
third_party/move/move-model/bytecode/ast-generator-tests/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
name = "ast-generator-tests" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = { workspace = true } | ||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dev-dependencies] | ||
anyhow = { workspace = true } | ||
codespan-reporting = { workspace = true, features = ["serde", "serialization"] } | ||
datatest-stable = { workspace = true } | ||
move-compiler-v2 = { workspace = true } | ||
move-model = { workspace = true } | ||
move-prover-test-utils = { workspace = true } | ||
|
||
move-stackless-bytecode = { path = ".." } | ||
|
||
[[test]] | ||
name = "testsuite" | ||
harness = false | ||
|
||
[lib] | ||
doctest = false |
5 changes: 5 additions & 0 deletions
5
third_party/move/move-model/bytecode/ast-generator-tests/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright © Aptos Foundation | ||
// Parts of the project are originally copyright © Meta Platforms, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//! Intentionally empty |
Oops, something went wrong.