| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "src/compiler/type-hints.h" | |
| 6 | |
| 7 namespace v8 { | |
| 8 namespace internal { | |
| 9 namespace compiler { | |
| 10 | |
| 11 std::ostream& operator<<(std::ostream& os, BinaryOperationHint hint) { | |
| 12 switch (hint) { | |
| 13 case BinaryOperationHint::kNone: | |
| 14 return os << "None"; | |
| 15 case BinaryOperationHint::kSignedSmall: | |
| 16 return os << "SignedSmall"; | |
| 17 case BinaryOperationHint::kSigned32: | |
| 18 return os << "Signed32"; | |
| 19 case BinaryOperationHint::kNumberOrOddball: | |
| 20 return os << "NumberOrOddball"; | |
| 21 case BinaryOperationHint::kString: | |
| 22 return os << "String"; | |
| 23 case BinaryOperationHint::kAny: | |
| 24 return os << "Any"; | |
| 25 } | |
| 26 UNREACHABLE(); | |
| 27 return os; | |
| 28 } | |
| 29 | |
| 30 std::ostream& operator<<(std::ostream& os, CompareOperationHint hint) { | |
| 31 switch (hint) { | |
| 32 case CompareOperationHint::kNone: | |
| 33 return os << "None"; | |
| 34 case CompareOperationHint::kSignedSmall: | |
| 35 return os << "SignedSmall"; | |
| 36 case CompareOperationHint::kNumber: | |
| 37 return os << "Number"; | |
| 38 case CompareOperationHint::kNumberOrOddball: | |
| 39 return os << "NumberOrOddball"; | |
| 40 case CompareOperationHint::kAny: | |
| 41 return os << "Any"; | |
| 42 } | |
| 43 UNREACHABLE(); | |
| 44 return os; | |
| 45 } | |
| 46 | |
| 47 std::ostream& operator<<(std::ostream& os, ToBooleanHint hint) { | |
| 48 switch (hint) { | |
| 49 case ToBooleanHint::kNone: | |
| 50 return os << "None"; | |
| 51 case ToBooleanHint::kUndefined: | |
| 52 return os << "Undefined"; | |
| 53 case ToBooleanHint::kBoolean: | |
| 54 return os << "Boolean"; | |
| 55 case ToBooleanHint::kNull: | |
| 56 return os << "Null"; | |
| 57 case ToBooleanHint::kSmallInteger: | |
| 58 return os << "SmallInteger"; | |
| 59 case ToBooleanHint::kReceiver: | |
| 60 return os << "Receiver"; | |
| 61 case ToBooleanHint::kString: | |
| 62 return os << "String"; | |
| 63 case ToBooleanHint::kSymbol: | |
| 64 return os << "Symbol"; | |
| 65 case ToBooleanHint::kHeapNumber: | |
| 66 return os << "HeapNumber"; | |
| 67 case ToBooleanHint::kSimdValue: | |
| 68 return os << "SimdValue"; | |
| 69 case ToBooleanHint::kAny: | |
| 70 return os << "Any"; | |
| 71 } | |
| 72 UNREACHABLE(); | |
| 73 return os; | |
| 74 } | |
| 75 | |
| 76 std::ostream& operator<<(std::ostream& os, ToBooleanHints hints) { | |
| 77 if (hints == ToBooleanHint::kAny) return os << "Any"; | |
| 78 if (hints == ToBooleanHint::kNone) return os << "None"; | |
| 79 bool first = true; | |
| 80 for (ToBooleanHints::mask_type i = 0; i < sizeof(i) * 8; ++i) { | |
| 81 ToBooleanHint const hint = static_cast<ToBooleanHint>(1u << i); | |
| 82 if (hints & hint) { | |
| 83 if (!first) os << "|"; | |
| 84 first = false; | |
| 85 os << hint; | |
| 86 } | |
| 87 } | |
| 88 return os; | |
| 89 } | |
| 90 | |
| 91 } // namespace compiler | |
| 92 } // namespace internal | |
| 93 } // namespace v8 | |
| OLD | NEW |