| Index: src/mips/code-stubs-mips.cc
|
| diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
|
| index f053c7942cb4acef733139aac2f8246ee9b54360..1982c647ebc7e37cc2daaf45428dc561e19cd6a8 100644
|
| --- a/src/mips/code-stubs-mips.cc
|
| +++ b/src/mips/code-stubs-mips.cc
|
| @@ -178,14 +178,21 @@ static void InitializeArrayConstructorDescriptor(
|
| // a0 -- number of arguments
|
| // a1 -- function
|
| // a2 -- type info cell with elements kind
|
| - static Register registers[] = { a1, a2 };
|
| - descriptor->register_param_count_ = 2;
|
| - if (constant_stack_parameter_count != 0) {
|
| + static Register registers_variable_args[] = { a1, a2, a0 };
|
| + static Register registers_no_args[] = { a1, a2 };
|
| +
|
| + if (constant_stack_parameter_count == 0) {
|
| + descriptor->register_param_count_ = 2;
|
| + descriptor->register_params_ = registers_no_args;
|
| + } else {
|
| // stack param count needs (constructor pointer, and single argument)
|
| + descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| descriptor->stack_parameter_count_ = a0;
|
| + descriptor->register_param_count_ = 3;
|
| + descriptor->register_params_ = registers_variable_args;
|
| }
|
| +
|
| descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
| - descriptor->register_params_ = registers;
|
| descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
|
| descriptor->deoptimization_handler_ =
|
| Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
|
| @@ -199,15 +206,21 @@ static void InitializeInternalArrayConstructorDescriptor(
|
| // register state
|
| // a0 -- number of arguments
|
| // a1 -- constructor function
|
| - static Register registers[] = { a1 };
|
| - descriptor->register_param_count_ = 1;
|
| + static Register registers_variable_args[] = { a1, a0 };
|
| + static Register registers_no_args[] = { a1 };
|
|
|
| - if (constant_stack_parameter_count != 0) {
|
| - // Stack param count needs (constructor pointer, and single argument).
|
| + if (constant_stack_parameter_count == 0) {
|
| + descriptor->register_param_count_ = 1;
|
| + descriptor->register_params_ = registers_no_args;
|
| + } else {
|
| + // stack param count needs (constructor pointer, and single argument)
|
| + descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| descriptor->stack_parameter_count_ = a0;
|
| + descriptor->register_param_count_ = 2;
|
| + descriptor->register_params_ = registers_variable_args;
|
| }
|
| +
|
| descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
| - descriptor->register_params_ = registers;
|
| descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
|
| descriptor->deoptimization_handler_ =
|
| Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
|
|
|