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

Side by Side Diff: vm/intermediate_language_x64.cc

Issue 10445003: Make order of function definitions in intermediate_language_x64.cc consistent. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 #include "vm/locations.h" 9 #include "vm/locations.h"
10 #include "vm/stub_code.h" 10 #include "vm/stub_code.h"
(...skipping 17 matching lines...) Expand all
28 intptr_t current = val->AsUse()->definition()->temp_index(); 28 intptr_t current = val->AsUse()->definition()->temp_index();
29 if (i != 0) { 29 if (i != 0) {
30 if (current != (previous + 1)) return false; 30 if (current != (previous + 1)) return false;
31 } 31 }
32 previous = current; 32 previous = current;
33 } 33 }
34 return true; 34 return true;
35 } 35 }
36 36
37 37
38 void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
39 computation()->EmitNativeCode(compiler);
40 __ pushq(locs()->out().reg());
41 }
42
43
38 static LocationSummary* MakeSimpleLocationSummary( 44 static LocationSummary* MakeSimpleLocationSummary(
39 intptr_t input_count, Location out) { 45 intptr_t input_count, Location out) {
40 LocationSummary* summary = new LocationSummary(input_count); 46 LocationSummary* summary = new LocationSummary(input_count);
41 for (intptr_t i = 0; i < input_count; i++) { 47 for (intptr_t i = 0; i < input_count; i++) {
42 summary->set_in(i, Location::RequiresRegister()); 48 summary->set_in(i, Location::RequiresRegister());
43 } 49 }
44 summary->set_out(out); 50 summary->set_out(out);
45 return summary; 51 return summary;
46 } 52 }
47 53
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 185
180 186
181 void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) { 187 void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
182 Register value = locs()->in(0).reg(); 188 Register value = locs()->in(0).reg();
183 Register result = locs()->out().reg(); 189 Register result = locs()->out().reg();
184 ASSERT(result == value); // Assert that register assignment is correct. 190 ASSERT(result == value); // Assert that register assignment is correct.
185 __ movq(Address(RBP, local().index() * kWordSize), value); 191 __ movq(Address(RBP, local().index() * kWordSize), value);
186 } 192 }
187 193
188 194
189 void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
190 computation()->EmitNativeCode(compiler);
191 __ pushq(locs()->out().reg());
192 }
193
194
195 LocationSummary* ConstantVal::MakeLocationSummary() const { 195 LocationSummary* ConstantVal::MakeLocationSummary() const {
196 return MakeSimpleLocationSummary(0, Location::RequiresRegister()); 196 return MakeSimpleLocationSummary(0, Location::RequiresRegister());
197 } 197 }
198 198
199 199
200 void ConstantVal::EmitNativeCode(FlowGraphCompiler* compiler) { 200 void ConstantVal::EmitNativeCode(FlowGraphCompiler* compiler) {
201 Register result = locs()->out().reg(); 201 Register result = locs()->out().reg();
202 if (value().IsSmi()) { 202 if (value().IsSmi()) {
203 int64_t imm = reinterpret_cast<int64_t>(value().raw()); 203 int64_t imm = reinterpret_cast<int64_t>(value().raw());
204 __ movq(result, Immediate(imm)); 204 __ movq(result, Immediate(imm));
205 } else { 205 } else {
206 __ LoadObject(result, value()); 206 __ LoadObject(result, value());
207 } 207 }
208 } 208 }
209 209
210 210
211 LocationSummary* UseVal::MakeLocationSummary() const {
212 return NULL;
213 }
214
215
211 void UseVal::EmitNativeCode(FlowGraphCompiler* compiler) { 216 void UseVal::EmitNativeCode(FlowGraphCompiler* compiler) {
212 UNIMPLEMENTED(); 217 UNIMPLEMENTED();
213 } 218 }
214 219
215 220
216 LocationSummary* UseVal::MakeLocationSummary() const { 221 LocationSummary* AssertAssignableComp::MakeLocationSummary() const {
217 return NULL; 222 return NULL;
218 } 223 }
219 224
220 225
221 void AssertAssignableComp::EmitNativeCode(FlowGraphCompiler* compiler) { 226 void AssertAssignableComp::EmitNativeCode(FlowGraphCompiler* compiler) {
222 UNIMPLEMENTED(); 227 UNIMPLEMENTED();
223 } 228 }
224 229
225 230
226 LocationSummary* AssertAssignableComp::MakeLocationSummary() const { 231 LocationSummary* AssertBooleanComp::MakeLocationSummary() const {
227 return NULL; 232 return NULL;
228 } 233 }
229 234
230 235
231 void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) { 236 void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) {
232 UNIMPLEMENTED(); 237 UNIMPLEMENTED();
233 } 238 }
234 239
235 240
236 LocationSummary* AssertBooleanComp::MakeLocationSummary() const { 241 LocationSummary* EqualityCompareComp::MakeLocationSummary() const {
237 return NULL; 242 return NULL;
238 } 243 }
239 244
240 245
241 void EqualityCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) { 246 void EqualityCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) {
242 UNIMPLEMENTED(); 247 UNIMPLEMENTED();
243 } 248 }
244 249
245 250
246 LocationSummary* EqualityCompareComp::MakeLocationSummary() const { 251 LocationSummary* NativeCallComp::MakeLocationSummary() const {
247 return NULL; 252 return NULL;
248 } 253 }
249 254
250 255
251 void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { 256 void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
252 UNIMPLEMENTED(); 257 UNIMPLEMENTED();
253 } 258 }
254 259
255 260
256 LocationSummary* NativeCallComp::MakeLocationSummary() const { 261 LocationSummary* StoreIndexedComp::MakeLocationSummary() const {
257 return NULL; 262 return NULL;
258 } 263 }
259 264
260 265
261 void StoreIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) { 266 void StoreIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) {
262 UNIMPLEMENTED(); 267 UNIMPLEMENTED();
263 } 268 }
264 269
265 270
266 LocationSummary* StoreIndexedComp::MakeLocationSummary() const { 271 LocationSummary* InstanceSetterComp::MakeLocationSummary() const {
267 return NULL; 272 return NULL;
268 } 273 }
269 274
270 275
271 void InstanceSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) { 276 void InstanceSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) {
272 UNIMPLEMENTED(); 277 UNIMPLEMENTED();
273 } 278 }
274 279
275 280
276 LocationSummary* InstanceSetterComp::MakeLocationSummary() const { 281 LocationSummary* StaticSetterComp::MakeLocationSummary() const {
277 return NULL; 282 return NULL;
278 } 283 }
279 284
280 285
281 void StaticSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) { 286 void StaticSetterComp::EmitNativeCode(FlowGraphCompiler* compiler) {
282 UNIMPLEMENTED(); 287 UNIMPLEMENTED();
283 } 288 }
284 289
285 290
286 LocationSummary* StaticSetterComp::MakeLocationSummary() const { 291 LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const {
287 return NULL; 292 return NULL;
288 } 293 }
289 294
290 295
291 void LoadInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { 296 void LoadInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
292 UNIMPLEMENTED(); 297 UNIMPLEMENTED();
293 } 298 }
294 299
295 300
296 LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const { 301 LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const {
297 return NULL; 302 return NULL;
298 } 303 }
299 304
300 305
301 void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { 306 void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
302 UNIMPLEMENTED(); 307 UNIMPLEMENTED();
303 } 308 }
304 309
305 310
306 LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const { 311 LocationSummary* LoadStaticFieldComp::MakeLocationSummary() const {
307 return NULL; 312 return NULL;
308 } 313 }
309 314
310 315
311 void LoadStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { 316 void LoadStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
312 UNIMPLEMENTED(); 317 UNIMPLEMENTED();
313 } 318 }
314 319
315 320
316 LocationSummary* LoadStaticFieldComp::MakeLocationSummary() const { 321 LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const {
317 return NULL; 322 return NULL;
318 } 323 }
319 324
320 325
321 void StoreStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { 326 void StoreStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
322 UNIMPLEMENTED(); 327 UNIMPLEMENTED();
323 } 328 }
324 329
325 330
326 LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const { 331 LocationSummary* BooleanNegateComp::MakeLocationSummary() const {
327 return NULL; 332 return NULL;
328 } 333 }
329 334
330 335
331 void BooleanNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) { 336 void BooleanNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) {
332 UNIMPLEMENTED(); 337 UNIMPLEMENTED();
333 } 338 }
334 339
335 340
336 LocationSummary* BooleanNegateComp::MakeLocationSummary() const { 341 LocationSummary* InstanceOfComp::MakeLocationSummary() const {
337 return NULL; 342 return NULL;
338 } 343 }
339 344
340 345
341 void InstanceOfComp::EmitNativeCode(FlowGraphCompiler* compiler) { 346 void InstanceOfComp::EmitNativeCode(FlowGraphCompiler* compiler) {
342 UNIMPLEMENTED(); 347 UNIMPLEMENTED();
343 } 348 }
344 349
345 350
346 LocationSummary* InstanceOfComp::MakeLocationSummary() const { 351 LocationSummary* CreateArrayComp::MakeLocationSummary() const {
347 return NULL; 352 return NULL;
348 } 353 }
349 354
350 355
351 void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) { 356 void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) {
352 UNIMPLEMENTED(); 357 UNIMPLEMENTED();
353 } 358 }
354 359
355 360
356 LocationSummary* CreateArrayComp::MakeLocationSummary() const { 361 LocationSummary* CreateClosureComp::MakeLocationSummary() const {
357 return NULL; 362 return NULL;
358 } 363 }
359 364
360 365
361 void CreateClosureComp::EmitNativeCode(FlowGraphCompiler* compiler) { 366 void CreateClosureComp::EmitNativeCode(FlowGraphCompiler* compiler) {
362 UNIMPLEMENTED(); 367 UNIMPLEMENTED();
363 } 368 }
364 369
365 370
366 LocationSummary* CreateClosureComp::MakeLocationSummary() const { 371 LocationSummary* AllocateObjectComp::MakeLocationSummary() const {
367 return NULL; 372 return MakeCallSummary();
368 } 373 }
369 374
370 375
371 void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) { 376 void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) {
372 const Class& cls = Class::ZoneHandle(constructor().owner()); 377 const Class& cls = Class::ZoneHandle(constructor().owner());
373 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls)); 378 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls));
374 const ExternalLabel label(cls.ToCString(), stub.EntryPoint()); 379 const ExternalLabel label(cls.ToCString(), stub.EntryPoint());
375 compiler->GenerateCall(token_index(), 380 compiler->GenerateCall(token_index(),
376 try_index(), 381 try_index(),
377 &label, 382 &label,
378 PcDescriptors::kOther); 383 PcDescriptors::kOther);
379 __ Drop(arguments().length()); // Discard arguments. 384 __ Drop(arguments().length()); // Discard arguments.
380 } 385 }
381 386
382 387
383 LocationSummary* AllocateObjectComp::MakeLocationSummary() const { 388 LocationSummary* AllocateObjectWithBoundsCheckComp::
384 return MakeCallSummary(); 389 MakeLocationSummary() const {
390 return MakeSimpleLocationSummary(2, Location::RequiresRegister());
385 } 391 }
386 392
387 393
388 void AllocateObjectWithBoundsCheckComp::EmitNativeCode( 394 void AllocateObjectWithBoundsCheckComp::EmitNativeCode(
389 FlowGraphCompiler* compiler) { 395 FlowGraphCompiler* compiler) {
390 const Class& cls = Class::ZoneHandle(constructor().owner()); 396 const Class& cls = Class::ZoneHandle(constructor().owner());
391 Register type_arguments = locs()->in(0).reg(); 397 Register type_arguments = locs()->in(0).reg();
392 Register instantiator_type_arguments = locs()->in(1).reg(); 398 Register instantiator_type_arguments = locs()->in(1).reg();
393 Register result = locs()->out().reg(); 399 Register result = locs()->out().reg();
394 400
395 // Push the result place holder initialized to NULL. 401 // Push the result place holder initialized to NULL.
396 __ PushObject(Object::ZoneHandle()); 402 __ PushObject(Object::ZoneHandle());
397 __ pushq(Immediate(Smi::RawValue(token_index()))); 403 __ pushq(Immediate(Smi::RawValue(token_index())));
398 __ PushObject(cls); 404 __ PushObject(cls);
399 __ pushq(type_arguments); 405 __ pushq(type_arguments);
400 __ pushq(instantiator_type_arguments); 406 __ pushq(instantiator_type_arguments);
401 compiler->GenerateCallRuntime(cid(), 407 compiler->GenerateCallRuntime(cid(),
402 token_index(), 408 token_index(),
403 try_index(), 409 try_index(),
404 kAllocateObjectWithBoundsCheckRuntimeEntry); 410 kAllocateObjectWithBoundsCheckRuntimeEntry);
405 // Pop instantiator type arguments, type arguments, class, and 411 // Pop instantiator type arguments, type arguments, class, and
406 // source location. 412 // source location.
407 __ Drop(4); 413 __ Drop(4);
408 __ popq(result); // Pop new instance. 414 __ popq(result); // Pop new instance.
409 } 415 }
410 416
411 417
412 LocationSummary* AllocateObjectWithBoundsCheckComp:: 418 LocationSummary* NativeLoadFieldComp::MakeLocationSummary() const {
413 MakeLocationSummary() const { 419 return NULL;
414 return MakeSimpleLocationSummary(2, Location::RequiresRegister());
415 } 420 }
416 421
417 422
418 void NativeLoadFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { 423 void NativeLoadFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
419 UNIMPLEMENTED(); 424 UNIMPLEMENTED();
420 } 425 }
421 426
422 427
423 LocationSummary* NativeLoadFieldComp::MakeLocationSummary() const { 428 LocationSummary* NativeStoreFieldComp::MakeLocationSummary() const {
424 return NULL; 429 return NULL;
425 } 430 }
426 431
427 432
428 void NativeStoreFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { 433 void NativeStoreFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
429 UNIMPLEMENTED(); 434 UNIMPLEMENTED();
430 } 435 }
431 436
432 437
433 LocationSummary* NativeStoreFieldComp::MakeLocationSummary() const { 438 LocationSummary* InstantiateTypeArgumentsComp::MakeLocationSummary() const {
434 return NULL; 439 return NULL;
435 } 440 }
436 441
437 442
438 void InstantiateTypeArgumentsComp::EmitNativeCode(FlowGraphCompiler* compiler) { 443 void InstantiateTypeArgumentsComp::EmitNativeCode(FlowGraphCompiler* compiler) {
439 UNIMPLEMENTED(); 444 UNIMPLEMENTED();
440 } 445 }
441 446
442 447
443 LocationSummary* InstantiateTypeArgumentsComp::MakeLocationSummary() const { 448 LocationSummary* ExtractConstructorTypeArgumentsComp::
449 MakeLocationSummary() const {
444 return NULL; 450 return NULL;
445 } 451 }
446 452
447 453
448 void ExtractConstructorTypeArgumentsComp::EmitNativeCode( 454 void ExtractConstructorTypeArgumentsComp::EmitNativeCode(
449 FlowGraphCompiler* compiler) { 455 FlowGraphCompiler* compiler) {
450 UNIMPLEMENTED(); 456 UNIMPLEMENTED();
451 } 457 }
452 458
453 459
454 LocationSummary* ExtractConstructorTypeArgumentsComp:: 460 LocationSummary* ExtractConstructorInstantiatorComp::
455 MakeLocationSummary() const { 461 MakeLocationSummary() const {
456 return NULL; 462 return NULL;
457 } 463 }
458 464
459 465
460 void ExtractConstructorInstantiatorComp::EmitNativeCode( 466 void ExtractConstructorInstantiatorComp::EmitNativeCode(
461 FlowGraphCompiler* compiler) { 467 FlowGraphCompiler* compiler) {
462 UNIMPLEMENTED(); 468 UNIMPLEMENTED();
463 } 469 }
464 470
465 471
466 LocationSummary* ExtractConstructorInstantiatorComp:: 472 LocationSummary* AllocateContextComp::MakeLocationSummary() const {
467 MakeLocationSummary() const {
468 return NULL; 473 return NULL;
469 } 474 }
470 475
471 476
472 void AllocateContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { 477 void AllocateContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
473 UNIMPLEMENTED(); 478 UNIMPLEMENTED();
474 } 479 }
475 480
476 481
477 LocationSummary* AllocateContextComp::MakeLocationSummary() const { 482 LocationSummary* ChainContextComp::MakeLocationSummary() const {
478 return NULL; 483 return NULL;
479 } 484 }
480 485
481 486
482 void ChainContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { 487 void ChainContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
483 UNIMPLEMENTED(); 488 UNIMPLEMENTED();
484 } 489 }
485 490
486 491
487 LocationSummary* ChainContextComp::MakeLocationSummary() const { 492 LocationSummary* CloneContextComp::MakeLocationSummary() const {
488 return NULL; 493 return NULL;
489 } 494 }
490 495
491 496
492 void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { 497 void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
493 UNIMPLEMENTED(); 498 UNIMPLEMENTED();
494 } 499 }
495 500
496 501
497 LocationSummary* CloneContextComp::MakeLocationSummary() const { 502 LocationSummary* CatchEntryComp::MakeLocationSummary() const {
498 return NULL; 503 return NULL;
499 } 504 }
500 505
501 506
502 void CatchEntryComp::EmitNativeCode(FlowGraphCompiler* compiler) { 507 void CatchEntryComp::EmitNativeCode(FlowGraphCompiler* compiler) {
503 UNIMPLEMENTED(); 508 UNIMPLEMENTED();
504 } 509 }
505 510
506 511
507 LocationSummary* CatchEntryComp::MakeLocationSummary() const {
508 return NULL;
509 }
510
511
512 } // namespace dart 512 } // namespace dart
513 513
514 #undef __ 514 #undef __
515 515
516 #endif // defined TARGET_ARCH_X64 516 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698