| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |