OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 descriptor->deoptimization_handler_ = | 56 descriptor->deoptimization_handler_ = |
57 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; | 57 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; |
58 } | 58 } |
59 | 59 |
60 | 60 |
61 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 61 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
62 CodeStubInterfaceDescriptor* descriptor) { | 62 CodeStubInterfaceDescriptor* descriptor) { |
63 static Register registers[] = { eax, ebx, ecx }; | 63 static Register registers[] = { eax, ebx, ecx }; |
64 descriptor->register_param_count_ = 3; | 64 descriptor->register_param_count_ = 3; |
65 descriptor->register_params_ = registers; | 65 descriptor->register_params_ = registers; |
66 static Representation representations[] = { | |
67 Representation::Tagged(), | |
68 Representation::Smi(), | |
69 Representation::Tagged() }; | |
70 descriptor->register_param_representations_ = representations; | |
71 descriptor->deoptimization_handler_ = | 66 descriptor->deoptimization_handler_ = |
72 Runtime::FunctionForId( | 67 Runtime::FunctionForId( |
73 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; | 68 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; |
74 } | 69 } |
75 | 70 |
76 | 71 |
77 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 72 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
78 CodeStubInterfaceDescriptor* descriptor) { | 73 CodeStubInterfaceDescriptor* descriptor) { |
79 static Register registers[] = { eax, ebx, ecx, edx }; | 74 static Register registers[] = { eax, ebx, ecx, edx }; |
80 descriptor->register_param_count_ = 4; | 75 descriptor->register_param_count_ = 4; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 187 |
193 if (constant_stack_parameter_count == 0) { | 188 if (constant_stack_parameter_count == 0) { |
194 descriptor->register_param_count_ = 2; | 189 descriptor->register_param_count_ = 2; |
195 descriptor->register_params_ = registers_no_args; | 190 descriptor->register_params_ = registers_no_args; |
196 } else { | 191 } else { |
197 // stack param count needs (constructor pointer, and single argument) | 192 // stack param count needs (constructor pointer, and single argument) |
198 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 193 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
199 descriptor->stack_parameter_count_ = eax; | 194 descriptor->stack_parameter_count_ = eax; |
200 descriptor->register_param_count_ = 3; | 195 descriptor->register_param_count_ = 3; |
201 descriptor->register_params_ = registers_variable_args; | 196 descriptor->register_params_ = registers_variable_args; |
202 static Representation representations[] = { | |
203 Representation::Tagged(), | |
204 Representation::Tagged(), | |
205 Representation::Integer32() }; | |
206 descriptor->register_param_representations_ = representations; | |
207 } | 197 } |
208 | 198 |
209 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 199 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
210 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 200 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
211 descriptor->deoptimization_handler_ = | 201 descriptor->deoptimization_handler_ = |
212 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; | 202 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; |
213 } | 203 } |
214 | 204 |
215 | 205 |
216 static void InitializeInternalArrayConstructorDescriptor( | 206 static void InitializeInternalArrayConstructorDescriptor( |
217 CodeStubInterfaceDescriptor* descriptor, | 207 CodeStubInterfaceDescriptor* descriptor, |
218 int constant_stack_parameter_count) { | 208 int constant_stack_parameter_count) { |
219 // register state | 209 // register state |
220 // eax -- number of arguments | 210 // eax -- number of arguments |
221 // edi -- constructor function | 211 // edi -- constructor function |
222 static Register registers_variable_args[] = { edi, eax }; | 212 static Register registers_variable_args[] = { edi, eax }; |
223 static Register registers_no_args[] = { edi }; | 213 static Register registers_no_args[] = { edi }; |
224 | 214 |
225 if (constant_stack_parameter_count == 0) { | 215 if (constant_stack_parameter_count == 0) { |
226 descriptor->register_param_count_ = 1; | 216 descriptor->register_param_count_ = 1; |
227 descriptor->register_params_ = registers_no_args; | 217 descriptor->register_params_ = registers_no_args; |
228 } else { | 218 } else { |
229 // stack param count needs (constructor pointer, and single argument) | 219 // stack param count needs (constructor pointer, and single argument) |
230 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 220 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
231 descriptor->stack_parameter_count_ = eax; | 221 descriptor->stack_parameter_count_ = eax; |
232 descriptor->register_param_count_ = 2; | 222 descriptor->register_param_count_ = 2; |
233 descriptor->register_params_ = registers_variable_args; | 223 descriptor->register_params_ = registers_variable_args; |
234 static Representation representations[] = { | |
235 Representation::Tagged(), | |
236 Representation::Integer32() }; | |
237 descriptor->register_param_representations_ = representations; | |
238 } | 224 } |
239 | 225 |
240 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 226 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
241 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 227 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
242 descriptor->deoptimization_handler_ = | 228 descriptor->deoptimization_handler_ = |
243 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; | 229 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; |
244 } | 230 } |
245 | 231 |
246 | 232 |
247 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 233 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
(...skipping 4880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5128 Operand(ebp, 7 * kPointerSize), | 5114 Operand(ebp, 7 * kPointerSize), |
5129 NULL); | 5115 NULL); |
5130 } | 5116 } |
5131 | 5117 |
5132 | 5118 |
5133 #undef __ | 5119 #undef __ |
5134 | 5120 |
5135 } } // namespace v8::internal | 5121 } } // namespace v8::internal |
5136 | 5122 |
5137 #endif // V8_TARGET_ARCH_IA32 | 5123 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |