Index: src/ic/x64/handler-compiler-x64.cc |
diff --git a/src/ic/x64/handler-compiler-x64.cc b/src/ic/x64/handler-compiler-x64.cc |
index a89afa8a7e7f9882bc2886e2bda166af0773df1c..51d162fe814a643ea0cdb322535796f71408dabc 100644 |
--- a/src/ic/x64/handler-compiler-x64.cc |
+++ b/src/ic/x64/handler-compiler-x64.cc |
@@ -91,10 +91,12 @@ void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype( |
__ ret(0); |
} |
+static void CompileCallLoadPropertyWithInterceptor( |
+ MacroAssembler* masm, Register receiver, Register holder, Register name, |
+ Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
+ DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == |
+ Runtime::FunctionForId(id)->nargs); |
-static void PushInterceptorArguments(MacroAssembler* masm, Register receiver, |
- Register holder, Register name, |
- Handle<JSObject> holder_obj) { |
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
@@ -102,15 +104,7 @@ static void PushInterceptorArguments(MacroAssembler* masm, Register receiver, |
__ Push(name); |
__ Push(receiver); |
__ Push(holder); |
-} |
- |
-static void CompileCallLoadPropertyWithInterceptor( |
- MacroAssembler* masm, Register receiver, Register holder, Register name, |
- Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
- DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == |
- Runtime::FunctionForId(id)->nargs); |
- PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
__ CallRuntime(id); |
} |
@@ -524,10 +518,26 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
// Call the runtime system to load the interceptor. |
DCHECK(holder()->HasNamedInterceptor()); |
DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); |
- __ PopReturnAddressTo(scratch2()); |
- PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
- holder()); |
- __ PushReturnAddressFrom(scratch2()); |
+ |
+ // Stack: |
+ // return address |
+ |
+ STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
+ STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
+ STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
+ STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
+ __ Push(receiver()); |
+ __ Push(holder_reg); |
+ // See NamedLoadHandlerCompiler::InterceptorVectorSlotPop() for details. |
+ if (holder_reg.is(receiver())) { |
+ __ Push(slot()); |
+ __ Push(vector()); |
+ } else { |
+ __ Push(scratch3()); // slot |
+ __ Push(scratch2()); // vector |
+ } |
+ __ Push(Operand(rsp, 4 * kPointerSize)); // return address |
+ __ movp(Operand(rsp, 5 * kPointerSize), name()); |
__ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
} |