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/ic/ic-conventions.h" |
9 #include "src/interface-descriptors.h" | 10 #include "src/interface-descriptors.h" |
10 | 11 |
11 namespace v8 { | 12 namespace v8 { |
12 namespace internal { | 13 namespace internal { |
13 | 14 |
14 const Register InterfaceDescriptor::ContextRegister() { return esi; } | 15 const Register InterfaceDescriptor::ContextRegister() { return esi; } |
15 | 16 |
16 | 17 |
17 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 18 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 19 InitializeForIsolateAllPlatforms(isolate); |
| 20 |
| 21 { |
| 22 CallInterfaceDescriptor* descriptor = |
| 23 isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall); |
| 24 Register registers[] = {esi, ebx}; |
| 25 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 26 } |
| 27 { |
| 28 CallInterfaceDescriptor* descriptor = |
| 29 isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); |
| 30 Register registers[] = {esi, edi}; |
| 31 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 32 } |
| 33 { |
| 34 CallInterfaceDescriptor* descriptor = |
| 35 isolate->call_descriptor(CallDescriptorKey::ToNumberCall); |
| 36 // ToNumberStub invokes a function, and therefore needs a context. |
| 37 Register registers[] = {esi, eax}; |
| 38 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 39 } |
| 40 { |
| 41 CallInterfaceDescriptor* descriptor = |
| 42 isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); |
| 43 Register registers[] = {esi, eax}; |
| 44 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 45 } |
| 46 { |
| 47 CallInterfaceDescriptor* descriptor = |
| 48 isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); |
| 49 Register registers[] = {esi, eax, ebx, ecx}; |
| 50 Representation representations[] = { |
| 51 Representation::Tagged(), Representation::Tagged(), |
| 52 Representation::Smi(), Representation::Tagged()}; |
| 53 descriptor->Initialize(arraysize(registers), registers, representations); |
| 54 } |
| 55 { |
| 56 CallInterfaceDescriptor* descriptor = |
| 57 isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); |
| 58 Register registers[] = {esi, eax, ebx, ecx, edx}; |
| 59 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 60 } |
| 61 { |
| 62 CallInterfaceDescriptor* descriptor = |
| 63 isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); |
| 64 Register registers[] = {esi, ebx, edx}; |
| 65 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 66 } |
| 67 { |
| 68 CallInterfaceDescriptor* descriptor = |
| 69 isolate->call_descriptor(CallDescriptorKey::CallFunctionCall); |
| 70 Register registers[] = {esi, edi}; |
| 71 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 72 } |
| 73 { |
| 74 CallInterfaceDescriptor* descriptor = |
| 75 isolate->call_descriptor(CallDescriptorKey::CallConstructCall); |
| 76 // eax : number of arguments |
| 77 // ebx : feedback vector |
| 78 // edx : (only if ebx is not the megamorphic symbol) slot in feedback |
| 79 // vector (Smi) |
| 80 // edi : constructor function |
| 81 // TODO(turbofan): So far we don't gather type feedback and hence skip the |
| 82 // slot parameter, but ArrayConstructStub needs the vector to be undefined. |
| 83 Register registers[] = {esi, eax, edi, ebx}; |
| 84 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 85 } |
| 86 { |
| 87 CallInterfaceDescriptor* descriptor = |
| 88 isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); |
| 89 Register registers[] = {esi, ecx, ebx, eax}; |
| 90 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 91 } |
| 92 { |
| 93 CallInterfaceDescriptor* descriptor = |
| 94 isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); |
| 95 Register registers[] = {esi, eax, ebx}; |
| 96 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 97 } |
| 98 { |
| 99 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 100 CallDescriptorKey::ArrayConstructorConstantArgCountCall); |
| 101 // register state |
| 102 // eax -- number of arguments |
| 103 // edi -- function |
| 104 // ebx -- allocation site with elements kind |
| 105 Register registers[] = {esi, edi, ebx}; |
| 106 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 107 } |
| 108 { |
| 109 CallInterfaceDescriptor* descriptor = |
| 110 isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); |
| 111 // stack param count needs (constructor pointer, and single argument) |
| 112 Register registers[] = {esi, edi, ebx, eax}; |
| 113 Representation representations[] = { |
| 114 Representation::Tagged(), Representation::Tagged(), |
| 115 Representation::Tagged(), Representation::Integer32()}; |
| 116 descriptor->Initialize(arraysize(registers), registers, representations); |
| 117 } |
| 118 { |
| 119 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 120 CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); |
| 121 // register state |
| 122 // eax -- number of arguments |
| 123 // edi -- function |
| 124 Register registers[] = {esi, edi}; |
| 125 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 126 } |
| 127 { |
| 128 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 129 CallDescriptorKey::InternalArrayConstructorCall); |
| 130 // stack param count needs (constructor pointer, and single argument) |
| 131 Register registers[] = {esi, edi, eax}; |
| 132 Representation representations[] = {Representation::Tagged(), |
| 133 Representation::Tagged(), |
| 134 Representation::Integer32()}; |
| 135 descriptor->Initialize(arraysize(registers), registers, representations); |
| 136 } |
| 137 { |
| 138 CallInterfaceDescriptor* descriptor = |
| 139 isolate->call_descriptor(CallDescriptorKey::CompareNilCall); |
| 140 Register registers[] = {esi, eax}; |
| 141 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 142 } |
| 143 { |
| 144 CallInterfaceDescriptor* descriptor = |
| 145 isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); |
| 146 Register registers[] = {esi, eax}; |
| 147 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 148 } |
| 149 { |
| 150 CallInterfaceDescriptor* descriptor = |
| 151 isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); |
| 152 Register registers[] = {esi, edx, eax}; |
| 153 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 154 } |
| 155 { |
| 156 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 157 CallDescriptorKey::BinaryOpWithAllocationSiteCall); |
| 158 Register registers[] = {esi, ecx, edx, eax}; |
| 159 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 160 } |
| 161 { |
| 162 CallInterfaceDescriptor* descriptor = |
| 163 isolate->call_descriptor(CallDescriptorKey::StringAddCall); |
| 164 Register registers[] = {esi, edx, eax}; |
| 165 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 166 } |
| 167 |
18 { | 168 { |
19 CallInterfaceDescriptor* descriptor = | 169 CallInterfaceDescriptor* descriptor = |
20 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); | 170 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); |
21 Register registers[] = { | 171 Register registers[] = { |
22 esi, // context | 172 esi, // context |
23 edi, // JSFunction | 173 edi, // JSFunction |
24 eax, // actual number of arguments | 174 eax, // actual number of arguments |
25 ebx, // expected number of arguments | 175 ebx, // expected number of arguments |
26 }; | 176 }; |
27 Representation representations[] = { | 177 Representation representations[] = { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 Representation::Tagged(), // holder | 238 Representation::Tagged(), // holder |
89 Representation::External(), // api_function_address | 239 Representation::External(), // api_function_address |
90 }; | 240 }; |
91 descriptor->Initialize(arraysize(registers), registers, representations); | 241 descriptor->Initialize(arraysize(registers), registers, representations); |
92 } | 242 } |
93 } | 243 } |
94 } | 244 } |
95 } // namespace v8::internal | 245 } // namespace v8::internal |
96 | 246 |
97 #endif // V8_TARGET_ARCH_IA32 | 247 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |