Chromium Code Reviews| Index: src/checks.h |
| diff --git a/src/checks.h b/src/checks.h |
| index f5c5f232bd5e3e12afb8b8c0ec0e9154477080dd..d4c6039e3aa7f376fa40b6360191c4a497cf913e 100644 |
| --- a/src/checks.h |
| +++ b/src/checks.h |
| @@ -272,7 +272,21 @@ template <int> class StaticAssertionHelper { }; |
| #endif |
| +#ifdef DEBUG |
| +#ifndef OPTIMIZED_DEBUG |
| +#define ENABLE_SLOW_ASSERTS 1 |
| +#endif |
| +#endif |
| + |
| +namespace v8 { |
| +namespace internal { |
| +#if ENABLE_SLOW_ASSERTS |
|
Jakob Kummerow
2013/10/24 13:52:09
s/if/ifdef/?
|
| extern bool FLAG_enable_slow_asserts; |
| +#else |
| +const bool FLAG_enable_slow_asserts = false; |
| +#endif |
| +} // namespace internal |
| +} // namespace v8 |
| // The ASSERT macro is equivalent to CHECK except that it only |
| @@ -285,7 +299,12 @@ extern bool FLAG_enable_slow_asserts; |
| #define ASSERT_GE(v1, v2) CHECK_GE(v1, v2) |
| #define ASSERT_LT(v1, v2) CHECK_LT(v1, v2) |
| #define ASSERT_LE(v1, v2) CHECK_LE(v1, v2) |
| -#define SLOW_ASSERT(condition) CHECK(!FLAG_enable_slow_asserts || (condition)) |
| +#ifdef ENABLE_SLOW_ASSERTS |
| +#define SLOW_ASSERT(condition) \ |
| + CHECK(!v8::internal::FLAG_enable_slow_asserts || (condition)) |
| +#else |
| +#define SLOW_ASSERT(condition) ((void) 0) |
| +#endif |
| #else |
| #define ASSERT_RESULT(expr) (expr) |
| #define ASSERT(condition) ((void) 0) |