Closed Bug 1624793 Opened 5 years ago Closed 5 years ago

Simplify MThrow

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(3 files)

Ion code for JSOp::Throw is complicated. We can clean this all up by making MThrow a plain, non-control instruction with its own resume point and then use MUnreachable as the control instruction terminating the block.

The changes:

  • Make MThrow a non-control-instruction (followed by the MUnreachable control instruction).
  • This allows us to remove the separate MNop and attach the resume point to MThrow itself.
  • WarpBuilder only allows resumeAfter() on effectful instructions, so make sure MThrow isEffectful() by giving it a store AliasSet.

We can now easily terminate the block for JSOp::ThrowSetConst too.

In theory we could also terminate the block after the MThrowRuntimeLexicalError
added in IonBuilder::addLexicalCheck, but because that depends on type information
instead of being a static property of the bytecode I'm not completely sure it's
always safe (considering arguments/definite-properties analysis, for example).

Depends on D68164

Just a drive-by change to be more consistent with JSOp::Throw and JSOp::ThrowMsg.
It also results in slightly more compact code in Baseline Interpreter and JIT.

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f0a1f1eade8b part 1 - Simplify MThrow and IonBuilder::visitThrow. r=iain https://hg.mozilla.org/integration/autoland/rev/635cc9ec177c part 2 - Do the same thing for MThrowRuntimeLexicalError. r=iain https://hg.mozilla.org/integration/autoland/rev/f72280a54c6e part 3 - Handle JSOp::ThrowSetConst in BytecodeFallsThrough. r=iain
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: