Skip to main content

predecode

Function predecode 

Source
pub fn predecode(
    code: &[u8],
    bitmask: &[u8],
    jump_table: &[u32],
) -> Vec<PreDecodedInst>
Expand description

Pre-decode all instructions from raw code+bitmask into a flat array.

Three passes:

  1. Decode each instruction (opcode, args, pc, next_pc)
  2. Identify gas block boundaries (branch targets, post-terminators, jump table)
  3. Compute gas cost for each gas block start