| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; | 363 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; |
| 364 | 364 |
| 365 // Desired alignment for pointers. | 365 // Desired alignment for pointers. |
| 366 const intptr_t kPointerAlignment = (1 << kPointerSizeLog2); | 366 const intptr_t kPointerAlignment = (1 << kPointerSizeLog2); |
| 367 const intptr_t kPointerAlignmentMask = kPointerAlignment - 1; | 367 const intptr_t kPointerAlignmentMask = kPointerAlignment - 1; |
| 368 | 368 |
| 369 // Desired alignment for double values. | 369 // Desired alignment for double values. |
| 370 const intptr_t kDoubleAlignment = 8; | 370 const intptr_t kDoubleAlignment = 8; |
| 371 const intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1; | 371 const intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1; |
| 372 | 372 |
| 373 // Desired alignment for 128 bit SIMD values. | |
| 374 const intptr_t kSimd128Alignment = 16; | |
| 375 const intptr_t kSimd128AlignmentMask = kSimd128Alignment - 1; | |
| 376 | |
| 377 // Desired alignment for generated code is 32 bytes (to improve cache line | 373 // Desired alignment for generated code is 32 bytes (to improve cache line |
| 378 // utilization). | 374 // utilization). |
| 379 const int kCodeAlignmentBits = 5; | 375 const int kCodeAlignmentBits = 5; |
| 380 const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits; | 376 const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits; |
| 381 const intptr_t kCodeAlignmentMask = kCodeAlignment - 1; | 377 const intptr_t kCodeAlignmentMask = kCodeAlignment - 1; |
| 382 | 378 |
| 383 // The owner field of a page is tagged with the page header tag. We need that | 379 // The owner field of a page is tagged with the page header tag. We need that |
| 384 // to find out if a slot is part of a large object. If we mask out the lower | 380 // to find out if a slot is part of a large object. If we mask out the lower |
| 385 // 0xfffff bits (1M pages), go to the owner offset, and see that this field | 381 // 0xfffff bits (1M pages), go to the owner offset, and see that this field |
| 386 // is tagged with the page header tag, we can just look up the owner. | 382 // is tagged with the page header tag, we can just look up the owner. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 LO_SPACE, // Promoted large objects. | 505 LO_SPACE, // Promoted large objects. |
| 510 | 506 |
| 511 FIRST_SPACE = NEW_SPACE, | 507 FIRST_SPACE = NEW_SPACE, |
| 512 LAST_SPACE = LO_SPACE, | 508 LAST_SPACE = LO_SPACE, |
| 513 FIRST_PAGED_SPACE = OLD_SPACE, | 509 FIRST_PAGED_SPACE = OLD_SPACE, |
| 514 LAST_PAGED_SPACE = MAP_SPACE | 510 LAST_PAGED_SPACE = MAP_SPACE |
| 515 }; | 511 }; |
| 516 const int kSpaceTagSize = 3; | 512 const int kSpaceTagSize = 3; |
| 517 const int kSpaceTagMask = (1 << kSpaceTagSize) - 1; | 513 const int kSpaceTagMask = (1 << kSpaceTagSize) - 1; |
| 518 | 514 |
| 519 enum AllocationAlignment { | 515 enum AllocationAlignment { kWordAligned, kDoubleAligned, kDoubleUnaligned }; |
| 520 kWordAligned, | |
| 521 kDoubleAligned, | |
| 522 kDoubleUnaligned, | |
| 523 kSimd128Unaligned | |
| 524 }; | |
| 525 | 516 |
| 526 // Possible outcomes for decisions. | 517 // Possible outcomes for decisions. |
| 527 enum class Decision : uint8_t { kUnknown, kTrue, kFalse }; | 518 enum class Decision : uint8_t { kUnknown, kTrue, kFalse }; |
| 528 | 519 |
| 529 inline size_t hash_value(Decision decision) { | 520 inline size_t hash_value(Decision decision) { |
| 530 return static_cast<uint8_t>(decision); | 521 return static_cast<uint8_t>(decision); |
| 531 } | 522 } |
| 532 | 523 |
| 533 inline std::ostream& operator<<(std::ostream& os, Decision decision) { | 524 inline std::ostream& operator<<(std::ostream& os, Decision decision) { |
| 534 switch (decision) { | 525 switch (decision) { |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 } // namespace internal | 1344 } // namespace internal |
| 1354 } // namespace v8 | 1345 } // namespace v8 |
| 1355 | 1346 |
| 1356 // Used by js-builtin-reducer to identify whether ReduceArrayIterator() is | 1347 // Used by js-builtin-reducer to identify whether ReduceArrayIterator() is |
| 1357 // reducing a JSArray method, or a JSTypedArray method. | 1348 // reducing a JSArray method, or a JSTypedArray method. |
| 1358 enum class ArrayIteratorKind { kArray, kTypedArray }; | 1349 enum class ArrayIteratorKind { kArray, kTypedArray }; |
| 1359 | 1350 |
| 1360 namespace i = v8::internal; | 1351 namespace i = v8::internal; |
| 1361 | 1352 |
| 1362 #endif // V8_GLOBALS_H_ | 1353 #endif // V8_GLOBALS_H_ |
| OLD | NEW |