• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
operator <<(std::ostream & os,BinaryOperationHint hint)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::kString:
25       return os << "String";
26     case BinaryOperationHint::kBigInt:
27       return os << "BigInt";
28     case BinaryOperationHint::kAny:
29       return os << "Any";
30   }
31   UNREACHABLE();
32 }
33 
operator <<(std::ostream & os,CompareOperationHint hint)34 std::ostream& operator<<(std::ostream& os, CompareOperationHint hint) {
35   switch (hint) {
36     case CompareOperationHint::kNone:
37       return os << "None";
38     case CompareOperationHint::kSignedSmall:
39       return os << "SignedSmall";
40     case CompareOperationHint::kNumber:
41       return os << "Number";
42     case CompareOperationHint::kNumberOrOddball:
43       return os << "NumberOrOddball";
44     case CompareOperationHint::kInternalizedString:
45       return os << "InternalizedString";
46     case CompareOperationHint::kString:
47       return os << "String";
48     case CompareOperationHint::kSymbol:
49       return os << "Symbol";
50     case CompareOperationHint::kBigInt:
51       return os << "BigInt";
52     case CompareOperationHint::kReceiver:
53       return os << "Receiver";
54     case CompareOperationHint::kAny:
55       return os << "Any";
56   }
57   UNREACHABLE();
58 }
59 
operator <<(std::ostream & os,ForInHint hint)60 std::ostream& operator<<(std::ostream& os, ForInHint hint) {
61   switch (hint) {
62     case ForInHint::kNone:
63       return os << "None";
64     case ForInHint::kEnumCacheKeys:
65       return os << "EnumCacheKeys";
66     case ForInHint::kEnumCacheKeysAndIndices:
67       return os << "EnumCacheKeysAndIndices";
68     case ForInHint::kAny:
69       return os << "Any";
70   }
71   UNREACHABLE();
72 }
73 
operator <<(std::ostream & os,const StringAddFlags & flags)74 std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags) {
75   switch (flags) {
76     case STRING_ADD_CHECK_NONE:
77       return os << "CheckNone";
78     case STRING_ADD_CONVERT_LEFT:
79       return os << "ConvertLeft";
80     case STRING_ADD_CONVERT_RIGHT:
81       return os << "ConvertRight";
82   }
83   UNREACHABLE();
84 }
85 
86 }  // namespace internal
87 }  // namespace v8
88