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

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

Issue 600123: Port keyed interceptor stubs to ARM and x64. (Closed)
Patch Set: Changing receiver/key checks order Created 10 years, 10 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
« no previous file with comments | « src/arm/ic-arm.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
diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc
index da06aa0b55844bceda10c5e5ef38268cfe266178..c8211c7c989f79d51fd370c77b4b080ea3548ebc 100644
--- a/src/x64/ic-x64.cc
+++ b/src/x64/ic-x64.cc
@@ -574,7 +574,45 @@ void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm,
void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
- GenerateGeneric(masm);
+ // ----------- S t a t e -------------
+ // -- rsp[0] : return address
+ // -- rsp[8] : key
+ // -- rsp[16] : receiver
+ // -----------------------------------
+ Label slow;
+
+ // Load key and receiver.
+ __ movq(rax, Operand(rsp, kPointerSize));
+ __ movq(rcx, Operand(rsp, 2 * kPointerSize));
+
+ // Check that the receiver isn't a smi.
+ __ JumpIfSmi(rcx, &slow);
+
+ // Check that the key is a smi.
+ __ JumpIfNotSmi(rax, &slow);
+
+ // Get the map of the receiver.
+ __ movq(rdx, FieldOperand(rcx, HeapObject::kMapOffset));
+
+ // Check that it has indexed interceptor and access checks
+ // are not enabled for this object.
+ __ movb(rdx, FieldOperand(rdx, Map::kBitFieldOffset));
+ __ andb(rdx, Immediate(kSlowCaseBitFieldMask));
+ __ cmpb(rdx, Immediate(1 << Map::kHasIndexedInterceptor));
+ __ j(not_zero, &slow);
+
+ // Everything is fine, call runtime.
+ __ pop(rdx);
+ __ push(rcx); // receiver
+ __ push(rax); // key
+ __ push(rdx); // return address
+
+ // Perform tail call to the entry.
+ __ TailCallRuntime(ExternalReference(
+ IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
+
+ __ bind(&slow);
+ GenerateMiss(masm);
}
« no previous file with comments | « src/arm/ic-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698