| Index: src/x64/stub-cache-x64.cc
|
| diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
|
| index d4b3d4b9edccc38cccb82e555a708c5d7d7cd995..dae4a55d94ccf8a6301b338a220e8e9f53019f4d 100644
|
| --- a/src/x64/stub-cache-x64.cc
|
| +++ b/src/x64/stub-cache-x64.cc
|
| @@ -478,10 +478,12 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
| public:
|
| CallInterceptorCompiler(StubCompiler* stub_compiler,
|
| const ParameterCount& arguments,
|
| - Register name)
|
| + Register name,
|
| + Code::ExtraICState extra_ic_state)
|
| : stub_compiler_(stub_compiler),
|
| arguments_(arguments),
|
| - name_(name) {}
|
| + name_(name),
|
| + extra_ic_state_(extra_ic_state) {}
|
|
|
| MaybeObject* Compile(MacroAssembler* masm,
|
| JSObject* object,
|
| @@ -606,8 +608,11 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
| arguments_.immediate());
|
| if (result->IsFailure()) return result;
|
| } else {
|
| + CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
| + ? CALL_AS_FUNCTION
|
| + : CALL_AS_METHOD;
|
| __ InvokeFunction(optimization.constant_function(), arguments_,
|
| - JUMP_FUNCTION);
|
| + JUMP_FUNCTION, NullCallWrapper(), call_kind);
|
| }
|
|
|
| // Deferred code for fast API call case---clean preallocated space.
|
| @@ -686,6 +691,7 @@ class CallInterceptorCompiler BASE_EMBEDDED {
|
| StubCompiler* stub_compiler_;
|
| const ParameterCount& arguments_;
|
| Register name_;
|
| + Code::ExtraICState extra_ic_state_;
|
| };
|
|
|
|
|
| @@ -1348,7 +1354,11 @@ MaybeObject* CallStubCompiler::CompileCallField(JSObject* object,
|
| }
|
|
|
| // Invoke the function.
|
| - __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION);
|
| + CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
| + ? CALL_AS_FUNCTION
|
| + : CALL_AS_METHOD;
|
| + __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION,
|
| + NullCallWrapper(), call_kind);
|
|
|
| // Handle call cache miss.
|
| __ bind(&miss);
|
| @@ -1831,7 +1841,11 @@ MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall(
|
| // Tail call the full function. We do not have to patch the receiver
|
| // because the function makes no use of it.
|
| __ bind(&slow);
|
| - __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
|
| + CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
| + ? CALL_AS_FUNCTION
|
| + : CALL_AS_METHOD;
|
| + __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
| + NullCallWrapper(), call_kind);
|
|
|
| __ bind(&miss);
|
| // rcx: function name.
|
| @@ -1944,7 +1958,11 @@ MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object,
|
| // Tail call the full function. We do not have to patch the receiver
|
| // because the function makes no use of it.
|
| __ bind(&slow);
|
| - __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
|
| + CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
| + ? CALL_AS_FUNCTION
|
| + : CALL_AS_METHOD;
|
| + __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
| + NullCallWrapper(), call_kind);
|
|
|
| __ bind(&miss);
|
| // rcx: function name.
|
| @@ -2138,7 +2156,11 @@ MaybeObject* CallStubCompiler::CompileCallConstant(Object* object,
|
| UNREACHABLE();
|
| }
|
|
|
| - __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
|
| + CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
| + ? CALL_AS_FUNCTION
|
| + : CALL_AS_METHOD;
|
| + __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
|
| + NullCallWrapper(), call_kind);
|
|
|
| // Handle call cache miss.
|
| __ bind(&miss);
|
| @@ -2175,7 +2197,7 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
|
| // Get the receiver from the stack.
|
| __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
|
|
|
| - CallInterceptorCompiler compiler(this, arguments(), rcx);
|
| + CallInterceptorCompiler compiler(this, arguments(), rcx, extra_ic_state_);
|
| MaybeObject* result = compiler.Compile(masm(),
|
| object,
|
| holder,
|
| @@ -2205,7 +2227,11 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
|
|
|
| // Invoke the function.
|
| __ movq(rdi, rax);
|
| - __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION);
|
| + CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
| + ? CALL_AS_FUNCTION
|
| + : CALL_AS_METHOD;
|
| + __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION,
|
| + NullCallWrapper(), call_kind);
|
|
|
| // Handle load cache miss.
|
| __ bind(&miss);
|
| @@ -2217,13 +2243,11 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object,
|
| }
|
|
|
|
|
| -MaybeObject* CallStubCompiler::CompileCallGlobal(
|
| - JSObject* object,
|
| - GlobalObject* holder,
|
| - JSGlobalPropertyCell* cell,
|
| - JSFunction* function,
|
| - String* name,
|
| - Code::ExtraICState extra_ic_state) {
|
| +MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object,
|
| + GlobalObject* holder,
|
| + JSGlobalPropertyCell* cell,
|
| + JSFunction* function,
|
| + String* name) {
|
| // ----------- S t a t e -------------
|
| // rcx : function name
|
| // rsp[0] : return address
|
| @@ -2268,7 +2292,7 @@ MaybeObject* CallStubCompiler::CompileCallGlobal(
|
| __ IncrementCounter(counters->call_global_inline(), 1);
|
| ASSERT(function->is_compiled());
|
| ParameterCount expected(function->shared()->formal_parameter_count());
|
| - CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state)
|
| + CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_)
|
| ? CALL_AS_FUNCTION
|
| : CALL_AS_METHOD;
|
| if (V8::UseCrankshaft()) {
|
|
|