Closed Bug 1761755 Opened 2 years ago Closed 2 years ago

Add JSOp::IsNullOrUndefined to replace BytecodeEmitter::emitPushNotUndefinedOrNull

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(3 files)

In BytecodeEmitter::emitPushNotUndefinedOrNull we emit the equivalent of x !== undefined && x !== null. This bloats the bytecode for for-of, iterator closing, optional chaining, etc quite a lot. It probably makes sense to add a separate bytecode op for null-or-undefined testing.

This reduces the amount of bytecode emitted for optional chaining and iterator closing.

Depends on D142204

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2bd0d33b0e1c
part 1 - Add JSOp::IsNullOrUndefined. r=arai
https://hg.mozilla.org/integration/autoland/rev/a460ae7807f0
part 2 - Replace BytecodeEmitter::emitPushNotUndefinedOrNull with JSOp::IsNullOrUndefined. r=arai
https://hg.mozilla.org/integration/autoland/rev/79f4d29fb759
part 3 - Remove unnecessary IfEmitter in OptionalEmitter::emitJumpShortCircuit. r=arai
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
Regressions: 1764715
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: