OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 | 183 |
184 static void InitializeArrayConstructorDescriptor( | 184 static void InitializeArrayConstructorDescriptor( |
185 Isolate* isolate, | 185 Isolate* isolate, |
186 CodeStubInterfaceDescriptor* descriptor, | 186 CodeStubInterfaceDescriptor* descriptor, |
187 int constant_stack_parameter_count) { | 187 int constant_stack_parameter_count) { |
188 // register state | 188 // register state |
189 // r0 -- number of arguments | 189 // r0 -- number of arguments |
190 // r1 -- function | 190 // r1 -- function |
191 // r2 -- type info cell with elements kind | 191 // r2 -- type info cell with elements kind |
192 static Register registers[] = { r1, r2 }; | 192 static Register registers_variable_args[] = { r1, r2, r0 }; |
193 descriptor->register_param_count_ = 2; | 193 static Register registers_no_args[] = { r1, r2 }; |
194 if (constant_stack_parameter_count != 0) { | 194 |
| 195 if (constant_stack_parameter_count == 0) { |
| 196 descriptor->register_param_count_ = 2; |
| 197 descriptor->register_params_ = registers_no_args; |
| 198 } else { |
195 // stack param count needs (constructor pointer, and single argument) | 199 // stack param count needs (constructor pointer, and single argument) |
| 200 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
196 descriptor->stack_parameter_count_ = r0; | 201 descriptor->stack_parameter_count_ = r0; |
| 202 descriptor->register_param_count_ = 3; |
| 203 descriptor->register_params_ = registers_variable_args; |
197 } | 204 } |
| 205 |
198 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 206 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
199 descriptor->register_params_ = registers; | |
200 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 207 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
201 descriptor->deoptimization_handler_ = | 208 descriptor->deoptimization_handler_ = |
202 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; | 209 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; |
203 } | 210 } |
204 | 211 |
205 | 212 |
206 static void InitializeInternalArrayConstructorDescriptor( | 213 static void InitializeInternalArrayConstructorDescriptor( |
207 Isolate* isolate, | 214 Isolate* isolate, |
208 CodeStubInterfaceDescriptor* descriptor, | 215 CodeStubInterfaceDescriptor* descriptor, |
209 int constant_stack_parameter_count) { | 216 int constant_stack_parameter_count) { |
210 // register state | 217 // register state |
211 // r0 -- number of arguments | 218 // r0 -- number of arguments |
212 // r1 -- constructor function | 219 // r1 -- constructor function |
213 static Register registers[] = { r1 }; | 220 static Register registers_variable_args[] = { r1, r0 }; |
214 descriptor->register_param_count_ = 1; | 221 static Register registers_no_args[] = { r1 }; |
215 | 222 |
216 if (constant_stack_parameter_count != 0) { | 223 if (constant_stack_parameter_count == 0) { |
| 224 descriptor->register_param_count_ = 1; |
| 225 descriptor->register_params_ = registers_no_args; |
| 226 } else { |
217 // stack param count needs (constructor pointer, and single argument) | 227 // stack param count needs (constructor pointer, and single argument) |
| 228 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
218 descriptor->stack_parameter_count_ = r0; | 229 descriptor->stack_parameter_count_ = r0; |
| 230 descriptor->register_param_count_ = 2; |
| 231 descriptor->register_params_ = registers_variable_args; |
219 } | 232 } |
| 233 |
220 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 234 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
221 descriptor->register_params_ = registers; | |
222 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 235 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
223 descriptor->deoptimization_handler_ = | 236 descriptor->deoptimization_handler_ = |
224 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; | 237 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; |
225 } | 238 } |
226 | 239 |
227 | 240 |
228 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 241 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
229 Isolate* isolate, | 242 Isolate* isolate, |
230 CodeStubInterfaceDescriptor* descriptor) { | 243 CodeStubInterfaceDescriptor* descriptor) { |
231 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 244 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); |
(...skipping 5841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6073 __ bind(&fast_elements_case); | 6086 __ bind(&fast_elements_case); |
6074 GenerateCase(masm, FAST_ELEMENTS); | 6087 GenerateCase(masm, FAST_ELEMENTS); |
6075 } | 6088 } |
6076 | 6089 |
6077 | 6090 |
6078 #undef __ | 6091 #undef __ |
6079 | 6092 |
6080 } } // namespace v8::internal | 6093 } } // namespace v8::internal |
6081 | 6094 |
6082 #endif // V8_TARGET_ARCH_ARM | 6095 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |