| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 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 | 219 |
| 226 // Zap-value: The value used for zapping dead objects. | 220 // Zap-value: The value used for zapping dead objects. |
| 227 // Should be a recognizable hex value tagged as a failure. | 221 // Should be a recognizable hex value tagged as a failure. |
| 228 #ifdef V8_HOST_ARCH_64_BIT | 222 #ifdef V8_HOST_ARCH_64_BIT |
| 229 const Address kZapValue = | 223 const Address kZapValue = |
| 230 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef)); | 224 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef)); |
| 231 const Address kHandleZapValue = | 225 const Address kHandleZapValue = |
| 232 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf)); | 226 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf)); |
| 233 const Address kGlobalHandleZapValue = | 227 const Address kGlobalHandleZapValue = |
| 234 reinterpret_cast<Address>(V8_UINT64_C(0x1baffed00baffedf)); | 228 reinterpret_cast<Address>(V8_UINT64_C(0x1baffed00baffedf)); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 524 |
| 531 | 525 |
| 532 // ----------------------------------------------------------------------------- | 526 // ----------------------------------------------------------------------------- |
| 533 // Macros | 527 // Macros |
| 534 | 528 |
| 535 // Testers for test. | 529 // Testers for test. |
| 536 | 530 |
| 537 #define HAS_SMI_TAG(value) \ | 531 #define HAS_SMI_TAG(value) \ |
| 538 ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag) | 532 ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag) |
| 539 | 533 |
| 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 | 534 // OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer |
| 544 #define OBJECT_POINTER_ALIGN(value) \ | 535 #define OBJECT_POINTER_ALIGN(value) \ |
| 545 (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask) | 536 (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask) |
| 546 | 537 |
| 547 // POINTER_SIZE_ALIGN returns the value aligned as a pointer. | 538 // POINTER_SIZE_ALIGN returns the value aligned as a pointer. |
| 548 #define POINTER_SIZE_ALIGN(value) \ | 539 #define POINTER_SIZE_ALIGN(value) \ |
| 549 (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask) | 540 (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask) |
| 550 | 541 |
| 551 // CODE_POINTER_ALIGN returns the value aligned as a generated code segment. | 542 // CODE_POINTER_ALIGN returns the value aligned as a generated code segment. |
| 552 #define CODE_POINTER_ALIGN(value) \ | 543 #define CODE_POINTER_ALIGN(value) \ |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 enum MinusZeroMode { | 716 enum MinusZeroMode { |
| 726 TREAT_MINUS_ZERO_AS_ZERO, | 717 TREAT_MINUS_ZERO_AS_ZERO, |
| 727 FAIL_ON_MINUS_ZERO | 718 FAIL_ON_MINUS_ZERO |
| 728 }; | 719 }; |
| 729 | 720 |
| 730 } } // namespace v8::internal | 721 } } // namespace v8::internal |
| 731 | 722 |
| 732 namespace i = v8::internal; | 723 namespace i = v8::internal; |
| 733 | 724 |
| 734 #endif // V8_GLOBALS_H_ | 725 #endif // V8_GLOBALS_H_ |
| OLD | NEW |