Index: src/ia32/ic-ia32.cc |
=================================================================== |
--- src/ia32/ic-ia32.cc (revision 6456) |
+++ src/ia32/ic-ia32.cc (working copy) |
@@ -760,6 +760,44 @@ |
} |
+void KeyedLoadIC::GeneratePixelArray(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- eax : key |
+ // -- edx : receiver |
+ // -- esp[0] : return address |
+ // ----------------------------------- |
+ Label slow; |
+ |
+ // Check that the receiver isn't a smi. |
+ __ test(edx, Immediate(kSmiTagMask)); |
+ __ j(zero, &slow, not_taken); |
+ |
+ // Check that the key is an array index, that is Uint32. |
Mads Ager (chromium)
2011/01/25 14:49:17
This code looks more complicated than on ARM and I
danno
2011/01/25 20:56:29
Done.
|
+ __ test(eax, Immediate(kSmiTagMask | kSmiSignMask)); |
+ __ j(not_zero, &slow, not_taken); |
+ |
+ // Get the map of the receiver. |
+ __ mov(ecx, FieldOperand(edx, HeapObject::kMapOffset)); |
+ |
+ // Check whether the elements is a pixel array. |
+ // edx: receiver |
+ // eax: key |
+ __ mov(ebx, eax); |
+ __ SmiUntag(ebx); |
+ __ mov(ecx, FieldOperand(edx, JSObject::kElementsOffset)); |
Mads Ager (chromium)
2011/01/25 14:49:17
Need a JSObject check.
danno
2011/01/25 20:56:29
Done.
|
+ __ CheckMap(ecx, Factory::pixel_array_map(), &slow, true); |
+ __ cmp(ebx, FieldOperand(ecx, PixelArray::kLengthOffset)); |
+ __ j(above_equal, &slow); |
+ __ mov(eax, FieldOperand(ecx, PixelArray::kExternalPointerOffset)); |
+ __ movzx_b(eax, Operand(eax, ebx, times_1, 0)); |
+ __ SmiTag(eax); |
+ __ ret(0); |
+ |
+ __ bind(&slow); |
+ GenerateMiss(masm); |
+} |
+ |
+ |
void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
// -- eax : value |