The Val struct is 16 bytes due to it needing to contain a v128 (f32x4) value. Additionally it contains FuncRef, which is a 12-byte value.
Supporting vector opts allows conformance with wasm 2.0 spec, but since the stack operates on slices of the Val struct for values, we're paying 2x the overhead to copy values around in most cases, since the vast majority of wasm deals with 32 or 64-bit data, not 128. We should switch to a smaller 8-byte primitive-based stack to avoid that overhead. V128 values can span 2 8-byte values. The type-generic instructions like Local_Get, etc can become strongly typed thanks to the validation step's ability to determine the type of information on top of the stack, which can then be stored in immediates to determine the appropriate type to use.
The Val struct is 16 bytes due to it needing to contain a v128 (f32x4) value. Additionally it contains
FuncRef, which is a 12-byte value.Supporting vector opts allows conformance with wasm 2.0 spec, but since the stack operates on slices of the Val struct for values, we're paying 2x the overhead to copy values around in most cases, since the vast majority of wasm deals with 32 or 64-bit data, not 128. We should switch to a smaller 8-byte primitive-based stack to avoid that overhead. V128 values can span 2 8-byte values. The type-generic instructions like Local_Get, etc can become strongly typed thanks to the validation step's ability to determine the type of information on top of the stack, which can then be stored in immediates to determine the appropriate type to use.