Closed Bug 1850115 Opened 1 year ago Closed 9 months ago

Stop using IdToFunctionName in hot code

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED DUPLICATE of bug 1858040

People

(Reporter: arai, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Whiteboard: [sp3])

while looking into bug 1846110 with bug 1848278 patch applied, I spotted that IdToFunctionName takes some amount of time in CreateInterfaceObject.

https://searchfox.org/mozilla-central/rev/479f4762b8c537892269dbf4442dd33cc01a525c/js/src/vm/PropertyAndElement.cpp#105,115,132

static bool DefineAccessorPropertyById(JSContext* cx, JS::Handle<JSObject*> obj,
...
                             IdToFunctionName(cx, id, FunctionPrefixKind::Get));
...
                             IdToFunctionName(cx, id, FunctionPrefixKind::Set));

the property name itself can be defined with the extended-known atom, but the accessor names need "get " and "set " prefixes, and it's not represented in the JSPropertySpec, which means we perform StringBuffer operations and atomization there.

maybe we can have special extension to pre-atomize accessor names and point them from JSPropertySpec?

Depends on: 1850197

Some part can be solved by bug 1850115 and bug 1850344, which pre-calculates accessor names for interface objects.

Whiteboard: [sp3]

This is solved by bug 1858040, which lazifies the accessor name calculation

Status: NEW → RESOLVED
Closed: 9 months ago
Duplicate of bug: 1858040
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.