Index: src/x64/ic-x64.cc |
=================================================================== |
--- src/x64/ic-x64.cc (revision 6456) |
+++ src/x64/ic-x64.cc (working copy) |
@@ -767,6 +767,38 @@ |
} |
+void KeyedLoadIC::GeneratePixelArray(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- rax : key |
+ // -- rdx : receiver |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ Label slow; |
+ |
+ // Verify that the receiver's elements are a pixel array. |
+ __ JumpIfSmi(rdx, &slow); |
+ __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset)); |
Mads Ager (chromium)
2011/01/25 14:49:17
JSObject check needed.
danno
2011/01/25 20:56:29
Done.
|
+ __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset), |
+ Heap::kPixelArrayMapRootIndex); |
+ __ j(not_equal, &slow); |
+ |
+ // Check that the key is a smi and in range. |
+ __ JumpIfNotSmi(rax, &slow); |
+ __ SmiToInteger32(rbx, rax); |
+ __ cmpl(rbx, FieldOperand(rcx, PixelArray::kLengthOffset)); |
+ __ j(above_equal, &slow); |
+ |
+ // Load and tag the element as a smi. |
+ __ movq(rax, FieldOperand(rcx, PixelArray::kExternalPointerOffset)); |
+ __ movzxbq(rax, Operand(rax, rbx, times_1, 0)); |
+ __ Integer32ToSmi(rax, rax); |
+ __ ret(0); |
+ |
+ __ bind(&slow); |
+ GenerateMiss(masm); |
+} |
+ |
+ |
void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
// -- rax : value |