+8
−13
Loading
Bug 1790626 - wasm: Move 'immediate' type representation to FuncType and only use with call_indirect. r=yury TypeIdDesc describes how to load the 'type id' for any type. Right now the 'type id' is an immediate integer for small function types, a *FuncType for larger function types, and *RttValue for everything else. The immediate integer case is an optimization for signature checks in call_indirect. We can simplify our code by adding an 'immediateType_' field to `FuncType` which stores an alternate representation of the function type (if any) that can be used with call_indirect. Then `TypeIdDesc`/`TypeDefWithId` are not needed during instantiation anymore and we can just pass `TypeDefVector` from compilation to runtime. As a drive-by fix, some code for setting up the global data are of Instance was simplified to allocate whole contiguous areas, instead of looping, in some cases. Some uses of TypeIdDesc still remain after this commit, but they are only in codegen for figuring out how to emit signature checks. The class is renamed and simplified to CallIndirectId to represent this. Differential Revision: https://phabricator.services.mozilla.com/D157385