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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 const int kSpaceTagSize = 3; | 453 const int kSpaceTagSize = 3; |
454 const int kSpaceTagMask = (1 << kSpaceTagSize) - 1; | 454 const int kSpaceTagMask = (1 << kSpaceTagSize) - 1; |
455 | 455 |
456 enum AllocationAlignment { | 456 enum AllocationAlignment { |
457 kWordAligned, | 457 kWordAligned, |
458 kDoubleAligned, | 458 kDoubleAligned, |
459 kDoubleUnaligned, | 459 kDoubleUnaligned, |
460 kSimd128Unaligned | 460 kSimd128Unaligned |
461 }; | 461 }; |
462 | 462 |
| 463 // Possible outcomes for decisions. |
| 464 enum class Decision : uint8_t { kUnknown, kTrue, kFalse }; |
| 465 |
| 466 inline size_t hash_value(Decision decision) { |
| 467 return static_cast<uint8_t>(decision); |
| 468 } |
| 469 |
| 470 inline std::ostream& operator<<(std::ostream& os, Decision decision) { |
| 471 switch (decision) { |
| 472 case Decision::kUnknown: |
| 473 return os << "Unknown"; |
| 474 case Decision::kTrue: |
| 475 return os << "True"; |
| 476 case Decision::kFalse: |
| 477 return os << "False"; |
| 478 } |
| 479 UNREACHABLE(); |
| 480 return os; |
| 481 } |
| 482 |
463 // Supported write barrier modes. | 483 // Supported write barrier modes. |
464 enum WriteBarrierKind : uint8_t { | 484 enum WriteBarrierKind : uint8_t { |
465 kNoWriteBarrier, | 485 kNoWriteBarrier, |
466 kMapWriteBarrier, | 486 kMapWriteBarrier, |
467 kPointerWriteBarrier, | 487 kPointerWriteBarrier, |
468 kFullWriteBarrier | 488 kFullWriteBarrier |
469 }; | 489 }; |
470 | 490 |
471 inline size_t hash_value(WriteBarrierKind kind) { | 491 inline size_t hash_value(WriteBarrierKind kind) { |
472 return static_cast<uint8_t>(kind); | 492 return static_cast<uint8_t>(kind); |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> | 1113 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> |
1094 kPointerSizeLog2); | 1114 kPointerSizeLog2); |
1095 } | 1115 } |
1096 | 1116 |
1097 } // namespace internal | 1117 } // namespace internal |
1098 } // namespace v8 | 1118 } // namespace v8 |
1099 | 1119 |
1100 namespace i = v8::internal; | 1120 namespace i = v8::internal; |
1101 | 1121 |
1102 #endif // V8_GLOBALS_H_ | 1122 #endif // V8_GLOBALS_H_ |
OLD | NEW |