Commit Graph

144 Commits

Author SHA1 Message Date
Christian Parpart
df729b3084 Make use of C++17 std::optional<> instead of boost::optional<>. 2019-10-28 11:39:30 +01:00
Christian Parpart
3c1d12b16c Assembly: Remove errorTypeForLoose property from AsmAnalyzer. 2019-10-25 15:01:26 +02:00
chriseth
869d69d293 Supply full object to stack compressor and Optimizer Suite. 2019-07-10 18:49:42 +02:00
chriseth
cc5045a56e [Yul] Run optimizer on all dialects. 2019-06-19 10:01:16 +02:00
chriseth
6cb6fe35ef Make Yul optimizer not fail for wasm. 2019-06-17 18:42:47 +02:00
chriseth
1c16124a09 Constant optimiser for Yul. 2019-05-28 11:35:07 +02:00
mingchuan
f1374066af
Add shortcuts for formatting error information 2019-04-10 18:44:45 +08:00
chriseth
2308904f68 Remove "using namespace" from header and move Instruction to dev::eth. 2019-03-28 13:48:11 +01:00
chriseth
38cbf8d230 Pass "optimize stack allocation" flag down to the stack compressor. 2019-03-20 15:03:27 +01:00
chriseth
7c524f794f Also output optimized yul code if requested. 2019-03-19 17:24:36 +01:00
chriseth
6d1ed93247 Use stack optimizations. 2019-03-14 15:34:23 +01:00
chriseth
83d1382e78 Take yul optimizer setting into account. 2019-03-04 11:40:28 +01:00
Alex Beregszaszi
cf5c13f9c7 Introduce global optimiser settings. 2019-03-04 11:40:28 +01:00
chriseth
7f5b335b47 Make EVM version part of EVM dialect. 2019-02-21 21:59:46 +01:00
chriseth
1a823f0bf8 Fix tabs/spaces. 2019-02-13 17:05:48 +01:00
chriseth
17ea467e5b Fix style of "const". 2019-02-13 16:34:53 +01:00
chriseth
02373c2225 Adjust uses of AsmCodeGen. 2019-02-13 11:35:49 +01:00
chriseth
64312584dc Do not provide access to external assembly variables from within functions. 2019-01-28 14:42:38 +01:00
chriseth
29f6aa7d56 Do not create a copy of the assembly. 2019-01-17 20:36:48 +01:00
chriseth
e6fee257e6 Code generation for access to contract code. 2019-01-17 20:36:48 +01:00
Leonardo Alt
ab76676271 Sort includes in libsolidity/codegen 2018-12-17 17:06:11 +01:00
chriseth
fb3a0ac1c7 Codegen for object access. 2018-12-11 19:24:44 +01:00
Christian Parpart
073b03d90c liblangutil: refactor SourceReferenceFormatter, splitting out retrieval and making use of new SourceLocation's CharStream knowledge 2018-12-06 14:01:01 +01:00
chriseth
7ee1ddc172 Switch namespaces. 2018-12-04 15:36:03 +01:00
chriseth
3ebb78a886 Adjust include paths. 2018-12-04 15:20:29 +01:00
chriseth
99db4e3ff4 Introduce the concept of builtin functions. 2018-12-04 12:06:33 +01:00
Christian Parpart
435f7b3b72 liblangutil: Scanner: remove superfluous sourceName field (it's in CharStream already)
Also, ParserBase::sourceName() was dead code. Eliminating it should
increase test coverage (how sneaky) :-)
2018-11-30 17:07:17 +01:00
Christian Parpart
22eff22492 liblangutil: extends CharStream to know about the respective (file-)name (and adapt codebase to it) 2018-11-29 12:45:27 +01:00
chriseth
0b474d5299
Merge pull request #5497 from ethereum/langutil-SourceReferenceFormatter
Moving SourceReferenceFormatter into langutil namespace.
2018-11-26 12:44:25 +01:00
chriseth
bc137c2eeb
Merge pull request #5485 from ethereum/refactorCallableFunction
Refactor callable function
2018-11-26 12:34:43 +01:00
Christian Parpart
aeb66905de
Moving SourceReferenceFormatter into langutil namespace. 2018-11-24 12:33:36 +01:00
Christian Parpart
ec47c8946b
Isolating libyul library API into its own namespace yul. 2018-11-23 14:29:00 +01:00
Christian Parpart
713d94476e Reorder some include files and group <libyul/>'s together (as much as possible) 2018-11-23 12:37:19 +01:00
Christian Parpart
0f4ed52a71
Rewrite header paths to adapt to recent git mv of libsolidity/inlineasm to libyul 2018-11-23 11:18:57 +01:00
chriseth
62e801ed70 Use callable function for virtual resolution. 2018-11-22 15:48: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
674e17c2a8 Performance: Replace string by special single-copy YulString class. 2018-11-07 19:30:27 +01:00
chriseth
5e01d767d0 Prevent externally used functions from being removed. 2018-10-17 14:12:10 +02:00
Christian Parpart
1304361b9c
Renaming namespace dev::julia to dev::yul. 2018-10-15 11:58:51 +02:00
Jesse Busman
3fcd62921e Renamed FunctionType::hasEqualArgumentTypes to FunctionType::hasEqualParameterTypes 2018-08-06 13:05:06 +02:00
Leonardo Alt
0c5e0e0d59 Added assertion and tests suggestions 2018-07-10 18:39:38 +02:00
Leonardo Alt
b750ca9741 Add more tests and assertions 2018-07-10 18:39:38 +02:00
Leonardo Alt
1f77deada1 [050] Reserving and popping local vars in their scope 2018-07-10 18:39:38 +02:00
chriseth
fcb7a27216 Only forward returndata if EVM version supports it. 2018-04-12 13:09:38 +02:00
chriseth
7a9ee69e98 Bubble up error messages. 2018-04-12 13:09:38 +02:00
chriseth
069b150e42 Bugfix in virtual lookup for modifiers in libraries. 2018-03-13 16:55:41 +01:00
chriseth
fd1662d1c4 Warn about using loose inline assembly features as experimental 0.5.0 feature. 2018-03-06 17:45:34 +01:00
chriseth
dc317a44e0 Provide EVM version to assembly analysis. 2018-03-01 17:19:35 +01:00
chriseth
e2bf5de8a2 Expect end of string at end of top-level block for assembly parser. 2018-02-21 00:41:39 +01:00
chriseth
124190336b Split inline assembly into loose and strict flavours. 2018-01-06 01:23:38 +00:00
chriseth
00692a4ff6 Reset source location after using inline assembly. 2018-01-04 14:29:03 +01:00
chriseth
a5fddc9c57 Debugging info in CompilerContext. 2017-10-04 13:18:33 +02:00
chriseth
2530223ab5 More verbose errors for generated assembly. 2017-09-22 15:18:32 +02:00
chriseth
73771f5bb2 Named assembly labels. 2017-09-15 20:44:49 +01:00
chriseth
ee6f56d641 Remove unused magic global feature. 2017-08-14 13:11:41 +01:00
chriseth
517a366404 Merge pull request #2652 from ethereum/fixMultiModifier
Re-allow multiple modifiers per function.
2017-07-27 14:20:18 +02:00
chriseth
7c7c2baa82 Re-allow multiple modifiers per function. 2017-07-27 13:45:39 +02:00
Alex Beregszaszi
89fadd6935 Merge pull request #2645 from ethereum/asserts
Use solAssert where possible
2017-07-27 11:12:30 +01:00
Alex Beregszaszi
af57879187 Report location on stack too deep if possible 2017-07-26 22:56:55 +01:00
Alex Beregszaszi
8098030986 Use solAssert instead of boost throw where possible 2017-07-26 22:23:21 +01:00
Alex Beregszaszi
a0b0df2d98 Merge pull request #2460 from ethereum/disallowMultiModifier
Disallow invoking the same modifier multiple times.
2017-06-26 11:51:12 +01:00
chriseth
5a75581f66 Disallow invoking the same modifier multiple times. 2017-06-23 20:12:22 +02:00
chriseth
831ed08387 Change invalid opcode to revert for input validation. 2017-06-23 19:29:11 +02:00
Alex Beregszaszi
007ffe9430 Avoid including Scanner.h in ParserBase.h 2017-06-22 22:22:19 +01:00
Alex Beregszaszi
ae6251effd Use inline assembly directly and not via AsmStack 2017-06-09 11:43:40 +01:00
chriseth
97cc968a13 Initial EVM1.5 assembly implementation. 2017-06-08 15:52:44 +02:00
chriseth
261731f7ee Adapt EVM codegen to new namespace. 2017-05-26 15:08:27 +02:00
chriseth
e2b21e1c96 Refactor to abstract assembly to JULIA. 2017-05-19 19:20:28 +02:00
chriseth
34717838da Review comments. 2017-04-25 16:49:03 +02:00
chriseth
e0849f2f3b Split external identifier access into resolving and code generation. 2017-04-25 16:49:03 +02:00
chriseth
d9fbb83861 Allow inserting low-level functions without calling them. 2017-01-26 16:39:07 +01:00
chriseth
390bebaaf9 Split line. 2017-01-26 16:39:07 +01:00
Valentin Wüstholz
5b7cc018f0 Address feedback from code review. 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
7e6f1b3f00 Use int arithmetics for stack adjustment. 2017-01-24 12:07:09 +01:00
chriseth
b60623521f Move some util functions to low-level functions. 2017-01-24 12:06:40 +01:00
chriseth
d0e8d340a5 Low level named functions for CompilerContext. 2017-01-24 12:06:40 +01:00
chriseth
4184525d4a Fix inline assembly. 2016-12-11 17:57:15 +01:00
Alex Beregszaszi
efd7b4bfbb Reset stack height after inline assembly block 2016-12-11 17:57:15 +01:00
Alex Beregszaszi
4a11200a27 Better assert message for appendInlineAssembnly 2016-12-11 17:57:15 +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
chriseth
5789eaa78d Metadata stamp. 2016-12-01 16:03:59 +01:00
VoR0220
3f9f725737 Fix licensing headers
Signed-off-by: VoR0220 <rj@erisindustries.com>
2016-11-23 12:22:33 +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
77f4424589 Provide inline assembly to the code generator. (#840)
* Directly usable inline assembly.

* Add missing header.
2016-08-16 16:27:20 +02:00
chriseth
7ea3d950d7 Allow calling internal functions of libraries.
Internal functions of libraries can be called as if the library were a
base contract of the calling contract. As the calling convention for
internal functions is to not create a new call context, the code of
these functions will be pulled into the context of the caller,
duplicating their code. This might pull in code of further internal or
even private functions.

The use case for such functions is to allow libraries which can operate
on memory types such that these types can also be modified in place.
2016-05-03 22:41:18 +02:00
chriseth
652bc583c0 Remove non-determinism in missing code queue. 2016-05-03 01:14:26 +02:00
Dimitry
d2cee6f9c6 reduce unnecessary solidity:: namespace 2016-04-04 15:41:35 +04:00
Dimitry
858c41260d rename namespace for instruction.h/cpp in libevmasm 2016-04-02 15:56:43 +03:00
chriseth
b47d593252 Do not store elements of a contract by AST node type. 2015-11-26 15:37:55 +01:00
chriseth
e3dffb611f File reorganisation. 2015-10-21 00:46:01 +02:00