Lab 4 notes
call_bytecode_function
When initializing the localstate struct that will be passed
to interp_bytecode, keep these facts in mind:
- The array of bytes associated with a bytecode function consists of
a 4-byte header, followed by the first instruction in the function.
The pc field of the localstate struct is an offset
into this array, at which position interp_bytecode will
attempt to read an instruction.
- The sp field should be initialized to -1.
- localstate_alloc will initialize nlocal,
locals, nstack, and stack for you.