Open Bug 1850077 Opened 1 year ago Updated 1 year ago

Replace XPCJSRuntime::mStrIDs with well-known atom or extended well-known atom

Categories

(Core :: XPConnect, task, P3)

task

Tracking

()

People

(Reporter: arai, Unassigned)

References

(Depends on 2 open bugs)

Details

Bug 1848322 is going to make the WellKnownAtomId public, and also Bug 1848278 is going to make the well-known atoms extensible.
XPConnect is currently using their own set of frequently used PropertyKeys, but it can be replaced with either of them.

Some strings used there already exists in WellKnownAtomId, which means we can skip unnnecessary atomization steps.

https://searchfox.org/mozilla-central/rev/07548591c7125357ea27e7c2dbe9d610ea2d8f35/js/xpconnect/src/XPCJSRuntime.cpp#100-103,114,117-119

const char* const XPCJSRuntime::mStrings[] = {
    "constructor",      // IDX_CONSTRUCTOR
    "toString",         // IDX_TO_STRING
    "toSource",         // IDX_TO_SOURCE
...
    "eval",             // IDX_EVAL
...
    "length",           // IDX_LENGTH
    "name",             // IDX_NAME
    "undefined",        // IDX_UNDEFINED
...

and some others can be done in single place, which will improve the locality.

You need to log in before you can comment on or make changes to this bug.