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

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

Issue 603028: Compile very thin code to access objects on which indexed interceptor is set. (Closed)
Patch Set: 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/builtins.cc ('k') | src/ic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/ic-ia32.cc
diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc
index 024aba50b3ab1332cf5d614fae5b9c4d443d9ce2..b399bd6c518d72ba756dc629dc41df8da83b1002 100644
--- a/src/ia32/ic-ia32.cc
+++ b/src/ia32/ic-ia32.cc
@@ -590,6 +590,52 @@ void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm,
}
+void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
+ // ----------- S t a t e -------------
+ // -- eax : value
+ // -- esp[0] : return address
+ // -- esp[4] : key
+ // -- esp[8] : receiver
+ // -----------------------------------
+ Label slow;
+
+ // Load key and receiver.
+ __ mov(eax, Operand(esp, kPointerSize));
+ __ mov(ecx, Operand(esp, 2 * kPointerSize));
+
+ // Check that the receiver isn't a smi.
+ __ test(ecx, Immediate(kSmiTagMask));
+ __ j(zero, &slow, not_taken);
+
+ // Check that the key is a smi.
+ __ test(eax, Immediate(kSmiTagMask));
+ __ j(not_zero, &slow, not_taken);
+
+ // Get the map of the receiver.
+ __ mov(edx, FieldOperand(ecx, HeapObject::kMapOffset));
+
+ // Check that it has indexed interceptor and access checks
+ // are not enabled for this object.
+ __ movzx_b(edx, FieldOperand(edx, Map::kBitFieldOffset));
+ __ and_(Operand(edx), Immediate(kSlowCaseBitFieldMask));
+ __ cmp(Operand(edx), Immediate(1 << Map::kHasIndexedInterceptor));
+ __ j(not_zero, &slow, not_taken);
+
+ // Everything is fine, call runtime.
+ __ pop(edx);
+ __ push(ecx); // receiver
+ __ push(eax); // key
+ __ push(edx); // return address
+
+ // Perform tail call to the entry.
+ __ TailCallRuntime(ExternalReference(
+ IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
+
+ __ bind(&slow);
+ GenerateMiss(masm);
+}
+
+
void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : value
« no previous file with comments | « src/builtins.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698