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

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

Issue 184523002: Allocation sinking for contexts. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added new test Created 6 years, 1 month 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
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/flow_graph_range_analysis.h" 7 #include "vm/flow_graph_range_analysis.h"
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 498
499 void RelationalOpInstr::PrintOperandsTo(BufferFormatter* f) const { 499 void RelationalOpInstr::PrintOperandsTo(BufferFormatter* f) const {
500 f->Print("%s, ", Token::Str(kind())); 500 f->Print("%s, ", Token::Str(kind()));
501 left()->PrintTo(f); 501 left()->PrintTo(f);
502 f->Print(", "); 502 f->Print(", ");
503 right()->PrintTo(f); 503 right()->PrintTo(f);
504 } 504 }
505 505
506 506
507 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const { 507 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const {
508 f->Print("%s", cls().ToCString()); 508 f->Print("%s", String::Handle(cls().PrettyName()).ToCString());
509 for (intptr_t i = 0; i < ArgumentCount(); i++) { 509 for (intptr_t i = 0; i < ArgumentCount(); i++) {
510 f->Print(", "); 510 f->Print(", ");
511 PushArgumentAt(i)->value()->PrintTo(f); 511 PushArgumentAt(i)->value()->PrintTo(f);
512 } 512 }
513 513
514 if (Identity().IsNotAliased()) { 514 if (Identity().IsNotAliased()) {
515 f->Print(" <not-aliased>"); 515 f->Print(" <not-aliased>");
516 } 516 }
517 } 517 }
518 518
519 519
520 void MaterializeObjectInstr::PrintOperandsTo(BufferFormatter* f) const { 520 void MaterializeObjectInstr::PrintOperandsTo(BufferFormatter* f) const {
521 f->Print("%s", String::Handle(cls_.Name()).ToCString()); 521 f->Print("%s", String::Handle(cls_.PrettyName()).ToCString());
522 for (intptr_t i = 0; i < InputCount(); i++) { 522 for (intptr_t i = 0; i < InputCount(); i++) {
523 f->Print(", "); 523 f->Print(", ");
524 f->Print("%s: ", slots_[i]->ToCString()); 524 f->Print("%s: ", slots_[i]->ToCString());
525 InputAt(i)->PrintTo(f); 525 InputAt(i)->PrintTo(f);
526 } 526 }
527 } 527 }
528 528
529 529
530 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 530 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const {
531 instance()->PrintTo(f); 531 instance()->PrintTo(f);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 564
565 565
566 void AllocateContextInstr::PrintOperandsTo(BufferFormatter* f) const { 566 void AllocateContextInstr::PrintOperandsTo(BufferFormatter* f) const {
567 f->Print("%" Pd "", num_context_variables()); 567 f->Print("%" Pd "", num_context_variables());
568 } 568 }
569 569
570 570
571 void AllocateUninitializedContextInstr::PrintOperandsTo( 571 void AllocateUninitializedContextInstr::PrintOperandsTo(
572 BufferFormatter* f) const { 572 BufferFormatter* f) const {
573 f->Print("%" Pd "", num_context_variables()); 573 f->Print("%" Pd "", num_context_variables());
574
575 if (Identity().IsNotAliased()) {
576 f->Print(" <not-aliased>");
577 }
574 } 578 }
575 579
576 580
577 void MathUnaryInstr::PrintOperandsTo(BufferFormatter* f) const { 581 void MathUnaryInstr::PrintOperandsTo(BufferFormatter* f) const {
578 f->Print("'%s', ", MathUnaryInstr::KindToCString(kind())); 582 f->Print("'%s', ", MathUnaryInstr::KindToCString(kind()));
579 value()->PrintTo(f); 583 value()->PrintTo(f);
580 } 584 }
581 585
582 586
583 void MergedMathInstr::PrintOperandsTo(BufferFormatter* f) const { 587 void MergedMathInstr::PrintOperandsTo(BufferFormatter* f) const {
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 } 1113 }
1110 1114
1111 const char* Environment::ToCString() const { 1115 const char* Environment::ToCString() const {
1112 char buffer[1024]; 1116 char buffer[1024];
1113 BufferFormatter bf(buffer, 1024); 1117 BufferFormatter bf(buffer, 1024);
1114 PrintTo(&bf); 1118 PrintTo(&bf);
1115 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); 1119 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer);
1116 } 1120 }
1117 1121
1118 } // namespace dart 1122 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698