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

Unified Diff: src/string-stream.cc

Issue 12033007: Hide addresses in traced code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index fc07d94ded237ee4ca79ebde48fe036680de6910..57386fef5abea2da1877ea4bacf965a4e41cc3b0 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -167,10 +167,14 @@ void StringStream::Add(Vector<const char> format, Vector<FmtElm> elms) {
break;
}
case 'p': {
- void* value = current.data_.u_pointer_;
- EmbeddedVector<char, 20> formatted;
- OS::SNPrintF(formatted, temp.start(), value);
- Add(formatted.start());
+ if (FLAG_trace_code_addresses) {
+ void* value = current.data_.u_pointer_;
Sven Panne 2013/01/21 09:51:05 I would prefer just a ternary ?: to calculate valu
Massi 2013/01/21 15:27:49 The code would be more "linear" but the output wou
+ EmbeddedVector<char, 20> formatted;
+ OS::SNPrintF(formatted, temp.start(), value);
+ Add(formatted.start());
+ } else {
+ Add("0xXXXXXXXX");
+ }
break;
}
default:
@@ -206,7 +210,11 @@ void StringStream::PrintObject(Object* o) {
Add("#%d#", debug_object_cache->length());
debug_object_cache->Add(HeapObject::cast(o));
} else {
- Add("@%p", o);
+ if (FLAG_trace_code_addresses) {
Sven Panne 2013/01/21 09:51:05 Do we really need this if we have the change above
Massi 2013/01/21 15:27:49 Done.
+ Add("@%p", o);
+ } else {
+ Add("0xXXXXXXXX");
+ }
}
}
}
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698