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 #ifndef V8_TYPE_HINTS_H_ | 5 #ifndef V8_TYPE_HINTS_H_ |
6 #define V8_TYPE_HINTS_H_ | 6 #define V8_TYPE_HINTS_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/utils.h" | 9 #include "src/utils.h" |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 kUndefined = 1u << 0, | 48 kUndefined = 1u << 0, |
49 kBoolean = 1u << 1, | 49 kBoolean = 1u << 1, |
50 kNull = 1u << 2, | 50 kNull = 1u << 2, |
51 kSmallInteger = 1u << 3, | 51 kSmallInteger = 1u << 3, |
52 kReceiver = 1u << 4, | 52 kReceiver = 1u << 4, |
53 kString = 1u << 5, | 53 kString = 1u << 5, |
54 kSymbol = 1u << 6, | 54 kSymbol = 1u << 6, |
55 kHeapNumber = 1u << 7, | 55 kHeapNumber = 1u << 7, |
56 kSimdValue = 1u << 8, | 56 kSimdValue = 1u << 8, |
57 kAny = kUndefined | kBoolean | kNull | kSmallInteger | kReceiver | kString | | 57 kAny = kUndefined | kBoolean | kNull | kSmallInteger | kReceiver | kString | |
58 kSymbol | kHeapNumber | kSimdValue | 58 kSymbol | kHeapNumber | kSimdValue, |
| 59 kNeedsMap = kReceiver | kString | kSymbol | kHeapNumber | kSimdValue, |
| 60 kCanBeUndetectable = kReceiver, |
59 }; | 61 }; |
60 | 62 |
61 std::ostream& operator<<(std::ostream&, ToBooleanHint); | 63 std::ostream& operator<<(std::ostream&, ToBooleanHint); |
62 | 64 |
63 typedef base::Flags<ToBooleanHint, uint16_t> ToBooleanHints; | 65 typedef base::Flags<ToBooleanHint, uint16_t> ToBooleanHints; |
64 | 66 |
65 std::ostream& operator<<(std::ostream&, ToBooleanHints); | 67 std::ostream& operator<<(std::ostream&, ToBooleanHints); |
66 | 68 |
67 DEFINE_OPERATORS_FOR_FLAGS(ToBooleanHints) | 69 DEFINE_OPERATORS_FOR_FLAGS(ToBooleanHints) |
68 | 70 |
| 71 enum StringAddFlags { |
| 72 // Omit both parameter checks. |
| 73 STRING_ADD_CHECK_NONE = 0, |
| 74 // Check left parameter. |
| 75 STRING_ADD_CHECK_LEFT = 1 << 0, |
| 76 // Check right parameter. |
| 77 STRING_ADD_CHECK_RIGHT = 1 << 1, |
| 78 // Check both parameters. |
| 79 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT, |
| 80 // Convert parameters when check fails (instead of throwing an exception). |
| 81 STRING_ADD_CONVERT = 1 << 2, |
| 82 STRING_ADD_CONVERT_LEFT = STRING_ADD_CHECK_LEFT | STRING_ADD_CONVERT, |
| 83 STRING_ADD_CONVERT_RIGHT = STRING_ADD_CHECK_RIGHT | STRING_ADD_CONVERT |
| 84 }; |
| 85 |
| 86 std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags); |
| 87 |
69 } // namespace internal | 88 } // namespace internal |
70 } // namespace v8 | 89 } // namespace v8 |
71 | 90 |
72 #endif // V8_TYPE_HINTS_H_ | 91 #endif // V8_TYPE_HINTS_H_ |
OLD | NEW |