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 // Simulator specific helpers. | 10 // Simulator specific helpers. |
(...skipping 10 matching lines...) Expand all Loading... |
21 __ Debug("LOCATION: " message, __LINE__, NO_PARAM) | 21 __ Debug("LOCATION: " message, __LINE__, NO_PARAM) |
22 #else | 22 #else |
23 #define ASM_UNIMPLEMENTED(message) | 23 #define ASM_UNIMPLEMENTED(message) |
24 #define ASM_UNIMPLEMENTED_BREAK(message) | 24 #define ASM_UNIMPLEMENTED_BREAK(message) |
25 #define ASM_LOCATION(message) | 25 #define ASM_LOCATION(message) |
26 #endif | 26 #endif |
27 | 27 |
28 | 28 |
29 #ifdef DEBUG | 29 #ifdef DEBUG |
30 #ifndef OPTIMIZED_DEBUG | 30 #ifndef OPTIMIZED_DEBUG |
31 #define ENABLE_SLOW_ASSERTS 1 | 31 #define ENABLE_SLOW_DCHECKS 1 |
32 #endif | 32 #endif |
33 #endif | 33 #endif |
34 | 34 |
35 namespace v8 { | 35 namespace v8 { |
36 | 36 |
37 class Value; | 37 class Value; |
38 template <class T> class Handle; | 38 template <class T> class Handle; |
39 | 39 |
40 namespace internal { | 40 namespace internal { |
41 | 41 |
42 intptr_t HeapObjectTagMask(); | 42 intptr_t HeapObjectTagMask(); |
43 | 43 |
44 #ifdef ENABLE_SLOW_ASSERTS | 44 #ifdef ENABLE_SLOW_DCHECKS |
45 #define SLOW_ASSERT(condition) \ | 45 #define SLOW_DCHECK(condition) \ |
46 CHECK(!v8::internal::FLAG_enable_slow_asserts || (condition)) | 46 CHECK(!v8::internal::FLAG_enable_slow_asserts || (condition)) |
47 extern bool FLAG_enable_slow_asserts; | 47 extern bool FLAG_enable_slow_asserts; |
48 #else | 48 #else |
49 #define SLOW_ASSERT(condition) ((void) 0) | 49 #define SLOW_DCHECK(condition) ((void) 0) |
50 const bool FLAG_enable_slow_asserts = false; | 50 const bool FLAG_enable_slow_asserts = false; |
51 #endif | 51 #endif |
52 | 52 |
53 } } // namespace v8::internal | 53 } } // namespace v8::internal |
54 | 54 |
55 | 55 |
56 void CheckNonEqualsHelper(const char* file, int line, | 56 void CheckNonEqualsHelper(const char* file, int line, |
57 const char* expected_source, double expected, | 57 const char* expected_source, double expected, |
58 const char* value_source, double value); | 58 const char* value_source, double value); |
59 | 59 |
60 void CheckEqualsHelper(const char* file, int line, const char* expected_source, | 60 void CheckEqualsHelper(const char* file, int line, const char* expected_source, |
61 double expected, const char* value_source, double value); | 61 double expected, const char* value_source, double value); |
62 | 62 |
63 void CheckNonEqualsHelper(const char* file, int line, | 63 void CheckNonEqualsHelper(const char* file, int line, |
64 const char* unexpected_source, | 64 const char* unexpected_source, |
65 v8::Handle<v8::Value> unexpected, | 65 v8::Handle<v8::Value> unexpected, |
66 const char* value_source, | 66 const char* value_source, |
67 v8::Handle<v8::Value> value); | 67 v8::Handle<v8::Value> value); |
68 | 68 |
69 void CheckEqualsHelper(const char* file, | 69 void CheckEqualsHelper(const char* file, |
70 int line, | 70 int line, |
71 const char* expected_source, | 71 const char* expected_source, |
72 v8::Handle<v8::Value> expected, | 72 v8::Handle<v8::Value> expected, |
73 const char* value_source, | 73 const char* value_source, |
74 v8::Handle<v8::Value> value); | 74 v8::Handle<v8::Value> value); |
75 | 75 |
76 #define ASSERT_TAG_ALIGNED(address) \ | 76 #define DCHECK_TAG_ALIGNED(address) \ |
77 ASSERT((reinterpret_cast<intptr_t>(address) & HeapObjectTagMask()) == 0) | 77 DCHECK((reinterpret_cast<intptr_t>(address) & HeapObjectTagMask()) == 0) |
78 | 78 |
79 #define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & HeapObjectTagMask()) == 0) | 79 #define DCHECK_SIZE_TAG_ALIGNED(size) DCHECK((size & HeapObjectTagMask()) == 0) |
80 | 80 |
81 #endif // V8_CHECKS_H_ | 81 #endif // V8_CHECKS_H_ |
OLD | NEW |