Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: src/x64/interface-descriptors-x64.cc

Issue 1211333003: Make context register implicit for CallInterfaceDescriptors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Platform ports Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/interface-descriptors.h" 9 #include "src/interface-descriptors.h"
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return MathPowTaggedDescriptor::exponent(); 59 return MathPowTaggedDescriptor::exponent();
60 } 60 }
61 61
62 62
63 const Register GrowArrayElementsDescriptor::ObjectRegister() { return rax; } 63 const Register GrowArrayElementsDescriptor::ObjectRegister() { return rax; }
64 const Register GrowArrayElementsDescriptor::KeyRegister() { return rbx; } 64 const Register GrowArrayElementsDescriptor::KeyRegister() { return rbx; }
65 65
66 66
67 void FastNewClosureDescriptor::InitializePlatformSpecific( 67 void FastNewClosureDescriptor::InitializePlatformSpecific(
68 CallInterfaceDescriptorData* data) { 68 CallInterfaceDescriptorData* data) {
69 Register registers[] = {rsi, rbx}; 69 Register registers[] = {rbx};
70 data->InitializePlatformSpecific(arraysize(registers), registers); 70 data->InitializePlatformSpecific(arraysize(registers), registers);
71 } 71 }
72 72
73 73
74 void FastNewContextDescriptor::InitializePlatformSpecific( 74 void FastNewContextDescriptor::InitializePlatformSpecific(
75 CallInterfaceDescriptorData* data) { 75 CallInterfaceDescriptorData* data) {
76 Register registers[] = {rsi, rdi}; 76 Register registers[] = {rdi};
77 data->InitializePlatformSpecific(arraysize(registers), registers); 77 data->InitializePlatformSpecific(arraysize(registers), registers);
78 } 78 }
79 79
80 80
81 void TypeofDescriptor::InitializePlatformSpecific( 81 void TypeofDescriptor::InitializePlatformSpecific(
82 CallInterfaceDescriptorData* data) { 82 CallInterfaceDescriptorData* data) {
83 Register registers[] = {rsi, rbx}; 83 Register registers[] = {rbx};
84 data->InitializePlatformSpecific(arraysize(registers), registers); 84 data->InitializePlatformSpecific(arraysize(registers), registers);
85 } 85 }
86 86
87 87
88 void ToNumberDescriptor::InitializePlatformSpecific( 88 void ToNumberDescriptor::InitializePlatformSpecific(
89 CallInterfaceDescriptorData* data) { 89 CallInterfaceDescriptorData* data) {
90 // ToNumberStub invokes a function, and therefore needs a context. 90 // ToNumberStub invokes a function, and therefore needs a context.
91 Register registers[] = {rsi, rax}; 91 Register registers[] = {rax};
92 data->InitializePlatformSpecific(arraysize(registers), registers); 92 data->InitializePlatformSpecific(arraysize(registers), registers);
93 } 93 }
94 94
95 95
96 void NumberToStringDescriptor::InitializePlatformSpecific( 96 void NumberToStringDescriptor::InitializePlatformSpecific(
97 CallInterfaceDescriptorData* data) { 97 CallInterfaceDescriptorData* data) {
98 Register registers[] = {rsi, rax}; 98 Register registers[] = {rax};
99 data->InitializePlatformSpecific(arraysize(registers), registers); 99 data->InitializePlatformSpecific(arraysize(registers), registers);
100 } 100 }
101 101
102 102
103 void FastCloneShallowArrayDescriptor::InitializePlatformSpecific( 103 void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
104 CallInterfaceDescriptorData* data) { 104 CallInterfaceDescriptorData* data) {
105 Register registers[] = {rsi, rax, rbx, rcx}; 105 Register registers[] = {rax, rbx, rcx};
106 data->InitializePlatformSpecific(arraysize(registers), registers); 106 data->InitializePlatformSpecific(arraysize(registers), registers);
107 } 107 }
108 108
109 109
110 void FastCloneShallowObjectDescriptor::InitializePlatformSpecific( 110 void FastCloneShallowObjectDescriptor::InitializePlatformSpecific(
111 CallInterfaceDescriptorData* data) { 111 CallInterfaceDescriptorData* data) {
112 Register registers[] = {rsi, rax, rbx, rcx, rdx}; 112 Register registers[] = {rax, rbx, rcx, rdx};
113 data->InitializePlatformSpecific(arraysize(registers), registers); 113 data->InitializePlatformSpecific(arraysize(registers), registers);
114 } 114 }
115 115
116 116
117 void CreateAllocationSiteDescriptor::InitializePlatformSpecific( 117 void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
118 CallInterfaceDescriptorData* data) { 118 CallInterfaceDescriptorData* data) {
119 Register registers[] = {rsi, rbx, rdx}; 119 Register registers[] = {rbx, rdx};
120 data->InitializePlatformSpecific(arraysize(registers), registers); 120 data->InitializePlatformSpecific(arraysize(registers), registers);
121 } 121 }
122 122
123 123
124 void CreateWeakCellDescriptor::InitializePlatformSpecific( 124 void CreateWeakCellDescriptor::InitializePlatformSpecific(
125 CallInterfaceDescriptorData* data) { 125 CallInterfaceDescriptorData* data) {
126 Register registers[] = {rsi, rbx, rdx, rdi}; 126 Register registers[] = {rbx, rdx, rdi};
127 data->InitializePlatformSpecific(arraysize(registers), registers); 127 data->InitializePlatformSpecific(arraysize(registers), registers);
128 } 128 }
129 129
130 130
131 void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific( 131 void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific(
132 CallInterfaceDescriptorData* data) { 132 CallInterfaceDescriptorData* data) {
133 Register registers[] = {rsi, rcx, rax}; 133 Register registers[] = {rcx, rax};
134 data->InitializePlatformSpecific(arraysize(registers), registers); 134 data->InitializePlatformSpecific(arraysize(registers), registers);
135 } 135 }
136 136
137 137
138 void CallFunctionDescriptor::InitializePlatformSpecific( 138 void CallFunctionDescriptor::InitializePlatformSpecific(
139 CallInterfaceDescriptorData* data) { 139 CallInterfaceDescriptorData* data) {
140 Register registers[] = {rsi, rdi}; 140 Register registers[] = {rdi};
141 data->InitializePlatformSpecific(arraysize(registers), registers); 141 data->InitializePlatformSpecific(arraysize(registers), registers);
142 } 142 }
143 143
144 144
145 void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific( 145 void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
146 CallInterfaceDescriptorData* data) { 146 CallInterfaceDescriptorData* data) {
147 Register registers[] = {rsi, rdi, rdx}; 147 Register registers[] = {rdi, rdx};
148 data->InitializePlatformSpecific(arraysize(registers), registers); 148 data->InitializePlatformSpecific(arraysize(registers), registers);
149 } 149 }
150 150
151 151
152 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific( 152 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific(
153 CallInterfaceDescriptorData* data) { 153 CallInterfaceDescriptorData* data) {
154 Register registers[] = {rsi, rdi, rdx, rbx}; 154 Register registers[] = {rdi, rdx, rbx};
155 data->InitializePlatformSpecific(arraysize(registers), registers); 155 data->InitializePlatformSpecific(arraysize(registers), registers);
156 } 156 }
157 157
158 158
159 void CallConstructDescriptor::InitializePlatformSpecific( 159 void CallConstructDescriptor::InitializePlatformSpecific(
160 CallInterfaceDescriptorData* data) { 160 CallInterfaceDescriptorData* data) {
161 // rax : number of arguments 161 // rax : number of arguments
162 // rbx : feedback vector 162 // rbx : feedback vector
163 // rdx : (only if rbx is not the megamorphic symbol) slot in feedback 163 // rdx : (only if rbx is not the megamorphic symbol) slot in feedback
164 // vector (Smi) 164 // vector (Smi)
165 // rdi : constructor function 165 // rdi : constructor function
166 // TODO(turbofan): So far we don't gather type feedback and hence skip the 166 // TODO(turbofan): So far we don't gather type feedback and hence skip the
167 // slot parameter, but ArrayConstructStub needs the vector to be undefined. 167 // slot parameter, but ArrayConstructStub needs the vector to be undefined.
168 Register registers[] = {rsi, rax, rdi, rbx}; 168 Register registers[] = {rax, rdi, rbx};
169 data->InitializePlatformSpecific(arraysize(registers), registers); 169 data->InitializePlatformSpecific(arraysize(registers), registers);
170 } 170 }
171 171
172 172
173 void RegExpConstructResultDescriptor::InitializePlatformSpecific( 173 void RegExpConstructResultDescriptor::InitializePlatformSpecific(
174 CallInterfaceDescriptorData* data) { 174 CallInterfaceDescriptorData* data) {
175 Register registers[] = {rsi, rcx, rbx, rax}; 175 Register registers[] = {rcx, rbx, rax};
176 data->InitializePlatformSpecific(arraysize(registers), registers); 176 data->InitializePlatformSpecific(arraysize(registers), registers);
177 } 177 }
178 178
179 179
180 void TransitionElementsKindDescriptor::InitializePlatformSpecific( 180 void TransitionElementsKindDescriptor::InitializePlatformSpecific(
181 CallInterfaceDescriptorData* data) { 181 CallInterfaceDescriptorData* data) {
182 Register registers[] = {rsi, rax, rbx}; 182 Register registers[] = {rax, rbx};
183 data->InitializePlatformSpecific(arraysize(registers), registers); 183 data->InitializePlatformSpecific(arraysize(registers), registers);
184 } 184 }
185 185
186 186
187 void AllocateHeapNumberDescriptor::InitializePlatformSpecific( 187 void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
188 CallInterfaceDescriptorData* data) { 188 CallInterfaceDescriptorData* data) {
189 // register state 189 data->InitializePlatformSpecific(0, nullptr, nullptr);
190 // rsi -- context
191 Register registers[] = {rsi};
192 data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
193 } 190 }
194 191
195 192
196 void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific( 193 void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific(
197 CallInterfaceDescriptorData* data) { 194 CallInterfaceDescriptorData* data) {
198 // register state 195 // register state
199 // rax -- number of arguments 196 // rax -- number of arguments
200 // rdi -- function 197 // rdi -- function
201 // rbx -- allocation site with elements kind 198 // rbx -- allocation site with elements kind
202 Register registers[] = {rsi, rdi, rbx}; 199 Register registers[] = {rdi, rbx};
203 data->InitializePlatformSpecific(arraysize(registers), registers); 200 data->InitializePlatformSpecific(arraysize(registers), registers);
204 } 201 }
205 202
206 203
207 void ArrayConstructorDescriptor::InitializePlatformSpecific( 204 void ArrayConstructorDescriptor::InitializePlatformSpecific(
208 CallInterfaceDescriptorData* data) { 205 CallInterfaceDescriptorData* data) {
209 // stack param count needs (constructor pointer, and single argument) 206 // stack param count needs (constructor pointer, and single argument)
210 Register registers[] = {rsi, rdi, rbx, rax}; 207 Register registers[] = {rdi, rbx, rax};
211 data->InitializePlatformSpecific(arraysize(registers), registers); 208 data->InitializePlatformSpecific(arraysize(registers), registers);
212 } 209 }
213 210
214 211
215 void InternalArrayConstructorConstantArgCountDescriptor:: 212 void InternalArrayConstructorConstantArgCountDescriptor::
216 InitializePlatformSpecific(CallInterfaceDescriptorData* data) { 213 InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
217 // register state 214 // register state
218 // rsi -- context
219 // rax -- number of arguments 215 // rax -- number of arguments
220 // rdi -- constructor function 216 // rdi -- constructor function
221 Register registers[] = {rsi, rdi}; 217 Register registers[] = {rdi};
222 data->InitializePlatformSpecific(arraysize(registers), registers); 218 data->InitializePlatformSpecific(arraysize(registers), registers);
223 } 219 }
224 220
225 221
226 void InternalArrayConstructorDescriptor::InitializePlatformSpecific( 222 void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
227 CallInterfaceDescriptorData* data) { 223 CallInterfaceDescriptorData* data) {
228 // stack param count needs (constructor pointer, and single argument) 224 // stack param count needs (constructor pointer, and single argument)
229 Register registers[] = {rsi, rdi, rax}; 225 Register registers[] = {rdi, rax};
230 data->InitializePlatformSpecific(arraysize(registers), registers); 226 data->InitializePlatformSpecific(arraysize(registers), registers);
231 } 227 }
232 228
233 229
234 void CompareDescriptor::InitializePlatformSpecific( 230 void CompareDescriptor::InitializePlatformSpecific(
235 CallInterfaceDescriptorData* data) { 231 CallInterfaceDescriptorData* data) {
236 Register registers[] = {rsi, rdx, rax}; 232 Register registers[] = {rdx, rax};
237 data->InitializePlatformSpecific(arraysize(registers), registers); 233 data->InitializePlatformSpecific(arraysize(registers), registers);
238 } 234 }
239 235
240 236
241 void CompareNilDescriptor::InitializePlatformSpecific( 237 void CompareNilDescriptor::InitializePlatformSpecific(
242 CallInterfaceDescriptorData* data) { 238 CallInterfaceDescriptorData* data) {
243 Register registers[] = {rsi, rax}; 239 Register registers[] = {rax};
244 data->InitializePlatformSpecific(arraysize(registers), registers); 240 data->InitializePlatformSpecific(arraysize(registers), registers);
245 } 241 }
246 242
247 243
248 void ToBooleanDescriptor::InitializePlatformSpecific( 244 void ToBooleanDescriptor::InitializePlatformSpecific(
249 CallInterfaceDescriptorData* data) { 245 CallInterfaceDescriptorData* data) {
250 Register registers[] = {rsi, rax}; 246 Register registers[] = {rax};
251 data->InitializePlatformSpecific(arraysize(registers), registers); 247 data->InitializePlatformSpecific(arraysize(registers), registers);
252 } 248 }
253 249
254 250
255 void BinaryOpDescriptor::InitializePlatformSpecific( 251 void BinaryOpDescriptor::InitializePlatformSpecific(
256 CallInterfaceDescriptorData* data) { 252 CallInterfaceDescriptorData* data) {
257 Register registers[] = {rsi, rdx, rax}; 253 Register registers[] = {rdx, rax};
258 data->InitializePlatformSpecific(arraysize(registers), registers); 254 data->InitializePlatformSpecific(arraysize(registers), registers);
259 } 255 }
260 256
261 257
262 void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific( 258 void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
263 CallInterfaceDescriptorData* data) { 259 CallInterfaceDescriptorData* data) {
264 Register registers[] = {rsi, rcx, rdx, rax}; 260 Register registers[] = {rcx, rdx, rax};
265 data->InitializePlatformSpecific(arraysize(registers), registers); 261 data->InitializePlatformSpecific(arraysize(registers), registers);
266 } 262 }
267 263
268 264
269 void StringAddDescriptor::InitializePlatformSpecific( 265 void StringAddDescriptor::InitializePlatformSpecific(
270 CallInterfaceDescriptorData* data) { 266 CallInterfaceDescriptorData* data) {
271 Register registers[] = {rsi, rdx, rax}; 267 Register registers[] = {rdx, rax};
272 data->InitializePlatformSpecific(arraysize(registers), registers); 268 data->InitializePlatformSpecific(arraysize(registers), registers);
273 } 269 }
274 270
275 271
276 void KeyedDescriptor::InitializePlatformSpecific( 272 void KeyedDescriptor::InitializePlatformSpecific(
277 CallInterfaceDescriptorData* data) { 273 CallInterfaceDescriptorData* data) {
278 Register registers[] = { 274 Register registers[] = {
279 rsi, // context
280 rcx, // key 275 rcx, // key
281 }; 276 };
282 data->InitializePlatformSpecific(arraysize(registers), registers); 277 data->InitializePlatformSpecific(arraysize(registers), registers);
283 } 278 }
284 279
285 280
286 void NamedDescriptor::InitializePlatformSpecific( 281 void NamedDescriptor::InitializePlatformSpecific(
287 CallInterfaceDescriptorData* data) { 282 CallInterfaceDescriptorData* data) {
288 Register registers[] = { 283 Register registers[] = {
289 rsi, // context
290 rcx, // name 284 rcx, // name
291 }; 285 };
292 data->InitializePlatformSpecific(arraysize(registers), registers); 286 data->InitializePlatformSpecific(arraysize(registers), registers);
293 } 287 }
294 288
295 289
296 void CallHandlerDescriptor::InitializePlatformSpecific( 290 void CallHandlerDescriptor::InitializePlatformSpecific(
297 CallInterfaceDescriptorData* data) { 291 CallInterfaceDescriptorData* data) {
298 Register registers[] = { 292 Register registers[] = {
299 rsi, // context
300 rdx, // receiver 293 rdx, // receiver
301 }; 294 };
302 data->InitializePlatformSpecific(arraysize(registers), registers); 295 data->InitializePlatformSpecific(arraysize(registers), registers);
303 } 296 }
304 297
305 298
306 void ArgumentAdaptorDescriptor::InitializePlatformSpecific( 299 void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
307 CallInterfaceDescriptorData* data) { 300 CallInterfaceDescriptorData* data) {
308 Register registers[] = { 301 Register registers[] = {
309 rsi, // context
310 rdi, // JSFunction 302 rdi, // JSFunction
311 rax, // actual number of arguments 303 rax, // actual number of arguments
312 rbx, // expected number of arguments 304 rbx, // expected number of arguments
313 }; 305 };
314 data->InitializePlatformSpecific(arraysize(registers), registers); 306 data->InitializePlatformSpecific(arraysize(registers), registers);
315 } 307 }
316 308
317 309
318 void ApiFunctionDescriptor::InitializePlatformSpecific( 310 void ApiFunctionDescriptor::InitializePlatformSpecific(
319 CallInterfaceDescriptorData* data) { 311 CallInterfaceDescriptorData* data) {
320 Register registers[] = { 312 Register registers[] = {
321 rsi, // context
322 rdi, // callee 313 rdi, // callee
323 rbx, // call_data 314 rbx, // call_data
324 rcx, // holder 315 rcx, // holder
325 rdx, // api_function_address 316 rdx, // api_function_address
326 rax, // actual number of arguments 317 rax, // actual number of arguments
327 }; 318 };
328 data->InitializePlatformSpecific(arraysize(registers), registers); 319 data->InitializePlatformSpecific(arraysize(registers), registers);
329 } 320 }
330 321
331 322
332 void ApiAccessorDescriptor::InitializePlatformSpecific( 323 void ApiAccessorDescriptor::InitializePlatformSpecific(
333 CallInterfaceDescriptorData* data) { 324 CallInterfaceDescriptorData* data) {
334 Register registers[] = { 325 Register registers[] = {
335 rsi, // context
336 rdi, // callee 326 rdi, // callee
337 rbx, // call_data 327 rbx, // call_data
338 rcx, // holder 328 rcx, // holder
339 rdx, // api_function_address 329 rdx, // api_function_address
340 }; 330 };
341 data->InitializePlatformSpecific(arraysize(registers), registers); 331 data->InitializePlatformSpecific(arraysize(registers), registers);
342 } 332 }
343 333
344 334
345 void MathRoundVariantDescriptor::InitializePlatformSpecific( 335 void MathRoundVariantDescriptor::InitializePlatformSpecific(
346 CallInterfaceDescriptorData* data) { 336 CallInterfaceDescriptorData* data) {
347 Register registers[] = { 337 Register registers[] = {
348 rsi, // context
349 rdi, // math rounding function 338 rdi, // math rounding function
350 rdx, // vector slot id 339 rdx, // vector slot id
351 }; 340 };
352 data->InitializePlatformSpecific(arraysize(registers), registers); 341 data->InitializePlatformSpecific(arraysize(registers), registers);
353 } 342 }
354 } // namespace internal 343 } // namespace internal
355 } // namespace v8 344 } // namespace v8
356 345
357 #endif // V8_TARGET_ARCH_X64 346 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/code-stubs.h ('K') | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698