| 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 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 | |
| 13 class Value; | |
| 14 template <class T> class Handle; | |
| 15 | |
| 16 namespace internal { | 12 namespace internal { |
| 17 | 13 |
| 18 #ifdef ENABLE_SLOW_DCHECKS | 14 #ifdef ENABLE_SLOW_DCHECKS |
| 19 #define SLOW_DCHECK(condition) \ | 15 #define SLOW_DCHECK(condition) \ |
| 20 CHECK(!v8::internal::FLAG_enable_slow_asserts || (condition)) | 16 CHECK(!v8::internal::FLAG_enable_slow_asserts || (condition)) |
| 21 extern bool FLAG_enable_slow_asserts; | 17 extern bool FLAG_enable_slow_asserts; |
| 22 #else | 18 #else |
| 23 #define SLOW_DCHECK(condition) ((void) 0) | 19 #define SLOW_DCHECK(condition) ((void) 0) |
| 24 const bool FLAG_enable_slow_asserts = false; | 20 const bool FLAG_enable_slow_asserts = false; |
| 25 #endif | 21 #endif |
| 26 | 22 |
| 27 } } // namespace v8::internal | 23 } } // namespace v8::internal |
| 28 | 24 |
| 29 #define DCHECK_TAG_ALIGNED(address) \ | 25 #define DCHECK_TAG_ALIGNED(address) \ |
| 30 DCHECK((reinterpret_cast<intptr_t>(address) & \ | 26 DCHECK((reinterpret_cast<intptr_t>(address) & \ |
| 31 ::v8::internal::kHeapObjectTagMask) == 0) | 27 ::v8::internal::kHeapObjectTagMask) == 0) |
| 32 | 28 |
| 33 #define DCHECK_SIZE_TAG_ALIGNED(size) \ | 29 #define DCHECK_SIZE_TAG_ALIGNED(size) \ |
| 34 DCHECK((size & ::v8::internal::kHeapObjectTagMask) == 0) | 30 DCHECK((size & ::v8::internal::kHeapObjectTagMask) == 0) |
| 35 | 31 |
| 36 #endif // V8_CHECKS_H_ | 32 #endif // V8_CHECKS_H_ |
| OLD | NEW |