Index: src/ic/x87/handler-compiler-x87.cc |
diff --git a/src/ic/x87/handler-compiler-x87.cc b/src/ic/x87/handler-compiler-x87.cc |
index 4a521b76d3783427b7e84eaeb386e6f7457372c2..3442a686f40cdd747e748f4b3cd06198679f0657 100644 |
--- a/src/ic/x87/handler-compiler-x87.cc |
+++ b/src/ic/x87/handler-compiler-x87.cc |
@@ -302,10 +302,12 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
} |
} |
+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); |
@@ -313,15 +315,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); |
} |
@@ -538,10 +532,26 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
DCHECK(holder()->HasNamedInterceptor()); |
DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); |
// Call the runtime system to load the interceptor. |
- __ pop(scratch2()); // save old return address |
- PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
- holder()); |
- __ push(scratch2()); // restore old return address |
+ |
+ // 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(esp, 4 * kPointerSize)); // return address |
+ __ mov(Operand(esp, 5 * kPointerSize), name()); |
__ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
} |