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

Unified Diff: runtime/vm/il_printer.cc

Issue 10949019: Turn definitions that do not produce results (e.g. Checks) into instructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/il_printer.cc
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index 2f1247a377f3e8424c61a1550dd70443a9c56167..b3b39674af9aa80e7a8a682111cdff87ae7d744a 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -154,6 +154,26 @@ static void PrintUse(BufferFormatter* f, const Definition& definition) {
}
+void Instruction::PrintTo(BufferFormatter* f) const {
+ f->Print("%s:%"Pd"(", DebugName(), GetDeoptId());
+ PrintOperandsTo(f);
+ f->Print(")");
+}
+
+
+void Instruction::PrintOperandsTo(BufferFormatter* f) const {
+ for (int i = 0; i < InputCount(); ++i) {
+ if (i > 0) f->Print(", ");
+ if (InputAt(i) != NULL) InputAt(i)->PrintTo(f);
+ }
+}
+
+
+void Instruction::PrintToVisualizer(BufferFormatter* f) const {
+ PrintTo(f);
+}
+
+
void Definition::PrintTo(BufferFormatter* f) const {
PrintUse(f, *this);
if (is_used()) {
@@ -520,22 +540,6 @@ void PushArgumentInstr::PrintOperandsTo(BufferFormatter* f) const {
}
-void ReturnInstr::PrintTo(BufferFormatter* f) const {
- f->Print("%s ", DebugName());
- value()->PrintTo(f);
-}
-
-
-void ThrowInstr::PrintTo(BufferFormatter* f) const {
- f->Print("%s" , DebugName());
-}
-
-
-void ReThrowInstr::PrintTo(BufferFormatter* f) const {
- f->Print("%s ", DebugName());
-}
-
-
void GotoInstr::PrintTo(BufferFormatter* f) const {
if (HasParallelMove()) {
parallel_move()->PrintTo(f);
@@ -749,22 +753,6 @@ void PushArgumentInstr::PrintToVisualizer(BufferFormatter* f) const {
}
-void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const {
- f->Print("_ %s ", DebugName());
- value()->PrintTo(f);
-}
-
-
-void ThrowInstr::PrintToVisualizer(BufferFormatter* f) const {
- f->Print("_ %s ", DebugName());
-}
-
-
-void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const {
- f->Print("_ %s ", DebugName());
-}
-
-
void GotoInstr::PrintToVisualizer(BufferFormatter* f) const {
f->Print("_ goto B%"Pd"", successor()->block_id());
}

Powered by Google App Engine
This is Rietveld 408576698