Commit Graph

213 Commits

Author SHA1 Message Date
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
chriseth
3f3bcc4f8a Merge pull request #2848 from ethereum/checkViewPure
Enforce view and pure.
2017-09-13 18:29:13 +02:00
chriseth
66c01301fe Rename to invalidInPureFunctions 2017-09-13 17:18:22 +02:00
Alex Beregszaszi
bbfb16cf5c Introduce assemblyString 2017-09-11 15:53:20 +01:00
Alex Beregszaszi
50570c6c79 Do not return the stream in asssemblyStream 2017-09-11 15:48:58 +01:00
Alex Beregszaszi
a535a8b06e Split out the JSON functionality from assembly.stream() 2017-09-11 15:48:52 +01:00
Alex Beregszaszi
55d2a459a9 Mark functions static in libevmasm 2017-09-11 15:15:02 +01:00
chriseth
15bdc48a73 Rename and add anonymous namespace. 2017-09-06 13:52:29 +02:00
chriseth
d6861d909c Analyze assembly. 2017-09-06 13:52:29 +02:00
chriseth
7c61a6daf2 Add view/pure information about instructions. 2017-09-06 13:52:29 +02:00
chriseth
2d39a42d37 Merge pull request #2843 from ethereum/anonymous-cleanup
Move all file specific globals to anonymous namespace
2017-08-29 14:07:24 +02:00
Alex Beregszaszi
7fb4a64136 Move all file specific globals to anonymous namespace 2017-08-29 11:09:18 +01:00
gcolvin
7da86daa17 Reconcile EVM 1.5 instruction numbers with working draft EIP615 2017-08-28 23:27:13 +01:00
chriseth
6951a371ec Cleanup of vector_ref.h 2017-08-25 19:36:48 +02:00
chriseth
82e4f6f604 Cleanup of FixedHash.h 2017-08-25 16:05:28 +02:00
chriseth
4b0e30d259 Cleanup of Common.h 2017-08-25 14:54:23 +02:00
Alex Beregszaszi
70e89a5dac Introduce JumpdestRemover optimisation step 2017-08-25 10:42:36 +01:00
Alex Beregszaszi
3b07c4d38e Merge pull request #2757 from ethereum/cmake
Static linking
2017-08-23 12:36:24 +01:00
chriseth
c5f11d938f Merge pull request #2656 from ethereum/performance1
Avoid some Json copy operations.
2017-08-23 13:26:43 +02:00
Paweł Bylica
388fc983fa
CMake: Cleanup "local" include path 2017-08-22 22:50:25 +02:00
Alex Beregszaszi
f2d6226718 Some smaller issues found by Covertiy Scan 2017-08-22 13:55:28 +01:00
Alex Beregszaszi
f38429fef8 Switch stream properties back after temporary modification 2017-08-22 13:55:01 +01:00
Alex Beregszaszi
9897c56b2c Mark a lot of functions static (where possible) 2017-08-22 10:51:46 +01:00
Alex Beregszaszi
2a5772cff7 Mark appropriate constructors explicit 2017-08-22 10:51:46 +01:00
Alex Beregszaszi
e2cfc9ee92 Mark a lot of functions const (where possible) 2017-08-22 10:51:46 +01:00
chriseth
e3f90565d8 Avoid some Json copy operations. 2017-08-21 16:28:30 +01:00
Paweł Bylica
63372e4a85
CMake: Simplify libevmasm config 2017-08-18 13:32:35 +02:00
Paweł Bylica
d1f4d110fb
CMake: Build static libs by default 2017-08-18 13:32:35 +02:00
Alex Beregszaszi
f9d5f7e497 Introduce fine-grained optimiser settings in libevmasm 2017-07-27 12:40:28 +01:00
chriseth
09e821619e Refactor exceptions and provide comment function. 2017-07-13 11:34:03 +02:00
Alex Beregszaszi
32d6c1c316 MLOAD has side-effects, treat it like that in the optimiser 2017-06-30 21:27:39 +01:00
chriseth
168f64f4cb Fix negative stack size checks. 2017-06-28 16:55:49 +01:00
Alex Beregszaszi
becea47ac3 Use assertThrow where possible 2017-06-22 11:25:06 +01:00
Alex Beregszaszi
bc95da354d Replace obsolete assembly code in LLL 2017-06-21 21:23:39 +01:00
chriseth
57f79ebfa6 Remove debugbreak. 2017-06-20 19:21:29 +02:00
chriseth
fb5db94879 Merge pull request #2397 from ethereum/doublepush
Peephole optimizer for double push.
2017-06-15 10:50:07 +02:00
chriseth
3cb71ac516 Merge pull request #2398 from ethereum/assembly-cleanup
Remove obsolete features from libevmasm
2017-06-15 08:41:14 +02:00
chriseth
66881bd675 Merge branch 'develop' into asm-aux 2017-06-15 08:39:02 +02:00
Alex Beregszaszi
c08c4b8b6f Move subroutine helpers from CompilerContext to Assembly 2017-06-14 21:21:26 +01:00
Alex Beregszaszi
6a260a9ff1 Remove single use Assembly::popTo 2017-06-14 21:21:26 +01:00
Alex Beregszaszi
18fc667658 Remove obsolete Assembly::out 2017-06-14 21:21:26 +01:00
Alex Beregszaszi
398099f50e Remove obsolete errorTag() 2017-06-14 21:21:26 +01:00
Alex Beregszaszi
585b3ea3e3 Print auxiliary data in the assembly 2017-06-14 20:14:15 +01:00
Alex Beregszaszi
3273e865ec Print assembly even if there's no data section 2017-06-14 19:51:02 +01:00
chriseth
e5b0ad562e Peephole optimizer for double push. 2017-06-14 20:02:45 +02:00
Dimitry
c20cdd0a05 add new opcode instructions to the parser
STATICCALL        0xfa  6 inputs  (gas address mem1 mem2 mem3 mem4)
2017-06-14 18:18:12 +02:00
Alex Beregszaszi
bec30051c5 Introduce CREATE2 in the assembler 2017-06-14 16:00:39 +02:00
Yoichi Hirai
9ff3064d03
Mention RETURNDATACOPY in GasMeter and SemanticInformation 2017-06-13 16:57:07 +02:00
Yoichi Hirai
0b22154a75
libevmasm: add RETURNDATACOPY and RETURNDATASIZE 2017-06-13 16:57:02 +02:00
chriseth
97cc968a13 Initial EVM1.5 assembly implementation. 2017-06-08 15:52:44 +02:00
Alex Beregszaszi
0c8beac357 Rename the SHA3 assembly instruction to KECCAK256 2017-05-30 10:54:29 +01:00
Alex Beregszaszi
af3a4b0642 Add simplification rule for SDIV(0,X) and SDIV(X,0) 2017-05-19 17:49:20 +01:00
Alex Beregszaszi
dc8eb3d846 Cleanup simplification rules 2017-05-19 17:49:20 +01:00
chriseth
b976d53e87 Add parentheses for readability. 2017-05-02 16:56:12 +02:00
chriseth
5c4f3f6d0b Fix number representation bug. 2017-05-02 12:22:11 +02:00
Alex Beregszaszi
0e91b8fb98 Do not use the member in checkRepresentation 2017-04-27 14:06:58 +01:00
chriseth
c1e14d0119 Use OptimizerException to report error 2017-04-27 14:06:29 +01:00
chriseth
54210ea89f Add recomputation check for number representation. 2017-04-27 14:06:28 +01:00
Yoichi Hirai
5176784b18 libevmasm: fix sloadGas in another file 2017-04-25 16:47:43 +02:00
Yoichi Hirai
362813f0d6 libevmasm: add a break 2017-04-25 16:47:43 +02:00
Yoichi Hirai
56e4b82696 libevmasm: reflect EIP 160 gas schedule change 2017-04-25 16:14:58 +02:00
Yoichi Hirai
4e24639e39 libevmasm: EIP150.c gas change 2017-04-25 16:14:58 +02:00
Yoichi Hirai
e54a3ead16 libevmasm: EIP150.a changes on SLOAD, CALL, CALLCODE, DELEGATECALL and SUICIDE 2017-04-25 16:14:58 +02:00
Yoichi Hirai
f2775f82d0 libevmadm: EIP150.a changes on EXTCODE, EXTCODESIZE and BALANCE 2017-04-25 16:14:58 +02:00
chriseth
8ebea783f4 Initialize local variables. 2017-04-12 16:30:27 +02:00
chriseth
4d715e9055 Implement missing assembly output functions and do not use PushString for assembly. 2017-04-11 19:54:44 +02:00
chriseth
ddc4918f36 Add upper bound for computing constants. 2017-03-03 16:51:37 +01:00
chriseth
46d3c2dd3d Print source location before items. 2017-02-24 08:24:34 +01:00
Alex Beregszaszi
148f923351 Add REVERT to libevmasm 2017-02-10 22:40:12 +00:00
Alex Beregszaszi
693226b1ab Rename SUICIDE opcode to SELFDESTRUCT in libevmasm 2017-02-06 20:17:52 +00:00
Alex Beregszaszi
7ec3dd9bbc More verbose log of when using invalid instructions 2017-02-02 11:39:29 +00:00
chriseth
ae2b59d18a Fix optimizer with regards to INVALID instruction. 2017-01-26 16:39:07 +01:00
chriseth
c2b3d8bcd2 Change code for INVALID opcode to 0xfe. 2017-01-26 16:39:07 +01:00
Valentin Wüstholz
9bcbd93ac5 Change translation of implicit throws (issue #1589).
This adds a new invalid instruction that is used for encoding
implicit throws that are emitted by the compiler. This makes it
possible to distinguish such runtime errors from user-provided,
explicit throws.
2017-01-26 16:39:07 +01:00
chriseth
997f5d751a Create functional assembly output, if possible. 2017-01-24 01:09:55 +01:00
chriseth
4713dd625d Fix error tag usage in lll. 2017-01-23 15:46:03 +01:00
chriseth
7c18b785e3 Merge pull request #1584 from ethereum/tier
libevmasm: remove duplicate `Tier` from `Tier::xTier`s
2017-01-18 19:28:37 +01:00
chriseth
d3a391c136 Provide fallback for linking. 2017-01-18 17:41:36 +01:00
Yoichi Hirai
821997a1d3
libevmasm: remove duplicate Tier from Tier::xTiers
Synchronize with cpp-ethereum
2017-01-18 17:24:39 +01:00
Yoichi Hirai
20c62a132d
Make enum Tier into an enum class 2017-01-13 13:19:14 +01:00
chriseth
3cfa851f6f Minor changes from review. 2017-01-12 17:53:06 +01:00
chriseth
d34b561f68 Windows build fix. 2017-01-12 17:52:27 +01:00
chriseth
58509ca3aa Fix match groups. 2017-01-12 17:52:27 +01:00
chriseth
7127f2fdfd Fix debug output. 2017-01-12 17:52:27 +01:00