Skip to content
Snippets Groups Projects
Commit 5dc19236 authored by Julian Seward's avatar Julian Seward
Browse files

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
parent a0fd7922
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment