Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index 143d8d8697ee19b159837b8c2896e2b0c4e80eb4..d4b3d4b9edccc38cccb82e555a708c5d7d7cd995 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -1294,8 +1294,10 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell, |
MaybeObject* CallStubCompiler::GenerateMissBranch() { |
- MaybeObject* maybe_obj = isolate()->stub_cache()->ComputeCallMiss( |
- arguments().immediate(), kind_); |
+ MaybeObject* maybe_obj = |
+ isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(), |
+ kind_, |
+ extra_ic_state_); |
Object* obj; |
if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
__ Jump(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET); |
@@ -1626,7 +1628,9 @@ MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall( |
Label index_out_of_range; |
Label* index_out_of_range_label = &index_out_of_range; |
- if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { |
+ if (kind_ == Code::CALL_IC && |
+ (CallICBase::StringStubState::decode(extra_ic_state_) == |
+ DEFAULT_STRING_STUB)) { |
index_out_of_range_label = &miss; |
} |
@@ -1708,7 +1712,9 @@ MaybeObject* CallStubCompiler::CompileStringCharAtCall( |
Label index_out_of_range; |
Label* index_out_of_range_label = &index_out_of_range; |
- if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { |
+ if (kind_ == Code::CALL_IC && |
+ (CallICBase::StringStubState::decode(extra_ic_state_) == |
+ DEFAULT_STRING_STUB)) { |
index_out_of_range_label = &miss; |
} |
@@ -2211,11 +2217,13 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object, |
} |
-MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object, |
- GlobalObject* holder, |
- JSGlobalPropertyCell* cell, |
- JSFunction* function, |
- String* name) { |
+MaybeObject* CallStubCompiler::CompileCallGlobal( |
+ JSObject* object, |
+ GlobalObject* holder, |
+ JSGlobalPropertyCell* cell, |
+ JSFunction* function, |
+ String* name, |
+ Code::ExtraICState extra_ic_state) { |
// ----------- S t a t e ------------- |
// rcx : function name |
// rsp[0] : return address |
@@ -2260,16 +2268,21 @@ MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object, |
__ 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) |
+ ? CALL_AS_FUNCTION |
+ : CALL_AS_METHOD; |
if (V8::UseCrankshaft()) { |
// TODO(kasperl): For now, we always call indirectly through the |
// code field in the function to allow recompilation to take effect |
// without changing any of the call sites. |
__ movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); |
- __ InvokeCode(rdx, expected, arguments(), JUMP_FUNCTION); |
+ __ InvokeCode(rdx, expected, arguments(), JUMP_FUNCTION, |
+ NullCallWrapper(), call_kind); |
} else { |
Handle<Code> code(function->code()); |
__ InvokeCode(code, expected, arguments(), |
- RelocInfo::CODE_TARGET, JUMP_FUNCTION); |
+ RelocInfo::CODE_TARGET, JUMP_FUNCTION, |
+ NullCallWrapper(), call_kind); |
} |
// Handle call cache miss. |
__ bind(&miss); |