Commit Graph

437 Commits

Author SHA1 Message Date
Alex Beregszaszi
517beb6fa6 Use explicit break and do not coerce 0 into bool in AssemblyItem 2018-12-19 12:35:00 +00:00
Christian Parpart
62fe57479e
make use of C++ = default constructor declarations as well as more non-static member initialization syntax. 2018-12-19 11:26:42 +01:00
chriseth
27e4e25a99 Optimize some instruction comparisons. 2018-12-18 17:25:49 +01:00
chriseth
01249984f2 Provide comparison shortcut. 2018-12-18 16:10:14 +01:00
chriseth
18efbb52c0 Use the move. 2018-12-18 16:10:14 +01:00
chriseth
68ad015714 Make swappable instructions static. 2018-12-18 12:39:24 +01:00
Daniel Kirchner
2353f73c39 Add headers to targets in CMakeLists.txt. 2018-12-17 15:01:02 +01:00
Mathias Baumann
cb935fe908 Use curly-brackets initialization 2018-12-10 19:03:47 +01:00
Mathias Baumann
2f6dc2e773 Replace push_back with emplace_back where it makes sense 2018-12-10 19:02:39 +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
chriseth
fb2e471d00 Fix nondeterminism bug related to boost version. 2018-11-27 16:00:22 +01:00
Christian Parpart
cdd8c72c9d CMake: Explicitly state which files to compile instead of relying on globbing.
Also remove header file lists, as there is no need to add them to
add_library() or add_executable(), which should lower maintenance of the cmake files.
2018-11-26 14:39:24 +01:00
chriseth
2e861bf1a0
Merge pull request #5472 from ethereum/assemblyAnnotationOutput
Jumps with annotations cannot be functional.
2018-11-23 17:02:03 +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
82055cbb61 Jumps with annotations cannot be functional. 2018-11-21 19:28:41 +01:00
mordax
ea8b7d803e Removing redundant virtual from override function declaration
Remove trailing whitespace

Remove changelog change
2018-11-21 14:37:32 +00:00
chriseth
6bbedab383
Merge pull request #5265 from ethereum/cleanupsha3
Simplify sha3.
2018-11-09 15:39:57 +01:00
Christian Parpart
ab0de38f16
Eliminate byte-typedef and use uint8_t in all their places instead.
This change is made to (easily) be forward compatible with future C++
standards, in order to allow compiling the code with newer standards at
some point in the future.

* Removed the `using byte = uint8_t;` line from Common.h
* Mechanically change all uses of `byte` to `uint8_t`.

Tested with GCC 7.3 in C++11/14/17 modes :-)
2018-11-07 12:17:57 +01:00
chriseth
e78b95d9d4 Renamed SHA3.{h,cpp} files. 2018-10-18 14:31:36 +02:00
chriseth
26c693aa92 Change library placeholder to __$<hash>$__. 2018-10-12 15:15:02 +02:00
chriseth
4d6d224cf8 Prefix "0x" to library placeholder. 2018-10-12 15:15:01 +02:00
chriseth
6daeb39ecc Use hash for library placeholders. 2018-10-12 15:15:01 +02:00
chriseth
d76bfcd935 Fix typos. 2018-10-04 13:28:16 +02:00
chriseth
7609710d4f
Merge pull request #5110 from codemascot/libevmasm/Assembly.cpp
Use 'switch' instead of 'else if'
2018-10-02 13:18:22 +02:00
Khan M Rashedun-Naby
14738d05e4 Use 'switch' instead of 'else if' 2018-09-27 17:46:53 +06:00
Alex Beregszaszi
6a1e79a8e3 Set the price of EXTCODEHASH properly 2018-09-26 16:11:02 +01:00
Jared Wasinger
c6bd2979b1 Add assembly support for EXTCODEHASH (EIP-1052) 2018-09-26 16:11:02 +01:00
Alex Beregszaszi
410d94c498
Merge pull request #5089 from ethereum/gasmeter
Small pathgasmeter cleanups
2018-09-26 15:16:38 +01:00
chriseth
2c860b7d74
Merge pull request #5094 from ethereum/evmasm-grouping
Group LLL only assembly features in libevmasm
2018-09-26 15:51:20 +02:00
Alex Beregszaszi
d7c3f197c4 Some cleanups in GasMeter 2018-09-26 14:25:40 +01:00
Alex Beregszaszi
d64be90497 Add PathGasMeter.estimateMax helper 2018-09-26 14:25:40 +01:00
Alex Beregszaszi
9be058eb70 Add explanation to GasMeter::dataGas 2018-09-26 14:25:40 +01:00
Alex Beregszaszi
913ddf158f Group LLL only assembly features in libevmasm 2018-09-26 12:46:03 +01:00
Alex Beregszaszi
535026b492 Group append() functions in libevmasm 2018-09-26 11:14:40 +01:00
Alex Beregszaszi
21beba76e2 Add helpers for the LOG instruction 2018-09-25 20:39:35 +01:00
Alex Beregszaszi
0db76a01da CREATE2 opcode has been moved from 0xfb to 0xf5 2018-09-18 23:04:57 +01:00
Alex Beregszaszi
c42dfc5b10
Merge pull request #4967 from ethereum/const-opt-cost
Move dataGas calculation helper to GasMeter
2018-09-18 15:46:15 +01:00
Alex Beregszaszi
0b68d093b4 Move dataGas calculation helper to GasMeter 2018-09-18 14:47:53 +01:00
Daniel Kirchner
a1d73a7bef Split simplification rules into two functions. 2018-09-18 14:28:21 +02:00
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
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
chriseth
da5e171f3b Optimize constant optimization. 2017-01-12 17:52:27 +01:00
chriseth
f1a4976ce6 Optimise simplification rules (sort into bins). 2017-01-12 17:52:26 +01:00
chriseth
652d8dab19 Optimize pattern matcher. 2017-01-12 17:52:26 +01:00
chriseth
afad40ac5a Optimise AssemblyItem::m_data. 2017-01-12 17:52:26 +01:00
chriseth
49ac2a1ee5 Rename programSize to bytecodeSize. 2017-01-03 14:13:49 +01:00
chriseth
a285ca44f2 Assembly output for Assembly object. 2017-01-03 14:13:49 +01:00
Yoichi Hirai
2d60990238
libevmasm: OpPop() optimization keeps the source location
fixes #1521
2016-12-30 13:52:38 +01:00
chriseth
1e35526eb6 Fix tests. 2016-12-01 16:03:59 +01:00
chriseth
91ecc4533d Add swarm hash to the end of the bytecode. 2016-12-01 16:03:59 +01:00
Yoichi Hirai
77bad18648
libevmasm: remove an unused variable total 2016-12-01 11:31:58 +01:00
Yoichi Hirai
df4b405f9c Add more optimization rules 2016-11-30 11:16:43 +00:00
Alex Beregszaszi
3fdef92911 Replace XOR with self with 0 2016-11-30 11:16:43 +00:00
Alex Beregszaszi
b8bba66220 Replace XOR/ISZERO with EQ 2016-11-30 11:16:43 +00:00
Alex Beregszaszi
25160bfc26 Add optimiser rule for SUB with 0 2016-11-30 11:16:43 +00:00
chriseth
f521624952 Integrate AddPop. 2016-11-25 16:10:57 +01:00
chriseth
612c1726d9 Templatize. 2016-11-25 16:10:02 +01:00
chriseth
f2872bfa99 Peephole optimizer for unreacheable code. 2016-11-25 16:10:02 +01:00
Yoichi Hirai
b6ffb6c8b7
libevmasm: generalize ADDPOP optimization into ADDMODPOP etc 2016-11-24 18:22:22 +01:00
Yoichi Hirai
c0fe5fbe9b
libevmasm: Add another peephole optimization 2016-11-24 18:22:22 +01:00
VoR0220
3f9f725737 Fix licensing headers
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +01:00
chriseth
7fb7d5ae39 Optimizer: Clear state for JUMPDESTs. 2016-11-22 14:58:24 +01:00
chriseth
2c14a96820 Some more assertions and style changes. 2016-11-16 15:09:01 +01:00
chriseth
ec31d08775 Change encoding to address-funid and add "function" as ABI type. 2016-11-16 14:37:19 +01:00
chriseth
cb000a5532 Fix setting the tag. 2016-11-16 14:37:19 +01:00
chriseth
390ba085b6 fixup! Simple peephole optimizer that is activated even if not requested. 2016-11-16 14:37:19 +01:00
chriseth
0335ed4cb4 Simple peephole optimizer that is activated even if not requested. 2016-11-16 14:37:19 +01:00
chriseth
e51f852504 Converted sub assembly to smart pointer. 2016-11-16 14:37:18 +01:00
chriseth
e543bd34c0 Stored combined creation and runtime tags.
Includes a change to Assembly to allow tags from sub-assemblies to be
used.

Sorry, this get a bit bigger than I thought.
2016-11-16 14:37:18 +01:00
chriseth
47794c1da4 Implement uninitialized storage functions. 2016-11-16 14:37:18 +01:00
chriseth
bf5b0dc2d2 Keep old code. 2016-11-14 23:28:26 +01:00
chriseth
c2c39239d6 Report infinite gas for calls. 2016-11-14 16:02:57 +01:00
chriseth
c82acfd3eb Merge pull request #1333 from ethereum/compare_location_files
Compare source files in source locations
2016-11-09 10:49:30 +01:00
chriseth
7a30e8cf6e Merge pull request #1252 from ethereum/jsoncpp-from-source
Build jsoncpp from source using jsoncpp.cmake script
2016-11-08 13:47:52 +01:00
Yoichi Hirai
2e92966684
libevmasm: fix comparison of SourceLocations 2016-11-08 11:11:08 +01:00
chriseth
9e0594f4c1 Merge pull request #1270 from ethereum/optimise-eq0
Optimise the PUSH 0, EQ case as ISZERO
2016-10-24 15:50:31 +02:00
Alex Beregszaszi
6686ea6c03 Optimiser the PUSH 0, EQ case as ISZERO 2016-10-23 00:23:08 +01:00
chriseth
ba42c6e447 Optimizer: generate code starting with empty state 2016-10-21 18:03:57 +02:00
Paweł Bylica
4bde0a2d36 Build jsoncpp from source using jsoncpp.cmake script 2016-10-20 22:18:13 +01:00
Alex Beregszaszi
aefb6e5fcf Rename dev::sha3 to dev::keccak256 2016-10-06 14:53:40 +01:00
chriseth
cc0bc9b908 Explicitly specify length of push data for assembly output. 2016-08-18 16:37:42 +02:00
chriseth
4c54834908 Rename libevmasm. 2016-08-10 13:52:24 +02:00
chriseth
c3ed550eb6 Merge pull request #834 from chriseth/devcorecleanup
Some cleanup regarding libdevcore. Also rename to avoid conflicts.
2016-08-08 15:11:36 +02:00
chriseth
ccd78d05d6 Correct library usage. 2016-08-08 12:26:07 +02:00
chriseth
226ed7b9dc Some cleanup regarding libdevcore. Also rename to avoid conflicts. 2016-08-06 11:14:28 +02:00
chriseth
7ea5770598 Do not install headers. 2016-08-05 16:35:24 +02:00
chriseth
c0afb4549e Further fixes to the optimizer. 2016-08-01 23:41:11 +02:00
chriseth
93ebaa4822 Reset knowledge in optimizer for path joins. 2016-08-01 15:30:21 +02:00
Bob Summerwill
4ee2114127 Make the Solidity repository standalone.
This commit is the culmination of several months of work to decouple Solidity from the webthree-umbrella so that it can be developed in parallel with cpp-ethereum (the Ethereum C++ runtime) and so that even for the Solidity unit-tests there is no hard-dependency onto the C++ runtime.

The Tests-over-IPC refactoring was a major step in the same process which was already committed.

This commit contains the following changes:

- A subset of the CMake functionality in webthree-helpers was extracted and tailored for Solidity into ./cmake.   Further cleanup is certainly possible.
- A subset of the libdevcore functionality in libweb3core was extracted and tailored for Solidity into ./libdevcore.   Further cleanup is certainly possible
- The gas price constants in EVMSchedule were orphaned into libevmasm.
- Some other refactorings and cleanups were made to sever unnecessary EVM dependencies in the Solidity unit-tests.
- TravisCI and Appveyor support was added, covering builds and running of the unit-tests (Linux and macOS only for now)
- A bug-fix was made to get the Tests-over-IPC running on macOS.
- There are still reliability issues in the unit-tests, which need immediate attention.    The Travis build has been flipped to run the unit-tests 5 times, to try to flush these out.
- The Emscripten automation which was previously in webthree-umbrella was merged into the TravisCI automation here.
- The development ZIP deployment step has been commented out, but we will want to read that ONLY for release branch.

Further iteration on these changes will definitely be needed, but I feel these have got to sufficient maturity than holding them back further isn't winning us anything.    It is go time :-)
2016-08-01 01:45:11 -07:00
Bob Summerwill
5707f66c99 Fix warning showing up in openSUSE build. 2016-06-07 12:28:21 -07:00
chriseth
a927efb151 Correctly use not/bnot/iszero.
A long time ago, some opcodes were renamed. Now we should only have
not (bitwise negation) and iszero (logical negation).
2016-05-09 10:52:23 +02:00
chriseth
8704dd0f7f Windows fix. 2016-04-21 16:13:39 +02:00
chriseth
ed9da5171b Source location for inline assembly. 2016-04-19 18:35:21 +02:00
Bob Summerwill
539b392a6d Merge pull request #496 from chriseth/removelog
Remove log.h from solidity.
2016-04-11 21:50:05 -07:00
chriseth
6f54b13d7a Remove log.h from solidity. 2016-04-12 01:03:46 +02:00
chriseth
f227050c20 Make solidity independent from ethcore. 2016-04-06 20:56:00 +02:00
Dimitry
d2cee6f9c6 reduce unnecessary solidity:: namespace 2016-04-04 15:41:35 +04:00
Dimitry
d43d4347bf return instructionInfo style 2016-04-04 15:27:09 +04:00
Dimitry
9816510065 enable solidity test 2016-04-04 15:18:24 +04:00
Dimitry
858c41260d rename namespace for instruction.h/cpp in libevmasm 2016-04-02 15:56:43 +03:00
Dimitry
ccbd3ff63f move libevmcore to solidity 2016-04-01 23:11:01 +03:00
Dimitry
2851967dac includes 2016-03-22 16:05:27 +04:00
Dimitry
332d58d9b9 add liblll lllc libevmasm 2016-03-21 22:15:14 +03:00
Dimitry
b50e65437e move libevmasm 2016-03-21 11:55:45 +03:00