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 "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 | 9 |
10 #ifdef DEBUG | |
11 #ifndef OPTIMIZED_DEBUG | |
12 #define ENABLE_SLOW_DCHECKS 1 | |
13 #endif | |
14 #endif | |
15 | |
16 namespace v8 { | 10 namespace v8 { |
17 | 11 |
18 class Value; | 12 class Value; |
19 template <class T> class Handle; | 13 template <class T> class Handle; |
20 | 14 |
21 namespace internal { | 15 namespace internal { |
22 | 16 |
23 intptr_t HeapObjectTagMask(); | 17 intptr_t HeapObjectTagMask(); |
24 | 18 |
25 #ifdef ENABLE_SLOW_DCHECKS | 19 #ifdef ENABLE_SLOW_DCHECKS |
(...skipping 27 matching lines...) Expand all Loading... |
53 v8::Handle<v8::Value> expected, | 47 v8::Handle<v8::Value> expected, |
54 const char* value_source, | 48 const char* value_source, |
55 v8::Handle<v8::Value> value); | 49 v8::Handle<v8::Value> value); |
56 | 50 |
57 #define DCHECK_TAG_ALIGNED(address) \ | 51 #define DCHECK_TAG_ALIGNED(address) \ |
58 DCHECK((reinterpret_cast<intptr_t>(address) & HeapObjectTagMask()) == 0) | 52 DCHECK((reinterpret_cast<intptr_t>(address) & HeapObjectTagMask()) == 0) |
59 | 53 |
60 #define DCHECK_SIZE_TAG_ALIGNED(size) DCHECK((size & HeapObjectTagMask()) == 0) | 54 #define DCHECK_SIZE_TAG_ALIGNED(size) DCHECK((size & HeapObjectTagMask()) == 0) |
61 | 55 |
62 #endif // V8_CHECKS_H_ | 56 #endif // V8_CHECKS_H_ |
OLD | NEW |