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

Unified Diff: src/objects-printer.cc

Issue 694533003: Add FLAG_trace_maps (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index ba05b474e4b2aca5e302660e108748d2b060351e..2fb924cfc99a19b94d964ddd364c7545d16f3d81 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -1129,4 +1129,38 @@ void TransitionArray::PrintTransitions(std::ostream& os,
#endif // OBJECT_PRINT
+#if TRACE_MAPS
+
+
+void Name::NameShortPrint() {
+ if (this->IsString()) {
+ PrintF("%s", String::cast(this)->ToCString().get());
+ } else {
+ DCHECK(this->IsSymbol());
+ Symbol* s = Symbol::cast(this);
+ if (s->name()->IsUndefined()) {
+ PrintF("#<%s>", s->PrivateSymbolToName());
+ } else {
+ PrintF("<%s>", String::cast(s->name())->ToCString().get());
+ }
+ }
+}
+
+
+int Name::NameShortPrint(Vector<char> str) {
+ if (this->IsString()) {
+ return SNPrintF(str, "%s", String::cast(this)->ToCString().get());
+ } else {
+ DCHECK(this->IsSymbol());
+ Symbol* s = Symbol::cast(this);
+ if (s->name()->IsUndefined()) {
+ return SNPrintF(str, "#<%s>", s->PrivateSymbolToName());
+ } else {
+ return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get());
+ }
+ }
+}
+
+
+#endif // TRACE_MAPS
} } // namespace v8::internal
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698