Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 2607f9eac2e1b59b9418a98c01c5d79b63cd5348..94e114fef94c69976f097a058e5067b6365b6dd6 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -189,14 +189,21 @@ static void InitializeArrayConstructorDescriptor( |
// r0 -- number of arguments |
// r1 -- function |
// r2 -- type info cell with elements kind |
- static Register registers[] = { r1, r2 }; |
- descriptor->register_param_count_ = 2; |
- if (constant_stack_parameter_count != 0) { |
+ static Register registers_variable_args[] = { r1, r2, r0 }; |
+ static Register registers_no_args[] = { r1, r2 }; |
+ |
+ 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_ = r0; |
+ 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; |
@@ -210,15 +217,21 @@ static void InitializeInternalArrayConstructorDescriptor( |
// register state |
// r0 -- number of arguments |
// r1 -- constructor function |
- static Register registers[] = { r1 }; |
- descriptor->register_param_count_ = 1; |
+ static Register registers_variable_args[] = { r1, r0 }; |
+ static Register registers_no_args[] = { r1 }; |
- if (constant_stack_parameter_count != 0) { |
+ 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_ = r0; |
+ 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; |