diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 3d1330be33..5cbfb647f9 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -196,9 +196,7 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) { __ IncrementCounter(counters->fast_new_closure_total(), 1, t2, t3); - int map_index = (language_mode_ == CLASSIC_MODE) - ? Context::FUNCTION_MAP_INDEX - : Context::STRICT_MODE_FUNCTION_MAP_INDEX; + int map_index = Context::FunctionMapIndex(language_mode_, is_generator_); // Compute the function map in the current native context and set that // as the map of the allocated object. diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index f41ca4784e..2931c15208 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -1277,7 +1277,7 @@ void FullCodeGenerator::EmitNewClosure(Handle info, !pretenure && scope()->is_function_scope() && info->num_literals() == 0) { - FastNewClosureStub stub(info->language_mode()); + FastNewClosureStub stub(info->language_mode(), info->is_generator()); __ li(a0, Operand(info)); __ push(a0); __ CallStub(&stub); diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index d8550494e7..afd5ba5193 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -5490,7 +5490,8 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { Handle shared_info = instr->shared_info(); bool pretenure = instr->hydrogen()->pretenure(); if (!pretenure && shared_info->num_literals() == 0) { - FastNewClosureStub stub(shared_info->language_mode()); + FastNewClosureStub stub(shared_info->language_mode(), + shared_info->is_generator()); __ li(a1, Operand(shared_info)); __ push(a1); CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);