Skip to content

Commit

Permalink
baseline: Use static cgoto table
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Aug 21, 2022
1 parent caddcde commit 16a5c31
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/evmone/baseline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ evmc_result execute_cgoto(
#undef X
#undef X_UNDEFINED

auto& current_cgoto_table = cgoto_table[state.rev];
static constexpr auto current_cgoto_table = cgoto_table[EVMC_MAX_REVISION];

state.analysis.baseline = &analysis; // Assign code analysis for instruction implementations.

Expand All @@ -366,20 +366,20 @@ evmc_result execute_cgoto(
const auto op = *position.code_it;
goto* current_cgoto_table[op];

#define DISPATCH_CASE(OPCODE) \
TARGET_##OPCODE : ASM_COMMENT(OPCODE); \
\
if (const auto next = invoke<OPCODE, false>(cost_table, stack_bottom, position, state); \
next.code_it == nullptr) \
{ \
goto exit; \
} \
else \
{ \
/* Update current position only when no error, \
this improves compiler optimization. */ \
position = next; \
} \
#define DISPATCH_CASE(OPCODE) \
TARGET_##OPCODE : ASM_COMMENT(OPCODE); \
\
if (const auto next = invoke<OPCODE, true>(cost_table, stack_bottom, position, state); \
next.code_it == nullptr) \
{ \
goto exit; \
} \
else \
{ \
/* Update current position only when no error, \
this improves compiler optimization. */ \
position = next; \
} \
goto* current_cgoto_table[*position.code_it];

#define X(OPCODE, IGNORED) DISPATCH_CASE(OPCODE);
Expand Down

0 comments on commit 16a5c31

Please sign in to comment.