Revision: 24042
Author: [email protected]
Date: Thu Sep 18 13:28:32 2014 UTC
Log: Convert KeyedLoad indexed interceptor case to a Handler.
Currently, KeyedLoads on objects with indexed interceptors are handled with
a
special stub. Instead, key on the map and handler mechanism for more uniform
treatment.
[email protected]
Review URL: https://codereview.chromium.org/575373004
https://code.google.com/p/v8/source/detail?r=24042
Modified:
/branches/bleeding_edge/src/arm/code-stubs-arm.cc
/branches/bleeding_edge/src/arm64/code-stubs-arm64.cc
/branches/bleeding_edge/src/builtins.cc
/branches/bleeding_edge/src/builtins.h
/branches/bleeding_edge/src/code-stubs.h
/branches/bleeding_edge/src/ia32/code-stubs-ia32.cc
/branches/bleeding_edge/src/ic/arm/ic-arm.cc
/branches/bleeding_edge/src/ic/arm64/ic-arm64.cc
/branches/bleeding_edge/src/ic/handler-compiler.cc
/branches/bleeding_edge/src/ic/ia32/ic-ia32.cc
/branches/bleeding_edge/src/ic/ic-compiler.cc
/branches/bleeding_edge/src/ic/ic.cc
/branches/bleeding_edge/src/ic/ic.h
/branches/bleeding_edge/src/ic/mips/ic-mips.cc
/branches/bleeding_edge/src/ic/x64/ic-x64.cc
/branches/bleeding_edge/src/mips/code-stubs-mips.cc
/branches/bleeding_edge/src/x64/code-stubs-x64.cc
=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Thu Sep 18 12:31:31
2014 UTC
+++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Thu Sep 18 13:28:32
2014 UTC
@@ -1783,6 +1783,32 @@
__ str(r2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count.
__ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1);
}
+
+
+void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) {
+ // Return address is in lr.
+ Label slow;
+
+ Register receiver = LoadDescriptor::ReceiverRegister();
+ Register key = LoadDescriptor::NameRegister();
+
+ // Check that the key is an array index, that is Uint32.
+ __ NonNegativeSmiTst(key);
+ __ b(ne, &slow);
+
+ // Everything is fine, call runtime.
+ __ Push(receiver, key); // Receiver, key.
+
+ // Perform tail call to the entry.
+ __ TailCallExternalReference(
+ ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
+ masm->isolate()),
+ 2, 1);
+
+ __ bind(&slow);
+ PropertyAccessCompiler::TailCallBuiltin(
+ masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
+}
void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc Thu Sep 18
12:31:31 2014 UTC
+++ /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc Thu Sep 18
13:28:32 2014 UTC
@@ -1959,6 +1959,29 @@
__ Push(function, recv_arg, arg_count_smi);
__ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1);
}
+
+
+void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) {
+ // Return address is in lr.
+ Label slow;
+
+ Register receiver = LoadDescriptor::ReceiverRegister();
+ Register key = LoadDescriptor::NameRegister();
+
+ // Check that the key is an array index, that is Uint32.
+ __ TestAndBranchIfAnySet(key, kSmiTagMask | kSmiSignMask, &slow);
+
+ // Everything is fine, call runtime.
+ __ Push(receiver, key);
+ __ TailCallExternalReference(
+ ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
+ masm->isolate()),
+ 2, 1);
+
+ __ Bind(&slow);
+ PropertyAccessCompiler::TailCallBuiltin(
+ masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
+}
void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/builtins.cc Mon Sep 1 09:11:44 2014 UTC
+++ /branches/bleeding_edge/src/builtins.cc Thu Sep 18 13:28:32 2014 UTC
@@ -1287,11 +1287,6 @@
static void Generate_KeyedLoadIC_PreMonomorphic(MacroAssembler* masm) {
KeyedLoadIC::GeneratePreMonomorphic(masm);
}
-
-
-static void Generate_KeyedLoadIC_IndexedInterceptor(MacroAssembler* masm) {
- KeyedLoadIC::GenerateIndexedInterceptor(masm);
-}
static void Generate_KeyedLoadIC_SloppyArguments(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/builtins.h Wed Sep 17 15:29:42 2014 UTC
+++ /branches/bleeding_edge/src/builtins.h Thu Sep 18 13:28:32 2014 UTC
@@ -89,8 +89,6 @@
kNoExtraICState) \
V(KeyedLoadIC_Generic, KEYED_LOAD_IC, GENERIC,
kNoExtraICState) \
V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC,
kNoExtraICState) \
- V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC,
MONOMORPHIC, \
-
kNoExtraICState) \
V(KeyedLoadIC_SloppyArguments, KEYED_LOAD_IC, MONOMORPHIC,
kNoExtraICState) \
\
V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC,
StoreIC::kStrictModeState) \
=======================================
--- /branches/bleeding_edge/src/code-stubs.h Wed Sep 17 12:50:17 2014 UTC
+++ /branches/bleeding_edge/src/code-stubs.h Thu Sep 18 13:28:32 2014 UTC
@@ -38,6 +38,7 @@
V(JSEntry) \
V(KeyedLoadICTrampoline) \
V(LoadICTrampoline) \
+ V(LoadIndexedInterceptor) \
V(MathPow) \
V(ProfileEntryHook) \
V(RecordWrite) \
@@ -857,6 +858,20 @@
};
+// TODO(mvstanton): Translate to hydrogen code stub.
+class LoadIndexedInterceptorStub : public PlatformCodeStub {
+ public:
+ explicit LoadIndexedInterceptorStub(Isolate* isolate)
+ : PlatformCodeStub(isolate) {}
+
+ virtual Code::Kind GetCodeKind() const { return Code::HANDLER; }
+ virtual Code::StubType GetStubType() { return Code::FAST; }
+
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(Load);
+ DEFINE_PLATFORM_CODE_STUB(LoadIndexedInterceptor, PlatformCodeStub);
+};
+
+
class HandlerStub : public HydrogenCodeStub {
public:
virtual Code::Kind GetCodeKind() const { return Code::HANDLER; }
=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Thu Sep 18 12:31:31
2014 UTC
+++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Thu Sep 18 13:28:32
2014 UTC
@@ -657,6 +657,36 @@
PropertyAccessCompiler::TailCallBuiltin(
masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC));
}
+
+
+void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) {
+ // Return address is on the stack.
+ Label slow;
+
+ Register receiver = LoadDescriptor::ReceiverRegister();
+ Register key = LoadDescriptor::NameRegister();
+ Register scratch = eax;
+ DCHECK(!scratch.is(receiver) && !scratch.is(key));
+
+ // Check that the key is an array index, that is Uint32.
+ __ test(key, Immediate(kSmiTagMask | kSmiSignMask));
+ __ j(not_zero, &slow);
+
+ // Everything is fine, call runtime.
+ __ pop(scratch);
+ __ push(receiver); // receiver
+ __ push(key); // key
+ __ push(scratch); // return address
+
+ // Perform tail call to the entry.
+ ExternalReference ref = ExternalReference(
+ IC_Utility(IC::kLoadElementWithInterceptor), masm->isolate());
+ __ TailCallExternalReference(ref, 2, 1);
+
+ __ bind(&slow);
+ PropertyAccessCompiler::TailCallBuiltin(
+ masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
+}
void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/ic/arm/ic-arm.cc Mon Sep 8 12:51:29 2014
UTC
+++ /branches/bleeding_edge/src/ic/arm/ic-arm.cc Thu Sep 18 13:28:32 2014
UTC
@@ -637,48 +637,6 @@
__ bind(&miss);
GenerateMiss(masm);
}
-
-
-void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
- // Return address is in lr.
- Label slow;
-
- Register receiver = LoadDescriptor::ReceiverRegister();
- Register key = LoadDescriptor::NameRegister();
- Register scratch1 = r3;
- Register scratch2 = r4;
- DCHECK(!scratch1.is(receiver) && !scratch1.is(key));
- DCHECK(!scratch2.is(receiver) && !scratch2.is(key));
-
- // Check that the receiver isn't a smi.
- __ JumpIfSmi(receiver, &slow);
-
- // Check that the key is an array index, that is Uint32.
- __ NonNegativeSmiTst(key);
- __ b(ne, &slow);
-
- // Get the map of the receiver.
- __ ldr(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset));
-
- // Check that it has indexed interceptor and access checks
- // are not enabled for this object.
- __ ldrb(scratch2, FieldMemOperand(scratch1, Map::kBitFieldOffset));
- __ and_(scratch2, scratch2, Operand(kSlowCaseBitFieldMask));
- __ cmp(scratch2, Operand(1 << Map::kHasIndexedInterceptor));
- __ b(ne, &slow);
-
- // Everything is fine, call runtime.
- __ Push(receiver, key); // Receiver, key.
-
- // Perform tail call to the entry.
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
-
- __ bind(&slow);
- GenerateMiss(masm);
-}
void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/ic/arm64/ic-arm64.cc Mon Sep 8 12:51:29
2014 UTC
+++ /branches/bleeding_edge/src/ic/arm64/ic-arm64.cc Thu Sep 18 13:28:32
2014 UTC
@@ -680,46 +680,6 @@
__ Bind(&miss);
GenerateMiss(masm);
}
-
-
-void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
- // Return address is in lr.
- Label slow;
-
- Register receiver = LoadDescriptor::ReceiverRegister();
- Register key = LoadDescriptor::NameRegister();
- Register scratch1 = x3;
- Register scratch2 = x4;
- DCHECK(!AreAliased(scratch1, scratch2, receiver, key));
-
- // Check that the receiver isn't a smi.
- __ JumpIfSmi(receiver, &slow);
-
- // Check that the key is an array index, that is Uint32.
- __ TestAndBranchIfAnySet(key, kSmiTagMask | kSmiSignMask, &slow);
-
- // Get the map of the receiver.
- Register map = scratch1;
- __ Ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
-
- // Check that it has indexed interceptor and access checks
- // are not enabled for this object.
- __ Ldrb(scratch2, FieldMemOperand(map, Map::kBitFieldOffset));
- DCHECK(kSlowCaseBitFieldMask == ((1 << Map::kIsAccessCheckNeeded) |
- (1 << Map::kHasIndexedInterceptor)));
- __ Tbnz(scratch2, Map::kIsAccessCheckNeeded, &slow);
- __ Tbz(scratch2, Map::kHasIndexedInterceptor, &slow);
-
- // Everything is fine, call runtime.
- __ Push(receiver, key);
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
-
- __ Bind(&slow);
- GenerateMiss(masm);
-}
void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/ic/handler-compiler.cc Tue Sep 16 12:51:33
2014 UTC
+++ /branches/bleeding_edge/src/ic/handler-compiler.cc Thu Sep 18 13:28:32
2014 UTC
@@ -388,10 +388,11 @@
} else {
bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
ElementsKind elements_kind = receiver_map->elements_kind();
-
- if (IsFastElementsKind(elements_kind) ||
- IsExternalArrayElementsKind(elements_kind) ||
- IsFixedTypedArrayElementsKind(elements_kind)) {
+ if (receiver_map->has_indexed_interceptor()) {
+ cached_stub = LoadIndexedInterceptorStub(isolate()).GetCode();
+ } else if (IsFastElementsKind(elements_kind) ||
+ IsExternalArrayElementsKind(elements_kind) ||
+ IsFixedTypedArrayElementsKind(elements_kind)) {
cached_stub = LoadFastElementStub(isolate(), is_js_array,
elements_kind)
.GetCode();
} else if (elements_kind == SLOPPY_ARGUMENTS_ELEMENTS) {
=======================================
--- /branches/bleeding_edge/src/ic/ia32/ic-ia32.cc Mon Sep 8 12:51:29 2014
UTC
+++ /branches/bleeding_edge/src/ic/ia32/ic-ia32.cc Thu Sep 18 13:28:32 2014
UTC
@@ -501,48 +501,6 @@
__ bind(&miss);
GenerateMiss(masm);
}
-
-
-void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
- // Return address is on the stack.
- Label slow;
-
- Register receiver = LoadDescriptor::ReceiverRegister();
- Register key = LoadDescriptor::NameRegister();
- Register scratch = eax;
- DCHECK(!scratch.is(receiver) && !scratch.is(key));
-
- // Check that the receiver isn't a smi.
- __ JumpIfSmi(receiver, &slow);
-
- // Check that the key is an array index, that is Uint32.
- __ test(key, Immediate(kSmiTagMask | kSmiSignMask));
- __ j(not_zero, &slow);
-
- // Get the map of the receiver.
- __ mov(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
-
- // Check that it has indexed interceptor and access checks
- // are not enabled for this object.
- __ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset));
- __ and_(scratch, Immediate(kSlowCaseBitFieldMask));
- __ cmp(scratch, Immediate(1 << Map::kHasIndexedInterceptor));
- __ j(not_zero, &slow);
-
- // Everything is fine, call runtime.
- __ pop(scratch);
- __ push(receiver); // receiver
- __ push(key); // key
- __ push(scratch); // return address
-
- // Perform tail call to the entry.
- ExternalReference ref = ExternalReference(
- IC_Utility(kLoadElementWithInterceptor), masm->isolate());
- __ TailCallExternalReference(ref, 2, 1);
-
- __ bind(&slow);
- GenerateMiss(masm);
-}
void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/ic/ic-compiler.cc Mon Sep 8 12:51:29 2014
UTC
+++ /branches/bleeding_edge/src/ic/ic-compiler.cc Thu Sep 18 13:28:32 2014
UTC
@@ -94,9 +94,11 @@
ElementsKind elements_kind = receiver_map->elements_kind();
Handle<Code> stub;
- if (receiver_map->has_fast_elements() ||
- receiver_map->has_external_array_elements() ||
- receiver_map->has_fixed_typed_array_elements()) {
+ if (receiver_map->has_indexed_interceptor()) {
+ stub = LoadIndexedInterceptorStub(isolate).GetCode();
+ } else if (receiver_map->has_fast_elements() ||
+ receiver_map->has_external_array_elements() ||
+ receiver_map->has_fixed_typed_array_elements()) {
stub = LoadFastElementStub(isolate,
receiver_map->instance_type() ==
JS_ARRAY_TYPE,
elements_kind).GetCode();
=======================================
--- /branches/bleeding_edge/src/ic/ic.cc Thu Sep 18 12:31:31 2014 UTC
+++ /branches/bleeding_edge/src/ic/ic.cc Thu Sep 18 13:28:32 2014 UTC
@@ -1109,14 +1109,6 @@
Handle<Code> KeyedLoadIC::LoadElementStub(Handle<JSObject> receiver) {
- // Don't handle megamorphic property accesses for INTERCEPTORS or
CALLBACKS
- // via megamorphic stubs, since they don't have a map in their
relocation info
- // and so the stubs can't be harvested for the object needed for a map
check.
- if (target()->type() != Code::NORMAL) {
- TRACE_GENERIC_IC(isolate(), "KeyedIC", "non-NORMAL target type");
- return generic_stub();
- }
-
Handle<Map> receiver_map(receiver->map(), isolate());
MapHandleList target_receiver_maps;
if (target().is_identical_to(string_stub())) {
@@ -1192,8 +1184,6 @@
if (receiver->elements()->map() ==
isolate()->heap()->sloppy_arguments_elements_map()) {
stub = sloppy_arguments_stub();
- } else if (receiver->HasIndexedInterceptor()) {
- stub = indexed_interceptor_stub();
} else if (!Object::ToSmi(isolate(), key).is_null() &&
(!target().is_identical_to(sloppy_arguments_stub()))) {
stub = LoadElementStub(receiver);
=======================================
--- /branches/bleeding_edge/src/ic/ic.h Thu Sep 18 12:31:31 2014 UTC
+++ /branches/bleeding_edge/src/ic/ic.h Thu Sep 18 13:28:32 2014 UTC
@@ -414,7 +414,6 @@
}
static void GenerateGeneric(MacroAssembler* masm);
static void GenerateString(MacroAssembler* masm);
- static void GenerateIndexedInterceptor(MacroAssembler* masm);
static void GenerateSloppyArguments(MacroAssembler* masm);
// Bit mask to be tested against bit field for the cases when
@@ -435,9 +434,6 @@
private:
Handle<Code> generic_stub() const { return generic_stub(isolate()); }
- Handle<Code> indexed_interceptor_stub() {
- return isolate()->builtins()->KeyedLoadIC_IndexedInterceptor();
- }
Handle<Code> sloppy_arguments_stub() {
return isolate()->builtins()->KeyedLoadIC_SloppyArguments();
}
=======================================
--- /branches/bleeding_edge/src/ic/mips/ic-mips.cc Mon Sep 8 17:20:49 2014
UTC
+++ /branches/bleeding_edge/src/ic/mips/ic-mips.cc Thu Sep 18 13:28:32 2014
UTC
@@ -885,46 +885,6 @@
key, receiver, receiver_map,
elements_map,
elements);
}
-
-
-void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
- // Return address is in ra.
- Label slow;
-
- Register receiver = LoadDescriptor::ReceiverRegister();
- Register key = LoadDescriptor::NameRegister();
- Register scratch1 = a3;
- Register scratch2 = t0;
- DCHECK(!scratch1.is(receiver) && !scratch1.is(key));
- DCHECK(!scratch2.is(receiver) && !scratch2.is(key));
-
- // Check that the receiver isn't a smi.
- __ JumpIfSmi(receiver, &slow);
-
- // Check that the key is an array index, that is Uint32.
- __ And(t0, key, Operand(kSmiTagMask | kSmiSignMask));
- __ Branch(&slow, ne, t0, Operand(zero_reg));
-
- // Get the map of the receiver.
- __ lw(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset));
-
- // Check that it has indexed interceptor and access checks
- // are not enabled for this object.
- __ lbu(scratch2, FieldMemOperand(scratch1, Map::kBitFieldOffset));
- __ And(scratch2, scratch2, Operand(kSlowCaseBitFieldMask));
- __ Branch(&slow, ne, scratch2, Operand(1 <<
Map::kHasIndexedInterceptor));
- // Everything is fine, call runtime.
- __ Push(receiver, key); // Receiver, key.
-
- // Perform tail call to the entry.
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
-
- __ bind(&slow);
- GenerateMiss(masm);
-}
void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/ic/x64/ic-x64.cc Mon Sep 8 12:51:29 2014
UTC
+++ /branches/bleeding_edge/src/ic/x64/ic-x64.cc Thu Sep 18 13:28:32 2014
UTC
@@ -427,49 +427,6 @@
__ bind(&miss);
GenerateMiss(masm);
}
-
-
-void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
- // Return address is on the stack.
- Label slow;
-
- Register receiver = LoadDescriptor::ReceiverRegister();
- Register key = LoadDescriptor::NameRegister();
- Register scratch = rax;
- DCHECK(!scratch.is(receiver) && !scratch.is(key));
-
- // Check that the receiver isn't a smi.
- __ JumpIfSmi(receiver, &slow);
-
- // Check that the key is an array index, that is Uint32.
- STATIC_ASSERT(kSmiValueSize <= 32);
- __ JumpUnlessNonNegativeSmi(key, &slow);
-
- // Get the map of the receiver.
- __ movp(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
-
- // Check that it has indexed interceptor and access checks
- // are not enabled for this object.
- __ movb(scratch, FieldOperand(scratch, Map::kBitFieldOffset));
- __ andb(scratch, Immediate(kSlowCaseBitFieldMask));
- __ cmpb(scratch, Immediate(1 << Map::kHasIndexedInterceptor));
- __ j(not_zero, &slow);
-
- // Everything is fine, call runtime.
- __ PopReturnAddressTo(scratch);
- __ Push(receiver); // receiver
- __ Push(key); // key
- __ PushReturnAddressFrom(scratch);
-
- // Perform tail call to the entry.
- __ TailCallExternalReference(
- ExternalReference(IC_Utility(kLoadElementWithInterceptor),
- masm->isolate()),
- 2, 1);
-
- __ bind(&slow);
- GenerateMiss(masm);
-}
static void KeyedStoreGenerateGenericHelper(
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Thu Sep 18 12:31:31
2014 UTC
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Thu Sep 18 13:28:32
2014 UTC
@@ -1894,6 +1894,32 @@
__ sw(a2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count.
__ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1);
}
+
+
+void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) {
+ // Return address is in ra.
+ Label slow;
+
+ Register receiver = LoadDescriptor::ReceiverRegister();
+ Register key = LoadDescriptor::NameRegister();
+
+ // Check that the key is an array index, that is Uint32.
+ __ And(t0, key, Operand(kSmiTagMask | kSmiSignMask));
+ __ Branch(&slow, ne, t0, Operand(zero_reg));
+
+ // Everything is fine, call runtime.
+ __ Push(receiver, key); // Receiver, key.
+
+ // Perform tail call to the entry.
+ __ TailCallExternalReference(
+ ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
+ masm->isolate()),
+ 2, 1);
+
+ __ bind(&slow);
+ PropertyAccessCompiler::TailCallBuiltin(
+ masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
+}
void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/x64/code-stubs-x64.cc Thu Sep 18 12:31:31
2014 UTC
+++ /branches/bleeding_edge/src/x64/code-stubs-x64.cc Thu Sep 18 13:28:32
2014 UTC
@@ -832,6 +832,37 @@
__ bind(&runtime);
__ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1);
}
+
+
+void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) {
+ // Return address is on the stack.
+ Label slow;
+
+ Register receiver = LoadDescriptor::ReceiverRegister();
+ Register key = LoadDescriptor::NameRegister();
+ Register scratch = rax;
+ DCHECK(!scratch.is(receiver) && !scratch.is(key));
+
+ // Check that the key is an array index, that is Uint32.
+ STATIC_ASSERT(kSmiValueSize <= 32);
+ __ JumpUnlessNonNegativeSmi(key, &slow);
+
+ // Everything is fine, call runtime.
+ __ PopReturnAddressTo(scratch);
+ __ Push(receiver); // receiver
+ __ Push(key); // key
+ __ PushReturnAddressFrom(scratch);
+
+ // Perform tail call to the entry.
+ __ TailCallExternalReference(
+ ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
+ masm->isolate()),
+ 2, 1);
+
+ __ bind(&slow);
+ PropertyAccessCompiler::TailCallBuiltin(
+ masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
+}
void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.