Browse Source
cl-refactor533531b
Create helper/external functions on demand (env_balance for now)e12fa12
Suicide reworkae6e709
Disalbe bswap constant foldingec30ce4
Object cache5be8c59
Byte swap for constants3df5a12
Do not compile LLVM module if machine code available in memory2b31cba
Memory manager cleanup6a22491
Clean up ExecutionEngine28a0623
Clean up ExecutionEnginede02425
Clean up ExecutionEngineece7fe7
Clean up ExecutionEnginefe90c6f
Clean up ExecutionEngine9d9e73a
Using one ExecutionEngine to cache compiled contracts713b33e
Remove global private memory pointersf8ffdfa
Remove global privite pointers to runtime instance and runtime data6643af5
Use code hash as main function namee3245e1
Remove addtional cost param from commitCostBlock(). Count additional cost manually. [#81461534]90cb4a7
More aggresive gas counting optimization: do not commit cost before LOG. [#81461534]5d5259e
Do not auto-commit cost blockc5de54d
More aggresive gas counting optimization: do not commit cost before SSTORE.c5ebca6
More aggresive gas counting optimization: do not commit cost before memory access.69930b9
Use sub "no-wrap"6acbfe0
Remove unused functioneaed9c3
Read push data using llvm::APInt30f0a7a
Type usage and other cleanups4254b3f
Fix memory copy [Delivers #84703344]43e08ea
Handle create/call depth limit in CREATE instruction20190b1
Add -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS needed by LLVM (reverted from commit66d5a2b5cd
)75fa672
Fix compilation with LLVM pre-3.5 (Ubuntu 14.04) (reverted from commit6094aa30ad
)6094aa3
Fix compilation with LLVM pre-3.5 (Ubuntu 14.04)66d5a2b
Add -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS needed by LLVM1b49024
Workaround for Ubuntu broken LLVM package (llvm-3.5-dev does not have correct cmake files)ed63ced
Disable rtti for Cache as LLVM has not rtti232f9fe
Refactor cmake files8287c60
Own cached objects6543cc4
Execution Engine cleanups (reverted from commitbd85efa299
)98b265b
Merge commit '2332595c9c0d315dc9ecde22d236ae477b931863' into develop2b83b75
Object cache wit memory leaksde22a0a
Execution Engine cleanups2332595
Change the name of a module to some hash (for caching)bd85efa
Execution Engine cleanupsb37ce8e
Gas counting for CREATE instruction0a64245
Fix checking memory requirements with size 0a492760
Using llvm::ExecutionEngine::getFunctionAddress() instead of getPointerToFunction(). Cleanups.dd63bb3
Remove TODO comment8f3edbc
Disable cache. It's broken.49bd78b
SHA3 gas cost updated76d30b8
Count additional gas cost for memory copies. Some GasMeter improvments.077cf7b
Count additional cost for EXP exponentc2699b3
Comment about MCJIT and caching pointers to entry functions91cd37e
Remove logs47d92e9
Remove dummy int argument in entry function2e1c90f
Change the way entry function is called.4a9d08d
Change the way entry function is called.70279f8
Changes in setjmpsdbf8174
Update usage of ExtVMFacedc4bc0e
Jit can handle call stack up to 102445fb3f5
Move some data from stack to JitVM object to save stack space.6e318f8
Check current call depth70348d9
Fix cache key and do not compile to LLVM module when it is not neededda02a18
Cache key is contract code. Does not work7c9cf6e
Trying to cache compiled contracts with pointer to code as a key (it's not a good idea)2a7111c
ExecBundle - all information needed to execute a JIT-compiled contractsb3a1734
Disable JIT logsb1b94de
Opcodes updatec9f5694
CMakeLists.txt cleanup (in progress)63d6997
added missing <csetjmp>b07f25d
Detect endianness without boost helpb176574
Remove usage of boost::lexical_cast5f4c1c7
Fix evmcc compilation - provide fake runtime datae3ccc03
Fix MSVC warning9452da9
Merge remote-tracking branch 'origin/develop' into develop2fd2446
Simplify ExecutionEngine interface. It is possible to pass raw code instead of LLVM module.46d1926
fixed gcc warnings (missing field initializers, unused functions)bd40486
Moving ext_calldataload helper function to evmjit library (does not depend on Env)2b9b530
Cleanupsc6fcdbc
Arith performace testsadb5a68
A bit of work in evmcc. Not ready yet.b987258
A TODO comment5362d50
SDIV & SMOD fixed58d2bfb
External code access in Env reimplemented4366542
LOGs reimplemented63719d2
env_call updated69dae9a
env_create updated6f84f3d
Rename sload, sstore & sha3 Env functions408fda8
Old code removed116ce60
Remove Env* param from env_sha3 function (not needed)4fc4e76
Change the way memory is passed to sha3 Env functioncc6bb83
Simplify JIT logs259d1d2
Old files removedddfe85b
Update VM gas counter after execution2b4430e
Change Env functions first argument type to opaque Env*969f1b5
The way runtime data is passed to jit'ed contract changedb8e0ad1
Fix exporting Env callback symbols7db676c
Client side Env updateda0d0f85
JIT VM updated3298e10
Remove mock declaration49b82cd
Move EXP implementation from Ext to Arith2568672c4b
Updating Ext interfacebb6e603
Updating ExecutionEngine interface0509b3b
Changing Runtime interfaceaa77158
Separate runtime classes68648a2
Separating EVM JIT from CPP client (WIP)99c7113
CMake scripts5f61bdc
Starting cmake scriptsdc82664
C Interface draft 194e41d8
correct calculation of LOG costfdd5275
fixed bug in implementation of LOG30eea6e
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmccf72cced
resolved circular dependency between libevm and libevmjitc2c96e6
Merge remote-tracking branch 'origin/develop-evmcc' into develop-evmccbf6a4d4
output gas updated in vmPerformanceTest.jsond77ee40
EVM code updated in vmPerformanceTests3517bfc
fixed libevmjit dependencies in cmake filesf7d6554
Move mock of ExtVMFace to evmcc tool89e6d2f
made _ext a mandatory arg of Runtime::run()aa7fc79
libevmface -> libevmcore: updated cmake files320bdf5
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc86334f5
Handle bytecode as bytes2bd4d6c
Update Instruction.h locationc907c71
codegen for LOG instructions [Delivers #81700490]cdcbb6b
removed references to Memory::dump()47e654c
Merge branch 'develop' into develop-evmcc7305fb3
fixed bug in llvm ir computing required memory size4b4265c
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmccae9f57f
(1) Handling evmcc options with boost::program_options. (2) Writing out .ll and .bc filescb87052
unused var removed9a0f9d3
1) JUMP/I semantics updated. 2) Members of BasicBlock::LocalStack pulled out to BasicBlockc91c5df
Rename BNOT -> NOT, NOT -> ISZERO29432be
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmccee0e2d3
added struct for compiler options172fc1c
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc8f7b5d6
removed *.orig file6f99869
code cleanup and coding-standardization3fc508f
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcca44a7ab
Use llvm.longjmp intrinsic for longjmp [Delivers #81792986]b6b4f5f
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc8ee32d9
Coding style: use "o_" prefix for output function arguments40561b1
code cleanup & coding-standardizationaaaf543
Rename Type::i256 -> Type::Wordb5abb70
Use common builder in GasMeter and Memory33cc50d
Empty lines removal72398d2
Handle unsigned integer overflow in Memory::require() [Delivers #81773288]350b004
Change Constant::get to support negative values272c568
Remove Memory::require(size) interface [#81773288]273b0f6
Deprecate Memory::require(size) function. Risk of unsigned integer overflow.439561a
Use readPushData() in basic block analysisbfb9660
Use readPushData() in instruction compilation1008c70
Create dedicated function for pushdata reading4ff7ba0
Fix u256 to APInt conversion65af01c
removed accidentally added *.orig filed32daf6
New performance tests [Delivers #81578852]895d0aa
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc7760b31
Cleaning up warnings and build dependencies [#81588646]2d6aa46
CMakeLists updated, should now build without LLVM when EVMJIT is not enabled [#81588646]43093d6
Fix MSIZE and memory resize step [Delivers #81777708]85f67a5
Improve PUSH compilation2bbbf6c
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc3725432
Fix case where JUMPI is the last instruction2524c72
Codegen for SIGNEXTEND [Delivers #81700414]007641a
SIGEXTEND: first try [#81700414]d778640
Fix BNOT instruction [Delivers #81700198]dd75da2
BNOT instruction [Delivers #81700198]e4a77c1
Increase refund counter if deleting a storage item [Delivers #81575908]22e4d16
Remove old codeaf0530b
Got rid of some gcc warningsc6cf723
Fix u256 to APInt conversione6b4761
Allow creating LLVM constants directly from u25633f1253
Update gas counting for SSTORE, no refunding yet [#81575908]e24c9c2
Improve Compiler code formattingf06445f
Improve VM code formattingc03d36a
Improve Ext code formattingbc1ef19
Improve GasMeter code formatting3212b2b
Improve ExecutionEngine code formattingde67937
Improve BasicBlock code formatting64513d5
Improve Memory code formatting3ee33cc
Improve code formatting1e8a091
Improve Arith256 code formatting211d3c0
Change #include setjmpfa6d4c6
Improve Stack code formatting7e3a9f4
Remove done FIXME tasksce889fc
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc4c9fed9
turned on stack optimization by default in jit compiler664de37
json test file for performance testing89d4a1c
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc887bac9
Use clog for JIT logs6e8d1ce
added inlcude of setjmp.h required for jmp_buf typeac478d2
added dependency on libethereum to evmcca3871e5
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcccecf567
MULMOD/ADDMOD implemented in separate functions [FIXES #80566276]65eaa13
Remove global Runtime pointer25ccd49
Changed semantics of JUMPDEST so that *the next* instruction is a jump destination6bf994d
1. Indenting spaces converted to tabs 2. Options changed: -G --> -g4684c6f
Using call helper2493ef5
Call helper6da6f3d
Handle bad instructions (BadInstruction exception) [#81563132]ac38bf9
Add raiseException helper to RuntimeManager [#81563132]31c9dd3
Ignore opOp callback silently5a923d6
Ignore opOp callback silentlyc7ba567
Merge branch 'develop' into develop-evmcc0da6823
Fix EXTCODECOPY0eb8311
Restore correct memory access in Ext functions05bbe53
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmccd5ddbfa
Added missing changes [#79450108]6a16efa
Get Runtime pointer from main function argument if availablee273299
Change some runtime namesfd7b6da
Move return data reference to Runtime [#81470252]6d428d8
Fix ReturnData::Index::_size64e3748
Move jmpbuf to Runtime [#81470252]68ca696
256-bit arithmetic implemented via calls to boost::multiprecision library. [#79450108]4bcd092
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcca90ebe6
Print compilation/execution times734dd31
Using RuntimeData pointer in ext functions [#81470252]a076ced
Old bswap intrinsic removed3cba473
Moving CODE data from Ext to Runtime [#81470252]83b24b6
Moving CALLDATA data from Ext to Runtime [#81470252]916f5ab
Group instructions that access runtime data [#81470252]088a4ef
Moving the rest word-size data from Ext to Runtime [#81470252]bfe1216
Moving ORIGIN, CALLER & CALLVALUE data from Ext to Runtime [#81470252]5c1e344
Add name to data indices [#81470252]399cf28
Moving ADDRESS data from Ext to Runtime [#81470252]2b898fc
Introducing RuntimeHelper - a compiler helper that depends on runtime data [#81470252]9ca2663
Use Type::RuntimePtr instead of RuntimeData::getType->getPointerTo()3670e32
Access stack structure through runtime structure [#81470252]693c4b3
Add Type::RuntimePtr predefined LLVM typec388a81
Access memory structure through runtime structure [#81470252]b579c70
Place current gas counter value in RuntimeData097b7ae
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc8da55ff
Export runtime data to global variable in main functiona60843e
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc547ca38
Propagation of values between basic blocks' local stacks [#80895676]6c2a120
Introducing RuntimeData struct - a data that will be provided to running program6580a9b
Visual Studio build fix0dae894
new test casesd281396
Refactored local stack [#81180320]d41828f
added option to set initial gasfc7a46b
Change the way VMs are created (mostly for tracking where are created)dcb739e
Better assert condition16de530
Try not to use JIT in any interactive mode48108f5
Implement VMFace with jit::VM701d99e
Fixed the order in which phi nodes are created (was incorrect) [#80895676]aaf0f7d
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc044e838
Fixed bug in phi node rewriting [#80895676]170ca15
Null gas in case of out-of-gas exception [Delivers #81118624]54c636a
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmccf28f8cc
Add support for Big Endian architectures [Delivers #79877740]0757523
Use Endianness in Ext [#79877740]920ea2e
Comment: storage uses native endianness [#79877740]05741c2
Handle endianness for CALLDATALOAD correctly [#79877740]5a8ba36
added assert in linkBasicBlocks()8909c15
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc080cf20
Handling pop() from the empty EVM stack. [#80895676]49b0769
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmccd95083a
Remove unreachable basic blocks before "linking"a6ce4ba
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc1cf3549
minor changes in the compiler drivera4416e5
Remove unreachable basic blocks before "linking"c4eb835
added missing CMakeLists.txt937fbaa
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc0a9e0f5
Propagation of values between basic blocks (and the stack): initial implementation (probably buggy, but simple cases work). [#80895676]8ba533f
Merge branch 'develop' into develop-evmccc7eac0d
Fix SHA3 instruction :)5db2038
Handle endianness of MSTORE & MLOAD [#79877740]51fc9ad
Fix compiling empty bytecodec97ca24
Throw exception if EVM program is not jitable instead of terminating to make tests going150162e
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmccf83e23a
Another round of fixing ExtVM interface54e0824
Updated cmake files after moving the jit compiler to a lib.58c5a4f
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc607458b
BYTE reimplementationafe0254
Endianness handlerb13f1ac
Check if pushed item is a wordb01a75a
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc52ba848
Add support for direct jump outside the code - terminates with STOP6c3af96
Limit debug outputde8deab
Fix for invalid jump table basic block0febd6a
Do not try to add additional cost (call instruction) to cost-blockf31f3bc
Using gas provided by test engine and fix for creating fake ExtVMFace.dfac5a0
Using ExtVM provided by test enginef0928f5
Tests moved to test/ folderdd6fbda
Fix not allocated arg8 for CALL15714ce
Fix GasMeter not nulling cost call0f4c8eb
VM execution wrapper with similar interface as libevm/VM9105fb1
Merge branch 'develop' into develop-evmcc7df24fa
Move JIT compiler project to library34afb85
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmccf062fd0
Dumping CFG to .dot: showing indirect jumps with dashed linesdcafa47
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc72a6fe4
InsertPointGuard definition moved to CompilerHelper.h8eea475
Get IR module from IR builder on demandf233122
Added dumping of CFG to a .dot file [Delivers #80816506]c83739e
Get IR module from IR builder5e13d59
Introducing CompilerHelper - a base class for... compiler helper classes like Memory, GasMeter, etc.bb51b34
Cleanup block terminator generation1463897
Basic block compilation in separated functione094ba9
Placing IRBuilder in Compiler class (for future refactoring)5586ff5
Some changes about final/stop block07f6bbf
Removing unnecessary `dev` name prefixes11bf67b
Eliminating some `using namespace`a2da7c9
Change namespace from `evmcc` to `dev::eth::jit`f1ea6c9
Macros grouping PUSH, DUP and SWAP switch casesa36a432
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc67ee0b6
Unused rt_exit() function removedec2013d
Working longjmp solution00a872e
* codegen for CODECALL * fixes for EXTCODECOPY59a392c
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc564a593
Codegen for EXTCODESIZE & EXTCODECOPY [Delivers #80644732]9007b74
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc7fcf24d
Trying to implement "exceptions" with longjmp (does not work on Windows 64bit at least)727691f
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcce22238f
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmccc57de78
Use longjmp to return OutOfGas code from main function (WIP)dbb3e81
Try to throw an OutOfGas exception when out of gas. The exception cannot be handled.04d6ffb
Some LLVM function attribute fune11a9bb
Change a bit the implementation of GAS instruction (fix)00e5afc
Change a bit the implementation of GAS instruction0d679f0
Count gas cost for SSTORE instructiondf93292
Codegen for CODECOPY. [Delivers #80644732]1c70f3d
Prealloc memory and count gas for CALL instructiond56f60f
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc7d67476
Prealloc memory and count gas for SHA3 and CREATE instructions42b14ae
Fixes in CALLDATACOPY [Delivers #80644732]9d9e160
InsertPointGuard helper class for IRBuilder7203120
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc0d97405
Initial implementation for CALLDATACOPY [Delivers #80644732]82cba7a
Use mem.require in mload, mstore & mstore80931289
Convenient Memory::require() overloadab556c6
Private mem.require function that preallocates memory and counts gas fee01ca987
Give back an amount of gas not used by CALL instructionsfb87a0b
Count gas for CALL instructions07131e4
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc475b85d
Fixes in inline asm in some jump tests.7494fdb
Use Constant::get() interface to create LLVM constantsf95999c
Allocate memory and count gas for RETURN instruction7a89751
Change the way compiled program returns8fb6de0
Define constants and return codes6caff31
Implemented ADDMOD, MULMOD and GAS [Delivers #80566276]9b3c446
Codegen for GAS3a25969
Report error if static-analysed stack is too small0c259cd
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcca2a496e
test cases for JUMPS/phi nodes6131cca
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc8a52283
Do not check gas cost of value 0efe23ad
Do not commit gas costs on JUMPDEST instruction7c78ecb
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc293f0de
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc9bdfd59
Change basic block linking order to get better results (still not perfect)56a17a0
test cases for JUMPe4cf741
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc6e2bcef
Implemented indirect JUMPI and fixes for JUMPs to invalid PCs2c3d0cc
test cases for JUMP(I)d5f7de4
Always commit cost blocks39ba3ae
Use external counter for gas (external linkage global variable)4eb65a8
Fix block cost counting (counter not reset)5470faf
Count gas for additional memoryd6e6a5f
MSIZE test0128f09
Wrong resize condition fixed4f87144
mload function added as implementation of MLOAD5f1ea8f
store8 function added as implementation of MSTORE8f5a0975
Use mem.store as implementation of MSTOREf825a60
Generate mem.store function and dependencies (currently unused)7a7d4e3
Fix for finding jumpTableBlockd6915b4
Renames & commentsad43b92
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmccfd7069e
Indirect jump: jump table generated in separate bblock.09a5899
Fix stack swap or dup not generating PHI nodes973e0a2
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc52d1ceb
test cases for jumps5dd3037
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcccfb226b
Group gas counting into block of instructions called cost-block.dab29a9
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc6778940
test cases for JUMP2b36803
Implementing JUMP/JUMPDEST (work in progress)e42217d
Disable gas checking for now (does not work and makes IR code hard to read)04cf0cf
Generate gas checking function97644d6
Cleanup LLVM types usageb7f31af
Cleanup LLVM types usage28d6dd7
Decrement global gas value by instruction step costd3f59f6
Introducing GasMeter7f88487
EXP instruction.dafa5bc
Make the Stack an integral part of BasicBlock58c5950
JUMP test in assemblybb19540
Cleanup Compilerb273b86
Provide end instruction to basic block16ea3bf
Improve basic blocks linking implementation7a3f3f9
Remove external stack1cbb9d5
Stack cleanupsa338b88
Cleanups: move basic block linking to separated function577438e
Correct the order of basic blockse52d421
Link basic blocks with phi functions0961908
Introducing BasicBlock class.cc51bfd
Pop entry state of basic block from external stack, push exit state to external stack.33e36ce
Basic stack implementation for basic block. Values on stack are not preserved between basic blocks (jumps)3cba3a2
SHA3 instructionf230c82
SUICIDE instruction3f57858
CALL instruction. Still needs gas counting and callback support.3942b2e
CREATE instruction. Still needs some work with ExtVM interface.a1a195b
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmccf075b7b
- fixes for RETURN and STOP - codegen for SLT, SGT, EQ and NEGb519b73
Stack functions simplified7bee86a
Runtime class that inits and keeps stack, memory and ExtVM interface320add0
BYTE instruction implementation (with bug on BYTE 0)710b734
TODO: implement BYTE48897f4
Bitwise operators: AND, OR, XORc002d9b
PC instructions20cd698
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc09a9f10
Block Information instructions: PREVHASH, COINBASE, TIMESTAMP, NUMBER, DIFFICULTY, GASLIMIT9289508
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc48d4294
- implemented LT, GT - new tests for jumps and comparisons954300f
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmccfbe97fd
BALANCE8b625fa
fixed implementation of NOTfa76d7a
fixes for JUMP/JUMPI (generating final basic block) implementation of NOTad2c4c4
fixed implementation of JUMPI (cond casted to bool)1d17da1
Added Module* constructor argument to Memory and Ext.b730bdc
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc0b8ba6d
initial implementation of JUMP/JUMPI (untested)edf192b
Print returned memory to standard outputd073af7
Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc748ee0f
Implementing RETURN and STOP instructionseea755c
fixed bug in memory handlinge1abb20
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc00f9939
Implemented MLOAD, MSTORE, MSTORE8 and MSIZEb9cda13
Push call data on stack - CALLDATALOADfcde2f3
Accessing Ext static data: CALLER, ORIGIN, CALLVALUE, CALLDATASIZE, GASPRICEac795c4
Send Ext static data to running contract. ADDRESS instruction9ba6a7c
Improve stack binary interface8cd4326
Set/get values in Ext store - SSTORE & SLOAD0013656
added ethcore to libs required by evmcc15b9452
Merge branch 'develop-evmcc' of git@github.com:imapp-pl/ethereum.git into develop-evmcc68f15f9
initial implementation of memoryf3a347b
Starting ExtVM binary interface78b188c
Fix stack set/get bad function signature58e03d5
Basic arithmetic, limited precision for MUL, DIV and MOD.e53c0a4
SWAP* instructions3e01d18
POP and DUP* instructions4266ce5
PUSH instruction implementationd8430db
Output compilation (option -c) result to standard output by defaulte8ff67c
Stack interface and implementationbbc3aa4
evmcc's CMakeLists updated: * added std=c++14 for gcc (required for std::make_unique) * added required llvm libnamesdfa141a
Staring with Stack helperf124be6
Implementation of ExecutionEngine with LLVM MCJITe33fdea
Remove public LLVM dependency in Compiler507ba06
ExecutionEngine stub and -i program option for interpreting EVM Codef5eda1f
Moving Compiler to separated files REVERT: 334deeb Initial commit git-subtree-dir: evmjit git-subtree-split:533531bd07
Marek Kotewicz
10 years ago
168 changed files with 6168 additions and 50 deletions
@ -1,28 +0,0 @@ |
|||
# Compiled Object files |
|||
*.slo |
|||
*.lo |
|||
*.o |
|||
*.obj |
|||
|
|||
# Precompiled Headers |
|||
*.gch |
|||
*.pch |
|||
|
|||
# Compiled Dynamic libraries |
|||
*.so |
|||
*.dylib |
|||
*.dll |
|||
|
|||
# Fortran module files |
|||
*.mod |
|||
|
|||
# Compiled Static libraries |
|||
*.lai |
|||
*.la |
|||
*.a |
|||
*.lib |
|||
|
|||
# Executables |
|||
*.exe |
|||
*.out |
|||
*.app |
@ -0,0 +1,27 @@ |
|||
cmake_minimum_required(VERSION 2.8.12) |
|||
|
|||
project(evmjit) |
|||
|
|||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) |
|||
|
|||
# LLVM |
|||
if(LLVM_DIR) # local LLVM build |
|||
find_package(LLVM REQUIRED CONFIG) |
|||
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") |
|||
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") |
|||
# TODO: bitwriter is needed only for evmcc |
|||
llvm_map_components_to_libnames(LLVM_LIBS core support mcjit x86asmparser x86codegen bitwriter) |
|||
else() |
|||
# Workaround for Ubuntu broken LLVM package |
|||
message(STATUS "Using llvm-3.5-dev package from Ubuntu. If does not work, build LLVM and set -DLLVM_DIR=llvm-build/share/llvm/cmake") |
|||
execute_process(COMMAND llvm-config-3.5 --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS) |
|||
message(STATUS "LLVM include dirs: ${LLVM_INCLUDE_DIRS}") |
|||
set(LLVM_LIBS "-lLLVMBitWriter -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMTarget -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMExecutionEngine -lLLVMMC -lLLVMCore -lLLVMSupport -lz -lpthread -lffi -ltinfo -ldl -lm") |
|||
endif() |
|||
|
|||
# Boost |
|||
find_package(Boost REQUIRED) |
|||
|
|||
add_subdirectory(libevmjit) |
|||
add_subdirectory(libevmjit-cpp) |
|||
add_subdirectory(evmcc) |
@ -1,22 +0,0 @@ |
|||
The MIT License (MIT) |
|||
|
|||
Copyright (c) 2014 |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is |
|||
furnished to do so, subject to the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be included in all |
|||
copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|||
SOFTWARE. |
|||
|
@ -0,0 +1,18 @@ |
|||
set(TARGET_NAME evmcc) |
|||
|
|||
set(SOURCES |
|||
evmcc.cpp |
|||
) |
|||
source_group("" FILES ${SOURCES}) |
|||
|
|||
add_executable(${TARGET_NAME} ${SOURCES}) |
|||
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "tools") |
|||
|
|||
include_directories(../..) |
|||
include_directories(${LLVM_INCLUDE_DIRS}) |
|||
include_directories(${Boost_INCLUDE_DIRS}) |
|||
|
|||
target_link_libraries(${TARGET_NAME} ethereum) |
|||
target_link_libraries(${TARGET_NAME} ${Boost_PROGRAM_OPTIONS_LIBRARIES}) |
|||
|
|||
install(TARGETS ${TARGET_NAME} DESTINATION bin ) |
@ -0,0 +1,211 @@ |
|||
|
|||
#include <chrono> |
|||
#include <iostream> |
|||
#include <fstream> |
|||
#include <ostream> |
|||
#include <string> |
|||
#include <vector> |
|||
|
|||
#include <boost/algorithm/string.hpp> |
|||
#include <boost/program_options.hpp> |
|||
|
|||
#include <llvm/Bitcode/ReaderWriter.h> |
|||
#include <llvm/Support/raw_os_ostream.h> |
|||
#include <llvm/Support/Signals.h> |
|||
#include <llvm/Support/PrettyStackTrace.h> |
|||
|
|||
#include <libdevcore/Common.h> |
|||
#include <libdevcore/CommonIO.h> |
|||
#include <libevmcore/Instruction.h> |
|||
#include <libevm/ExtVMFace.h> |
|||
#include <evmjit/libevmjit/Compiler.h> |
|||
#include <evmjit/libevmjit/ExecutionEngine.h> |
|||
|
|||
|
|||
void parseProgramOptions(int _argc, char** _argv, boost::program_options::variables_map& _varMap) |
|||
{ |
|||
namespace opt = boost::program_options; |
|||
|
|||
opt::options_description explicitOpts("Allowed options"); |
|||
explicitOpts.add_options() |
|||
("help,h", "show usage information") |
|||
("compile,c", "compile the code to LLVM IR") |
|||
("interpret,i", "compile the code to LLVM IR and execute") |
|||
("gas,g", opt::value<size_t>(), "set initial gas for execution") |
|||
("disassemble,d", "dissassemble the code") |
|||
("dump-cfg", "dump control flow graph to graphviz file") |
|||
("dont-optimize", "turn off optimizations") |
|||
("optimize-stack", "optimize stack use between basic blocks (default: on)") |
|||
("rewrite-switch", "rewrite LLVM switch to branches (default: on)") |
|||
("output-ll", opt::value<std::string>(), "dump generated LLVM IR to file") |
|||
("output-bc", opt::value<std::string>(), "dump generated LLVM bitcode to file") |
|||
("show-logs", "output LOG statements to stderr") |
|||
("verbose,V", "enable verbose output"); |
|||
|
|||
opt::options_description implicitOpts("Input files"); |
|||
implicitOpts.add_options() |
|||
("input-file", opt::value<std::string>(), "input file"); |
|||
|
|||
opt::options_description allOpts(""); |
|||
allOpts.add(explicitOpts).add(implicitOpts); |
|||
|
|||
opt::positional_options_description inputOpts; |
|||
inputOpts.add("input-file", 1); |
|||
|
|||
const char* errorMsg = nullptr; |
|||
try |
|||
{ |
|||
auto parser = opt::command_line_parser(_argc, _argv).options(allOpts).positional(inputOpts); |
|||
opt::store(parser.run(), _varMap); |
|||
opt::notify(_varMap); |
|||
} |
|||
catch (boost::program_options::error& err) |
|||
{ |
|||
errorMsg = err.what(); |
|||
} |
|||
|
|||
if (!errorMsg && _varMap.count("input-file") == 0) |
|||
errorMsg = "missing input file name"; |
|||
|
|||
if (_varMap.count("disassemble") == 0 |
|||
&& _varMap.count("compile") == 0 |
|||
&& _varMap.count("interpret") == 0) |
|||
{ |
|||
errorMsg = "at least one of -c, -i, -d is required"; |
|||
} |
|||
|
|||
if (errorMsg || _varMap.count("help")) |
|||
{ |
|||
if (errorMsg) |
|||
std::cerr << "Error: " << errorMsg << std::endl; |
|||
|
|||
std::cout << "Usage: " << _argv[0] << " <options> input-file " << std::endl |
|||
<< explicitOpts << std::endl; |
|||
std::exit(errorMsg ? 1 : 0); |
|||
} |
|||
} |
|||
|
|||
int main(int argc, char** argv) |
|||
{ |
|||
llvm::sys::PrintStackTraceOnErrorSignal(); |
|||
llvm::PrettyStackTraceProgram X(argc, argv); |
|||
|
|||
boost::program_options::variables_map options; |
|||
parseProgramOptions(argc, argv, options); |
|||
|
|||
auto inputFile = options["input-file"].as<std::string>(); |
|||
std::ifstream ifs(inputFile); |
|||
if (!ifs.is_open()) |
|||
{ |
|||
std::cerr << "cannot open input file " << inputFile << std::endl; |
|||
exit(1); |
|||
} |
|||
|
|||
std::string src((std::istreambuf_iterator<char>(ifs)), |
|||
(std::istreambuf_iterator<char>())); |
|||
|
|||
boost::algorithm::trim(src); |
|||
|
|||
using namespace dev; |
|||
|
|||
bytes bytecode = fromHex(src); |
|||
|
|||
if (options.count("disassemble")) |
|||
{ |
|||
std::string assembly = eth::disassemble(bytecode); |
|||
std::cout << assembly << std::endl; |
|||
} |
|||
|
|||
if (options.count("compile") || options.count("interpret")) |
|||
{ |
|||
size_t initialGas = 10000; |
|||
|
|||
if (options.count("gas")) |
|||
initialGas = options["gas"].as<size_t>(); |
|||
|
|||
auto compilationStartTime = std::chrono::high_resolution_clock::now(); |
|||
|
|||
eth::jit::Compiler::Options compilerOptions; |
|||
compilerOptions.dumpCFG = options.count("dump-cfg") > 0; |
|||
bool optimize = options.count("dont-optimize") == 0; |
|||
compilerOptions.optimizeStack = optimize || options.count("optimize-stack") > 0; |
|||
compilerOptions.rewriteSwitchToBranches = optimize || options.count("rewrite-switch") > 0; |
|||
|
|||
auto compiler = eth::jit::Compiler(compilerOptions); |
|||
auto module = compiler.compile(bytecode, "main"); |
|||
|
|||
auto compilationEndTime = std::chrono::high_resolution_clock::now(); |
|||
|
|||
module->dump(); |
|||
|
|||
if (options.count("output-ll")) |
|||
{ |
|||
auto outputFile = options["output-ll"].as<std::string>(); |
|||
std::ofstream ofs(outputFile); |
|||
if (!ofs.is_open()) |
|||
{ |
|||
std::cerr << "cannot open output file " << outputFile << std::endl; |
|||
exit(1); |
|||
} |
|||
llvm::raw_os_ostream ros(ofs); |
|||
module->print(ros, nullptr); |
|||
ofs.close(); |
|||
} |
|||
|
|||
if (options.count("output-bc")) |
|||
{ |
|||
auto outputFile = options["output-bc"].as<std::string>(); |
|||
std::ofstream ofs(outputFile); |
|||
if (!ofs.is_open()) |
|||
{ |
|||
std::cerr << "cannot open output file " << outputFile << std::endl; |
|||
exit(1); |
|||
} |
|||
llvm::raw_os_ostream ros(ofs); |
|||
llvm::WriteBitcodeToFile(module.get(), ros); |
|||
ros.flush(); |
|||
ofs.close(); |
|||
} |
|||
|
|||
if (options.count("verbose")) |
|||
{ |
|||
std::cerr << "*** Compilation time: " |
|||
<< std::chrono::duration_cast<std::chrono::microseconds>(compilationEndTime - compilationStartTime).count() |
|||
<< std::endl; |
|||
} |
|||
|
|||
if (options.count("interpret")) |
|||
{ |
|||
using namespace eth::jit; |
|||
|
|||
ExecutionEngine engine; |
|||
eth::jit::u256 gas = initialGas; |
|||
|
|||
// Create random runtime data
|
|||
RuntimeData data; |
|||
data.set(RuntimeData::Gas, gas); |
|||
data.set(RuntimeData::Address, (u160)Address(1122334455667788)); |
|||
data.set(RuntimeData::Caller, (u160)Address(0xfacefacefaceface)); |
|||
data.set(RuntimeData::Origin, (u160)Address(101010101010101010)); |
|||
data.set(RuntimeData::CallValue, 0xabcd); |
|||
data.set(RuntimeData::CallDataSize, 3); |
|||
data.set(RuntimeData::GasPrice, 1003); |
|||
data.set(RuntimeData::PrevHash, 1003); |
|||
data.set(RuntimeData::CoinBase, (u160)Address(101010101010101015)); |
|||
data.set(RuntimeData::TimeStamp, 1005); |
|||
data.set(RuntimeData::Number, 1006); |
|||
data.set(RuntimeData::Difficulty, 16); |
|||
data.set(RuntimeData::GasLimit, 1008); |
|||
data.set(RuntimeData::CodeSize, bytecode.size()); |
|||
data.callData = (uint8_t*)"abc"; |
|||
data.code = bytecode.data(); |
|||
|
|||
// BROKEN: env_* functions must be implemented & RuntimeData struct created
|
|||
// TODO: Do not compile module again
|
|||
auto result = engine.run(bytecode, &data, nullptr); |
|||
return static_cast<int>(result); |
|||
} |
|||
} |
|||
|
|||
return 0; |
|||
} |
@ -0,0 +1 @@ |
|||
60646107b760271460005560006001f2 |
@ -0,0 +1,12 @@ |
|||
;; Should return (1975 + 39) `mod` 100 = 14 = 0x0e |
|||
(asm |
|||
100 |
|||
1975 |
|||
39 |
|||
ADDMOD |
|||
0 |
|||
MSTORE8 |
|||
0 |
|||
1 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
60016001900160070260050160029004600490066021900560150160030260059007600303600960110860005460086000f2 |
@ -0,0 +1,37 @@ |
|||
|
|||
(asm |
|||
1 |
|||
1 |
|||
SWAP1 |
|||
ADD ;; 2 |
|||
7 |
|||
MUL ;; 14 |
|||
5 |
|||
ADD ;; 19 |
|||
2 |
|||
SWAP1 |
|||
DIV ;; 9 |
|||
4 |
|||
SWAP1 |
|||
MOD ;; 1 |
|||
33 |
|||
SWAP1 |
|||
SDIV;; 0 |
|||
21 |
|||
ADD ;; 21 |
|||
3 |
|||
MUL ;; 63 |
|||
5 |
|||
SWAP1 |
|||
SMOD;; 3 |
|||
3 |
|||
SUB ;; 0 |
|||
9 |
|||
17 |
|||
EXP ;; 17^9 |
|||
0 |
|||
MSTORE |
|||
8 |
|||
0 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
6201e2406000546000530960005460206000f2 |
@ -0,0 +1,14 @@ |
|||
|
|||
(asm |
|||
123456 |
|||
0 |
|||
MSTORE |
|||
0 |
|||
MLOAD |
|||
BNOT |
|||
0 |
|||
MSTORE |
|||
32 |
|||
0 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
60027ffedcba9876543210fedcba9876543210fedcba9876543210fedcba98765432100460005460206000f2 |
@ -0,0 +1,10 @@ |
|||
(asm |
|||
0x2 |
|||
0xfedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 |
|||
DIV |
|||
0 |
|||
MSTORE |
|||
32 |
|||
0 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
60016001818101818101818101818101818101818101818101818101818101818101818101818101818101818101818101818101818101 |
@ -0,0 +1,57 @@ |
|||
;; Fibbonacci unrolled |
|||
|
|||
(asm |
|||
1 |
|||
1 |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
DUP2 |
|||
DUP2 |
|||
ADD |
|||
) |
@ -0,0 +1 @@ |
|||
7001234567890abcdef0fedcba09876543217001234567890abcdef0fedcba09876543217001234567890abcdef0fedcba0987654321020260005460206000f2 |
@ -0,0 +1,13 @@ |
|||
(asm |
|||
0x1234567890abcdef0fedcba0987654321 |
|||
0x1234567890abcdef0fedcba0987654321 |
|||
0x1234567890abcdef0fedcba0987654321 |
|||
MUL |
|||
MUL |
|||
0 |
|||
MSTORE |
|||
32 |
|||
0 |
|||
RETURN |
|||
;; 47d0817e4167b1eb4f9fc722b133ef9d7d9a6fb4c2c1c442d000107a5e419561 |
|||
) |
@ -0,0 +1 @@ |
|||
6064601b60251560005560006001f2 |
@ -0,0 +1,12 @@ |
|||
;; Should return (27 * 37) `mod` 100 = 99 = 0x63 |
|||
(asm |
|||
100 |
|||
27 |
|||
37 |
|||
MULMOD |
|||
0 |
|||
MSTORE8 |
|||
0 |
|||
1 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
4a |
@ -0,0 +1 @@ |
|||
60326000600a37600053600a6014f2 |
@ -0,0 +1,13 @@ |
|||
(asm |
|||
50 ;; byte count |
|||
0 ;; source index in calldata array |
|||
10 ;; dest index in memory |
|||
CALLDATACOPY |
|||
|
|||
0 |
|||
MLOAD ;; to dump memory |
|||
|
|||
10 |
|||
20 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
606464e8d4a510006000376000536000600af2 |
@ -0,0 +1,13 @@ |
|||
(asm |
|||
100 ;; byte count |
|||
1000000000000 ;; source index in calldata array |
|||
0 ;; dest index in memory |
|||
CALLDATACOPY |
|||
|
|||
0 |
|||
MLOAD ;; to dump memory |
|||
|
|||
0 |
|||
10 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
60146000600a39600053600a6014f2 |
@ -0,0 +1,13 @@ |
|||
(asm |
|||
20 ;; byte count |
|||
0 ;; source index in code array |
|||
10 ;; dest index in memory |
|||
CODECOPY |
|||
|
|||
0 |
|||
MLOAD ;; to dump memory |
|||
|
|||
10 |
|||
20 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
606464e8d4a510006000396000536000600af2 |
@ -0,0 +1,13 @@ |
|||
(asm |
|||
100 ;; byte count |
|||
1000000000000 ;; source index in code array |
|||
0 ;; dest index in memory |
|||
CODECOPY |
|||
|
|||
0 |
|||
MLOAD ;; to dump memory |
|||
|
|||
0 |
|||
10 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
3860006000396000536000600af2 |
@ -0,0 +1,13 @@ |
|||
(asm |
|||
CODESIZE ;; byte count |
|||
0 ;; source index in code array |
|||
0 ;; dest index in memory |
|||
CODECOPY |
|||
|
|||
0 |
|||
MLOAD ;; to dump memory |
|||
|
|||
0 |
|||
10 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
5a3031333234363a4041424344455a36600035602635601335387f1111222233334444555566667777888899990000aaaabbbbccccddddeeeeffff600054602060006000f06020600060206000600030610bb8f1600053611000545b60200260002030ff60016002f2 |
@ -0,0 +1,55 @@ |
|||
|
|||
(asm |
|||
PC |
|||
ADDRESS |
|||
BALANCE |
|||
CALLER |
|||
ORIGIN |
|||
CALLVALUE |
|||
CALLDATASIZE |
|||
GASPRICE |
|||
PREVHASH |
|||
COINBASE |
|||
TIMESTAMP |
|||
NUMBER |
|||
DIFFICULTY |
|||
GASLIMIT |
|||
PC |
|||
CALLDATASIZE |
|||
0 |
|||
CALLDATALOAD |
|||
38 |
|||
CALLDATALOAD |
|||
19 |
|||
CALLDATALOAD |
|||
CODESIZE |
|||
0x1111222233334444555566667777888899990000aaaabbbbccccddddeeeeffff |
|||
0 |
|||
MSTORE |
|||
32 |
|||
0 |
|||
0 |
|||
CREATE |
|||
32 |
|||
0 |
|||
32 |
|||
0 |
|||
0 |
|||
ADDRESS |
|||
3000 |
|||
CALL |
|||
0 |
|||
MLOAD |
|||
4096 |
|||
MSTORE |
|||
MSIZE |
|||
32 |
|||
MUL |
|||
0 |
|||
SHA3 |
|||
ADDRESS |
|||
SUICIDE |
|||
1 |
|||
2 |
|||
RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
60c86000600a303c60005360006020f2 |
@ -0,0 +1,11 @@ |
|||
(asm |
|||
200 ;; byte count |
|||
0 ;; source index in code array |
|||
10 ;; dest index in memory |
|||
ADDRESS |
|||
EXTCODECOPY |
|||
|
|||
0 MLOAD ;; to dump memory |
|||
|
|||
0 32 RETURN |
|||
) |
@ -0,0 +1 @@ |
|||
6104d26063576000606357 |
@ -0,0 +1,9 @@ |
|||
|
|||
(asm |
|||
1234 |
|||
99 |
|||
SSTORE |
|||
0 |
|||
99 |
|||
SSTORE |
|||
) |
@ -0,0 +1 @@ |
|||
607b607c60015760005760015660005603 |
@ -0,0 +1,14 @@ |
|||
|
|||
(asm |
|||
123 |
|||
124 |
|||
1 |
|||
SSTORE |
|||
0 |
|||
SSTORE |
|||
1 |
|||
SLOAD |
|||
0 |
|||
SLOAD |
|||
SUB |
|||
) |
@ -0,0 +1,7 @@ |
|||
let A m n = |
|||
if m == 0 then n+1 |
|||
else if n == 0 then A (m-1) 1 |
|||
else A (m-1) (A (m) (n-1)) |
|||
|
|||
return A 3 8 |
|||
|
@ -0,0 +1 @@ |
|||
6009600360086012585d60005460206000f26000820e6047596000810e603859603460018303603084600185036012585d6012585d60445860436001830360016012585d604b5860018101905090509058 |
@ -0,0 +1 @@ |
|||
601b602502585d |
@ -0,0 +1,9 @@ |
|||
;; Indirect jump out of code |
|||
|
|||
(asm |
|||
27 |
|||
37 |
|||
MUL |
|||
JUMP |
|||
JUMPDEST |
|||
) |
@ -0,0 +1 @@ |
|||
60016003600302596000600058 |
@ -0,0 +1,12 @@ |
|||
;; Indirect jump into data |
|||
|
|||
(asm |
|||
1 ;; 0 |
|||
3 |
|||
3 |
|||
MUL ;; 6 |
|||
JUMPI ;; 7 |
|||
0 ;; 8 |
|||
0 |
|||
JUMP |
|||
) |
@ -0,0 +1 @@ |
|||
6103e758 |
@ -0,0 +1,6 @@ |
|||
;; Direct jump out of code. |
|||
|
|||
(asm |
|||
999 |
|||
JUMP |
|||
) |
@ -0,0 +1 @@ |
|||
6004586000600058 |
@ -0,0 +1,9 @@ |
|||
;; Direct jump into data |
|||
|
|||
(asm |
|||
4 ;; 0 0-3 |
|||
JUMP ;; 2 |
|||
0 ;; 3 3-4 |
|||
0 ;; 5 4-7 |
|||
JUMP ;; 6 |
|||
) |
@ -0,0 +1,5 @@ |
|||
let f n = n + 1 |
|||
|
|||
return f 2 |
|||
|
|||
|
@ -0,0 +1 @@ |
|||
600760026010585d60005460206000f28060010190509058 |
@ -0,0 +1,5 @@ |
|||
let f a b = a + b |
|||
|
|||
return f 2 3 |
|||
|
|||
|
@ -0,0 +1 @@ |
|||
6009600260036012585d60005460206000f2818101905090509058 |
@ -0,0 +1,5 @@ |
|||
let fac n = |
|||
if n == 0 then 1 |
|||
else n * fac (n-1) |
|||
|
|||
return fac 60 |
@ -0,0 +1 @@ |
|||
6007603c6010585d60005460206000f26000810e6026596020600182036010585d8102602858600190509058 |
@ -0,0 +1,5 @@ |
|||
let fac a n = |
|||
if n == 0 then a |
|||
else fac (a*n) (n-1) |
|||
|
|||
return fac 1 60 |
@ -0,0 +1 @@ |
|||
60096001603c6012585d60005460206000f26000810e6029596025818302600183036012585d602a5881905090509058 |
@ -0,0 +1,6 @@ |
|||
let fib n = |
|||
if n < 3 then 1 |
|||
else fib (n-1) + fib (n-2) |
|||
|
|||
return fib 10 |
|||
|
@ -0,0 +1 @@ |
|||
6007600a6010585d60005460206000f26003810a602f596020600282036010585d602a600183036010585d01603158600190509058 |
@ -0,0 +1 @@ |
|||
600a60805460006080530b0f60255960a0536080530160a054600160805303608054600558 |
@ -0,0 +1,3 @@ |
|||
(for [i]:10 (> @i 0) [i](- @i 1) |
|||
[j](+ @i @j) |
|||
) |
@ -0,0 +1 @@ |
|||
6000608054600a6080530a0f60255960a0536080530160a054600160805301608054600558 |
@ -0,0 +1,3 @@ |
|||
(for [i]:0 (< @i 10) [i](+ @i 1) |
|||
[j](+ @i @j) |
|||
) |
@ -0,0 +1 @@ |
|||
return if 0 then 1 else 2 |
@ -0,0 +1 @@ |
|||
60006300000010596002630000001258600160005460206000f2 |
@ -0,0 +1 @@ |
|||
return if 1 then 1 else 2 |
@ -0,0 +1 @@ |
|||
60016300000010596002630000001258600160005460206000f2 |
@ -0,0 +1 @@ |
|||
600460030158005d6001600054 |
@ -0,0 +1,13 @@ |
|||
;; Indirect JUMP |
|||
|
|||
(asm |
|||
4 ;; 0 |
|||
3 ;; 2 |
|||
ADD ;; 4 |
|||
JUMP ;; 5 |
|||
STOP ;; 6 |
|||
JUMPDEST ;; 7 |
|||
1 |
|||
0 |
|||
MSTORE |
|||
) |
@ -0,0 +1 @@ |
|||
600860060158005d6001600054005d600260005400 |
@ -0,0 +1,19 @@ |
|||
;; Indirect JUMP |
|||
|
|||
(asm |
|||
8 ;; 0 |
|||
6 ;; 2 |
|||
ADD ;; 4 |
|||
JUMP ;; 5 --> 14 |
|||
STOP ;; 6 |
|||
JUMPDEST ;; 7 |
|||
1 ;; 8 |
|||
0 ;; 10 |
|||
MSTORE ;; 12 |
|||
STOP ;; 13 |
|||
JUMPDEST ;; 14 |
|||
2 |
|||
0 |
|||
MSTORE |
|||
STOP |
|||
) |
@ -0,0 +1 @@ |
|||
6001600460050159005d6001600054 |
@ -0,0 +1,14 @@ |
|||
;; Indirect JUMP |
|||
|
|||
(asm |
|||
1 ;; 0 |
|||
4 ;; 2 |
|||
5 ;; 4 |
|||
ADD ;; 6 |
|||
JUMPI ;; 7 |
|||
STOP ;; 8 |
|||
JUMPDEST ;; 9 |
|||
1 |
|||
0 |
|||
MSTORE |
|||
) |
@ -0,0 +1 @@ |
|||
60006007600501596001600054005d00 |
@ -0,0 +1,15 @@ |
|||
;; Indirect JUMP |
|||
|
|||
(asm |
|||
0 ;; 0 |
|||
7 ;; 2 |
|||
5 ;; 4 |
|||
ADD ;; 6 |
|||
JUMPI ;; 7 |
|||
1 ;; 8 |
|||
0 ;; 9 |
|||
MSTORE ;; 10 |
|||
STOP ;; 11 |
|||
JUMPDEST ;; 12 |
|||
STOP |
|||
) |
@ -0,0 +1 @@ |
|||
600458006001600154 |
@ -0,0 +1,11 @@ |
|||
;; Direct JUMP. |
|||
;; output: memory[1] == 1 |
|||
|
|||
(asm |
|||
4 ;; 0 |
|||
JUMP ;; 2 |
|||
STOP ;; 3 |
|||
1 ;; 4 |
|||
1 ;; 6 |
|||
MSTORE ;; 8 |
|||
) |
@ -0,0 +1 @@ |
|||
6008586001600154 |
@ -0,0 +1,10 @@ |
|||
;; Direct JUMP to the end of code. |
|||
;; output: memory should have size 0. |
|||
|
|||
(asm |
|||
8 ;; 0 |
|||
JUMP ;; 2 |
|||
1 ;; 3 |
|||
1 ;; 5 |
|||
MSTORE ;; 7 |
|||
) |
@ -0,0 +1 @@ |
|||
602a586001600154 |
@ -0,0 +1,10 @@ |
|||
;; Direct JUMP past the end of code. |
|||
;; output: memory should have size 0. |
|||
|
|||
(asm |
|||
42 |
|||
JUMP |
|||
1 |
|||
1 |
|||
MSTORE |
|||
) |
@ -0,0 +1 @@ |
|||
600b6009580000600558005d6001600154 |
@ -0,0 +1,17 @@ |
|||
;; Direct JUMP. |
|||
;; output: memory[1] = 1 |
|||
|
|||
(asm |
|||
11 ;; 0 |
|||
9 ;; 2 |
|||
JUMP ;; 4 --> 9 |
|||
STOP ;; 5 |
|||
STOP ;; 6 |
|||
5 ;; 7 |
|||
JUMP ;; 9 --> 11 |
|||
STOP ;; 10 |
|||
JUMPDEST |
|||
1 ;; 11 |
|||
1 |
|||
MSTORE |
|||
) |
@ -0,0 +1 @@ |
|||
6005600e585d600160015400600f5800 |
@ -0,0 +1,16 @@ |
|||
;; Direct JUMP. |
|||
;; output: memory[1] = 1 |
|||
|
|||
(asm |
|||
5 ;; 0 |
|||
14 ;; 2 |
|||
JUMP ;; 4 --> 14 |
|||
JUMPDEST ;; 5 |
|||
1 ;; 6 |
|||
1 ;; 8 |
|||
MSTORE ;; 10 |
|||
STOP ;; 11 |
|||
15 ;; 12 |
|||
JUMP ;; 14 --> 5 |
|||
STOP ;; 15 |
|||
) |
@ -0,0 +1 @@ |
|||
600358600f600d58006014600758005d6001600154005d600260025400 |
@ -0,0 +1,32 @@ |
|||
;; Direct JUMP. |
|||
;; output: memory[1] = 1 |
|||
|
|||
;; 0, 2 --> 3 .. 7 --> 13 -*-> 15 .. 19 |
|||
|
|||
(asm |
|||
3 ;; 0 |
|||
JUMP ;; 2 |
|||
|
|||
15 ;; 3 <- start |
|||
13 ;; 5 |
|||
JUMP ;; 7 <- b |
|||
STOP ;; 8 |
|||
|
|||
20 ;; 9 |
|||
7 ;; 11 |
|||
|
|||
JUMP ;; 13 <- a |
|||
STOP ;; 14 |
|||
|
|||
JUMPDEST ;; 15 <- c |
|||
1 ;; 16 |
|||
1 ;; 18 |
|||
MSTORE ;; 19 |
|||
STOP ;; 20 |
|||
|
|||
JUMPDEST ;; 21 <- d |
|||
2 ;; 22 |
|||
2 ;; 24 |
|||
MSTORE ;; 26 |
|||
STOP ;; 27 |
|||
) |
@ -0,0 +1 @@ |
|||
600a6000545d6000536001900380600054600659 |
@ -0,0 +1 @@ |
|||
(asm 10 0 MSTORE JUMPDEST 0 MLOAD 1 SWAP1 SUB DUP1 0 MSTORE 6 JUMPI) |
@ -0,0 +1 @@ |
|||
600a600181038060025960005460015460025400 |
@ -0,0 +1,27 @@ |
|||
;; Produces 1 2 3 4 5 6 7 8 9 10 on the stack and exits |
|||
|
|||
(asm |
|||
10 |
|||
|
|||
;; 2 |
|||
1 |
|||
DUP2 |
|||
SUB |
|||
DUP1 |
|||
2 |
|||
JUMPI |
|||
|
|||
;; stack = 1 2 3 4 5 6 7 8 9 10 |
|||
0 |
|||
MSTORE |
|||
1 |
|||
MSTORE |
|||
2 |
|||
MSTORE |
|||
;;3 |
|||
;;MSTORE |
|||
|
|||
STOP |
|||
) |
|||
|
|||
|
@ -0,0 +1 @@ |
|||
600a80600190038060025960005460015460025400 |
@ -0,0 +1,28 @@ |
|||
;; Produces 1 2 3 4 5 6 7 8 9 10 on the stack and exits |
|||
|
|||
(asm |
|||
10 |
|||
|
|||
;; 2 |
|||
DUP1 |
|||
1 |
|||
SWAP1 |
|||
SUB |
|||
DUP1 |
|||
2 |
|||
JUMPI |
|||
|
|||
;; stack = 1 2 3 4 5 6 7 8 9 10 |
|||
0 |
|||
MSTORE |
|||
1 |
|||
MSTORE |
|||
2 |
|||
MSTORE |
|||
;;3 |
|||
;;MSTORE |
|||
|
|||
STOP |
|||
) |
|||
|
|||
|
@ -0,0 +1,4 @@ |
|||
let f n = |
|||
if n == 0 then 2 else f (n-1) |
|||
|
|||
return f 10 |
@ -0,0 +1 @@ |
|||
6007600a6010585d60005460206000f26000810e6024596020600182036010585d602658600290509058 |
@ -0,0 +1,10 @@ |
|||
.code: |
|||
PUSH 1 |
|||
NOT |
|||
PUSH [tag0] |
|||
JUMPI |
|||
PUSH 13 |
|||
PUSH 128 |
|||
MSTORE |
|||
tag0: |
|||
|
@ -0,0 +1 @@ |
|||
60010f600b59600d608054 |
@ -0,0 +1,2 @@ |
|||
(when (> 1 0) [i] 13) |
|||
|
@ -0,0 +1 @@ |
|||
33604557602a8060106000396000f200604556330e0f602a59366080530a0f602a59602060805301356080533557604060805301608054600958 |
@ -0,0 +1,10 @@ |
|||
{ |
|||
[[69]] (caller) |
|||
(return 0 (lll |
|||
(when (= (caller) @@69) |
|||
(for {} (< @i (calldatasize)) [i](+ @i 64) |
|||
[[ (calldataload @i) ]] (calldataload (+ @i 32)) |
|||
) |
|||
) |
|||
0)) |
|||
} |
@ -0,0 +1 @@ |
|||
7f112233445566778899001122334455667788990011223344556677889900aabb6000137f112233445566778899001122334455667788990011223344556677889900aabb6001137f112233445566778899001122334455667788990011223344556677889900aabb6002137f112233445566778899001122334455667788990011223344556677889900aabb6003137f112233445566778899001122334455667788990011223344556677889900aabb6004137f112233445566778899001122334455667788990011223344556677889900aabb6005137f112233445566778899001122334455667788990011223344556677889900aabb6006137f112233445566778899001122334455667788990011223344556677889900aabb6007137f112233445566778899001122334455667788990011223344556677889900aabb6008137f112233445566778899001122334455667788990011223344556677889900aabb6009137f112233445566778899001122334455667788990011223344556677889900aabb600a137f112233445566778899001122334455667788990011223344556677889900aabb600b137f112233445566778899001122334455667788990011223344556677889900aabb600c137f112233445566778899001122334455667788990011223344556677889900aabb600d137f112233445566778899001122334455667788990011223344556677889900aabb600e137f112233445566778899001122334455667788990011223344556677889900aabb600f137f112233445566778899001122334455667788990011223344556677889900aabb6010137f112233445566778899001122334455667788990011223344556677889900aabb6011137f112233445566778899001122334455667788990011223344556677889900aabb6012137f112233445566778899001122334455667788990011223344556677889900aabb6013137f112233445566778899001122334455667788990011223344556677889900aabb6014137f112233445566778899001122334455667788990011223344556677889900aabb6015137f112233445566778899001122334455667788990011223344556677889900aabb6016137f112233445566778899001122334455667788990011223344556677889900aabb6017137f112233445566778899001122334455667788990011223344556677889900aabb6018137f112233445566778899001122334455667788990011223344556677889900aabb6019137f112233445566778899001122334455667788990011223344556677889900aabb601a137f112233445566778899001122334455667788990011223344556677889900aabb601b137f112233445566778899001122334455667788990011223344556677889900aabb601c137f112233445566778899001122334455667788990011223344556677889900aabb601d137f112233445566778899001122334455667788990011223344556677889900aabb601e137f112233445566778899001122334455667788990011223344556677889900aabb601f137f112233445566778899001122334455667788990011223344556677889900aabb6020137f112233445566778899001122334455667788990011223344556677889900aabb6107de13 |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue