Closed Bug 1838554 Opened 1 years ago Closed 2 days ago

Use an IC for JSOp::BuiltinObject

Categories

(Core :: JavaScript Engine: JIT, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: iain, Assigned: iain, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

We currently handle BuiltinObject in the baseline interpreter by generating a VM call to BuiltinObjectOperation, and in the baseline compiler by calling BuiltinObjectOperation during compilation to get the object, and then baking it in directly.

The interpreter implementation is slow. The compiler implementation doesn't play nicely with Bryan's work to share selfhosted baseline code, and also doesn't play nicely with my work to do offthread baseline compiles.

We can solve all these problems at once by using a baseline IC, much like we already do for GetIntrinsic.

Attachment #9339196 - Attachment description: WIP: Bug 1838554: Use an IC for JSOp::BuiltinObject → WIP: Bug 1838554 - Use an IC for JSOp::BuiltinObject
Blocks: 1930281
Attachment #9339196 - Attachment is obsolete: true

A GetIntrinsic IC will always produce the same result, so it looks up the result in the fallback stub and then attaches a trivial stub that returns the correct value. We can reuse the same idea for JSOp::BuiltinObject and JSOp::ImportMeta. This makes blinterp more efficient (because we only have to do the VM call to look up the result once), and works better for offthread baseline compilation (where we can't do the VM call inside the compiler and bake in the result).

In preparation, this patch renames the ICKind. The next two patches will update the ops.

Pushed by iireland@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/007ce442c413 Rename GetIntrinsic ICKind to LazyConstant r=jandem https://hg.mozilla.org/integration/autoland/rev/9eeaab44d7d2 Use an IC for JSOp::BuiltinObject r=jandem https://hg.mozilla.org/integration/autoland/rev/8cde9d09e842 Use an IC for JSOp::ImportMeta r=jandem

Between this bug and some pieces of bug 1930281, there are regressions on Jetstream2 on Windows, Linux and MacOS

12.3% on n-body-sp
6% on Richards-wasm
4.8% on crypto-aes
5% on date-formatxparb
9% on delta-blue-average

Could be the compilerWarmUpThreshold refactoring, although I don't see any issues with it looking at the patch again.

Some of these numbers are stable enough that we should be able to narrow it down with a few try pushes.

Flags: needinfo?(iireland)

(there may be some improvements on other sub-tests including SP3 too . Not validated yet by perf-sheriffs yet, so consider my comment as a unverified rumour)

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

Attachment

General

Created:
Updated:
Size: