Closed Bug 1361125 Opened 7 years ago Closed 7 years ago

Handle slot indices meaning slightly different thing on DOM proxies vs DOM non-proxies

Categories

(Core :: JavaScript Engine: JIT, enhancement)

53 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(3 files)

We have code in CodeGenerator::visitGetDOMProperty/visitGetDOMMemberV/visitGetDOMMemberT that assumes that reserved slot indices for DOM objects correspond to fixed slot indices as long as the index is NativeObject::MAX_FIXED_SLOTS.

But that's not true for DOM proxies, because of the extra slot for the private.

We need to adjust this code to either not be reached for DOM proxies at all or take take into account the different slot indexing in proxies.
If we don't care about inlining this for now, we could just add TemporaryTypeSet::maybeProxy, like the maybeCallable method, and then check that in IonBuilder. maybeProxy can check clasp->isProxy().
That seems pretty reasonable for the moment.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
We do this for now because the Ion fast paths assume things about whether slots
are fixed or not, and how reserved slot indices map to fixed slot indices, that
are not true for proxies, because they have an extra reserved slot.
Attachment #8868394 - Flags: review?(jdemooij)
Attached patch Part 2, diff -wSplinter Review
Attachment #8868393 - Flags: review?(jdemooij) → review+
Comment on attachment 8868394 [details] [diff] [review]
part 2.  Disable Ion fast paths for DOM getters on proxies when the jitinfo indicates the value can live in a slot

Review of attachment 8868394 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, LGTM.
Attachment #8868394 - Flags: review?(jdemooij) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cc19302e6e0c
part 1.  Add a way to ask a TemporaryTypeSet whether it might contain proxies.  r=jandem
https://hg.mozilla.org/integration/mozilla-inbound/rev/556cd0250570
part 2.  Disable Ion fast paths for DOM getters on proxies when the jitinfo indicates the value can live in a slot.  r=jandem
https://hg.mozilla.org/mozilla-central/rev/cc19302e6e0c
https://hg.mozilla.org/mozilla-central/rev/556cd0250570
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: