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

Unified Diff: src/type-hints.cc

Issue 2503183002: [Tracing] Implement IC statistics in tracing. (Closed)
Patch Set: Remove unnecessary cast Created 4 years 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/type-hints.h ('k') | src/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-hints.cc
diff --git a/src/type-hints.cc b/src/type-hints.cc
index 56542e5264e179031443a47f074af611ad80a20e..1c5fe3b8bfef78c972ee8381a0cfd14676acd8e9 100644
--- a/src/type-hints.cc
+++ b/src/type-hints.cc
@@ -76,6 +76,37 @@ std::ostream& operator<<(std::ostream& os, ToBooleanHint hint) {
return os;
}
+std::string ToString(ToBooleanHint hint) {
+ switch (hint) {
+ case ToBooleanHint::kNone:
+ return "None";
+ case ToBooleanHint::kUndefined:
+ return "Undefined";
+ case ToBooleanHint::kBoolean:
+ return "Boolean";
+ case ToBooleanHint::kNull:
+ return "Null";
+ case ToBooleanHint::kSmallInteger:
+ return "SmallInteger";
+ case ToBooleanHint::kReceiver:
+ return "Receiver";
+ case ToBooleanHint::kString:
+ return "String";
+ case ToBooleanHint::kSymbol:
+ return "Symbol";
+ case ToBooleanHint::kHeapNumber:
+ return "HeapNumber";
+ case ToBooleanHint::kSimdValue:
+ return "SimdValue";
+ case ToBooleanHint::kAny:
+ return "Any";
+ case ToBooleanHint::kNeedsMap:
+ return "NeedsMap";
+ }
+ UNREACHABLE();
+ return "";
+}
+
std::ostream& operator<<(std::ostream& os, ToBooleanHints hints) {
if (hints == ToBooleanHint::kAny) return os << "Any";
if (hints == ToBooleanHint::kNone) return os << "None";
@@ -91,6 +122,22 @@ std::ostream& operator<<(std::ostream& os, ToBooleanHints hints) {
return os;
}
+std::string ToString(ToBooleanHints hints) {
+ if (hints == ToBooleanHint::kAny) return "Any";
+ if (hints == ToBooleanHint::kNone) return "None";
+ std::string ret;
+ bool first = true;
+ for (ToBooleanHints::mask_type i = 0; i < sizeof(i) * 8; ++i) {
+ ToBooleanHint const hint = static_cast<ToBooleanHint>(1u << i);
+ if (hints & hint) {
+ if (!first) ret += "|";
+ first = false;
+ ret += ToString(hint);
+ }
+ }
+ return ret;
+}
+
std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags) {
switch (flags) {
case STRING_ADD_CHECK_NONE:
« no previous file with comments | « src/type-hints.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698