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

Side by Side Diff: src/type-hints.cc

Issue 2498563002: [cleanup] Replace ToBooleanICStub::Types with ToBooleanHints (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « src/type-hints.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/type-hints.h" 5 #include "src/type-hints.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 9
10 std::ostream& operator<<(std::ostream& os, BinaryOperationHint hint) { 10 std::ostream& operator<<(std::ostream& os, BinaryOperationHint hint) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 case ToBooleanHint::kString: 60 case ToBooleanHint::kString:
61 return os << "String"; 61 return os << "String";
62 case ToBooleanHint::kSymbol: 62 case ToBooleanHint::kSymbol:
63 return os << "Symbol"; 63 return os << "Symbol";
64 case ToBooleanHint::kHeapNumber: 64 case ToBooleanHint::kHeapNumber:
65 return os << "HeapNumber"; 65 return os << "HeapNumber";
66 case ToBooleanHint::kSimdValue: 66 case ToBooleanHint::kSimdValue:
67 return os << "SimdValue"; 67 return os << "SimdValue";
68 case ToBooleanHint::kAny: 68 case ToBooleanHint::kAny:
69 return os << "Any"; 69 return os << "Any";
70 case ToBooleanHint::kNeedsMap:
71 return os << "NeedsMap";
70 } 72 }
71 UNREACHABLE(); 73 UNREACHABLE();
72 return os; 74 return os;
73 } 75 }
74 76
75 std::ostream& operator<<(std::ostream& os, ToBooleanHints hints) { 77 std::ostream& operator<<(std::ostream& os, ToBooleanHints hints) {
76 if (hints == ToBooleanHint::kAny) return os << "Any"; 78 if (hints == ToBooleanHint::kAny) return os << "Any";
77 if (hints == ToBooleanHint::kNone) return os << "None"; 79 if (hints == ToBooleanHint::kNone) return os << "None";
78 bool first = true; 80 bool first = true;
79 for (ToBooleanHints::mask_type i = 0; i < sizeof(i) * 8; ++i) { 81 for (ToBooleanHints::mask_type i = 0; i < sizeof(i) * 8; ++i) {
80 ToBooleanHint const hint = static_cast<ToBooleanHint>(1u << i); 82 ToBooleanHint const hint = static_cast<ToBooleanHint>(1u << i);
81 if (hints & hint) { 83 if (hints & hint) {
82 if (!first) os << "|"; 84 if (!first) os << "|";
83 first = false; 85 first = false;
84 os << hint; 86 os << hint;
85 } 87 }
86 } 88 }
87 return os; 89 return os;
88 } 90 }
89 91
92 std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags) {
93 switch (flags) {
94 case STRING_ADD_CHECK_NONE:
95 return os << "CheckNone";
96 case STRING_ADD_CHECK_LEFT:
97 return os << "CheckLeft";
98 case STRING_ADD_CHECK_RIGHT:
99 return os << "CheckRight";
100 case STRING_ADD_CHECK_BOTH:
101 return os << "CheckBoth";
102 case STRING_ADD_CONVERT_LEFT:
103 return os << "ConvertLeft";
104 case STRING_ADD_CONVERT_RIGHT:
105 return os << "ConvertRight";
106 case STRING_ADD_CONVERT:
107 break;
108 }
109 UNREACHABLE();
110 return os;
111 }
112
90 } // namespace internal 113 } // namespace internal
91 } // namespace v8 114 } // namespace v8
OLDNEW
« no previous file with comments | « src/type-hints.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698