-
- Downloads
Bug 1774836 - Add WasmStructObject with inline and outline data. r=rhunt.
This refactors the wasm struct representation to use a hybrid in-line/out-of-line representation and does other cleanups. Changes: * Rename InlineTypedObject (and related names) to WasmStructObject. * Rename OutlineTypedObject (and related names) to WasmArrayObject. * WasmStructObject: add in-line and out-of-line areas and padding to ensure the inline area is 8-aligned. * WasmStructObject_MaxInlineBytes: remove implicit assumptions that the size of the struct prior to the first data field is equal to sizeof(TypedObject), that being the parent class. * WasmStructObject and `class StructLayout`: add logic, comments and assertions to deal with the in-line/out-of-line split. * WasmStructObject: new functions getDataByteSizes, fieldOffsetToAreaAndOffset, fieldOffsetToAddress * Baseline compiler cases for emitStruct*: have been updated accordingly -- a significant simplification. - emitGcStructSet has changed slightly, so as to take `areaBase` (a RegPtr) and `areaOffset` (a fixed offset). The caller must set those up correctly for the access; it is not for emitGcStructSet itself to decide whether this is an in-line or out-of-line access. * InlineTypedObject::create (a.k.a. WasmStructObject::create) has been manually inlined into its caller, to reduce the complexity of initialisation code. * New `class RttValue::PropOffset` used for carrying data between RttValue::lookupProperty to + TypedObject::loadValue. May be removed in bug 1785776 rework. * SymbolicAddress::WasmStructObjectClass (was ::InlineTypedObjectClass) is now unnecessary, hence is deleted. The logic and code for OutlineTypedObject (a.k.a. WasmArrayObject) is unchanged. The above refactoring does however make it possible to do some cleanups to the array code and to reduce the complexity and overall manual-RTTI-style of `class TypedObject`. These are tracked in followup bug 1785776. Differential Revision: https://phabricator.services.mozilla.com/D155670
Showing
- js/src/jit-test/tests/wasm/gc/structs.js 3 additions, 0 deletionsjs/src/jit-test/tests/wasm/gc/structs.js
- js/src/vm/JSObject.cpp 7 additions, 7 deletionsjs/src/vm/JSObject.cpp
- js/src/wasm/TypedObject-inl.h 13 additions, 3 deletionsjs/src/wasm/TypedObject-inl.h
- js/src/wasm/TypedObject.cpp 118 additions, 85 deletionsjs/src/wasm/TypedObject.cpp
- js/src/wasm/TypedObject.h 190 additions, 46 deletionsjs/src/wasm/TypedObject.h
- js/src/wasm/WasmBCClass.h 10 additions, 2 deletionsjs/src/wasm/WasmBCClass.h
- js/src/wasm/WasmBaselineCompile.cpp 77 additions, 80 deletionsjs/src/wasm/WasmBaselineCompile.cpp
- js/src/wasm/WasmBuiltins.cpp 0 additions, 8 deletionsjs/src/wasm/WasmBuiltins.cpp
- js/src/wasm/WasmBuiltins.h 0 additions, 1 deletionjs/src/wasm/WasmBuiltins.h
- js/src/wasm/WasmFrameIter.cpp 0 additions, 2 deletionsjs/src/wasm/WasmFrameIter.cpp
- js/src/wasm/WasmInstance.cpp 34 additions, 34 deletionsjs/src/wasm/WasmInstance.cpp
- js/src/wasm/WasmSerialize.cpp 2 additions, 2 deletionsjs/src/wasm/WasmSerialize.cpp
- js/src/wasm/WasmTypeDef.cpp 9 additions, 0 deletionsjs/src/wasm/WasmTypeDef.cpp
- js/src/wasm/WasmTypeDef.h 16 additions, 2 deletionsjs/src/wasm/WasmTypeDef.h
Loading
Please register or sign in to comment