Skip to content

Commit

Permalink
baseline: Swap execute() variant implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed May 12, 2021
1 parent 0647358 commit 4a7161b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/evmone/baseline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@ inline evmc_status_code check_requirements(const char* const* instruction_names,
}
} // namespace

evmc_result execute(evmc_vm* c_vm, const evmc_host_interface* host, evmc_host_context* ctx,
evmc_revision rev, const evmc_message* msg, const uint8_t* code, size_t code_size) noexcept
{
auto vm = static_cast<VM*>(c_vm);
const auto jumpdest_map = analyze(code, code_size);
auto state = std::make_unique<ExecutionState>(*msg, rev, *host, ctx, code, code_size);
return execute(*vm, *state, jumpdest_map);
}

evmc_result execute(const VM& /*vm*/, ExecutionState& state, const CodeAnalysis& analysis) noexcept
{
const auto rev = state.rev;
Expand Down Expand Up @@ -763,4 +754,13 @@ evmc_result execute(const VM& /*vm*/, ExecutionState& state, const CodeAnalysis&
return evmc::make_result(state.status, gas_left,
state.output_size != 0 ? &state.memory[state.output_offset] : nullptr, state.output_size);
}

evmc_result execute(evmc_vm* c_vm, const evmc_host_interface* host, evmc_host_context* ctx,
evmc_revision rev, const evmc_message* msg, const uint8_t* code, size_t code_size) noexcept
{
auto vm = static_cast<VM*>(c_vm);
const auto jumpdest_map = analyze(code, code_size);
auto state = std::make_unique<ExecutionState>(*msg, rev, *host, ctx, code, code_size);
return execute(*vm, *state, jumpdest_map);
}
} // namespace evmone::baseline

0 comments on commit 4a7161b

Please sign in to comment.