Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(994)

Unified Diff: src/ia32/ic-ia32.cc

Issue 6323002: Add custom typed ICs for pixel array loads. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698