| Index: src/x64/ic-x64.cc | 
| diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc | 
| index f05e6a2479ee21befc8c8d241912e975ab8dd0e0..8f4f9f98b5d4e1c15cccb528b7b6a427401900b8 100644 | 
| --- a/src/x64/ic-x64.cc | 
| +++ b/src/x64/ic-x64.cc | 
| @@ -813,7 +813,8 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, | 
| // The generated code falls through if both probes miss. | 
| static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, | 
| int argc, | 
| -                                          Code::Kind kind) { | 
| +                                          Code::Kind kind, | 
| +                                          Code::ExtraICState extra_ic_state) { | 
| // ----------- S t a t e ------------- | 
| // rcx                      : function name | 
| // rdx                      : receiver | 
| @@ -824,7 +825,7 @@ static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, | 
| Code::Flags flags = Code::ComputeFlags(kind, | 
| NOT_IN_LOOP, | 
| MONOMORPHIC, | 
| -                                         Code::kNoExtraICState, | 
| +                                         extra_ic_state, | 
| NORMAL, | 
| argc); | 
| Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx, | 
| @@ -923,7 +924,10 @@ static void GenerateCallNormal(MacroAssembler* masm, int argc) { | 
| } | 
|  | 
|  | 
| -static void GenerateCallMiss(MacroAssembler* masm, int argc, IC::UtilityId id) { | 
| +static void GenerateCallMiss(MacroAssembler* masm, | 
| +                             int argc, | 
| +                             IC::UtilityId id, | 
| +                             Code::ExtraICState extra_ic_state) { | 
| // ----------- S t a t e ------------- | 
| // rcx                      : function name | 
| // rsp[0]                   : return address | 
| @@ -980,12 +984,21 @@ static void GenerateCallMiss(MacroAssembler* masm, int argc, IC::UtilityId id) { | 
| } | 
|  | 
| // Invoke the function. | 
| +  CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state) | 
| +      ? CALL_AS_FUNCTION | 
| +      : CALL_AS_METHOD; | 
| ParameterCount actual(argc); | 
| -  __ InvokeFunction(rdi, actual, JUMP_FUNCTION); | 
| +  __ InvokeFunction(rdi, | 
| +                    actual, | 
| +                    JUMP_FUNCTION, | 
| +                    NullCallWrapper(), | 
| +                    call_kind); | 
| } | 
|  | 
|  | 
| -void CallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { | 
| +void CallIC::GenerateMegamorphic(MacroAssembler* masm, | 
| +                                 int argc, | 
| +                                 Code::ExtraICState extra_ic_state) { | 
| // ----------- S t a t e ------------- | 
| // rcx                      : function name | 
| // rsp[0]                   : return address | 
| @@ -998,8 +1011,8 @@ void CallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { | 
|  | 
| // Get the receiver of the function from the stack; 1 ~ return address. | 
| __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); | 
| -  GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC); | 
| -  GenerateMiss(masm, argc); | 
| +  GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); | 
| +  GenerateMiss(masm, argc, extra_ic_state); | 
| } | 
|  | 
|  | 
| @@ -1015,11 +1028,13 @@ void CallIC::GenerateNormal(MacroAssembler* masm, int argc) { | 
| // ----------------------------------- | 
|  | 
| GenerateCallNormal(masm, argc); | 
| -  GenerateMiss(masm, argc); | 
| +  GenerateMiss(masm, argc, Code::kNoExtraICState); | 
| } | 
|  | 
|  | 
| -void CallIC::GenerateMiss(MacroAssembler* masm, int argc) { | 
| +void CallIC::GenerateMiss(MacroAssembler* masm, | 
| +                          int argc, | 
| +                          Code::ExtraICState extra_ic_state) { | 
| // ----------- S t a t e ------------- | 
| // rcx                      : function name | 
| // rsp[0]                   : return address | 
| @@ -1030,7 +1045,7 @@ void CallIC::GenerateMiss(MacroAssembler* masm, int argc) { | 
| // rsp[(argc + 1) * 8]      : argument 0 = receiver | 
| // ----------------------------------- | 
|  | 
| -  GenerateCallMiss(masm, argc, IC::kCallIC_Miss); | 
| +  GenerateCallMiss(masm, argc, IC::kCallIC_Miss, extra_ic_state); | 
| } | 
|  | 
|  | 
| @@ -1121,7 +1136,10 @@ void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { | 
|  | 
| __ bind(&lookup_monomorphic_cache); | 
| __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1); | 
| -  GenerateMonomorphicCacheProbe(masm, argc, Code::KEYED_CALL_IC); | 
| +  GenerateMonomorphicCacheProbe(masm, | 
| +                                argc, | 
| +                                Code::KEYED_CALL_IC, | 
| +                                Code::kNoExtraICState); | 
| // Fall through on miss. | 
|  | 
| __ bind(&slow_call); | 
| @@ -1174,7 +1192,7 @@ void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) { | 
| // rsp[(argc + 1) * 8]      : argument 0 = receiver | 
| // ----------------------------------- | 
|  | 
| -  GenerateCallMiss(masm, argc, IC::kKeyedCallIC_Miss); | 
| +  GenerateCallMiss(masm, argc, IC::kKeyedCallIC_Miss, Code::kNoExtraICState); | 
| } | 
|  | 
|  | 
|  |