Free to LearnSystems fieldbooksCode workshop
Fieldbooks/WebAssembly/Lesson 06
Lesson 06 of 08 · Course index

Lesson 06 / Memory & calls

Which host function can run?

Your plug-in may call one of two functions supplied by the app. Such a function is a host import. The sandbox limits the plug-in to the listed functions. A table stores them in numbered slots. call_indirect takes a slot number from the stack and requests a signature, the input and result types it expects. Both functions here return their input. Choose a slot that can safely accept the value read from memory.

+ Figure 06
Two host functions in slots 0 and 1 with different input and result types.
A call through a numbered slot

1 · The big idea

To do useful work (like printing text or sending a network reply), a sandboxed plugin calls functions supplied by the host app—called host imports. When calling through a dynamic index (like a function pointer in C or virtual method in C++/Rust), WebAssembly uses call_indirect.

call_indirect looks up a numbered slot inside a fixed function table and checks two things in order: first, the verifier checks statically that the stack has the argument types and an i32 slot index; second, at runtime the runner checks that the slot exists and that the target function’s actual signature (inputs → outputs) matches the requested signature.

Even if the stack passes verification, calling slot 0 when slot 0 expects i64 while the caller requested i32 traps cleanly before entering the host function.

2 · Worked step-by-step example

Step-by-step worked trace for lesson 6call_indirect Checks Table Slot Signature Before Entering FunctionStack: [0 i32, 0 slot]Verifier: PASSTable[0] = echo64i64->i64 != i32->i32Table[1] = echo32Fix: slot 1 -> 1 callSlot 0 traps cleanly with 0 host calls; slot 1 matches echo32.
Worked Example: Reading Slot 0 From Memory and Calling Table[0]
  1. Load 4 zero bytes from address 65532 → pushes argument 0 (i32), then push slot 0 (i32).
  2. Verifier: Sees [i32 arg, i32 slot] matching requested (i32) → (i32) → passes!
  3. Runner: Looks up table slot 0, which holds echo64 (i64 → i64).
  4. Actual signature i64 → i64 ≠ requested i32 → i32 → traps before calling! Switching to slot 1 (echo32) succeeds.
Result: Indirect calls enforce both static argument types and exact runtime signature matching on the target table slot.

Read the case

Read four bytes at 65532 → i32 value 0

Slot 0 · echo64 · i64 in, i64 out

Slot 1 · echo32 · i32 in, i32 out

Request · slot 0 · i32 in, i32 out

3 · Bytecode stepper (explore before quizzing)

First check the stack against the requested signature. At runtime, look up the slot, check that it exists and holds a function, then compare the function’s signature. Only a match permits the call. The earlier memory read has its own bounds check.

Bytecode is the list of machine instructions below. Step through Check types and Run values before answering the prediction below.

Instruction step
Ready0 / 4

Start with an empty stack. Read the instructions in order.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

[ ] Empty

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.const1 / 4

Push the type i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.load2 / 4

Check the address and value types. The actual address is checked during execution.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.const3 / 4

Push the type i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

call_indirect4 / 4

Check the table index and argument types. The selected slot is checked during execution.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

Types accepted
Instruction step
Ready0 / 4

Start with an empty stack and one page of zero bytes.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

[ ] Empty

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

i32.const1 / 4

Push the value 65532.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 65532

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

i32.load2 / 4

The entire range fits. Read four bytes as an i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Base 65532 + offset 0 = 65532. Four bytes need [65532, 65536). The whole range fits.

i32.const3 / 4

Push the value 0.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0i32 0

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

call_indirect4 / 4

Indirect call signature mismatch at slot 0 (echo64).

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 0
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0i32 0

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

Run trapped

4 · Make a prediction

The read fits. Does the checker or the runner stop this call?

Compare your prediction. The slot number is i32, exactly the required type. The checker also sees an i32 argument for the requested signature.

Compare your prediction. A table call checks the selected function’s signature before calling it. It cannot change an i32 argument into i64.

Prediction confirmed. The selected slot exists, but echo64 takes and returns i64. Its signature differs from the requested i32 input and result.

5 · Repair the program

Read the last four bytes of the page and complete one host call with the resulting i32.
Repair confirmed. The read fits exactly. Slot 1 names echo32, which accepts the i32 and returns it.
Types acceptedRun finishedCalls 1Writes 0
Step through this edit
Instruction step
Ready0 / 4

Start with an empty stack. Read the instructions in order.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

[ ] Empty

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.const1 / 4

Push the type i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.load2 / 4

Check the address and value types. The actual address is checked during execution.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.const3 / 4

Push the type i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

call_indirect4 / 4

Check the table index and argument types. The selected slot is checked during execution.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

Types accepted
Instruction step
Ready0 / 4

Start with an empty stack and one page of zero bytes.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

[ ] Empty

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

i32.const1 / 4

Push the value 65532.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 65532

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

i32.load2 / 4

The entire range fits. Read four bytes as an i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Base 65532 + offset 0 = 65532. Four bytes need [65532, 65536). The whole range fits.

i32.const3 / 4

Push the value 1.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0i32 1

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

call_indirect4 / 4

Slot 1 matches. echo32 returns its argument.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

Run finished
Inspect this edit. Only slots 0 and 1 exist. Lookup at slot 2 stops before a function is entered.
Types acceptedRun trappedCalls 0Writes 0
Step through this edit
Instruction step
Ready0 / 4

Start with an empty stack. Read the instructions in order.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

[ ] Empty

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.const1 / 4

Push the type i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.load2 / 4

Check the address and value types. The actual address is checked during execution.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.const3 / 4

Push the type i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

call_indirect4 / 4

Check the table index and argument types. The selected slot is checked during execution.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

Types accepted
Instruction step
Ready0 / 4

Start with an empty stack and one page of zero bytes.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

[ ] Empty

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

i32.const1 / 4

Push the value 65532.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 65532

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

i32.load2 / 4

The entire range fits. Read four bytes as an i32.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Base 65532 + offset 0 = 65532. Four bytes need [65532, 65536). The whole range fits.

i32.const3 / 4

Push the value 2.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0i32 2

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

call_indirect4 / 4

Indirect call table index out of bounds: 2.

Bytecode instruction address

  1. 00i32.const 65532
  2. 01i32.load
  3. 02i32.const 2
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 0i32 2

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

Run trapped
Inspect this edit. The function would match. The read crosses the page edge first, so the runner never reaches the call.
Types acceptedRun trappedCalls 0Writes 0
Step through this edit
Instruction step
Ready0 / 4

Start with an empty stack. Read the instructions in order.

Bytecode instruction address

  1. 00i32.const 65533
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

[ ] Empty

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.const1 / 4

Push the type i32.

Bytecode instruction address

  1. 00i32.const 65533
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.load2 / 4

Check the address and value types. The actual address is checked during execution.

Bytecode instruction address

  1. 00i32.const 65533
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

i32.const3 / 4

Push the type i32.

Bytecode instruction address

  1. 00i32.const 65533
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

call_indirect4 / 4

Check the table index and argument types. The selected slot is checked during execution.

Bytecode instruction address

  1. 00i32.const 65533
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
–65528
–65529
–65530
–65531
–65532
–65533
–65534
–65535
×65536+

Type checking does not read or write bytes.

Types accepted
Instruction step
Ready0 / 2

Start with an empty stack and one page of zero bytes.

Bytecode instruction address

  1. 00i32.const 65533
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

[ ] Empty

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

i32.const1 / 2

Push the value 65533.

Bytecode instruction address

  1. 00i32.const 65533
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 65533

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.

i32.load2 / 2

Memory access out of bounds: [65533, 65537) exceeds 65536 bytes.

Bytecode instruction address

  1. 00i32.const 65533
  2. 01i32.load
  3. 02i32.const 1
  4. 03call_indirect (i32) → i32

Operand stack top at right

i32 65533

Control label stack innermost at right

function h=0

Each label keeps its entry height (h = stack height when the block opened).

Linear memory

Tail of page 0
0065528
0065529
0065530
0065531
0065532
0065533
0065534
0065535
×65536+

Base 65533 + offset 0 = 65533. Four bytes need [65533, 65537). The end exceeds 65536. No bytes move.

Run trapped

Code workshop

Implement requireSlot in my-rules.mjs. Check the selected table slot and its signature before allowing the call. The first command makes your own copy of the starter if needed. Edit the named function, then run the second command.

cp -n workshop/starter.mjs my-rules.mjs
node workshop/check.mjs 6 ./my-rules.mjs
Optional worked example in a separate file

Build the lookup for this table. Each entry here stands for one signature. Try slot 0 and then slot 1.

function requireSlot(table, slot, signature) {
  const actual = table[slot >>> 0]
  if (actual == null) throw Error("missing function")
  if (actual !== signature) throw Error("wrong signature")
  return actual
}
console.log(requireSlot(["i64→i64", "i32→i32"], 1, "i32→i32"))

Slot 1 passes. In the supplied engine, a signature is a pair of type lists. Match both lists in order before the host call count goes up.

Key Takeaway & Next Up

call_indirect pairs static stack checking with runtime table bounds and signature checks so plugins can never jump into functions with mismatched arguments.

Next: Next, we compare two classic ways to implement the bytecode verifier itself: one-pass streaming vs. two-pass graphs.