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

Side by Side Diff: runtime/vm/il_printer.cc

Issue 12212093: Convert some compiler passes to preserve valid def-use chains. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 7 years, 10 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 | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | 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/il_printer.h" 5 #include "vm/il_printer.h"
6 6
7 #include "vm/intermediate_language.h" 7 #include "vm/intermediate_language.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 #include "vm/parser.h" 9 #include "vm/parser.h"
10 10
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 saved_arguments_descriptor()->PrintTo(f); 312 saved_arguments_descriptor()->PrintTo(f);
313 f->Print(", ?%s @%"Pd"", 313 f->Print(", ?%s @%"Pd"",
314 formal_parameter_name().ToCString(), 314 formal_parameter_name().ToCString(),
315 formal_parameter_index()); 315 formal_parameter_index());
316 } 316 }
317 317
318 318
319 void ClosureCallInstr::PrintOperandsTo(BufferFormatter* f) const { 319 void ClosureCallInstr::PrintOperandsTo(BufferFormatter* f) const {
320 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 320 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
321 if (i > 0) f->Print(", "); 321 if (i > 0) f->Print(", ");
322 ArgumentAt(i)->value()->PrintTo(f); 322 PushArgumentAt(i)->value()->PrintTo(f);
323 } 323 }
324 } 324 }
325 325
326 326
327 void InstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { 327 void InstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const {
328 f->Print("%s", function_name().ToCString()); 328 f->Print("%s", function_name().ToCString());
329 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 329 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
330 f->Print(", "); 330 f->Print(", ");
331 ArgumentAt(i)->value()->PrintTo(f); 331 PushArgumentAt(i)->value()->PrintTo(f);
332 } 332 }
333 if (HasICData()) { 333 if (HasICData()) {
334 PrintICData(f, *ic_data()); 334 PrintICData(f, *ic_data());
335 } 335 }
336 } 336 }
337 337
338 338
339 void PolymorphicInstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { 339 void PolymorphicInstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const {
340 f->Print("%s", instance_call()->function_name().ToCString()); 340 f->Print("%s", instance_call()->function_name().ToCString());
341 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 341 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
342 f->Print(", "); 342 f->Print(", ");
343 ArgumentAt(i)->value()->PrintTo(f); 343 PushArgumentAt(i)->value()->PrintTo(f);
344 } 344 }
345 PrintICData(f, ic_data()); 345 PrintICData(f, ic_data());
346 } 346 }
347 347
348 348
349 void StrictCompareInstr::PrintOperandsTo(BufferFormatter* f) const { 349 void StrictCompareInstr::PrintOperandsTo(BufferFormatter* f) const {
350 f->Print("%s, ", Token::Str(kind())); 350 f->Print("%s, ", Token::Str(kind()));
351 left()->PrintTo(f); 351 left()->PrintTo(f);
352 f->Print(", "); 352 f->Print(", ");
353 right()->PrintTo(f); 353 right()->PrintTo(f);
354 } 354 }
355 355
356 356
357 void EqualityCompareInstr::PrintOperandsTo(BufferFormatter* f) const { 357 void EqualityCompareInstr::PrintOperandsTo(BufferFormatter* f) const {
358 left()->PrintTo(f); 358 left()->PrintTo(f);
359 f->Print(" %s ", Token::Str(kind())); 359 f->Print(" %s ", Token::Str(kind()));
360 right()->PrintTo(f); 360 right()->PrintTo(f);
361 if (HasICData()) { 361 if (HasICData()) {
362 PrintICData(f, *ic_data()); 362 PrintICData(f, *ic_data());
363 } 363 }
364 } 364 }
365 365
366 366
367 void StaticCallInstr::PrintOperandsTo(BufferFormatter* f) const { 367 void StaticCallInstr::PrintOperandsTo(BufferFormatter* f) const {
368 f->Print("%s ", String::Handle(function().name()).ToCString()); 368 f->Print("%s ", String::Handle(function().name()).ToCString());
369 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 369 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
370 if (i > 0) f->Print(", "); 370 if (i > 0) f->Print(", ");
371 ArgumentAt(i)->value()->PrintTo(f); 371 PushArgumentAt(i)->value()->PrintTo(f);
372 } 372 }
373 } 373 }
374 374
375 375
376 void LoadLocalInstr::PrintOperandsTo(BufferFormatter* f) const { 376 void LoadLocalInstr::PrintOperandsTo(BufferFormatter* f) const {
377 f->Print("%s lvl:%"Pd"", local().name().ToCString(), context_level()); 377 f->Print("%s lvl:%"Pd"", local().name().ToCString(), context_level());
378 } 378 }
379 379
380 380
381 void StoreLocalInstr::PrintOperandsTo(BufferFormatter* f) const { 381 void StoreLocalInstr::PrintOperandsTo(BufferFormatter* f) const {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (HasICData()) { 433 if (HasICData()) {
434 PrintICData(f, *ic_data()); 434 PrintICData(f, *ic_data());
435 } 435 }
436 } 436 }
437 437
438 438
439 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const { 439 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const {
440 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); 440 f->Print("%s", Class::Handle(constructor().Owner()).ToCString());
441 for (intptr_t i = 0; i < ArgumentCount(); i++) { 441 for (intptr_t i = 0; i < ArgumentCount(); i++) {
442 f->Print(", "); 442 f->Print(", ");
443 ArgumentAt(i)->value()->PrintTo(f); 443 PushArgumentAt(i)->value()->PrintTo(f);
444 } 444 }
445 } 445 }
446 446
447 447
448 void AllocateObjectWithBoundsCheckInstr::PrintOperandsTo( 448 void AllocateObjectWithBoundsCheckInstr::PrintOperandsTo(
449 BufferFormatter* f) const { 449 BufferFormatter* f) const {
450 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); 450 f->Print("%s", Class::Handle(constructor().Owner()).ToCString());
451 for (intptr_t i = 0; i < InputCount(); i++) { 451 for (intptr_t i = 0; i < InputCount(); i++) {
452 f->Print(", "); 452 f->Print(", ");
453 InputAt(i)->PrintTo(f); 453 InputAt(i)->PrintTo(f);
454 } 454 }
455 } 455 }
456 456
457 457
458 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const { 458 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const {
459 for (int i = 0; i < ArgumentCount(); ++i) { 459 for (int i = 0; i < ArgumentCount(); ++i) {
460 if (i != 0) f->Print(", "); 460 if (i != 0) f->Print(", ");
461 ArgumentAt(i)->value()->PrintTo(f); 461 PushArgumentAt(i)->value()->PrintTo(f);
462 } 462 }
463 if (ArgumentCount() > 0) f->Print(", "); 463 if (ArgumentCount() > 0) f->Print(", ");
464 element_type()->PrintTo(f); 464 element_type()->PrintTo(f);
465 } 465 }
466 466
467 467
468 void CreateClosureInstr::PrintOperandsTo(BufferFormatter* f) const { 468 void CreateClosureInstr::PrintOperandsTo(BufferFormatter* f) const {
469 f->Print("%s", function().ToCString()); 469 f->Print("%s", function().ToCString());
470 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 470 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
471 if (i > 0) f->Print(", "); 471 if (i > 0) f->Print(", ");
472 ArgumentAt(i)->value()->PrintTo(f); 472 PushArgumentAt(i)->value()->PrintTo(f);
473 } 473 }
474 } 474 }
475 475
476 476
477 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 477 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const {
478 value()->PrintTo(f); 478 value()->PrintTo(f);
479 f->Print(", %"Pd", immutable=%d", offset_in_bytes(), immutable_); 479 f->Print(", %"Pd", immutable=%d", offset_in_bytes(), immutable_);
480 } 480 }
481 481
482 482
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 f->Print(" ["); 705 f->Print(" [");
706 locations_[i].PrintTo(f); 706 locations_[i].PrintTo(f);
707 f->Print("]"); 707 f->Print("]");
708 } 708 }
709 } 709 }
710 f->Print(" }"); 710 f->Print(" }");
711 if (outer_ != NULL) outer_->PrintTo(f); 711 if (outer_ != NULL) outer_->PrintTo(f);
712 } 712 }
713 713
714 } // namespace dart 714 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698