Closed Bug 842264 Opened 11 years ago Closed 11 years ago

BaselineCompiler: Add SETELEM stub for typed arrays

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Looking at some Emscripten benchmarks, we are currently spending most time in SETELEM VM calls.
Attached patch PatchSplinter Review
Adds a stub which handles storing int32 and doubles values to typed arrays. With this patch we spend most time in JIT code on Emscripten-generated code.
Attachment #715148 - Flags: review?(kvijayan)
Comment on attachment 715148 [details] [diff] [review]
Patch

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

::: js/src/ion/BaselineIC.cpp
@@ +3053,5 @@
> +    Register key = masm.extractInt32(R1, ExtractTemp1);
> +
> +    // Bounds check.
> +    masm.unboxInt32(Address(obj, TypedArray::lengthOffset()), scratchReg);
> +    masm.branch32(Assembler::BelowOrEqual, scratchReg, key, &failure);

Add jump to failure on key < 0.
Attachment #715148 - Flags: review?(kvijayan) → review+
https://hg.mozilla.org/projects/ionmonkey/rev/fc9de695de03

(In reply to Kannan Vijayan [:djvj] from comment #2)
> Add jump to failure on key < 0.

The bounds check is unsigned, so it handles this case. See also the dense array stubs and the other JITs.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: