| 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_BASE_LOGGING_H_ | 5 #ifndef V8_BASE_LOGGING_H_ |
| 6 #define V8_BASE_LOGGING_H_ | 6 #define V8_BASE_LOGGING_H_ |
| 7 | 7 |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Exposed for making debugging easier (to see where your function is being | 142 // Exposed for making debugging easier (to see where your function is being |
| 143 // called, just add a call to DumpBacktrace). | 143 // called, just add a call to DumpBacktrace). |
| 144 void DumpBacktrace(); | 144 void DumpBacktrace(); |
| 145 | 145 |
| 146 } // namespace base | 146 } // namespace base |
| 147 } // namespace v8 | 147 } // namespace v8 |
| 148 | 148 |
| 149 | 149 |
| 150 // The DCHECK macro is equivalent to CHECK except that it only | 150 // The DCHECK macro is equivalent to CHECK except that it only |
| 151 // generates code in debug builds. | 151 // generates code in debug builds. |
| 152 // TODO(bmeurer): DCHECK_RESULT(expr) must die! | |
| 153 #ifdef DEBUG | 152 #ifdef DEBUG |
| 154 #define DCHECK_RESULT(expr) CHECK(expr) | |
| 155 #define DCHECK(condition) CHECK(condition) | 153 #define DCHECK(condition) CHECK(condition) |
| 156 #define DCHECK_EQ(v1, v2) CHECK_EQ(v1, v2) | 154 #define DCHECK_EQ(v1, v2) CHECK_EQ(v1, v2) |
| 157 #define DCHECK_NE(v1, v2) CHECK_NE(v1, v2) | 155 #define DCHECK_NE(v1, v2) CHECK_NE(v1, v2) |
| 158 #define DCHECK_GE(v1, v2) CHECK_GE(v1, v2) | 156 #define DCHECK_GE(v1, v2) CHECK_GE(v1, v2) |
| 159 #define DCHECK_LT(v1, v2) CHECK_LT(v1, v2) | 157 #define DCHECK_LT(v1, v2) CHECK_LT(v1, v2) |
| 160 #define DCHECK_LE(v1, v2) CHECK_LE(v1, v2) | 158 #define DCHECK_LE(v1, v2) CHECK_LE(v1, v2) |
| 161 #define DCHECK_NULL(val) CHECK_NULL(val) | 159 #define DCHECK_NULL(val) CHECK_NULL(val) |
| 162 #define DCHECK_NOT_NULL(val) CHECK_NOT_NULL(val) | 160 #define DCHECK_NOT_NULL(val) CHECK_NOT_NULL(val) |
| 163 #define DCHECK_IMPLIES(v1, v2) CHECK_IMPLIES(v1, v2) | 161 #define DCHECK_IMPLIES(v1, v2) CHECK_IMPLIES(v1, v2) |
| 164 #else | 162 #else |
| 165 #define DCHECK_RESULT(expr) (expr) | |
| 166 #define DCHECK(condition) ((void) 0) | 163 #define DCHECK(condition) ((void) 0) |
| 167 #define DCHECK_EQ(v1, v2) ((void) 0) | 164 #define DCHECK_EQ(v1, v2) ((void) 0) |
| 168 #define DCHECK_NE(v1, v2) ((void) 0) | 165 #define DCHECK_NE(v1, v2) ((void) 0) |
| 169 #define DCHECK_GE(v1, v2) ((void) 0) | 166 #define DCHECK_GE(v1, v2) ((void) 0) |
| 170 #define DCHECK_LT(v1, v2) ((void) 0) | 167 #define DCHECK_LT(v1, v2) ((void) 0) |
| 171 #define DCHECK_LE(v1, v2) ((void) 0) | 168 #define DCHECK_LE(v1, v2) ((void) 0) |
| 172 #define DCHECK_NULL(val) ((void) 0) | 169 #define DCHECK_NULL(val) ((void) 0) |
| 173 #define DCHECK_NOT_NULL(val) ((void) 0) | 170 #define DCHECK_NOT_NULL(val) ((void) 0) |
| 174 #define DCHECK_IMPLIES(v1, v2) ((void) 0) | 171 #define DCHECK_IMPLIES(v1, v2) ((void) 0) |
| 175 #endif | 172 #endif |
| 176 | 173 |
| 177 #endif // V8_BASE_LOGGING_H_ | 174 #endif // V8_BASE_LOGGING_H_ |
| OLD | NEW |