Browse Source

Release 0.2: merge remote-tracking branch 'origin/release/0.2'

cl-refactor
Paweł Bylica 10 years ago
parent
commit
5ed93694ed
  1. 9
      CMakeLists.txt
  2. 21
      LICENSE.md
  3. 43
      README.md
  4. 1
      evmcc/test/arith/addmod.evm
  5. 12
      evmcc/test/arith/addmod.lll
  6. 1
      evmcc/test/arith/arith1.evm
  7. 37
      evmcc/test/arith/arith1.lll
  8. 1
      evmcc/test/arith/arith_bnot.evm
  9. 14
      evmcc/test/arith/arith_bnot.lll
  10. 1
      evmcc/test/arith/div.evm
  11. 10
      evmcc/test/arith/div.lll
  12. 1
      evmcc/test/arith/fib1.evm
  13. 57
      evmcc/test/arith/fib1.lll
  14. 1
      evmcc/test/arith/mul.evm
  15. 13
      evmcc/test/arith/mul.lll
  16. 1
      evmcc/test/arith/mulmod.evm
  17. 12
      evmcc/test/arith/mulmod.lll
  18. 1
      evmcc/test/except/badinst1.evm
  19. 1
      evmcc/test/ext/calldatacopy1.evm
  20. 13
      evmcc/test/ext/calldatacopy1.lll
  21. 1
      evmcc/test/ext/calldatacopy2.evm
  22. 13
      evmcc/test/ext/calldatacopy2.lll
  23. 1
      evmcc/test/ext/codecopy1.evm
  24. 13
      evmcc/test/ext/codecopy1.lll
  25. 1
      evmcc/test/ext/codecopy2.evm
  26. 13
      evmcc/test/ext/codecopy2.lll
  27. 1
      evmcc/test/ext/codecopy3.evm
  28. 13
      evmcc/test/ext/codecopy3.lll
  29. 1
      evmcc/test/ext/ext_test.evm
  30. 55
      evmcc/test/ext/ext_test.lll
  31. 1
      evmcc/test/ext/extcodecopy1.evm
  32. 11
      evmcc/test/ext/extcodecopy1.lll
  33. 1
      evmcc/test/ext/store_delete.evm
  34. 9
      evmcc/test/ext/store_delete.lll
  35. 1
      evmcc/test/ext/store_test.evm
  36. 14
      evmcc/test/ext/store_test.lll
  37. 7
      evmcc/test/jump/ackermann.ethel
  38. 1
      evmcc/test/jump/ackermann.evm
  39. 1
      evmcc/test/jump/badindirect1.evm
  40. 9
      evmcc/test/jump/badindirect1.lll
  41. 1
      evmcc/test/jump/badindirect2.evm
  42. 12
      evmcc/test/jump/badindirect2.lll
  43. 1
      evmcc/test/jump/badjump1.evm
  44. 6
      evmcc/test/jump/badjump1.lll
  45. 1
      evmcc/test/jump/badjump2.evm
  46. 9
      evmcc/test/jump/badjump2.lll
  47. 5
      evmcc/test/jump/call1.ethel
  48. 1
      evmcc/test/jump/call1.evm
  49. 5
      evmcc/test/jump/call2.ethel
  50. 1
      evmcc/test/jump/call2.evm
  51. 5
      evmcc/test/jump/fac.ethel
  52. 1
      evmcc/test/jump/fac.evm
  53. 5
      evmcc/test/jump/fac_tail.ethel
  54. 1
      evmcc/test/jump/fac_tail.evm
  55. 6
      evmcc/test/jump/fib1.ethel
  56. 1
      evmcc/test/jump/fib1.evm
  57. 1
      evmcc/test/jump/for1.evm
  58. 3
      evmcc/test/jump/for1.lll
  59. 1
      evmcc/test/jump/for2.evm
  60. 3
      evmcc/test/jump/for2.lll
  61. 1
      evmcc/test/jump/if1.ethel
  62. 1
      evmcc/test/jump/if1.evm
  63. 1
      evmcc/test/jump/if2.ethel
  64. 1
      evmcc/test/jump/if2.evm
  65. 1
      evmcc/test/jump/indirect1.evm
  66. 13
      evmcc/test/jump/indirect1.lll
  67. 1
      evmcc/test/jump/indirect2.evm
  68. 19
      evmcc/test/jump/indirect2.lll
  69. 1
      evmcc/test/jump/indirect3.evm
  70. 14
      evmcc/test/jump/indirect3.lll
  71. 1
      evmcc/test/jump/indirect4.evm
  72. 15
      evmcc/test/jump/indirect4.lll
  73. 1
      evmcc/test/jump/jump1.evm
  74. 11
      evmcc/test/jump/jump1.lll
  75. 1
      evmcc/test/jump/jump2.evm
  76. 10
      evmcc/test/jump/jump2.lll
  77. 1
      evmcc/test/jump/jump3.evm
  78. 10
      evmcc/test/jump/jump3.lll
  79. 1
      evmcc/test/jump/jump4.evm
  80. 17
      evmcc/test/jump/jump4.lll
  81. 1
      evmcc/test/jump/jump5.evm
  82. 16
      evmcc/test/jump/jump5.lll
  83. 1
      evmcc/test/jump/jump6.evm
  84. 32
      evmcc/test/jump/jump6.lll
  85. 1
      evmcc/test/jump/jumpi_at_the_end.evm
  86. 1
      evmcc/test/jump/jumpi_at_the_end.lll
  87. 1
      evmcc/test/jump/loop1.evm
  88. 27
      evmcc/test/jump/loop1.lll
  89. 1
      evmcc/test/jump/loop2.evm
  90. 28
      evmcc/test/jump/loop2.lll
  91. 4
      evmcc/test/jump/rec1.ethel
  92. 1
      evmcc/test/jump/rec1.evm
  93. 10
      evmcc/test/jump/when1.asm
  94. 1
      evmcc/test/jump/when1.evm
  95. 2
      evmcc/test/jump/when1.lll
  96. 1
      evmcc/test/kv.evm
  97. 10
      evmcc/test/kv.lll
  98. 1
      evmcc/test/mem/byte.evm
  99. 105
      evmcc/test/mem/byte.lll
  100. 1
      evmcc/test/mem/mem2.evm

9
CMakeLists.txt

@ -3,13 +3,14 @@ cmake_minimum_required(VERSION 2.8.12)
project(evmjit)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_AUTOMOC OFF)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
else()
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra -fPIC")
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wconversion -Wno-sign-conversion -Wno-unknown-pragmas")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
# Do not allow unresovled symbols in shared library (default on linux)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
endif()
@ -21,7 +22,7 @@ if(LLVM_DIR OR APPLE) # local LLVM build
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
add_definitions(${LLVM_DEFINITIONS})
# TODO: bitwriter is needed only for evmcc
llvm_map_components_to_libnames(LLVM_LIBS core support mcjit x86asmparser x86codegen bitwriter)
llvm_map_components_to_libnames(LLVM_LIBS core support mcjit x86asmparser x86codegen bitwriter ipo)
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")

21
LICENSE.md

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Paweł Bylica <chfast@gmail.com>
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.

43
README.md

@ -0,0 +1,43 @@
# The Ethereum EVM JIT
EVM JIT is a library for just-in-time compilation of Ethereum EVM code.
It can be used to substitute classic interpreter-like EVM Virtual Machine in Ethereum client.
## Build
### Linux / Ubuntu
1. Install llvm-3.5-dev package
1. For Ubuntu 14.04 using LLVM deb packages source: http://llvm.org/apt
2. For Ubuntu 14.10 using Ubuntu packages
2. Build library with cmake
1. `mkdir build && cd $_`
2. `cmake .. && make`
3. Install library
1. `sudo make install`
2. `sudo ldconfig`
### OSX
1. Install llvm35
1. `brew install llvm35 --disable-shared --HEAD`
2. Build library with cmake
1. `mkdir build && cd $_`
2. `cmake -DLLVM_DIR=/usr/local/lib/llvm-3.5/share/llvm/cmake .. && make`
3. Install library
1. `make install` (with admin rights?)
### Windows
Ask me.
## Options
Options to evmjit library can be passed by environmental variables, e.g. `EVMJIT_CACHE=0 testeth --jit`.
Option | Default value | Description
------------- | ------------- | ----------------------------------------------
EVMJIT_CACHE | 1 | Enables on disk cache for compiled EVM objects
EVMJIT_DUMP | 0 | Dumps generated LLVM module to standard output

1
evmcc/test/arith/addmod.evm

@ -1 +0,0 @@
60646107b760271460005560006001f2

12
evmcc/test/arith/addmod.lll

@ -1,12 +0,0 @@
;; Should return (1975 + 39) `mod` 100 = 14 = 0x0e
(asm
100
1975
39
ADDMOD
0
MSTORE8
0
1
RETURN
)

1
evmcc/test/arith/arith1.evm

@ -1 +0,0 @@
60016001900160070260050160029004600490066021900560150160030260059007600303600960110860005460086000f2

37
evmcc/test/arith/arith1.lll

@ -1,37 +0,0 @@
(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
)

1
evmcc/test/arith/arith_bnot.evm

@ -1 +0,0 @@
6201e2406000546000530960005460206000f2

14
evmcc/test/arith/arith_bnot.lll

@ -1,14 +0,0 @@
(asm
123456
0
MSTORE
0
MLOAD
BNOT
0
MSTORE
32
0
RETURN
)

1
evmcc/test/arith/div.evm

@ -1 +0,0 @@
60027ffedcba9876543210fedcba9876543210fedcba9876543210fedcba98765432100460005460206000f2

10
evmcc/test/arith/div.lll

@ -1,10 +0,0 @@
(asm
0x2
0xfedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210
DIV
0
MSTORE
32
0
RETURN
)

1
evmcc/test/arith/fib1.evm

@ -1 +0,0 @@
60016001818101818101818101818101818101818101818101818101818101818101818101818101818101818101818101818101818101

57
evmcc/test/arith/fib1.lll

@ -1,57 +0,0 @@
;; 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
)

1
evmcc/test/arith/mul.evm

@ -1 +0,0 @@
7001234567890abcdef0fedcba09876543217001234567890abcdef0fedcba09876543217001234567890abcdef0fedcba0987654321020260005460206000f2

13
evmcc/test/arith/mul.lll

@ -1,13 +0,0 @@
(asm
0x1234567890abcdef0fedcba0987654321
0x1234567890abcdef0fedcba0987654321
0x1234567890abcdef0fedcba0987654321
MUL
MUL
0
MSTORE
32
0
RETURN
;; 47d0817e4167b1eb4f9fc722b133ef9d7d9a6fb4c2c1c442d000107a5e419561
)

1
evmcc/test/arith/mulmod.evm

@ -1 +0,0 @@
6064601b60251560005560006001f2

12
evmcc/test/arith/mulmod.lll

@ -1,12 +0,0 @@
;; Should return (27 * 37) `mod` 100 = 99 = 0x63
(asm
100
27
37
MULMOD
0
MSTORE8
0
1
RETURN
)

1
evmcc/test/except/badinst1.evm

@ -1 +0,0 @@
4a

1
evmcc/test/ext/calldatacopy1.evm

@ -1 +0,0 @@
60326000600a37600053600a6014f2

13
evmcc/test/ext/calldatacopy1.lll

@ -1,13 +0,0 @@
(asm
50 ;; byte count
0 ;; source index in calldata array
10 ;; dest index in memory
CALLDATACOPY
0
MLOAD ;; to dump memory
10
20
RETURN
)

1
evmcc/test/ext/calldatacopy2.evm

@ -1 +0,0 @@
606464e8d4a510006000376000536000600af2

13
evmcc/test/ext/calldatacopy2.lll

@ -1,13 +0,0 @@
(asm
100 ;; byte count
1000000000000 ;; source index in calldata array
0 ;; dest index in memory
CALLDATACOPY
0
MLOAD ;; to dump memory
0
10
RETURN
)

1
evmcc/test/ext/codecopy1.evm

@ -1 +0,0 @@
60146000600a39600053600a6014f2

13
evmcc/test/ext/codecopy1.lll

@ -1,13 +0,0 @@
(asm
20 ;; byte count
0 ;; source index in code array
10 ;; dest index in memory
CODECOPY
0
MLOAD ;; to dump memory
10
20
RETURN
)

1
evmcc/test/ext/codecopy2.evm

@ -1 +0,0 @@
606464e8d4a510006000396000536000600af2

13
evmcc/test/ext/codecopy2.lll

@ -1,13 +0,0 @@
(asm
100 ;; byte count
1000000000000 ;; source index in code array
0 ;; dest index in memory
CODECOPY
0
MLOAD ;; to dump memory
0
10
RETURN
)

1
evmcc/test/ext/codecopy3.evm

@ -1 +0,0 @@
3860006000396000536000600af2

13
evmcc/test/ext/codecopy3.lll

@ -1,13 +0,0 @@
(asm
CODESIZE ;; byte count
0 ;; source index in code array
0 ;; dest index in memory
CODECOPY
0
MLOAD ;; to dump memory
0
10
RETURN
)

1
evmcc/test/ext/ext_test.evm

@ -1 +0,0 @@
5a3031333234363a4041424344455a36600035602635601335387f1111222233334444555566667777888899990000aaaabbbbccccddddeeeeffff600054602060006000f06020600060206000600030610bb8f1600053611000545b60200260002030ff60016002f2

55
evmcc/test/ext/ext_test.lll

@ -1,55 +0,0 @@
(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
)

1
evmcc/test/ext/extcodecopy1.evm

@ -1 +0,0 @@
60c86000600a303c60005360006020f2

11
evmcc/test/ext/extcodecopy1.lll

@ -1,11 +0,0 @@
(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
)

1
evmcc/test/ext/store_delete.evm

@ -1 +0,0 @@
6104d26063576000606357

9
evmcc/test/ext/store_delete.lll

@ -1,9 +0,0 @@
(asm
1234
99
SSTORE
0
99
SSTORE
)

1
evmcc/test/ext/store_test.evm

@ -1 +0,0 @@
607b607c60015760005760015660005603

14
evmcc/test/ext/store_test.lll

@ -1,14 +0,0 @@
(asm
123
124
1
SSTORE
0
SSTORE
1
SLOAD
0
SLOAD
SUB
)

7
evmcc/test/jump/ackermann.ethel

@ -1,7 +0,0 @@
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

1
evmcc/test/jump/ackermann.evm

@ -1 +0,0 @@
6009600360086012585d60005460206000f26000820e6047596000810e603859603460018303603084600185036012585d6012585d60445860436001830360016012585d604b5860018101905090509058

1
evmcc/test/jump/badindirect1.evm

@ -1 +0,0 @@
601b602502585d

9
evmcc/test/jump/badindirect1.lll

@ -1,9 +0,0 @@
;; Indirect jump out of code
(asm
27
37
MUL
JUMP
JUMPDEST
)

1
evmcc/test/jump/badindirect2.evm

@ -1 +0,0 @@
60016003600302596000600058

12
evmcc/test/jump/badindirect2.lll

@ -1,12 +0,0 @@
;; Indirect jump into data
(asm
1 ;; 0
3
3
MUL ;; 6
JUMPI ;; 7
0 ;; 8
0
JUMP
)

1
evmcc/test/jump/badjump1.evm

@ -1 +0,0 @@
6103e758

6
evmcc/test/jump/badjump1.lll

@ -1,6 +0,0 @@
;; Direct jump out of code.
(asm
999
JUMP
)

1
evmcc/test/jump/badjump2.evm

@ -1 +0,0 @@
6004586000600058

9
evmcc/test/jump/badjump2.lll

@ -1,9 +0,0 @@
;; Direct jump into data
(asm
4 ;; 0 0-3
JUMP ;; 2
0 ;; 3 3-4
0 ;; 5 4-7
JUMP ;; 6
)

5
evmcc/test/jump/call1.ethel

@ -1,5 +0,0 @@
let f n = n + 1
return f 2

1
evmcc/test/jump/call1.evm

@ -1 +0,0 @@
600760026010585d60005460206000f28060010190509058

5
evmcc/test/jump/call2.ethel

@ -1,5 +0,0 @@
let f a b = a + b
return f 2 3

1
evmcc/test/jump/call2.evm

@ -1 +0,0 @@
6009600260036012585d60005460206000f2818101905090509058

5
evmcc/test/jump/fac.ethel

@ -1,5 +0,0 @@
let fac n =
if n == 0 then 1
else n * fac (n-1)
return fac 60

1
evmcc/test/jump/fac.evm

@ -1 +0,0 @@
6007603c6010585d60005460206000f26000810e6026596020600182036010585d8102602858600190509058

5
evmcc/test/jump/fac_tail.ethel

@ -1,5 +0,0 @@
let fac a n =
if n == 0 then a
else fac (a*n) (n-1)
return fac 1 60

1
evmcc/test/jump/fac_tail.evm

@ -1 +0,0 @@
60096001603c6012585d60005460206000f26000810e6029596025818302600183036012585d602a5881905090509058

6
evmcc/test/jump/fib1.ethel

@ -1,6 +0,0 @@
let fib n =
if n < 3 then 1
else fib (n-1) + fib (n-2)
return fib 10

1
evmcc/test/jump/fib1.evm

@ -1 +0,0 @@
6007600a6010585d60005460206000f26003810a602f596020600282036010585d602a600183036010585d01603158600190509058

1
evmcc/test/jump/for1.evm

@ -1 +0,0 @@
600a60805460006080530b0f60255960a0536080530160a054600160805303608054600558

3
evmcc/test/jump/for1.lll

@ -1,3 +0,0 @@
(for [i]:10 (> @i 0) [i](- @i 1)
[j](+ @i @j)
)

1
evmcc/test/jump/for2.evm

@ -1 +0,0 @@
6000608054600a6080530a0f60255960a0536080530160a054600160805301608054600558

3
evmcc/test/jump/for2.lll

@ -1,3 +0,0 @@
(for [i]:0 (< @i 10) [i](+ @i 1)
[j](+ @i @j)
)

1
evmcc/test/jump/if1.ethel

@ -1 +0,0 @@
return if 0 then 1 else 2

1
evmcc/test/jump/if1.evm

@ -1 +0,0 @@
60006300000010596002630000001258600160005460206000f2

1
evmcc/test/jump/if2.ethel

@ -1 +0,0 @@
return if 1 then 1 else 2

1
evmcc/test/jump/if2.evm

@ -1 +0,0 @@
60016300000010596002630000001258600160005460206000f2

1
evmcc/test/jump/indirect1.evm

@ -1 +0,0 @@
600460030158005d6001600054

13
evmcc/test/jump/indirect1.lll

@ -1,13 +0,0 @@
;; Indirect JUMP
(asm
4 ;; 0
3 ;; 2
ADD ;; 4
JUMP ;; 5
STOP ;; 6
JUMPDEST ;; 7
1
0
MSTORE
)

1
evmcc/test/jump/indirect2.evm

@ -1 +0,0 @@
600860060158005d6001600054005d600260005400

19
evmcc/test/jump/indirect2.lll

@ -1,19 +0,0 @@
;; 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
)

1
evmcc/test/jump/indirect3.evm

@ -1 +0,0 @@
6001600460050159005d6001600054

14
evmcc/test/jump/indirect3.lll

@ -1,14 +0,0 @@
;; Indirect JUMP
(asm
1 ;; 0
4 ;; 2
5 ;; 4
ADD ;; 6
JUMPI ;; 7
STOP ;; 8
JUMPDEST ;; 9
1
0
MSTORE
)

1
evmcc/test/jump/indirect4.evm

@ -1 +0,0 @@
60006007600501596001600054005d00

15
evmcc/test/jump/indirect4.lll

@ -1,15 +0,0 @@
;; Indirect JUMP
(asm
0 ;; 0
7 ;; 2
5 ;; 4
ADD ;; 6
JUMPI ;; 7
1 ;; 8
0 ;; 9
MSTORE ;; 10
STOP ;; 11
JUMPDEST ;; 12
STOP
)

1
evmcc/test/jump/jump1.evm

@ -1 +0,0 @@
600458006001600154

11
evmcc/test/jump/jump1.lll

@ -1,11 +0,0 @@
;; Direct JUMP.
;; output: memory[1] == 1
(asm
4 ;; 0
JUMP ;; 2
STOP ;; 3
1 ;; 4
1 ;; 6
MSTORE ;; 8
)

1
evmcc/test/jump/jump2.evm

@ -1 +0,0 @@
6008586001600154

10
evmcc/test/jump/jump2.lll

@ -1,10 +0,0 @@
;; Direct JUMP to the end of code.
;; output: memory should have size 0.
(asm
8 ;; 0
JUMP ;; 2
1 ;; 3
1 ;; 5
MSTORE ;; 7
)

1
evmcc/test/jump/jump3.evm

@ -1 +0,0 @@
602a586001600154

10
evmcc/test/jump/jump3.lll

@ -1,10 +0,0 @@
;; Direct JUMP past the end of code.
;; output: memory should have size 0.
(asm
42
JUMP
1
1
MSTORE
)

1
evmcc/test/jump/jump4.evm

@ -1 +0,0 @@
600b6009580000600558005d6001600154

17
evmcc/test/jump/jump4.lll

@ -1,17 +0,0 @@
;; 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
)

1
evmcc/test/jump/jump5.evm

@ -1 +0,0 @@
6005600e585d600160015400600f5800

16
evmcc/test/jump/jump5.lll

@ -1,16 +0,0 @@
;; 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
)

1
evmcc/test/jump/jump6.evm

@ -1 +0,0 @@
600358600f600d58006014600758005d6001600154005d600260025400

32
evmcc/test/jump/jump6.lll

@ -1,32 +0,0 @@
;; 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
)

1
evmcc/test/jump/jumpi_at_the_end.evm

@ -1 +0,0 @@
600a6000545d6000536001900380600054600659

1
evmcc/test/jump/jumpi_at_the_end.lll

@ -1 +0,0 @@
(asm 10 0 MSTORE JUMPDEST 0 MLOAD 1 SWAP1 SUB DUP1 0 MSTORE 6 JUMPI)

1
evmcc/test/jump/loop1.evm

@ -1 +0,0 @@
600a600181038060025960005460015460025400

27
evmcc/test/jump/loop1.lll

@ -1,27 +0,0 @@
;; 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
)

1
evmcc/test/jump/loop2.evm

@ -1 +0,0 @@
600a80600190038060025960005460015460025400

28
evmcc/test/jump/loop2.lll

@ -1,28 +0,0 @@
;; 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
)

4
evmcc/test/jump/rec1.ethel

@ -1,4 +0,0 @@
let f n =
if n == 0 then 2 else f (n-1)
return f 10

1
evmcc/test/jump/rec1.evm

@ -1 +0,0 @@
6007600a6010585d60005460206000f26000810e6024596020600182036010585d602658600290509058

10
evmcc/test/jump/when1.asm

@ -1,10 +0,0 @@
.code:
PUSH 1
NOT
PUSH [tag0]
JUMPI
PUSH 13
PUSH 128
MSTORE
tag0:

1
evmcc/test/jump/when1.evm

@ -1 +0,0 @@
60010f600b59600d608054

2
evmcc/test/jump/when1.lll

@ -1,2 +0,0 @@
(when (> 1 0) [i] 13)

1
evmcc/test/kv.evm

@ -1 +0,0 @@
33604557602a8060106000396000f200604556330e0f602a59366080530a0f602a59602060805301356080533557604060805301608054600958

10
evmcc/test/kv.lll

@ -1,10 +0,0 @@
{
[[69]] (caller)
(return 0 (lll
(when (= (caller) @@69)
(for {} (< @i (calldatasize)) [i](+ @i 64)
[[ (calldataload @i) ]] (calldataload (+ @i 32))
)
)
0))
}

1
evmcc/test/mem/byte.evm

@ -1 +0,0 @@
7f112233445566778899001122334455667788990011223344556677889900aabb6000137f112233445566778899001122334455667788990011223344556677889900aabb6001137f112233445566778899001122334455667788990011223344556677889900aabb6002137f112233445566778899001122334455667788990011223344556677889900aabb6003137f112233445566778899001122334455667788990011223344556677889900aabb6004137f112233445566778899001122334455667788990011223344556677889900aabb6005137f112233445566778899001122334455667788990011223344556677889900aabb6006137f112233445566778899001122334455667788990011223344556677889900aabb6007137f112233445566778899001122334455667788990011223344556677889900aabb6008137f112233445566778899001122334455667788990011223344556677889900aabb6009137f112233445566778899001122334455667788990011223344556677889900aabb600a137f112233445566778899001122334455667788990011223344556677889900aabb600b137f112233445566778899001122334455667788990011223344556677889900aabb600c137f112233445566778899001122334455667788990011223344556677889900aabb600d137f112233445566778899001122334455667788990011223344556677889900aabb600e137f112233445566778899001122334455667788990011223344556677889900aabb600f137f112233445566778899001122334455667788990011223344556677889900aabb6010137f112233445566778899001122334455667788990011223344556677889900aabb6011137f112233445566778899001122334455667788990011223344556677889900aabb6012137f112233445566778899001122334455667788990011223344556677889900aabb6013137f112233445566778899001122334455667788990011223344556677889900aabb6014137f112233445566778899001122334455667788990011223344556677889900aabb6015137f112233445566778899001122334455667788990011223344556677889900aabb6016137f112233445566778899001122334455667788990011223344556677889900aabb6017137f112233445566778899001122334455667788990011223344556677889900aabb6018137f112233445566778899001122334455667788990011223344556677889900aabb6019137f112233445566778899001122334455667788990011223344556677889900aabb601a137f112233445566778899001122334455667788990011223344556677889900aabb601b137f112233445566778899001122334455667788990011223344556677889900aabb601c137f112233445566778899001122334455667788990011223344556677889900aabb601d137f112233445566778899001122334455667788990011223344556677889900aabb601e137f112233445566778899001122334455667788990011223344556677889900aabb601f137f112233445566778899001122334455667788990011223344556677889900aabb6020137f112233445566778899001122334455667788990011223344556677889900aabb6107de13

105
evmcc/test/mem/byte.lll

@ -1,105 +0,0 @@
(asm
0x112233445566778899001122334455667788990011223344556677889900aabb
0
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
1
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
2
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
3
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
4
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
5
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
6
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
7
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
8
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
9
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
10
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
11
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
12
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
13
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
14
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
15
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
16
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
17
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
18
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
19
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
20
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
21
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
22
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
23
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
24
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
25
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
26
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
27
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
28
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
29
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
30
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
31
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
32
BYTE
0x112233445566778899001122334455667788990011223344556677889900aabb
2014
BYTE
)

1
evmcc/test/mem/mem2.evm

@ -1 +0,0 @@
6001610d805b01556504409585d6df620493e05462061a80535b01

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save