Try caching `isFixedSlot` in the megamorphic cache
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox112 | --- | fixed |
People
(Reporter: alexical, Assigned: jandem)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(2 files)
From Jan's comment:
I'm wondering if it makes sense to have an isFixedSlot flag in the megamorphic cache entries if we have the space for it.. Then we could also pre-subtract numFixed for dynamic slots and store an offset rather than slot index, when storing the entry in the table... Not sure how much it matters.
It probably won't move the needle a ton, but it's simple and seems like a strict improvement over what we have.
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
NI myself to do a quick experiment this week to see if it matters.
Assignee | ||
Comment 2•2 years ago
|
||
I'm looking into this at the moment. I think we can get rid of some instructions and have more compact code, but I haven't measured perf impact yet.
Assignee | ||
Comment 3•2 years ago
|
||
This makes our JIT code for the megamorphic cache lookup a bit more compact by
caching the slot's offset + isFixedSlot
flag in a single 32-bit value.
This improves some local micro-benchmarks a bit, but it's hard to see an improvement
on Speedometer. Maybe it improves some of the subtests a tiny bit and combined with
the shorter and simpler JIT code that might be good enough.
It's possible to go further and combine the load instruction for fixed vs dynamic,
and to replace the isFixedSlot
branch with a CMOV instruction, but that seemed to
be a bit harder on the CPU (the branch is probably quite predictable in practice)
so this is the more conservative approach.
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
Leaving this open to do the same for the setprop cache.
Comment 6•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
Probably either neutral on Speedometer or a tiny improvement on some subtests.
Assignee | ||
Updated•2 years ago
|
Comment 9•2 years ago
|
||
bugherder |
Description
•