Add fast path for PlainObject allocation
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(8 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 |
PlainObjects account for a large number of object allocations. We should move this out of the generic allocation code and add a fast path for all PlainObject allocations. This lets us cache the shape in the global for plain objects with default prototype.
This will also bypass the NewObjectCache for these allocations, getting us closer to removing it.
Assignee | ||
Comment 1•3 years ago
|
||
Other callers were recently changed to call PlainObject::createWithShape instead.
We can also do that for the remaining caller and then remove CopyTemplateObject.
Drive-by change: assert we don't reuse dictionary shapes for new objects.
Assignee | ||
Comment 2•3 years ago
|
||
NewBuiltinClassInstance<PlainObject>
=>NewPlainObject
NewObjectWithGivenProto<PlainObject>
=>NewPlainObjectWithProto
Depends on D123456
Assignee | ||
Comment 5•3 years ago
|
||
Drive-by clean-up: GuessObjectGCKind(0)
returns AllocKind::OBJECT4
, this is
equivalent to NewObjectGCKind()
that we already use elsewhere for this.
Depends on D123459
Assignee | ||
Comment 7•3 years ago
|
||
Because plain objects are created with different AllocKinds, we use an array of
shapes for this. A bit annoying but because plain objects are so common it's
probably worth handling all of them.
Depends on D123461
Assignee | ||
Comment 8•3 years ago
|
||
This is faster for callers that already know the AllocKind.
Depends on D123462
Comment 9•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c30a66b773cc
https://hg.mozilla.org/mozilla-central/rev/a513b36de59c
https://hg.mozilla.org/mozilla-central/rev/c893b5769016
https://hg.mozilla.org/mozilla-central/rev/6fdb51703983
https://hg.mozilla.org/mozilla-central/rev/9ad88ab90367
https://hg.mozilla.org/mozilla-central/rev/8fbf291d0412
https://hg.mozilla.org/mozilla-central/rev/02f18eaee023
https://hg.mozilla.org/mozilla-central/rev/6c26dce573db
Description
•