-
Notifications
You must be signed in to change notification settings - Fork 809
Closed
Description
We already group by type in the binary format in BinaryInstWriter::mapLocalsAndEmitHeader
. That means we don't emit locals like this:
(local $a i32)
(local $b f64)
(local $c i32)
Instead all i32
s would be in sequence:
(local $a i32)
(local $c i32)
(local $b f64)
We do the same for reference types, but we could also easily group them separately from MVP types. That is, we could avoid this:
(local $a (ref null $A)
(local $b i32)
(local $c (ref null $C)
This would be better even though the reference types are different:
(local $a (ref null $A)
(local $c (ref null $C)
(local $b i32)
The benefit is that VMs have work to do that may be different for references versus MVP types. Putting all reference types in one contiguous block would let the VM clear them out more efficiently. For more details see WebAssembly/function-references#44 (comment)
Metadata
Metadata
Assignees
Labels
No labels