Closed
Bug 1009664
Opened 11 years ago
Closed 11 years ago
Remove duplicate slot initialization when we cannot bail
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: terrence, Assigned: jandem)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
terrence
:
review+
|
Details | Diff | Splinter Review |
Currently, ion's object allocation and init code will initialize all slots with undefined. In at least one hot path in raytrace (and probably others), this leads to initialization with undefined, immediately followed by the client code re-initializing the slots with the intended values. We should be able to easily detect initialization patterns that cannot bail before all slots have been initialized and elide the allocator's initialization in those cases. In bug 969012, removing a single instruction in this path was worth 3000 on raytrace, so removing 3 more should be a substantial win.
Flags: needinfo?(jdemooij)
Assignee | ||
Comment 1•11 years ago
|
||
This patch looks for StoreFixedSlot instructions following NewObject/CreateThisWithTemplate etc, and if all fixed slots are initialized we don't initialize the slots to undefined.
Incremental GC complicates this a bit, because StoreFixedSlot may have a pre-barrier that looks at the old slot value (garbage if we don't initialize the slots to undefined).
This patch is indeed a nice win on Octane-raytrace: at least 7000 points on my machine.
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Attachment #8422543 -
Flags: review?(terrence)
Flags: needinfo?(jdemooij)
Assignee | ||
Updated•11 years ago
|
Attachment #8422543 -
Flags: review?(terrence)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8422543 -
Attachment is obsolete: true
Attachment #8422992 -
Flags: review?(terrence)
Reporter | ||
Comment 3•11 years ago
|
||
Comment on attachment 8422992 [details] [diff] [review]
Patch
Review of attachment 8422992 [details] [diff] [review]:
-----------------------------------------------------------------
Very nice! r=me
::: js/src/jit/IonMacroAssembler.cpp
@@ +750,5 @@
> uint32_t nslots = templateObj->lastProperty()->slotSpan(templateObj->getClass());
> if (nslots == 0)
> return;
>
> uint32_t nfixed = Min(templateObj->numFixedSlots(), nslots);
Please make this templateObj->numUsedFixedSlots();
Attachment #8422992 -
Flags: review?(terrence) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
This doesnt appear to have much effect on octane-raytrace on machine 11 on AWFY... or am i reading it wrong?
Comment 6•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to mayankleoboy1 from comment #5)
> This doesnt appear to have much effect on octane-raytrace on machine 11 on
> AWFY... or am i reading it wrong?
I see about 2000 points on AWFY 32-bit, it's less than what I'm seeing locally, no idea why. I double checked this before I pushed the patch.
You need to log in
before you can comment on or make changes to this bug.
Description
•