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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 inline bool is_valid_language_mode(int language_mode) { | 287 inline bool is_valid_language_mode(int language_mode) { |
288 return language_mode == SLOPPY || language_mode == STRICT; | 288 return language_mode == SLOPPY || language_mode == STRICT; |
289 } | 289 } |
290 | 290 |
291 | 291 |
292 inline LanguageMode construct_language_mode(bool strict_bit) { | 292 inline LanguageMode construct_language_mode(bool strict_bit) { |
293 return static_cast<LanguageMode>(strict_bit); | 293 return static_cast<LanguageMode>(strict_bit); |
294 } | 294 } |
295 | 295 |
| 296 // This constant is used as an undefined value when passing source positions. |
| 297 const int kNoSourcePosition = -1; |
296 | 298 |
297 // Mask for the sign bit in a smi. | 299 // Mask for the sign bit in a smi. |
298 const intptr_t kSmiSignMask = kIntptrSignBit; | 300 const intptr_t kSmiSignMask = kIntptrSignBit; |
299 | 301 |
300 const int kObjectAlignmentBits = kPointerSizeLog2; | 302 const int kObjectAlignmentBits = kPointerSizeLog2; |
301 const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits; | 303 const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits; |
302 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; | 304 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; |
303 | 305 |
304 // Desired alignment for pointers. | 306 // Desired alignment for pointers. |
305 const intptr_t kPointerAlignment = (1 << kPointerSizeLog2); | 307 const intptr_t kPointerAlignment = (1 << kPointerSizeLog2); |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> | 1105 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> |
1104 kPointerSizeLog2); | 1106 kPointerSizeLog2); |
1105 } | 1107 } |
1106 | 1108 |
1107 } // namespace internal | 1109 } // namespace internal |
1108 } // namespace v8 | 1110 } // namespace v8 |
1109 | 1111 |
1110 namespace i = v8::internal; | 1112 namespace i = v8::internal; |
1111 | 1113 |
1112 #endif // V8_GLOBALS_H_ | 1114 #endif // V8_GLOBALS_H_ |
OLD | NEW |