Closed Bug 1521491 Opened 6 years ago Closed 6 years ago

Store IC index in jump target ops

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

(Whiteboard: [overhead:38k])

Attachments

(5 files)

I have some patches to store the IC index (= number of JOF_IC ops) in jump target ops. The interpreter will use this to set the frame's ICEntry* pointer at jump target ops and then it will just bump this pointer after each JOF_IC op. This way the interpreter can use Baseline ICs with minimal overhead compared to the Baseline JIT.

This is easier now that the BCE prologue/main split is gone (bug 1284719) and we can assert correctness in ICScript::create.

Summary: Store ic index in jump target ops → Store IC index in jump target ops

The bytecode emitter used to call checkTypeSet for each JOF_TYPESET op. Despite
correctness asserts in the TypeScript code, this was pretty error prone. Doing
something similar for JOF_IC ops would have made it worse.

The solution is to move this check to BytecodeEmitter::emitCheck (called for
each opcode we emit), so we don't have to worry about this anymore.

Depends on D17113

The interpreter will use this to set the frame's ICEntry* pointer at jump target
ops and then it will just bump this pointer after each JOF_IC op. This way the
interpreter can use Baseline ICs with minimal overhead compared to the Baseline
JIT.

Depends on D17114

Priority: -- → P2
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2058451bd944 part 1 - Stop treating JSOP_ENDITER as a jump target op. r=nbp https://hg.mozilla.org/integration/autoland/rev/92a00136c2fd part 2 - Stop treating JSOP_TRY as a jump target op. r=nbp https://hg.mozilla.org/integration/autoland/rev/a9a95a138e04 part 3 - Fold BytecodeEmitter::checkTypeSet into BytecodeEmitter::emitCheck. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/159930eacfd7 part 4 - Store IC index in jump target ops. r=tcampbell
Flags: needinfo?(jdemooij)
Keywords: leave-open
Flags: needinfo?(jdemooij)

Silly rooting hazard while emitting JSOP_LABEL. Maybe now is a good time to stop using JOF_JUMP for JSOP_LABEL.

JSOP_LABEL isn't a jump instruction at all. This patch adds JOF_CODE_OFFSET and
uses it for JSOP_LABEL. This lets us simplify some code and avoids a rooting
hazard with the next patch.

Attachment #9037943 - Attachment description: Bug 1521491 part 4 - Store IC index in jump target ops. r?tcampbell! → Bug 1521491 part 5 - Store IC index in jump target ops. r?tcampbell!
Flags: needinfo?(jdemooij)
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/731a43e841ab part 4 - Stop using JOF_JUMP for JSOP_LABEL. r=tcampbell
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/037f2dd3a63f part 5 - Store IC index in jump target ops. r=tcampbell
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Oh wait, parts 4 and 5 still need to merge to m-c but didn't yet because of the big ChromeUtils.import changes. Should happen soon though.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla67 → ---
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

It looks like there was a 38K base memory regression associated with this.

Jan, is this something we can work around or do we need to accept the regression?

Flags: needinfo?(jdemooij)
Whiteboard: [overhead:38k]

Bug 1523749 will gain back most of this regression, but some of it will probably remain for perf reasons.

What Ted said. We'll have to accept this one for now unfortunately.

Flags: needinfo?(jdemooij)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: