Skip to content

Commit 5a4b15b

Browse files
vyzoStebalien
andauthored
EVM: Refactor Interpreter dispatch (#646)
* check stack limits at dispatch, make stack ops unchecked * use a growable vector for the stack * fix growth check * clippy wants default... * optimize ensure somewhat * remove implicit assumption about growth patterns * drop error from Bytecode::new signature, it can't really err. fix rebase artifact * refactor part I: primops * add arity/stack checks for primops * dup and swap * push * immediates * sugar * first stdfun * keccak256 as stdfun and prettier sugar * moar stdfuns * calldatacopy * emacs auto-indent friendly sugar * more functionoids * moar funcionoids * call opcodes also kill leftover callactor * primitive -> primop * codesize and codecopy * create and create2 * control flow * mark stack ops as unsafe only macro mechanically checked invocations for these * fix tests * rustfmt * shut up clippy's frivolous complaints * nit: macro magic Co-authored-by: Steven Allen <steven@stebalien.com>
1 parent 3c90246 commit 5a4b15b

18 files changed

+1123
-1209
lines changed

actors/evm/src/interpreter/bytecode.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ impl Bytecode {
1212
pub fn new(bytecode: Vec<u8>) -> Self {
1313
// only jumps to those addresses are valid. This is a security
1414
// feature by EVM to disallow jumps to arbitary code addresses.
15-
// todo: create the jumpdest table only once during initial contract deployment
1615
let mut jumpdest = vec![false; bytecode.len()];
1716
let mut i = 0;
1817
while i < bytecode.len() {

0 commit comments

Comments
 (0)