Index: src/full-codegen/mips/full-codegen-mips.cc |
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc |
index 4af426cdc2ae5eff6f23c1eef3d513067e1f1208..d64d2790194d8373c1f180917a20f4e63e64aa26 100644 |
--- a/src/full-codegen/mips/full-codegen-mips.cc |
+++ b/src/full-codegen/mips/full-codegen-mips.cc |
@@ -280,28 +280,32 @@ void FullCodeGenerator::Generate() { |
if (arguments != NULL) { |
// Function uses arguments object. |
Comment cmnt(masm_, "[ Allocate arguments object"); |
- DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); |
if (!function_in_register_a1) { |
// Load this again, if it's used by the local context below. |
__ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
} |
- // Receiver is just before the parameters on the caller's stack. |
- int num_parameters = info->scope()->num_parameters(); |
- int offset = num_parameters * kPointerSize; |
- __ li(ArgumentsAccessNewDescriptor::parameter_count(), |
- Operand(Smi::FromInt(num_parameters))); |
- __ Addu(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, |
- Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
- |
- // Arguments to ArgumentsAccessStub: |
- // function, parameter pointer, parameter count. |
- // The stub will rewrite parameter pointer and parameter count if the |
- // previous stack frame was an arguments adapter frame. |
- bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); |
- ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
- is_unmapped, literal()->has_duplicate_parameters()); |
- ArgumentsAccessStub stub(isolate(), type); |
- __ CallStub(&stub); |
+ if (is_strict(language_mode()) || !has_simple_parameters()) { |
+ FastNewStrictArgumentsStub stub(isolate()); |
+ __ CallStub(&stub); |
+ } else { |
+ DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); |
+ // Receiver is just before the parameters on the caller's stack. |
+ int num_parameters = info->scope()->num_parameters(); |
+ int offset = num_parameters * kPointerSize; |
+ __ li(ArgumentsAccessNewDescriptor::parameter_count(), |
+ Operand(Smi::FromInt(num_parameters))); |
+ __ Addu(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, |
+ Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
+ |
+ // Arguments to ArgumentsAccessStub: |
+ // function, parameter pointer, parameter count. |
+ // The stub will rewrite parameter pointer and parameter count if the |
+ // previous stack frame was an arguments adapter frame. |
+ ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
+ literal()->has_duplicate_parameters()); |
+ ArgumentsAccessStub stub(isolate(), type); |
+ __ CallStub(&stub); |
+ } |
SetVar(arguments, v0, a1, a2); |
} |