Don't emit JSOP_INITELEM_ARRAY to set hole values

RESOLVED INVALID

Status

()

RESOLVED INVALID
2 years ago
a year ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Created attachment 8850933 [details] [diff] [review]
Patch

While reviewing bug 1346028 I noticed JSOP_INITELEM_ARRAY is a no-op when it's used to set the hole value (the array length is set by the JSOP_NEWARRAY op).

This patch changes the bytecode emitter to emit no bytecode in this case and then we can simplify InitArrayElemOperation a bit because it no longer has to check for JSOP_INITELEM_ARRAY + hole values.
Attachment #8850933 - Flags: review?(tcampbell)
Comment on attachment 8850933 [details] [diff] [review]
Patch

Review of attachment 8850933 [details] [diff] [review]:
-----------------------------------------------------------------

A much better solution.
Attachment #8850933 - Flags: review?(tcampbell) → review+
(Assignee)

Comment 2

a year ago
This actually doesn't work well with Ion because when we update the initializedLength after setting some hole values, we need to write the magic hole value to the elements we "skipped". That's fixable but for now I'll just close this.
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.