OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_GLOBALS_H_ | 5 #ifndef V8_GLOBALS_H_ |
6 #define V8_GLOBALS_H_ | 6 #define V8_GLOBALS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 } | 332 } |
333 | 333 |
334 enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | 334 enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; |
335 | 335 |
336 // This constant is used as an undefined value when passing source positions. | 336 // This constant is used as an undefined value when passing source positions. |
337 const int kNoSourcePosition = -1; | 337 const int kNoSourcePosition = -1; |
338 | 338 |
339 // This constant is used to indicate missing deoptimization information. | 339 // This constant is used to indicate missing deoptimization information. |
340 const int kNoDeoptimizationId = -1; | 340 const int kNoDeoptimizationId = -1; |
341 | 341 |
| 342 // Deoptimize bailout kind. |
| 343 enum class DeoptimizeKind : uint8_t { kEager, kSoft }; |
| 344 inline size_t hash_value(DeoptimizeKind kind) { |
| 345 return static_cast<size_t>(kind); |
| 346 } |
| 347 inline std::ostream& operator<<(std::ostream& os, DeoptimizeKind kind) { |
| 348 switch (kind) { |
| 349 case DeoptimizeKind::kEager: |
| 350 return os << "Eager"; |
| 351 case DeoptimizeKind::kSoft: |
| 352 return os << "Soft"; |
| 353 } |
| 354 UNREACHABLE(); |
| 355 return os; |
| 356 } |
| 357 |
342 // Mask for the sign bit in a smi. | 358 // Mask for the sign bit in a smi. |
343 const intptr_t kSmiSignMask = kIntptrSignBit; | 359 const intptr_t kSmiSignMask = kIntptrSignBit; |
344 | 360 |
345 const int kObjectAlignmentBits = kPointerSizeLog2; | 361 const int kObjectAlignmentBits = kPointerSizeLog2; |
346 const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits; | 362 const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits; |
347 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; | 363 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; |
348 | 364 |
349 // Desired alignment for pointers. | 365 // Desired alignment for pointers. |
350 const intptr_t kPointerAlignment = (1 << kPointerSizeLog2); | 366 const intptr_t kPointerAlignment = (1 << kPointerSizeLog2); |
351 const intptr_t kPointerAlignmentMask = kPointerAlignment - 1; | 367 const intptr_t kPointerAlignmentMask = kPointerAlignment - 1; |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 } // namespace internal | 1352 } // namespace internal |
1337 } // namespace v8 | 1353 } // namespace v8 |
1338 | 1354 |
1339 // Used by js-builtin-reducer to identify whether ReduceArrayIterator() is | 1355 // Used by js-builtin-reducer to identify whether ReduceArrayIterator() is |
1340 // reducing a JSArray method, or a JSTypedArray method. | 1356 // reducing a JSArray method, or a JSTypedArray method. |
1341 enum class ArrayIteratorKind { kArray, kTypedArray }; | 1357 enum class ArrayIteratorKind { kArray, kTypedArray }; |
1342 | 1358 |
1343 namespace i = v8::internal; | 1359 namespace i = v8::internal; |
1344 | 1360 |
1345 #endif // V8_GLOBALS_H_ | 1361 #endif // V8_GLOBALS_H_ |
OLD | NEW |