| Index: src/mips/ic-mips.cc
 | 
| diff --git a/src/mips/ic-mips.cc b/src/mips/ic-mips.cc
 | 
| index 1946bf18a1abac37b73ceb71029ab063efb6ed6b..12c81c218736915f9260e3bd16aca4aa4e26a644 100644
 | 
| --- a/src/mips/ic-mips.cc
 | 
| +++ b/src/mips/ic-mips.cc
 | 
| @@ -494,7 +494,8 @@ Object* CallIC_Miss(Arguments args);
 | 
|  // 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 -------------
 | 
|    //  -- a1    : receiver
 | 
|    //  -- a2    : name
 | 
| @@ -505,7 +506,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(
 | 
| @@ -593,7 +594,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 -------------
 | 
|    //  -- a2    : name
 | 
|    //  -- ra    : return address
 | 
| @@ -643,22 +647,33 @@ static void GenerateCallMiss(MacroAssembler* masm, int argc, IC::UtilityId id) {
 | 
|      __ bind(&invoke);
 | 
|    }
 | 
|    // Invoke the function.
 | 
| +  CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state)
 | 
| +      ? CALL_AS_FUNCTION
 | 
| +      : CALL_AS_METHOD;
 | 
|    ParameterCount actual(argc);
 | 
| -  __ InvokeFunction(a1, actual, JUMP_FUNCTION);
 | 
| +  __ InvokeFunction(a1,
 | 
| +                    actual,
 | 
| +                    JUMP_FUNCTION,
 | 
| +                    NullCallWrapper(),
 | 
| +                    call_kind);
 | 
|  }
 | 
|  
 | 
|  
 | 
| -void CallIC::GenerateMiss(MacroAssembler* masm, int argc) {
 | 
| +void CallIC::GenerateMiss(MacroAssembler* masm,
 | 
| +                          int argc,
 | 
| +                          Code::ExtraICState extra_ic_state) {
 | 
|    // ----------- S t a t e -------------
 | 
|    //  -- a2    : name
 | 
|    //  -- ra    : return address
 | 
|    // -----------------------------------
 | 
|  
 | 
| -  GenerateCallMiss(masm, argc, IC::kCallIC_Miss);
 | 
| +  GenerateCallMiss(masm, argc, IC::kCallIC_Miss, extra_ic_state);
 | 
|  }
 | 
|  
 | 
|  
 | 
| -void CallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
 | 
| +void CallIC::GenerateMegamorphic(MacroAssembler* masm,
 | 
| +                                 int argc,
 | 
| +                                 Code::ExtraICState extra_ic_state) {
 | 
|    // ----------- S t a t e -------------
 | 
|    //  -- a2    : name
 | 
|    //  -- ra    : return address
 | 
| @@ -666,8 +681,8 @@ void CallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
 | 
|  
 | 
|    // Get the receiver of the function from the stack into a1.
 | 
|    __ lw(a1, MemOperand(sp, argc * 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);
 | 
|  }
 | 
|  
 | 
|  
 | 
| @@ -678,7 +693,7 @@ void CallIC::GenerateNormal(MacroAssembler* masm, int argc) {
 | 
|    // -----------------------------------
 | 
|  
 | 
|    GenerateCallNormal(masm, argc);
 | 
| -  GenerateMiss(masm, argc);
 | 
| +  GenerateMiss(masm, argc, Code::kNoExtraICState);
 | 
|  }
 | 
|  
 | 
|  
 | 
| @@ -688,7 +703,7 @@ void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) {
 | 
|    //  -- ra    : return address
 | 
|    // -----------------------------------
 | 
|  
 | 
| -  GenerateCallMiss(masm, argc, IC::kKeyedCallIC_Miss);
 | 
| +  GenerateCallMiss(masm, argc, IC::kKeyedCallIC_Miss, Code::kNoExtraICState);
 | 
|  }
 | 
|  
 | 
|  
 | 
| @@ -773,7 +788,10 @@ void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
 | 
|  
 | 
|    __ bind(&lookup_monomorphic_cache);
 | 
|    __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1, a0, a3);
 | 
| -  GenerateMonomorphicCacheProbe(masm, argc, Code::KEYED_CALL_IC);
 | 
| +  GenerateMonomorphicCacheProbe(masm,
 | 
| +                                argc,
 | 
| +                                Code::KEYED_CALL_IC,
 | 
| +                                Code::kNoExtraICState);
 | 
|    // Fall through on miss.
 | 
|  
 | 
|    __ bind(&slow_call);
 | 
| 
 |