Index: src/full-codegen/ppc/full-codegen-ppc.cc |
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc |
index 0ce982204da664cc030e3a77a20d60462fb633fa..6425134d6a3b21c8a2d934c28171e43805b242e7 100644 |
--- a/src/full-codegen/ppc/full-codegen-ppc.cc |
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc |
@@ -276,28 +276,32 @@ void FullCodeGenerator::Generate() { |
if (arguments != NULL) { |
// Function uses arguments object. |
Comment cmnt(masm_, "[ Allocate arguments object"); |
- DCHECK(r4.is(ArgumentsAccessNewDescriptor::function())); |
if (!function_in_register_r4) { |
// Load this again, if it's used by the local context below. |
__ LoadP(r4, 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; |
- __ LoadSmiLiteral(ArgumentsAccessNewDescriptor::parameter_count(), |
- Smi::FromInt(num_parameters)); |
- __ addi(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(r4.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; |
+ __ LoadSmiLiteral(ArgumentsAccessNewDescriptor::parameter_count(), |
+ Smi::FromInt(num_parameters)); |
+ __ addi(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, r3, r4, r5); |
} |