Closed Bug 1790012 Opened 3 years ago Closed 3 years ago

Replace NativeObject::updateSlotsForSpan with more specialized functions

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: jandem, Assigned: jandem)

Details

Attachments

(7 files)

updateSlotsForSpan is very generic: it's used for both adding and removing slots. We can simplify and optimize some code in this area by using more specialized functions for the different cases.

Rename setShapeAndUpdateSlotsForNewSlot to setShapeAndAddNewSlot and use a
faster path for the case where we don't need to (re)allocate dynamic slots.
Move more of the growSlots code out of line.

The goal is to get rid of setShapeAndUpdateSlots in later patches.

Depends on D156953

Rename setShapeAndUpdateSlots to setShapeAndAddNewSlots to make it clearer
we're only adding slots.

This duplicates some code from updateSlotsForSpan, but that function will be
removed in a later patch.

Depends on D156955

ensureSlotsForDictionaryObject will be removed in a later patch.

Depends on D156956

mozilla::Array has release assertions for bounds checks and they show up
in some hot code paths. This is some of the hottest code in the engine so
switch to plain C++ arrays.

Depends on D156958

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bb97f5816720 part 1 - Optimize code for adding a single slot to an object. r=jonco https://hg.mozilla.org/integration/autoland/rev/f9bb1e81d184 part 2 - Use fast path for adding a slot in NativeObject::changeProperty. r=jonco https://hg.mozilla.org/integration/autoland/rev/198dbc501dcb part 3 - Use fast path for removing the last slot. r=jonco https://hg.mozilla.org/integration/autoland/rev/1f1189d91f59 part 4 - Don't use updateSlotsForSpan in setShapeAndUpdateSlots. r=jonco https://hg.mozilla.org/integration/autoland/rev/760fc689070a part 5 - Optimize adding a new slot to a dictionary object. r=jonco https://hg.mozilla.org/integration/autoland/rev/c459020035cc part 6 - Inline ensureSlotsForDictionaryObject/updateSlotsForSpan into sole caller. r=jonco https://hg.mozilla.org/integration/autoland/rev/4f53ae8e62ee part 7 - Stop using mozilla::Array in PropMap code. r=jonco
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: