| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 #define SEMI_STATIC_JOIN_HELPER(a, b) a##b | 261 #define SEMI_STATIC_JOIN_HELPER(a, b) a##b |
| 262 // Causes an error during compilation of the condition is not | 262 // Causes an error during compilation of the condition is not |
| 263 // statically known to be true. It is formulated as a typedef so that | 263 // statically known to be true. It is formulated as a typedef so that |
| 264 // it can be used wherever a typedef can be used. Beware that this | 264 // it can be used wherever a typedef can be used. Beware that this |
| 265 // actually causes each use to introduce a new defined type with a | 265 // actually causes each use to introduce a new defined type with a |
| 266 // name depending on the source line. | 266 // name depending on the source line. |
| 267 template <int> class StaticAssertionHelper { }; | 267 template <int> class StaticAssertionHelper { }; |
| 268 #define STATIC_CHECK(test) \ | 268 #define STATIC_CHECK(test) \ |
| 269 typedef \ | 269 typedef \ |
| 270 StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \ | 270 StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \ |
| 271 SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) | 271 SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) V8_UNUSED |
| 272 #endif | 272 #endif |
| 273 | 273 |
| 274 | 274 |
| 275 #ifdef DEBUG | 275 #ifdef DEBUG |
| 276 #ifndef OPTIMIZED_DEBUG | 276 #ifndef OPTIMIZED_DEBUG |
| 277 #define ENABLE_SLOW_ASSERTS 1 | 277 #define ENABLE_SLOW_ASSERTS 1 |
| 278 #endif | 278 #endif |
| 279 #endif | 279 #endif |
| 280 | 280 |
| 281 namespace v8 { | 281 namespace v8 { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 // "Extra checks" are lightweight checks that are enabled in some release | 323 // "Extra checks" are lightweight checks that are enabled in some release |
| 324 // builds. | 324 // builds. |
| 325 #ifdef ENABLE_EXTRA_CHECKS | 325 #ifdef ENABLE_EXTRA_CHECKS |
| 326 #define EXTRA_CHECK(condition) CHECK(condition) | 326 #define EXTRA_CHECK(condition) CHECK(condition) |
| 327 #else | 327 #else |
| 328 #define EXTRA_CHECK(condition) ((void) 0) | 328 #define EXTRA_CHECK(condition) ((void) 0) |
| 329 #endif | 329 #endif |
| 330 | 330 |
| 331 #endif // V8_CHECKS_H_ | 331 #endif // V8_CHECKS_H_ |
| OLD | NEW |