EEVM.Interpreter.Instructions.Registry (eevm v0.1.0)

Copy Markdown View Source

Opcode metadata registry — single source of truth for every opcode's name, stack I/O signature, implementing module, and static-context flag.

Given an opcode byte (0x00–0xFF) info/1 returns:

  • :name — the human-readable mnemonic (e.g. "ADD")
  • :inputs / :outputs — stack arity, used by the disassembler and stack-depth checks
  • :module — the EEVM.Interpreter.Instructions.* module that implements the opcode; EEVM.Interpreter dispatches on this field
  • :state_mutating (when present) — opcode mutates persistent state and is an exceptional halt ({:error, :static_state_modification}) inside a STATICCALL frame

PUSH1–PUSH32, DUP1–DUP16, and SWAP1–SWAP16 are generated dynamically from their opcode ranges rather than stored in the static map.

Summary

Functions

dup?(op)

@spec dup?(non_neg_integer()) :: boolean()

info(op)

@spec info(non_neg_integer()) :: {:ok, map()} | {:error, :unknown_opcode}

push?(op)

@spec push?(non_neg_integer()) :: boolean()

push_bytes(op)

@spec push_bytes(non_neg_integer()) :: non_neg_integer()

swap?(op)

@spec swap?(non_neg_integer()) :: boolean()