| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 descriptor->deoptimization_handler_ = | 52 descriptor->deoptimization_handler_ = |
| 53 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; | 53 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; |
| 54 } | 54 } |
| 55 | 55 |
| 56 | 56 |
| 57 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 57 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 58 CodeStubInterfaceDescriptor* descriptor) { | 58 CodeStubInterfaceDescriptor* descriptor) { |
| 59 static Register registers[] = { rax, rbx, rcx }; | 59 static Register registers[] = { rax, rbx, rcx }; |
| 60 descriptor->register_param_count_ = 3; | 60 descriptor->register_param_count_ = 3; |
| 61 descriptor->register_params_ = registers; | 61 descriptor->register_params_ = registers; |
| 62 static Representation representations[] = { | |
| 63 Representation::Tagged(), | |
| 64 Representation::Smi(), | |
| 65 Representation::Tagged() }; | |
| 66 descriptor->register_param_representations_ = representations; | |
| 67 descriptor->deoptimization_handler_ = | 62 descriptor->deoptimization_handler_ = |
| 68 Runtime::FunctionForId( | 63 Runtime::FunctionForId( |
| 69 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; | 64 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; |
| 70 } | 65 } |
| 71 | 66 |
| 72 | 67 |
| 73 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 68 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
| 74 CodeStubInterfaceDescriptor* descriptor) { | 69 CodeStubInterfaceDescriptor* descriptor) { |
| 75 static Register registers[] = { rax, rbx, rcx, rdx }; | 70 static Register registers[] = { rax, rbx, rcx, rdx }; |
| 76 descriptor->register_param_count_ = 4; | 71 descriptor->register_param_count_ = 4; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 static Register registers_no_args[] = { rdi, rbx }; | 181 static Register registers_no_args[] = { rdi, rbx }; |
| 187 | 182 |
| 188 if (constant_stack_parameter_count == 0) { | 183 if (constant_stack_parameter_count == 0) { |
| 189 descriptor->register_param_count_ = 2; | 184 descriptor->register_param_count_ = 2; |
| 190 descriptor->register_params_ = registers_no_args; | 185 descriptor->register_params_ = registers_no_args; |
| 191 } else { | 186 } else { |
| 192 // stack param count needs (constructor pointer, and single argument) | 187 // stack param count needs (constructor pointer, and single argument) |
| 193 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 188 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 194 descriptor->stack_parameter_count_ = rax; | 189 descriptor->stack_parameter_count_ = rax; |
| 195 descriptor->register_param_count_ = 3; | 190 descriptor->register_param_count_ = 3; |
| 196 static Representation representations[] = { | |
| 197 Representation::Tagged(), | |
| 198 Representation::Tagged(), | |
| 199 Representation::Integer32() }; | |
| 200 descriptor->register_param_representations_ = representations; | |
| 201 descriptor->register_params_ = registers_variable_args; | 191 descriptor->register_params_ = registers_variable_args; |
| 202 } | 192 } |
| 203 | 193 |
| 204 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 194 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 205 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 195 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 206 descriptor->deoptimization_handler_ = | 196 descriptor->deoptimization_handler_ = |
| 207 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; | 197 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; |
| 208 } | 198 } |
| 209 | 199 |
| 210 | 200 |
| 211 static void InitializeInternalArrayConstructorDescriptor( | 201 static void InitializeInternalArrayConstructorDescriptor( |
| 212 CodeStubInterfaceDescriptor* descriptor, | 202 CodeStubInterfaceDescriptor* descriptor, |
| 213 int constant_stack_parameter_count) { | 203 int constant_stack_parameter_count) { |
| 214 // register state | 204 // register state |
| 215 // rax -- number of arguments | 205 // rax -- number of arguments |
| 216 // rdi -- constructor function | 206 // rdi -- constructor function |
| 217 static Register registers_variable_args[] = { rdi, rax }; | 207 static Register registers_variable_args[] = { rdi, rax }; |
| 218 static Register registers_no_args[] = { rdi }; | 208 static Register registers_no_args[] = { rdi }; |
| 219 | 209 |
| 220 if (constant_stack_parameter_count == 0) { | 210 if (constant_stack_parameter_count == 0) { |
| 221 descriptor->register_param_count_ = 1; | 211 descriptor->register_param_count_ = 1; |
| 222 descriptor->register_params_ = registers_no_args; | 212 descriptor->register_params_ = registers_no_args; |
| 223 } else { | 213 } else { |
| 224 // stack param count needs (constructor pointer, and single argument) | 214 // stack param count needs (constructor pointer, and single argument) |
| 225 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 215 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 226 descriptor->stack_parameter_count_ = rax; | 216 descriptor->stack_parameter_count_ = rax; |
| 227 descriptor->register_param_count_ = 2; | 217 descriptor->register_param_count_ = 2; |
| 228 descriptor->register_params_ = registers_variable_args; | 218 descriptor->register_params_ = registers_variable_args; |
| 229 static Representation representations[] = { | |
| 230 Representation::Tagged(), | |
| 231 Representation::Integer32() }; | |
| 232 descriptor->register_param_representations_ = representations; | |
| 233 } | 219 } |
| 234 | 220 |
| 235 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 221 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 236 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 222 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 237 descriptor->deoptimization_handler_ = | 223 descriptor->deoptimization_handler_ = |
| 238 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; | 224 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; |
| 239 } | 225 } |
| 240 | 226 |
| 241 | 227 |
| 242 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 228 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| (...skipping 4793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5036 return_value_operand, | 5022 return_value_operand, |
| 5037 NULL); | 5023 NULL); |
| 5038 } | 5024 } |
| 5039 | 5025 |
| 5040 | 5026 |
| 5041 #undef __ | 5027 #undef __ |
| 5042 | 5028 |
| 5043 } } // namespace v8::internal | 5029 } } // namespace v8::internal |
| 5044 | 5030 |
| 5045 #endif // V8_TARGET_ARCH_X64 | 5031 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |