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

Unified Diff: src/x64/ic-x64.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
« src/ic.cc ('K') | « src/ic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« src/ic.cc ('K') | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698