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_CHECKS_H_ | 5 #ifndef V8_CHECKS_H_ |
6 #define V8_CHECKS_H_ | 6 #define V8_CHECKS_H_ |
7 | 7 |
8 #include "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/base/logging.h" | 9 #include "src/base/logging.h" |
| 10 #include "src/globals.h" |
10 | 11 |
11 namespace v8 { | 12 namespace v8 { |
12 | 13 |
13 class Value; | 14 class Value; |
14 | 15 |
15 namespace internal { | 16 namespace internal { |
16 | 17 |
17 #ifdef ENABLE_SLOW_DCHECKS | 18 #ifdef ENABLE_SLOW_DCHECKS |
18 #define SLOW_DCHECK(condition) \ | 19 #define SLOW_DCHECK(condition) \ |
19 CHECK(!v8::internal::FLAG_enable_slow_asserts || (condition)) | 20 CHECK(!v8::internal::FLAG_enable_slow_asserts || (condition)) |
20 extern bool FLAG_enable_slow_asserts; | 21 V8_EXPORT_PRIVATE extern bool FLAG_enable_slow_asserts; |
21 #else | 22 #else |
22 #define SLOW_DCHECK(condition) ((void) 0) | 23 #define SLOW_DCHECK(condition) ((void) 0) |
23 const bool FLAG_enable_slow_asserts = false; | 24 static const bool FLAG_enable_slow_asserts = false; |
24 #endif | 25 #endif |
25 | 26 |
26 } // namespace internal | 27 } // namespace internal |
27 } // namespace v8 | 28 } // namespace v8 |
28 | 29 |
29 #define DCHECK_TAG_ALIGNED(address) \ | 30 #define DCHECK_TAG_ALIGNED(address) \ |
30 DCHECK((reinterpret_cast<intptr_t>(address) & \ | 31 DCHECK((reinterpret_cast<intptr_t>(address) & \ |
31 ::v8::internal::kHeapObjectTagMask) == 0) | 32 ::v8::internal::kHeapObjectTagMask) == 0) |
32 | 33 |
33 #define DCHECK_SIZE_TAG_ALIGNED(size) \ | 34 #define DCHECK_SIZE_TAG_ALIGNED(size) \ |
34 DCHECK((size & ::v8::internal::kHeapObjectTagMask) == 0) | 35 DCHECK((size & ::v8::internal::kHeapObjectTagMask) == 0) |
35 | 36 |
36 #endif // V8_CHECKS_H_ | 37 #endif // V8_CHECKS_H_ |
OLD | NEW |