V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
type-hints.cc
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::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 
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::kReceiverOrNullOrUndefined:
55  return os << "ReceiverOrNullOrUndefined";
56  case CompareOperationHint::kAny:
57  return os << "Any";
58  }
59  UNREACHABLE();
60 }
61 
62 std::ostream& operator<<(std::ostream& os, ForInHint hint) {
63  switch (hint) {
64  case ForInHint::kNone:
65  return os << "None";
66  case ForInHint::kEnumCacheKeys:
67  return os << "EnumCacheKeys";
68  case ForInHint::kEnumCacheKeysAndIndices:
69  return os << "EnumCacheKeysAndIndices";
70  case ForInHint::kAny:
71  return os << "Any";
72  }
73  UNREACHABLE();
74 }
75 
76 std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags) {
77  switch (flags) {
78  case STRING_ADD_CHECK_NONE:
79  return os << "CheckNone";
80  case STRING_ADD_CONVERT_LEFT:
81  return os << "ConvertLeft";
82  case STRING_ADD_CONVERT_RIGHT:
83  return os << "ConvertRight";
84  }
85  UNREACHABLE();
86 }
87 
88 } // namespace internal
89 } // namespace v8
Definition: libplatform.h:13