Closed Bug 1847017 Opened 1 year ago Closed 1 year ago

Move the regexp and concat stubs from JitRealm to JitZone

Categories

(Core :: JavaScript Engine: JIT, task, P3)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [sp3])

Attachments

(5 files)

These stubs are pretty large and it'd be nice if we didn't need to regenerate them for each realm.

I think the main blocker for this is the regexp-match stub because it uses a template object. We can probably change this to use the MacroAssembler object allocation code that doesn't need a template object if we load the shape from the global.

Another issue is the RegExpStatics* we currently bake in. This would have to be loaded from the global.

I noticed while looking at bug 1846777 that the regexp-match stub always allocates a match result with 16 fixed elements, which is usually going to be overkill. While we're touching this code we could look into saving a little bit of memory there.

Depends on: 1847714

(In reply to Iain Ireland [:iain] from comment #2)

I noticed while looking at bug 1846777 that the regexp-match stub always allocates a match result with 16 fixed elements, which is usually going to be overkill. While we're touching this code we could look into saving a little bit of memory there.

That's a good point. If we rewrite this to use createArrayWithFixedElements we can fix that pretty easily and that seems worth doing regardless. I filed bug 1847714.

Priority: -- → P3
Blocks: sm-jits
Severity: -- → N/A
Depends on: 1847891
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED

This will let us share the code across realms.

The regexp stubs can be pretty large and this avoids re-generating them for each realm.

It also lets us remove JitRealm in a later patch because it's now empty.

Depends on D185910

We've migrated all shared stubs to JitZone or JitRuntime.

Depends on D185912

In MacroAssembler::checkAllocatorState we were checking if the realm has a
metadata hook, but that doesn't work if code is shared across realms.

This patch adds a counter to the zone so that we can check if any realm has a
metadata hook. We now also only check this for object allocations so that string
and bigint allocations can still use the fast path.

Depends on D185913

Attachment #9348370 - Attachment description: Bug 1847017 part 5 - Fix metadata hook when code is shared across realms. r?jonco! → Bug 1847017 part 5 - Fix check for metadata hook for code shared across realms. r?jonco!
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/74e34f523e79 part 1 - Change stubs to load RegExpStatics and match result shape at runtime. r=iain https://hg.mozilla.org/integration/autoland/rev/46ea212278dc part 2 - Move string/regexp stubs from JitRealm to JitZone. r=iain,jonco https://hg.mozilla.org/integration/autoland/rev/189960592ce4 part 3 - Change HasOffThreadIonCompile argument from realm to zone. r=jonco https://hg.mozilla.org/integration/autoland/rev/e9faa0ecf53d part 4 - Remove JitRealm. r=iain https://hg.mozilla.org/integration/autoland/rev/6853f3c9048b part 5 - Fix check for metadata hook for code shared across realms. r=jonco

"PERF" key word?

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

Attachment

General

Created:
Updated:
Size: