Closed Bug 1693483 Opened 3 months ago Closed 3 months ago

Move TypedObject TypeDescr from ObjectGroup to the object itself


(Core :: JavaScript Engine, task, P3)




87 Branch
Tracking Status
firefox87 --- fixed


(Reporter: jandem, Assigned: jandem)



(Keywords: perf-alert)


(3 files)

The TypeDescr is currently stored in the ObjectGroup. The goal in this bug is to move the descriptor to the TypedObject itself. This will add a word to each TypedObject, but it will allows us to remove the group in bug 1689413.

So we're just changing the TypedObject header from {group, shape} => {group, shape, typeDescr} => {shape, typeDescr}.

When we had unboxed objects, not every object had a shape so derived classes had
to take care of tracing the shape. Now that every object has a shape again we can
simplify this.

The next patch will (temporarily) change this to OBJECT2.

Depends on D105606

To prepare for ObjectGroup removal, this adds the TypeDescr to the TypedObject
itself instead of storing it in the group.

The OutlineTypedObject AllocKind is changed from OBJECT0 to OBJECT2 to be able
to store the extra value. Once we remove the group from JSObject this will be
changed back, at that point the TypeDescr* replaces the group so there will be no
size increase.

Typed objects are currently only used for Wasm GC. Once they're more stable and
perf-sensitive, we can consider optimizing them better by potentially moving the
TypeDescr into the Shape etc. Short-term this patch makes it much easier for us
to change the object representation for all other objects.

Depends on D105607

Pushed by
part 1 - Clean up object shape tracing. r=jonco
part 2 - Use a constant for OutlineTypedObject AllocKind, assert its size is correct. r=jonco
part 3 - Move TypeDescr from ObjectGroup to TypedObject. r=iain,rhunt
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch

== Change summary for alert #29056 (as of Thu, 04 Mar 2021 10:31:05 GMT) ==


Ratio Suite Test Platform Options Absolute values (old vs new)
0.25% Base Content JS linux1804-64-shippable 2,514,934.15 -> 2,508,624.00
0.24% Base Content JS linux1804-64-shippable 2,514,509.00 -> 2,508,357.33

For up to date results, see:

Keywords: perf-alert
You need to log in before you can comment on or make changes to this bug.