Closed Bug 1704744 Opened 1 year ago Closed 1 year ago

Add ShapeProperty and start using it for property lookups

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(11 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

This bug will add a ShapeProperty class that stores a property's attributes and slot number. Property lookups will return a ShapeProperty or Maybe<ShapeProperty>.

A nice side-effect of this is that PropertyResult will store a ShapeProperty instead of the current Shape* so it will no longer need rooting (because ShapeProperty is not a GC thing).

At this point it's just a wrapper around the Shape, but that will change in a later
part of this stack.

Some callers now need to create a ShapeProperty first. This is a bit ugly but will be
tidied up in later patches when they use ShapeProperty more.

Depends on D111802

This is preparing for moving it to an internal header in the next patch.

Depends on D111803

This way it can use the internal ShapeProperty type in the next patch.

Depends on D111804

Instead pass the HandleId from the callers.

Depends on D111808

This decouples ShapeProperty from Shape. It also no longer stores a GC pointer,
so we can now easily use it in the module bindings map.

Because ShapeProperty does not store the property's jsid, this removes a few assertions
that are now impossible to implement, for example in IsUninitializedLexicalSlot.

When we use ShapeProperty in a few more places we can remove some of the methods on Shape
that are similar to the ones on ShapeProperty.

Depends on D111809

It no longer stores any GC things.

Depends on D111810

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1566e6379e49
part 1 - Add ShapeProperty, use for lookupPure. r=jonco
https://hg.mozilla.org/integration/autoland/rev/ac54f1320ec9
part 2 - Use ShapeProperty for NativeObject::lookup. r=jonco
https://hg.mozilla.org/integration/autoland/rev/07409ca0230a
part 3 - Use ShapeProperty for getter/setter methods on NativeObject. r=jonco
https://hg.mozilla.org/integration/autoland/rev/1f1de8821c81
part 4 - Move JS::PropertyResult to the js namespace. r=jonco
https://hg.mozilla.org/integration/autoland/rev/c8e1d2e7ee99
part 5 - Move PropertyResult to an internal vm/PropertyResult.h header. r=jonco
https://hg.mozilla.org/integration/autoland/rev/642e059b633f
part 6 - Use ShapeProperty for PropertyResult. r=jonco
https://hg.mozilla.org/integration/autoland/rev/c50f3fb04aa3
part 7 - Use ShapeProperty more in the CacheIR code. r=jonco
https://hg.mozilla.org/integration/autoland/rev/9715e3dfb584
part 8 - Use ShapeProperty more for GetExistingProperty/SetExistingProperty. r=jonco
https://hg.mozilla.org/integration/autoland/rev/d67ea8672eea
part 9 - Stop getting the jsid from the ShapeProperty in EmitCallGetterResultGuards. r=jonco
https://hg.mozilla.org/integration/autoland/rev/1d2a20e9fa43
part 10 - Stop storing the property's Shape* in ShapeProperty. r=jonco
https://hg.mozilla.org/integration/autoland/rev/4560ff4a728b
part 11 - Remove GC rooting for PropertyResult. r=jonco
You need to log in before you can comment on or make changes to this bug.