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 "include/v8stdint.h" | 8 #include "include/v8stdint.h" |
9 | 9 |
10 #include "src/base/build_config.h" | 10 #include "src/base/build_config.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 | 208 |
209 // Desired alignment for double values. | 209 // Desired alignment for double values. |
210 const intptr_t kDoubleAlignment = 8; | 210 const intptr_t kDoubleAlignment = 8; |
211 const intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1; | 211 const intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1; |
212 | 212 |
213 // Desired alignment for generated code is 32 bytes (to improve cache line | 213 // Desired alignment for generated code is 32 bytes (to improve cache line |
214 // utilization). | 214 // utilization). |
215 const int kCodeAlignmentBits = 5; | 215 const int kCodeAlignmentBits = 5; |
216 const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits; | 216 const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits; |
217 const intptr_t kCodeAlignmentMask = kCodeAlignment - 1; | 217 const intptr_t kCodeAlignmentMask = kCodeAlignment - 1; |
218 | 218 |
Michael Starzinger
2014/07/15 11:05:33
nit: Let's keep two empty newlines.
Hannes Payer (out of office)
2014/07/15 11:10:53
Done.
| |
219 // Tag information for Failure. | |
220 // TODO(yangguo): remove this from space owner calculation. | |
221 const int kFailureTag = 3; | |
222 const int kFailureTagSize = 2; | |
223 const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1; | |
224 | |
225 | |
226 // Zap-value: The value used for zapping dead objects. | 219 // Zap-value: The value used for zapping dead objects. |
227 // Should be a recognizable hex value tagged as a failure. | 220 // Should be a recognizable hex value tagged as a failure. |
228 #ifdef V8_HOST_ARCH_64_BIT | 221 #ifdef V8_HOST_ARCH_64_BIT |
229 const Address kZapValue = | 222 const Address kZapValue = |
230 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef)); | 223 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef)); |
231 const Address kHandleZapValue = | 224 const Address kHandleZapValue = |
232 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf)); | 225 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf)); |
233 const Address kGlobalHandleZapValue = | 226 const Address kGlobalHandleZapValue = |
234 reinterpret_cast<Address>(V8_UINT64_C(0x1baffed00baffedf)); | 227 reinterpret_cast<Address>(V8_UINT64_C(0x1baffed00baffedf)); |
235 const Address kFromSpaceZapValue = | 228 const Address kFromSpaceZapValue = |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 | 523 |
531 | 524 |
532 // ----------------------------------------------------------------------------- | 525 // ----------------------------------------------------------------------------- |
533 // Macros | 526 // Macros |
534 | 527 |
535 // Testers for test. | 528 // Testers for test. |
536 | 529 |
537 #define HAS_SMI_TAG(value) \ | 530 #define HAS_SMI_TAG(value) \ |
538 ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag) | 531 ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag) |
539 | 532 |
540 #define HAS_FAILURE_TAG(value) \ | |
541 ((reinterpret_cast<intptr_t>(value) & kFailureTagMask) == kFailureTag) | |
542 | |
543 // OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer | 533 // OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer |
544 #define OBJECT_POINTER_ALIGN(value) \ | 534 #define OBJECT_POINTER_ALIGN(value) \ |
545 (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask) | 535 (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask) |
546 | 536 |
547 // POINTER_SIZE_ALIGN returns the value aligned as a pointer. | 537 // POINTER_SIZE_ALIGN returns the value aligned as a pointer. |
548 #define POINTER_SIZE_ALIGN(value) \ | 538 #define POINTER_SIZE_ALIGN(value) \ |
549 (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask) | 539 (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask) |
550 | 540 |
551 // CODE_POINTER_ALIGN returns the value aligned as a generated code segment. | 541 // CODE_POINTER_ALIGN returns the value aligned as a generated code segment. |
552 #define CODE_POINTER_ALIGN(value) \ | 542 #define CODE_POINTER_ALIGN(value) \ |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
725 enum MinusZeroMode { | 715 enum MinusZeroMode { |
726 TREAT_MINUS_ZERO_AS_ZERO, | 716 TREAT_MINUS_ZERO_AS_ZERO, |
727 FAIL_ON_MINUS_ZERO | 717 FAIL_ON_MINUS_ZERO |
728 }; | 718 }; |
729 | 719 |
730 } } // namespace v8::internal | 720 } } // namespace v8::internal |
731 | 721 |
732 namespace i = v8::internal; | 722 namespace i = v8::internal; |
733 | 723 |
734 #endif // V8_GLOBALS_H_ | 724 #endif // V8_GLOBALS_H_ |
OLD | NEW |