Skip to content

Commit c7e5212

Browse files
authored
Merge pull request #13673 from ethereum/import-asm-json-updated
Add support to import evm assembly json (updated).
2 parents 2cce9c7 + 91c7b32 commit c7e5212

File tree

89 files changed

+3031
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3031
-113
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ jobs:
11231123

11241124
t_osx_cli:
11251125
<<: *base_osx
1126-
parallelism: 7 # Should match number of tests in .circleci/cli.sh
1126+
parallelism: 8 # Should match number of tests in .circleci/parallel_cli_tests.py
11271127
steps:
11281128
- checkout
11291129
- install_dependencies_osx
@@ -1218,7 +1218,7 @@ jobs:
12181218

12191219
t_ubu_cli: &t_ubu_cli
12201220
<<: *base_ubuntu2204_small
1221-
parallelism: 7 # Should match number of tests in .circleci/cli.sh
1221+
parallelism: 8 # Should match number of tests in .circleci/parallel_cli_tests.py
12221222
steps:
12231223
- cmdline_tests
12241224

@@ -1237,7 +1237,7 @@ jobs:
12371237
t_ubu_asan_cli:
12381238
# Runs slightly faster on medium but we only run it nightly so efficiency matters more.
12391239
<<: *base_ubuntu2204
1240-
parallelism: 7 # Should match number of tests in .circleci/cli.sh
1240+
parallelism: 8 # Should match number of tests in .circleci/parallel_cli_tests.py
12411241
environment:
12421242
<<: *base_ubuntu2204_env
12431243
ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2
@@ -1286,7 +1286,7 @@ jobs:
12861286

12871287
t_ubu_ubsan_clang_cli:
12881288
<<: *base_ubuntu2204_clang
1289-
parallelism: 7 # Should match number of tests in .circleci/cli.sh
1289+
parallelism: 8 # Should match number of tests in .circleci/parallel_cli_tests.py
12901290
steps:
12911291
- cmdline_tests
12921292

.circleci/parallel_cli_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# TODO: We should switch to time-based splitting but that requires JUnit XML report support in cmdlineTests.sh.
99
tests_to_run_in_parallel = [
1010
'~ast_import_export', # ~7 min
11+
'~evmasm_import_export', # ~5 min
1112
'~ast_export_with_stop_after_parsing', # ~4 min
1213
'~soljson_via_fuzzer', # ~3 min
1314
'~via_ir_equivalence', # ~1 min

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Language Features:
77
Compiler Features:
88
* Code Generator: Remove redundant overflow checks of certain ``for`` loops when the counter variable cannot overflow.
99
* Commandline Interface: Add ``--no-import-callback`` option that prevents the compiler from loading source files not given explicitly on the CLI or in Standard JSON input.
10+
* Commandline Interface: Add an experimental ``--import-asm-json`` option that can import EVM assembly in the format used by ``--asm-json``.
1011
* Commandline Interface: Use proper severity and coloring also for error messages produced outside of the compilation pipeline.
1112
* EVM: Deprecate support for "homestead", "tangerineWhistle", "spuriousDragon" and "byzantium" EVM versions.
1213
* Parser: Remove the experimental error recovery mode (``--error-recovery`` / ``settings.parserErrorRecovery``).

libevmasm/AbstractAssemblyStack.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
This file is part of solidity.
3+
4+
solidity is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
solidity is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with solidity. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
// SPDX-License-Identifier: GPL-3.0
18+
19+
#pragma once
20+
21+
#include <libevmasm/LinkerObject.h>
22+
23+
#include <libsolutil/Common.h>
24+
#include <libsolutil/JSON.h>
25+
26+
#include <string>
27+
#include <vector>
28+
29+
namespace solidity::evmasm
30+
{
31+
32+
class AbstractAssemblyStack
33+
{
34+
public:
35+
virtual ~AbstractAssemblyStack() {}
36+
37+
virtual LinkerObject const& object(std::string const& _contractName) const = 0;
38+
virtual LinkerObject const& runtimeObject(std::string const& _contractName) const = 0;
39+
40+
virtual std::string const* sourceMapping(std::string const& _contractName) const = 0;
41+
virtual std::string const* runtimeSourceMapping(std::string const& _contractName) const = 0;
42+
43+
virtual Json::Value assemblyJSON(std::string const& _contractName) const = 0;
44+
virtual std::string assemblyString(std::string const& _contractName, StringMap const& _sourceCodes) const = 0;
45+
46+
virtual std::string const filesystemFriendlyName(std::string const& _contractName) const = 0;
47+
48+
virtual std::vector<std::string> contractNames() const = 0;
49+
virtual std::vector<std::string> sourceNames() const = 0;
50+
51+
virtual bool compilationSuccessful() const = 0;
52+
};
53+
54+
} // namespace solidity::evmasm

0 commit comments

Comments
 (0)