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

Unified Diff: src/hydrogen-instructions.cc

Issue 6995024: Improved c1visualizer output a bit: Emit a human-readable description for (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
===================================================================
--- src/hydrogen-instructions.cc (revision 7845)
+++ src/hydrogen-instructions.cc (working copy)
@@ -60,12 +60,10 @@
case kDouble: return "d";
case kInteger32: return "i";
case kExternal: return "x";
- case kNumRepresentations:
+ default:
UNREACHABLE();
return NULL;
}
- UNREACHABLE();
- return NULL;
}
@@ -402,11 +400,42 @@
}
-void HValue::PrintTypeTo(HType type, StringStream* stream) {
- stream->Add(type.ToShortString());
+void HValue::PrintTypeTo(StringStream* stream) {
+ if (!representation().IsTagged() || type().Equals(HType::Tagged())) return;
+ stream->Add(" type[%s]", type().ToString());
}
+void HValue::PrintRangeTo(StringStream* stream) {
+ if (range() == NULL || range()->IsMostGeneric()) return;
+ stream->Add(" range[%d,%d,m0=%d]",
+ range()->lower(),
+ range()->upper(),
+ static_cast<int>(range()->CanBeMinusZero()));
+}
+
+
+void HValue::PrintChangesTo(StringStream* stream) {
+ int changes_flags = (flags() & HValue::ChangesFlagsMask());
+ if (changes_flags == 0) return;
+ stream->Add(" changes[");
+ if (changes_flags == AllSideEffects()) {
+ stream->Add("*");
+ } else {
+ bool add_comma = false;
+#define PRINT_DO(type) \
+ if (changes_flags & (1 << kChanges##type)) { \
+ if (add_comma) stream->Add(","); \
+ add_comma = true; \
+ stream->Add(#type); \
+ }
+ GVN_FLAG_LIST(PRINT_DO);
+#undef PRINT_DO
+ }
+ stream->Add("]");
+}
+
+
void HValue::PrintNameTo(StringStream* stream) {
stream->Add("%s%d", representation_.Mnemonic(), id());
}
@@ -465,28 +494,18 @@
void HInstruction::PrintTo(StringStream* stream) {
+ PrintMnemonicTo(stream);
+ PrintDataTo(stream);
+ PrintRangeTo(stream);
+ PrintChangesTo(stream);
+ PrintTypeTo(stream);
+}
+
+
+void HInstruction::PrintMnemonicTo(StringStream* stream) {
stream->Add("%s", Mnemonic());
if (HasSideEffects()) stream->Add("*");
stream->Add(" ");
- PrintDataTo(stream);
-
- if (range() != NULL &&
- !range()->IsMostGeneric() &&
- !range()->CanBeMinusZero()) {
- stream->Add(" range[%d,%d,m0=%d]",
- range()->lower(),
- range()->upper(),
- static_cast<int>(range()->CanBeMinusZero()));
- }
-
- int changes_flags = (flags() & HValue::ChangesFlagsMask());
- if (changes_flags != 0) {
- stream->Add(" changes[0x%x]", changes_flags);
- }
-
- if (representation().IsTagged() && !type().Equals(HType::Tagged())) {
- stream->Add(" type[%s]", type().ToString());
- }
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698