Commit Graph

69 Commits

Author SHA1 Message Date
hrkrshnn
41ce3feb0a test: some tests for push0
1. `push0_disallowed.yul`: checks if `push0()` is a valid builtin in strict Yul
2. `push0_disallowed.sol`: checks if `push0()` is a valid builtin in inline assembly
3. `push0.sol`: simple semantic test that returns 0
4. `evmone_support.sol`: tests if push0 works properly in evmone
5. Updated some bytecode too large tests to use `shanghai` as version
6. Updated various tests where `push1 0` was hardcoded in different forms / expectations on bytecode
size (`Assembler.cpp`, `GasCosts.cpp`, `SolidityCompiler.cpp`, `SolidityExpressionCompiler.cpp`)
2023-04-12 00:10:24 +02:00
Rodrigo Q. Saramago
ef6ff2f055
Adds support for the EVM version "Paris".
Deprecates `block.difficulty` and disallow `difficulty()` in inline assembly for EVM versions >= paris.
The change is due to the renaming introduced by EIP-4399 (see: https://eips.ethereum.org/EIPS/eip-4399).
Introduces `block.prevrandao` in Solidity and `prevrandao()` in inline assembly for EVM versions >= paris.

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Daniel <daniel@ekpyron.org>
Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com>
Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
2023-01-23 18:50:36 +00:00
Marenz
f7cc29bec1 Add std:: qualifier to move() calls 2022-08-30 11:12:15 +02:00
Marenz
1b5332c2b9 Fix spelling mistakes and CI spellcheck job 2022-08-18 14:38:19 +02:00
Derek Gottfrid
3f62ab069c fix test w/ signed issues 2022-07-03 16:33:22 -04:00
Alexander Arlt
1a0988e503 libevmasm: refactor asm-json export & add support for source list. 2022-03-23 15:58:07 -05:00
Daniel Kirchner
e0c837b33b Remove isCreation flag from OptimiserSettings. 2022-03-09 17:53:28 +01:00
Daniel Kirchner
ce0a3e93f2 Store whether an evmasm Assembly is creation code. 2022-03-09 17:42:29 +01:00
chriseth
b0dcd7b915 Split out disassemble to remove numeric from instruction includes. 2022-03-02 15:30:41 +01:00
Christian Parpart
b1dd0d0d02 Properly compute source mappings for immutables. 2021-10-12 17:56:17 +02:00
chriseth
f75b55071e Remove CharStream from SourceLocation. 2021-07-14 15:12:07 +02:00
Kamil Śliwak
6ad6fa2382 Do not hard-code the default 'runs' value as 200 in code that fills out optimizer settings 2021-06-28 14:12:28 +02:00
chriseth
0df8a38e55 Support metadata via IR. 2021-06-21 18:20:31 +02:00
hrkrshnn
8b4eaeabbf Added a few optimizer tests for Verbatim 2021-04-28 09:56:45 +02:00
chriseth
e2d8005737 Add verbatim builtin. 2021-04-26 19:56:44 +02:00
hrkrshnn
4fbf5a3f12 Added few more tests for low level inliner. 2021-03-24 13:50:24 +01:00
Daniel Kirchner
8b3095920a Inline ordinary jumps to small blocks and jumps to terminating control flow. 2021-03-24 13:50:24 +01:00
Daniel Kirchner
cb74a45fd6 Add inlining for old optimizer. 2021-02-09 19:08:58 +01:00
chriseth
806453aca9 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-08 21:00:09 +01:00
Alex Beregszaszi
7e88ba8da0 Enable the -Wconversion warning 2020-12-08 16:45:24 +00:00
Daniel Kirchner
68667f0e84 Remove POPs from ASSIGNIMMUTABLE generated bytecode, if possible. 2020-10-15 18:14:41 +02:00
Daniel Kirchner
0dca223b45 Add another argument to setimmutable and the AssignImmutable opcode, allowing to modify code at any memory offset. 2020-10-15 18:14:41 +02:00
Djordje Mijovic
6f97e6153c [yul] Adding support for accessing subobjects via .
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2020-07-21 17:56:11 +02:00
Sachin Grover
b7adb2aa42 Add SPDX license identifier if not present already in source file
Fixes: #9220
2020-07-17 20:24:12 +05:30
Djordje Mijovic
e4e3f49844 Fixing signedness conversion warnings in libevmasm
Co-authored-by: Harikrishnan Mulackal <webmail.hari@gmail.com>
2020-06-03 13:25:43 +02:00
a3d4
a499ef16fa Fix spelling errors 2020-05-25 02:54:37 +02:00
Daniel Kirchner
e255c15227 Tests. 2020-03-24 16:45:31 +01:00
Daniel Kirchner
04d8ad2ae1 Legacy codegeneration for immutable state variables. 2020-03-24 16:45:25 +01:00
Djordje Mijovic
18dea6b69c Assembly: Added missing source field to legacy assembly json output to complete the source reference 2020-02-18 10:22:34 +01:00
alex
3416c029cf Relaxed assert in AsmJsonImporter::createAsmNode. 2020-02-04 20:37:51 +01:00
alex
211227f50b Modified SourceLocation::hasText() to allow empty source. 2020-02-04 04:19:28 +01:00
alex
e4b18e85e6 Replaced SourceLocation::isEmpty() with isValid() and hasText().
The function SourceLocation::isEmpty() had somewhat dual role.
Sometimes it indicates that the SourceLocation is invalid.
Sometimes it means that there is no corresponding source text.

Hence the proposal is to replace it with two functions, isValid() and hasText().

I also removed Scanner::sourceAt(). (Do we have a rule of thumb to remove unused code?)

Since hasText() checks that start and end are valid indices for source, I adjusted a couple of tests to avoid empty source strings.
2020-02-03 08:04:21 +01:00
Mathias Baumann
00e4d13975 TestFramework: Merge Options.h into Common.h 2020-01-29 12:27:05 +01:00
Alex Beregszaszi
9c19b93c37 Remove LLL specific features from libevmasm 2020-01-15 13:27:51 +00:00
Christian Parpart
345f9928ab Library libdevcore renamed to libsolutil. 2020-01-07 15:51:50 +01:00
Christian Parpart
ed45b000d1 Adapt tests directory to C++ namespace changes. 2020-01-07 15:51:50 +01:00
Christian Parpart
6b23412fae C++ namespace cleanup (except tests). 2020-01-07 15:51:50 +01:00
Mathias Baumann
5c66ccc179 Optimize obsolete ANDs in combination with certain SHIFTs 2019-03-29 10:08:05 +01:00
Alex Beregszaszi
84fbf605aa Replace shifts by larger than 255 with 0 2019-03-29 10:07:54 +01:00
Bhargava Shastry
f7b5a27581 Fixes bug in byte optimization rule and adds tests. 2019-03-21 14:29:06 +01:00
Bhargava Shastry
515fa872c8 Fixes u256 overflow in logical shift optimization rule and adds tests. 2019-03-13 11:19:20 +01:00
chriseth
e0d1b2f5b3 Peephole optimizer for "iszero iszero <tag> jumpi". 2019-03-07 15:52:02 +01:00
chriseth
851dd635eb Remove defaults in constructor arguments. 2019-03-04 11:41:52 +01:00
Christian Parpart
d10bae245e
liblangutil: SourceLocation to default initialize data members (w/o the use of ctor)
See: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c45-dont-define-a-default-constructor-that-only-initializes-data-members-use-in-class-member-initializers-instead
2018-12-19 11:21:45 +01:00
chriseth
bc6ddbdd09 Remove w parameter for toHex. 2018-12-05 22:51:49 +01:00
Christian Parpart
c48a5264be
liblangutil: SourceLocation: adds (shared) pointer to underlying CharStream source, eliminating sourceName
Also, adapted affecting code to those changes.
2018-11-30 17:07:12 +01:00
Christian Parpart
d67322a186 Introduce namespace langutil in liblangutil directory.
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
2018-11-21 19:13:44 +00:00
Christian Parpart
87821c53c3 Isolating files shared between Yul- and Solidity language frontend. 2018-11-21 18:58:12 +00:00
chriseth
26c693aa92 Change library placeholder to __$<hash>$__. 2018-10-12 15:15:02 +02:00
chriseth
6daeb39ecc Use hash for library placeholders. 2018-10-12 15:15:01 +02:00