BaselineCompiler: Compile INITELEM_ARRAY

RESOLVED FIXED

Status

()

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Posted patch Patch (obsolete) — Splinter Review
Pretty straight-forward with bug 821816 fixed.
Attachment #692897 - Flags: review?(kvijayan)
(Assignee)

Comment 1

6 years ago
Posted patch PatchSplinter Review
Attachment #692897 - Attachment is obsolete: true
Attachment #692897 - Flags: review?(kvijayan)
Attachment #692900 - Flags: review?(kvijayan)
Comment on attachment 692900 [details] [diff] [review]
Patch

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

::: js/src/ion/BaselineCompiler.cpp
@@ +905,5 @@
> +    masm.extractObject(frame.addressOfStackValue(array), scratch);
> +    masm.loadPtr(Address(scratch, JSObject::offsetOfElements()), scratch);
> +
> +    // Update initialized length.
> +    masm.store32(Imm32(index + 1), Address(scratch, ObjectElements::offsetOfInitializedLength()));

Is the array ever accessible in js code before it's been fully initialized?  If not, we can set the initialized length in NewArray and avoid updating it on each INITELEM.
Attachment #692900 - Flags: review?(kvijayan) → review+
(Assignee)

Comment 3

6 years ago
https://hg.mozilla.org/projects/ionmonkey/rev/c4bd7021e0ed

(In reply to Kannan Vijayan [:djvj] from comment #2)
> 
> Is the array ever accessible in js code before it's been fully initialized? 
> If not, we can set the initialized length in NewArray and avoid updating it
> on each INITELEM.

The array is not accessible in js code, but the GC may access it, like [{}, gc()]
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.