evmone icon indicating copy to clipboard operation
evmone copied to clipboard

Refactor call instruction implementation

Open chfast opened this issue 6 years ago • 0 comments

The abstract goal is to de-duplicate the logic of call instructions. Currently, almost all calls (except CALL and CALLCODE) are implemented independently - it was done to get good code coverage in unit tests.

This can be achieved in two ways:

  1. By using a template by evmc_call_kind. This might be faster (less checks in runtime, code for legacy opcodes like CALLCODE stay cold) but result in larger code size (bad for wasm?).
  2. By having single runtime procedure for all calls. See https://github.com/ethereum/evmone/pull/159#issuecomment-529843788.

There can be also a variant that selects 1 or 2 at build time - by using [[gcc::always_inline]] in variant 2.

chfast avatar Sep 10 '19 09:09 chfast