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/type-hints.h" |
6 | |
7 | namespace v8 { |
8 | namespace internal { |
9 | |
10 | std::ostream& operator<<(std::ostream& os, BinaryOperationHint hint) { |
11 | switch (hint) { |
12 | case BinaryOperationHint::kNone: |
13 | return os << "None"; |
14 | case BinaryOperationHint::kSignedSmall: |
15 | return os << "SignedSmall"; |
16 | case BinaryOperationHint::kSignedSmallInputs: |
17 | return os << "SignedSmallInputs"; |
18 | case BinaryOperationHint::kSigned32: |
19 | return os << "Signed32"; |
20 | case BinaryOperationHint::kNumber: |
21 | return os << "Number"; |
22 | case BinaryOperationHint::kNumberOrOddball: |
23 | return os << "NumberOrOddball"; |
24 | case BinaryOperationHint::kConsOneByteString: |
25 | return os << "ConsOneByteString"; |
26 | case BinaryOperationHint::kConsTwoByteString: |
27 | return os << "ConsTwoByteString"; |
28 | case BinaryOperationHint::kConsString: |
29 | return os << "ConsString"; |
30 | case BinaryOperationHint::kString: |
31 | return os << "String"; |
32 | case BinaryOperationHint::kBigInt: |
33 | return os << "BigInt"; |
34 | case BinaryOperationHint::kAny: |
35 | return os << "Any"; |
36 | } |
37 | UNREACHABLE(); |
38 | } |
39 | |
40 | std::ostream& operator<<(std::ostream& os, CompareOperationHint hint) { |
41 | switch (hint) { |
42 | case CompareOperationHint::kNone: |
43 | return os << "None"; |
44 | case CompareOperationHint::kSignedSmall: |
45 | return os << "SignedSmall"; |
46 | case CompareOperationHint::kNumber: |
47 | return os << "Number"; |
48 | case CompareOperationHint::kNumberOrOddball: |
49 | return os << "NumberOrOddball"; |
50 | case CompareOperationHint::kInternalizedString: |
51 | return os << "InternalizedString"; |
52 | case CompareOperationHint::kString: |
53 | return os << "String"; |
54 | case CompareOperationHint::kSymbol: |
55 | return os << "Symbol"; |
56 | case CompareOperationHint::kBigInt: |
57 | return os << "BigInt"; |
58 | case CompareOperationHint::kReceiver: |
59 | return os << "Receiver"; |
60 | case CompareOperationHint::kReceiverOrNullOrUndefined: |
61 | return os << "ReceiverOrNullOrUndefined"; |
62 | case CompareOperationHint::kAny: |
63 | return os << "Any"; |
64 | } |
65 | UNREACHABLE(); |
66 | } |
67 | |
68 | std::ostream& operator<<(std::ostream& os, ForInHint hint) { |
69 | switch (hint) { |
70 | case ForInHint::kNone: |
71 | return os << "None"; |
72 | case ForInHint::kEnumCacheKeys: |
73 | return os << "EnumCacheKeys"; |
74 | case ForInHint::kEnumCacheKeysAndIndices: |
75 | return os << "EnumCacheKeysAndIndices"; |
76 | case ForInHint::kAny: |
77 | return os << "Any"; |
78 | } |
79 | UNREACHABLE(); |
80 | } |
81 | |
82 | std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags) { |
83 | switch (flags) { |
84 | case STRING_ADD_CHECK_NONE: |
85 | return os << "CheckNone"; |
86 | case STRING_ADD_CONVERT_LEFT: |
87 | return os << "ConvertLeft"; |
88 | case STRING_ADD_CONVERT_RIGHT: |
89 | return os << "ConvertRight"; |
90 | } |
91 | UNREACHABLE(); |
92 | } |
93 | |
94 | } // namespace internal |
95 | } // namespace v8 |
96 |