| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 const uint32_t kMaxUInt32 = 0xFFFFFFFFu; | 131 const uint32_t kMaxUInt32 = 0xFFFFFFFFu; |
| 132 | 132 |
| 133 const int kCharSize = sizeof(char); // NOLINT | 133 const int kCharSize = sizeof(char); // NOLINT |
| 134 const int kShortSize = sizeof(short); // NOLINT | 134 const int kShortSize = sizeof(short); // NOLINT |
| 135 const int kIntSize = sizeof(int); // NOLINT | 135 const int kIntSize = sizeof(int); // NOLINT |
| 136 const int kInt32Size = sizeof(int32_t); // NOLINT | 136 const int kInt32Size = sizeof(int32_t); // NOLINT |
| 137 const int kInt64Size = sizeof(int64_t); // NOLINT | 137 const int kInt64Size = sizeof(int64_t); // NOLINT |
| 138 const int kDoubleSize = sizeof(double); // NOLINT | 138 const int kDoubleSize = sizeof(double); // NOLINT |
| 139 const int kIntptrSize = sizeof(intptr_t); // NOLINT | 139 const int kIntptrSize = sizeof(intptr_t); // NOLINT |
| 140 const int kPointerSize = sizeof(void*); // NOLINT | 140 const int kPointerSize = sizeof(void*); // NOLINT |
| 141 #if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT |
| 142 const int kRegisterSize = kPointerSize + kPointerSize; |
| 143 #else |
| 141 const int kRegisterSize = kPointerSize; | 144 const int kRegisterSize = kPointerSize; |
| 145 #endif |
| 142 const int kPCOnStackSize = kRegisterSize; | 146 const int kPCOnStackSize = kRegisterSize; |
| 143 const int kFPOnStackSize = kRegisterSize; | 147 const int kFPOnStackSize = kRegisterSize; |
| 144 | 148 |
| 145 const int kDoubleSizeLog2 = 3; | 149 const int kDoubleSizeLog2 = 3; |
| 146 | 150 |
| 147 #if V8_HOST_ARCH_64_BIT | 151 #if V8_HOST_ARCH_64_BIT |
| 148 const int kPointerSizeLog2 = 3; | 152 const int kPointerSizeLog2 = 3; |
| 149 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000); | 153 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000); |
| 150 const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF); | 154 const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF); |
| 151 const bool kRequiresCodeRange = true; | 155 const bool kRequiresCodeRange = true; |
| 152 const size_t kMaximalCodeRangeSize = 512 * MB; | 156 const size_t kMaximalCodeRangeSize = 512 * MB; |
| 153 #else | 157 #else |
| 154 const int kPointerSizeLog2 = 2; | 158 const int kPointerSizeLog2 = 2; |
| 155 const intptr_t kIntptrSignBit = 0x80000000; | 159 const intptr_t kIntptrSignBit = 0x80000000; |
| 156 const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu; | 160 const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu; |
| 161 #if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT |
| 162 // x32 port also requires code range. |
| 163 const bool kRequiresCodeRange = true; |
| 164 const size_t kMaximalCodeRangeSize = 256 * MB; |
| 165 #else |
| 157 const bool kRequiresCodeRange = false; | 166 const bool kRequiresCodeRange = false; |
| 158 const size_t kMaximalCodeRangeSize = 0 * MB; | 167 const size_t kMaximalCodeRangeSize = 0 * MB; |
| 159 #endif | 168 #endif |
| 169 #endif |
| 160 | 170 |
| 161 const int kBitsPerByte = 8; | 171 const int kBitsPerByte = 8; |
| 162 const int kBitsPerByteLog2 = 3; | 172 const int kBitsPerByteLog2 = 3; |
| 163 const int kBitsPerPointer = kPointerSize * kBitsPerByte; | 173 const int kBitsPerPointer = kPointerSize * kBitsPerByte; |
| 164 const int kBitsPerInt = kIntSize * kBitsPerByte; | 174 const int kBitsPerInt = kIntSize * kBitsPerByte; |
| 165 | 175 |
| 166 // IEEE 754 single precision floating point number bit layout. | 176 // IEEE 754 single precision floating point number bit layout. |
| 167 const uint32_t kBinary32SignMask = 0x80000000u; | 177 const uint32_t kBinary32SignMask = 0x80000000u; |
| 168 const uint32_t kBinary32ExponentMask = 0x7f800000u; | 178 const uint32_t kBinary32ExponentMask = 0x7f800000u; |
| 169 const uint32_t kBinary32MantissaMask = 0x007fffffu; | 179 const uint32_t kBinary32MantissaMask = 0x007fffffu; |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 enum MinusZeroMode { | 765 enum MinusZeroMode { |
| 756 TREAT_MINUS_ZERO_AS_ZERO, | 766 TREAT_MINUS_ZERO_AS_ZERO, |
| 757 FAIL_ON_MINUS_ZERO | 767 FAIL_ON_MINUS_ZERO |
| 758 }; | 768 }; |
| 759 | 769 |
| 760 } } // namespace v8::internal | 770 } } // namespace v8::internal |
| 761 | 771 |
| 762 namespace i = v8::internal; | 772 namespace i = v8::internal; |
| 763 | 773 |
| 764 #endif // V8_GLOBALS_H_ | 774 #endif // V8_GLOBALS_H_ |
| OLD | NEW |