Closed Bug 1664617 Opened 3 months ago Closed 2 months ago

CacheIR support for DOM getters

Categories

(Core :: JavaScript Engine: JIT, task)

task

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: evilpie, Assigned: evilpie)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

I started looking into some of the DOM optimizations in IonBuilder and this seemed like the easiest one to do. Sadly it seems like it's also not hugely useful? The WebIDL [StoreInSlot] attribute is only used for a handful of properties.
Some of those are probably very important like window.document. However in that case the optimization doesn't even seem to work, because the WindowProxy isn't a native object. I am not sure yet if IonBuilder can use this optimization in that case.

I am not quite sure why we need MGetDOMMember either, as claimed by this comment. MSetDOMProperty seems to have no alias set, so it should alias everything.

Depends on D90010

Assignee: nobody → evilpies
Attachment #9175356 - Attachment description: Bug 1664617 - WIP: DOM AlwaysInSlot support for CacheIR. → Bug 1664617 - WIP: Support calling DOM getters in CacheIR
Attachment #9175355 - Attachment is obsolete: true

On Jan suggestions I instead implemented support for DOM getters in general. Try actually looks quite good: https://treeherder.mozilla.org/#/jobs?repo=try&revision=578854e0531da8983784871581c7e209b19a1afe (On crash in JS related to realms, not sure if this is a real problem)

It would be better to call the getter in the JitInfo directly, but I had some difficulties implementing the call and fake frame setup. With this work done adding transpiler support to Warp should hopefully be easy. MGetDomProperty uses operands for the guards in Ion, not sure if we need that. We don't do anything like that for other stuff in Warp that also requires dominating guard instructions.

MGetDOMProperty wants the realm as a parameter, so it probably has to be added to CacheIR.
This is a bit faster in shell micro-benchmark.

Depends on D90011

Summary: CacheIR support for DOM AlwaysInSlot optimization → CacheIR support for DOM getters
Attachment #9175355 - Attachment is obsolete: false
Blocks: WarpBuilder
Attachment #9175356 - Attachment description: Bug 1664617 - WIP: Support calling DOM getters in CacheIR → Bug 1664617 - Support calling DOM getters in CacheIR
Attachment #9175493 - Attachment description: Bug 1664617 - WIP: Transpile CallDOMGetterResult → Bug 1664617 - Transpile CallDOMGetterResult
Blocks: 1665396
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6d8ab1990050
FakeDOMObject isAlwaysInSlot getter. r=jandem
https://hg.mozilla.org/integration/autoland/rev/562fc1b12bf2
Support calling DOM getters in CacheIR r=jandem
https://hg.mozilla.org/integration/autoland/rev/b7992da0b3b3
Transpile CallDOMGetterResult r=jandem

The new DOM getter (and setter) support in CacheIR is now only used when Warp is enabled, because otherwise we might break the BaselineInspector usage by Ion.

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