Commit Graph

196 Commits

Author SHA1 Message Date
Alex Beregszaszi
0b6a26f854 Calculate the dataGas correctly in the constant optimiser
This may cause a wrong decision about cost (and as a result choosing the least efficient code),
but will not cause any miscompilation or invalid output.
2018-08-14 17:45:43 +02:00
Leonardo Alt
17cac588d0 Replace safety stop by invalid 2018-08-14 12:32:47 +02:00
chriseth
7d9692c31d Explicitly use std::next to avoid boost version. 2018-08-09 01:12:55 +02:00
Alex Beregszaszi
d3c3fd2079 Use dev::toString() in Assembly instead of misusing string{} for u256 2018-08-08 20:52:19 +01:00
Leo Arias
c4a3c48aea
Fix typo 2018-08-07 13:35:15 -06:00
Augusto F. Hack
6c3b48ddfc Added guards for unknown pragmas
Removed push/pop if there was no change to the warnings *in the same
file* for a given compiler. This assumes the imported boost headers use
a warning stack themselves.

The pragmas don't seem to be required anymore, but were not removed to
mantain compatibility with older versions of the boost library.

Compiled with
- clang version 6.0.1 (tags/RELEASE_601/final)
- gcc (GCC) 8.1.1 20180531
 against:
- libboost 1.67.0-5
2018-08-05 19:21:33 -03:00
Christian Parpart
fb4857abed evmasm/Instruction: fixes undefined behavior of advancing iterator beyond the end of a container.
Usually the STL doesn't check whether or not the developer advances beyond its container's end, but MSVC does (found out by running soltest in debug mode on Win32 / VS2017).
2018-08-02 19:53:46 +02:00
chriseth
28ac3f0a6c
Merge pull request #4473 from ethereum/fixGasTuple
Fix comparison operator for GasConsumption.
2018-07-11 11:55:19 +02:00
Cryptomental
140dbfdbd8 Code, Changelog, ReleaseChecklist: Fix typos.
Refs: #4442
2018-07-11 00:26:23 +02:00
chriseth
1fed3519e1 Fix comparison operator for GasConsumption. 2018-07-10 21:36:47 +02:00
Khan M Rashedun-Naby
0e5b97446a As SWITCH..CASE is better than ELSE..IF 2018-07-02 15:42:30 +06:00
Nicolás Venturo
172e208c6a Add TruthyAnd Peephole optimization 2018-06-15 11:27:39 -03:00
chriseth
fba7e055d9 Follow highest gas usage only for gas estimation. 2018-05-09 10:53:30 +02:00
chriseth
e681f4ee79
Merge pull request #4028 from ethereum/asm-tags-32bit
Restrict assembly tags to 32-bit
2018-05-02 17:34:13 +02:00
Alexander Arlt
f94b793472 Add virtual destructors on base classes. 2018-05-02 13:29:16 +02:00
Alex Beregszaszi
d569ad91e4 Restrict assembly tags to 32-bit 2018-04-30 18:47:57 +01:00
Alex Beregszaszi
3ac3018e1d Ensure that subId and tag handling is correct on all compilers in AssemblyItem 2018-04-30 15:57:17 +01:00
Omar Boukli-Hacene
090f9995f2 Fix comment typos 2018-04-27 19:31:30 +04:00
Alexander Arlt
70fcf1a8e0 CMake: remove direct jsoncpp dependency in libevmasm 2018-04-20 20:37:26 +01:00
Alex Beregszaszi
38460d8b47 Remove unnecessary masking of the result of known short instructions 2018-04-19 23:59:06 +01:00
Alex Beregszaszi
cb352edd26 Add constant optimiser for SHR/SHL instructions 2018-04-09 20:07:44 +01:00
Alex Beregszaszi
02ea0e547f Replace comparison operators with opposites if preceded by SWAP1 2018-04-04 17:47:58 +02:00
Alex Beregszaszi
17bcabb6cf Remove useless SWAP1 in front of commutative operations 2018-04-03 18:57:07 +02:00
chriseth
6777f7a57f Optimize across MLOAD if MSIZE is not used. 2018-04-03 14:34:32 +02:00
chriseth
6ec4517929 Use EVM version in gas meter and optimizer. 2018-03-05 11:36:33 +01:00
Alex Beregszaszi
afa4a48e37 Remove ROL/ROR as they are not part of EIP145 anymore 2018-02-27 13:42:41 +01:00
Alex Beregszaszi
59e6ea601b Add bitwise shift operators to libevmasm (EIP145) 2018-02-27 12:03:18 +01:00
Alex Beregszaszi
037b97ef4a Replace MOD with AND if constant is power of 2 2018-02-12 22:47:04 +00:00
chriseth
c961a3079d Turn simplification rule tuple into struct. 2018-02-06 22:51:30 +01:00
chriseth
65c31ecaeb Remove recursive call to simplify with reversed arguments.
(We now have explicit rules for that).
2018-02-06 22:51:30 +01:00
chriseth
295f8c07ad Explicitly add reversed operands for commutative operations. 2018-02-06 22:51:30 +01:00
chriseth
9eea3f29ba Expression simplifier. 2018-02-06 22:51:30 +01:00
chriseth
b8074cdf78 Add flag to indicate whether it can be applied to expressions with side-effects. 2018-02-06 22:51:30 +01:00
chriseth
491d6d3e0c Move out the rule list. 2018-02-06 22:51:30 +01:00
chriseth
6807010dc7 Prevent libraries from being called. 2018-01-19 16:27:44 +01:00
chriseth
95cf9266ab Movability. 2018-01-12 17:48:51 +01:00
Isaac van Bakel
83f326525e Replaced solAssert in Jumpdest optimization
This is the only use of solAssert in libevmasm, and the only dependency
on libsolidity.
There is no justification for why the illegal state is checked here.
2017-11-25 21:51:27 +00:00
chriseth
7989fc4c35 Merge pull request #3077 from ethereum/optimze_pops
Assume peephole optimizer was successful if number of pops increased.
2017-10-16 22:11:45 +02:00
chriseth
f5e91e4a94 Throw on too many peephole optimizer iterations. 2017-10-16 18:45:21 +02:00
chriseth
082e7b6a9e Allow `gas` in view functions. 2017-10-16 13:28:44 +02:00
chriseth
7c94e5462a Assume peephole optimizer was successful if number of pops increased. 2017-10-13 19:00:56 +02:00
Alex Beregszaszi
4d1c48eeee Remove duplicate EVMSchedule 2017-10-03 11:59:53 +01:00
Alex Beregszaszi
43719839bf Use isDup/SwapInstruction helper 2017-10-03 11:45:44 +01:00
Alex Beregszaszi
8a32d7c3d7 Add helpers for isPush/isDup/isSwap 2017-10-02 10:34:54 +01:00
Paweł Bylica
ffd440ccff
CMake: Cleanup include paths 2017-09-26 22:44:57 +02:00
Alex Beregszaszi
aad829948a Ensure parameter names match between headers and implementation 2017-09-20 01:23:21 +01:00
chriseth
068a593d9c Merge pull request #2922 from ethereum/asm-bytes-required
Properly calculate bytesRequired for subs
2017-09-18 16:38:02 +02:00
Alex Beregszaszi
20ffa1db43 Properly calculate bytesRequired for subs 2017-09-18 11:39:49 +01:00
Alex Beregszaszi
f4b87548c8 Add useful messages to exceptions in the assembler 2017-09-18 11:32:56 +01:00
chriseth
73771f5bb2 Named assembly labels. 2017-09-15 20:44:49 +01:00