Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 0912661d7e3664e042938ca16ed603b732a9302a..9d95fc42639ac985980073f2040a08ce9d2cc3fb 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -176,14 +176,21 @@ static void InitializeArrayConstructorDescriptor( |
// rax -- number of arguments |
// rdi -- function |
// rbx -- type info cell with elements kind |
- static Register registers[] = { rdi, rbx }; |
- descriptor->register_param_count_ = 2; |
- if (constant_stack_parameter_count != 0) { |
+ static Register registers_variable_args[] = { rdi, rbx, rax }; |
+ static Register registers_no_args[] = { rdi, rbx }; |
+ |
+ 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_ = rax; |
+ 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; |
@@ -197,15 +204,21 @@ static void InitializeInternalArrayConstructorDescriptor( |
// register state |
// rax -- number of arguments |
// rdi -- constructor function |
- static Register registers[] = { rdi }; |
- descriptor->register_param_count_ = 1; |
+ static Register registers_variable_args[] = { rdi, rax }; |
+ static Register registers_no_args[] = { rdi }; |
- 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_ = rax; |
+ 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; |