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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 117 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
118 CodeStubInterfaceDescriptor* descriptor) { | 118 CodeStubInterfaceDescriptor* descriptor) { |
119 Register registers[] = { esi, eax, ebx }; | 119 Register registers[] = { esi, eax, ebx }; |
120 descriptor->Initialize( | 120 descriptor->Initialize( |
121 MajorKey(), arraysize(registers), registers, | 121 MajorKey(), arraysize(registers), registers, |
122 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry); | 122 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry); |
123 } | 123 } |
124 | 124 |
125 | 125 |
126 const Register InterfaceDescriptor::ContextRegister() { return esi; } | |
127 | |
128 | |
129 static void InitializeArrayConstructorDescriptor( | 126 static void InitializeArrayConstructorDescriptor( |
130 Isolate* isolate, CodeStub::Major major, | 127 Isolate* isolate, CodeStub::Major major, |
131 CodeStubInterfaceDescriptor* descriptor, | 128 CodeStubInterfaceDescriptor* descriptor, |
132 int constant_stack_parameter_count) { | 129 int constant_stack_parameter_count) { |
133 // register state | 130 // register state |
134 // eax -- number of arguments | 131 // eax -- number of arguments |
135 // edi -- function | 132 // edi -- function |
136 // ebx -- allocation site with elements kind | 133 // ebx -- allocation site with elements kind |
137 Address deopt_handler = Runtime::FunctionForId( | 134 Address deopt_handler = Runtime::FunctionForId( |
138 Runtime::kArrayConstructor)->entry; | 135 Runtime::kArrayConstructor)->entry; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 258 |
262 | 259 |
263 void StringAddStub::InitializeInterfaceDescriptor( | 260 void StringAddStub::InitializeInterfaceDescriptor( |
264 CodeStubInterfaceDescriptor* descriptor) { | 261 CodeStubInterfaceDescriptor* descriptor) { |
265 Register registers[] = { esi, edx, eax }; | 262 Register registers[] = { esi, edx, eax }; |
266 descriptor->Initialize(MajorKey(), arraysize(registers), registers, | 263 descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
267 Runtime::FunctionForId(Runtime::kStringAdd)->entry); | 264 Runtime::FunctionForId(Runtime::kStringAdd)->entry); |
268 } | 265 } |
269 | 266 |
270 | 267 |
271 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | |
272 { | |
273 CallInterfaceDescriptor* descriptor = | |
274 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); | |
275 Register registers[] = { esi, // context | |
276 edi, // JSFunction | |
277 eax, // actual number of arguments | |
278 ebx, // expected number of arguments | |
279 }; | |
280 Representation representations[] = { | |
281 Representation::Tagged(), // context | |
282 Representation::Tagged(), // JSFunction | |
283 Representation::Integer32(), // actual number of arguments | |
284 Representation::Integer32(), // expected number of arguments | |
285 }; | |
286 descriptor->Initialize(arraysize(registers), registers, representations); | |
287 } | |
288 { | |
289 CallInterfaceDescriptor* descriptor = | |
290 isolate->call_descriptor(Isolate::KeyedCall); | |
291 Register registers[] = { esi, // context | |
292 ecx, // key | |
293 }; | |
294 Representation representations[] = { | |
295 Representation::Tagged(), // context | |
296 Representation::Tagged(), // key | |
297 }; | |
298 descriptor->Initialize(arraysize(registers), registers, representations); | |
299 } | |
300 { | |
301 CallInterfaceDescriptor* descriptor = | |
302 isolate->call_descriptor(Isolate::NamedCall); | |
303 Register registers[] = { esi, // context | |
304 ecx, // name | |
305 }; | |
306 Representation representations[] = { | |
307 Representation::Tagged(), // context | |
308 Representation::Tagged(), // name | |
309 }; | |
310 descriptor->Initialize(arraysize(registers), registers, representations); | |
311 } | |
312 { | |
313 CallInterfaceDescriptor* descriptor = | |
314 isolate->call_descriptor(Isolate::CallHandler); | |
315 Register registers[] = { esi, // context | |
316 edx, // name | |
317 }; | |
318 Representation representations[] = { | |
319 Representation::Tagged(), // context | |
320 Representation::Tagged(), // receiver | |
321 }; | |
322 descriptor->Initialize(arraysize(registers), registers, representations); | |
323 } | |
324 { | |
325 CallInterfaceDescriptor* descriptor = | |
326 isolate->call_descriptor(Isolate::ApiFunctionCall); | |
327 Register registers[] = { esi, // context | |
328 eax, // callee | |
329 ebx, // call_data | |
330 ecx, // holder | |
331 edx, // api_function_address | |
332 }; | |
333 Representation representations[] = { | |
334 Representation::Tagged(), // context | |
335 Representation::Tagged(), // callee | |
336 Representation::Tagged(), // call_data | |
337 Representation::Tagged(), // holder | |
338 Representation::External(), // api_function_address | |
339 }; | |
340 descriptor->Initialize(arraysize(registers), registers, representations); | |
341 } | |
342 } | |
343 | |
344 | |
345 #define __ ACCESS_MASM(masm) | 268 #define __ ACCESS_MASM(masm) |
346 | 269 |
347 | 270 |
348 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 271 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
349 // Update the static counter each time a new code stub is generated. | 272 // Update the static counter each time a new code stub is generated. |
350 isolate()->counters()->code_stubs()->Increment(); | 273 isolate()->counters()->code_stubs()->Increment(); |
351 | 274 |
352 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); | 275 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
353 int param_count = descriptor->GetEnvironmentParameterCount(); | 276 int param_count = descriptor->GetEnvironmentParameterCount(); |
354 { | 277 { |
(...skipping 4663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5018 Operand(ebp, 7 * kPointerSize), | 4941 Operand(ebp, 7 * kPointerSize), |
5019 NULL); | 4942 NULL); |
5020 } | 4943 } |
5021 | 4944 |
5022 | 4945 |
5023 #undef __ | 4946 #undef __ |
5024 | 4947 |
5025 } } // namespace v8::internal | 4948 } } // namespace v8::internal |
5026 | 4949 |
5027 #endif // V8_TARGET_ARCH_IA32 | 4950 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |