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

Side by Side Diff: vm/il_printer.cc

Issue 10825035: Add an explicit push-argument instruction to the IL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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
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 9
10 namespace dart { 10 namespace dart {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 instantiator()->PrintTo(f); 145 instantiator()->PrintTo(f);
146 f->Print(")"); 146 f->Print(")");
147 f->Print(" instantiator_type_arguments("); 147 f->Print(" instantiator_type_arguments(");
148 instantiator_type_arguments()->PrintTo(f); 148 instantiator_type_arguments()->PrintTo(f);
149 f->Print(")"); 149 f->Print(")");
150 } 150 }
151 151
152 152
153 void ClosureCallComp::PrintOperandsTo(BufferFormatter* f) const { 153 void ClosureCallComp::PrintOperandsTo(BufferFormatter* f) const {
154 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 154 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
155 if (i == 0) f->Print(", "); 155 if (i > 0) f->Print(", ");
156 ArgumentAt(i)->PrintTo(f); 156 f->Print("cid%d", ArgumentAt(i)->cid());
157 } 157 }
158 } 158 }
159 159
160 160
161 void InstanceCallComp::PrintOperandsTo(BufferFormatter* f) const { 161 void InstanceCallComp::PrintOperandsTo(BufferFormatter* f) const {
162 f->Print("%s", function_name().ToCString()); 162 f->Print("%s", function_name().ToCString());
163 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 163 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
164 f->Print(", "); 164 f->Print(", ");
165 ArgumentAt(i)->PrintTo(f); 165 ArgumentAt(i)->PrintTo(f);
166 } 166 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 if (i != 0) f->Print(", "); 288 if (i != 0) f->Print(", ");
289 ElementAt(i)->PrintTo(f); 289 ElementAt(i)->PrintTo(f);
290 } 290 }
291 if (ElementCount() > 0) f->Print(", "); 291 if (ElementCount() > 0) f->Print(", ");
292 element_type()->PrintTo(f); 292 element_type()->PrintTo(f);
293 } 293 }
294 294
295 295
296 void CreateClosureComp::PrintOperandsTo(BufferFormatter* f) const { 296 void CreateClosureComp::PrintOperandsTo(BufferFormatter* f) const {
297 f->Print("%s", function().ToCString()); 297 f->Print("%s", function().ToCString());
298 f->Print(", ");
299 type_arguments()->PrintTo(f);
300 f->Print(", ");
301 receiver()->PrintTo(f);
302 } 298 }
303 299
304 300
305 void LoadVMFieldComp::PrintOperandsTo(BufferFormatter* f) const { 301 void LoadVMFieldComp::PrintOperandsTo(BufferFormatter* f) const {
306 value()->PrintTo(f); 302 value()->PrintTo(f);
307 f->Print(", %d", offset_in_bytes()); 303 f->Print(", %d", offset_in_bytes());
308 } 304 }
309 305
310 306
311 void StoreVMFieldComp::PrintOperandsTo(BufferFormatter* f) const { 307 void StoreVMFieldComp::PrintOperandsTo(BufferFormatter* f) const {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 f->Print(" "); 411 f->Print(" ");
416 } else if (HasSSATemp()) { 412 } else if (HasSSATemp()) {
417 f->Print(" v%d <- ", ssa_temp_index()); 413 f->Print(" v%d <- ", ssa_temp_index());
418 } else { 414 } else {
419 f->Print(" t%d <- ", temp_index()); 415 f->Print(" t%d <- ", temp_index());
420 } 416 }
421 computation()->PrintTo(f); 417 computation()->PrintTo(f);
422 } 418 }
423 419
424 420
421 void PushArgumentInstr::PrintTo(BufferFormatter* f) const {
422 f->Print(" %s:%d ", DebugName(), cid());
423 value()->PrintTo(f);
424 }
425
426
425 void ReturnInstr::PrintTo(BufferFormatter* f) const { 427 void ReturnInstr::PrintTo(BufferFormatter* f) const {
426 f->Print(" %s ", DebugName()); 428 f->Print(" %s ", DebugName());
427 value()->PrintTo(f); 429 value()->PrintTo(f);
428 } 430 }
429 431
430 432
431 void ThrowInstr::PrintTo(BufferFormatter* f) const { 433 void ThrowInstr::PrintTo(BufferFormatter* f) const {
432 f->Print(" %s ", DebugName()); 434 f->Print(" %s ", DebugName());
433 exception()->PrintTo(f); 435 exception()->PrintTo(f);
434 } 436 }
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 f->Print("_ "); 675 f->Print("_ ");
674 } else if (HasSSATemp()) { 676 } else if (HasSSATemp()) {
675 f->Print("v%d ", ssa_temp_index()); 677 f->Print("v%d ", ssa_temp_index());
676 } else { 678 } else {
677 f->Print("t%d ", temp_index()); 679 f->Print("t%d ", temp_index());
678 } 680 }
679 computation()->PrintTo(f); 681 computation()->PrintTo(f);
680 } 682 }
681 683
682 684
685 void PushArgumentInstr::PrintToVisualizer(BufferFormatter* f) const {
686 f->Print("_ %s:%d ", DebugName(), cid());
687 value()->PrintTo(f);
688 }
689
690
683 void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const { 691 void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const {
684 f->Print("_ %s ", DebugName()); 692 f->Print("_ %s ", DebugName());
685 value()->PrintTo(f); 693 value()->PrintTo(f);
686 } 694 }
687 695
688 696
689 void ThrowInstr::PrintToVisualizer(BufferFormatter* f) const { 697 void ThrowInstr::PrintToVisualizer(BufferFormatter* f) const {
690 f->Print("_ %s ", DebugName()); 698 f->Print("_ %s ", DebugName());
691 exception()->PrintTo(f); 699 exception()->PrintTo(f);
692 } 700 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { 738 if ((i < locations_.length()) && !locations_[i].IsInvalid()) {
731 f->Print(" ["); 739 f->Print(" [");
732 locations_[i].PrintTo(f); 740 locations_[i].PrintTo(f);
733 f->Print("]"); 741 f->Print("]");
734 } 742 }
735 } 743 }
736 f->Print(" }"); 744 f->Print(" }");
737 } 745 }
738 746
739 } // namespace dart 747 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698