| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 const int kSpaceTagSize = 3; | 445 const int kSpaceTagSize = 3; |
| 446 const int kSpaceTagMask = (1 << kSpaceTagSize) - 1; | 446 const int kSpaceTagMask = (1 << kSpaceTagSize) - 1; |
| 447 | 447 |
| 448 enum AllocationAlignment { | 448 enum AllocationAlignment { |
| 449 kWordAligned, | 449 kWordAligned, |
| 450 kDoubleAligned, | 450 kDoubleAligned, |
| 451 kDoubleUnaligned, | 451 kDoubleUnaligned, |
| 452 kSimd128Unaligned | 452 kSimd128Unaligned |
| 453 }; | 453 }; |
| 454 | 454 |
| 455 // Supported write barrier modes. | |
| 456 enum WriteBarrierKind : uint8_t { | |
| 457 kNoWriteBarrier, | |
| 458 kMapWriteBarrier, | |
| 459 kPointerWriteBarrier, | |
| 460 kFullWriteBarrier | |
| 461 }; | |
| 462 | |
| 463 inline size_t hash_value(WriteBarrierKind kind) { | |
| 464 return static_cast<uint8_t>(kind); | |
| 465 } | |
| 466 | |
| 467 inline std::ostream& operator<<(std::ostream& os, WriteBarrierKind kind) { | |
| 468 switch (kind) { | |
| 469 case kNoWriteBarrier: | |
| 470 return os << "NoWriteBarrier"; | |
| 471 case kMapWriteBarrier: | |
| 472 return os << "MapWriteBarrier"; | |
| 473 case kPointerWriteBarrier: | |
| 474 return os << "PointerWriteBarrier"; | |
| 475 case kFullWriteBarrier: | |
| 476 return os << "FullWriteBarrier"; | |
| 477 } | |
| 478 UNREACHABLE(); | |
| 479 return os; | |
| 480 } | |
| 481 | |
| 482 // A flag that indicates whether objects should be pretenured when | 455 // A flag that indicates whether objects should be pretenured when |
| 483 // allocated (allocated directly into the old generation) or not | 456 // allocated (allocated directly into the old generation) or not |
| 484 // (allocated in the young generation if the object size and type | 457 // (allocated in the young generation if the object size and type |
| 485 // allows). | 458 // allows). |
| 486 enum PretenureFlag { NOT_TENURED, TENURED }; | 459 enum PretenureFlag { NOT_TENURED, TENURED }; |
| 487 | 460 |
| 488 inline std::ostream& operator<<(std::ostream& os, const PretenureFlag& flag) { | 461 inline std::ostream& operator<<(std::ostream& os, const PretenureFlag& flag) { |
| 489 switch (flag) { | 462 switch (flag) { |
| 490 case NOT_TENURED: | 463 case NOT_TENURED: |
| 491 return os << "NotTenured"; | 464 return os << "NotTenured"; |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> | 1031 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> |
| 1059 kPointerSizeLog2); | 1032 kPointerSizeLog2); |
| 1060 } | 1033 } |
| 1061 | 1034 |
| 1062 } // namespace internal | 1035 } // namespace internal |
| 1063 } // namespace v8 | 1036 } // namespace v8 |
| 1064 | 1037 |
| 1065 namespace i = v8::internal; | 1038 namespace i = v8::internal; |
| 1066 | 1039 |
| 1067 #endif // V8_GLOBALS_H_ | 1040 #endif // V8_GLOBALS_H_ |
| OLD | NEW |