author | Jeff Gilbert <jgilbert@mozilla.com> |
Fri, 19 Apr 2013 16:20:35 -0700 | |
changeset 129382 | 87ac8643d3b35329df34451272ae87f5053c0eaf |
parent 129381 | 6953e922b5c7a7d51ba2d8a1fc6fd8e3271b7eed |
child 129383 | 1d3fb4987df795d8fcde1fe070b3f73025cb3484 |
push id | 26797 |
push user | cpeterson@mozilla.com |
push date | Fri, 19 Apr 2013 23:22:21 +0000 |
treeherder | mozilla-inbound@87ac8643d3b3 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | waldo |
bugs | 822431 |
milestone | 23.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
mfbt/Assertions.h | file | annotate | diff | comparison | revisions |
--- a/mfbt/Assertions.h +++ b/mfbt/Assertions.h @@ -5,16 +5,17 @@ /* Implementations of runtime and static assertion macros for C and C++. */ #ifndef mozilla_Assertions_h_ #define mozilla_Assertions_h_ #include "mozilla/Attributes.h" #include "mozilla/Compiler.h" +#include "mozilla/Likely.h" #include <stddef.h> #include <stdio.h> #include <stdlib.h> #ifdef WIN32 /* * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which * further depends on <windef.h>. We hardcode these few definitions manually @@ -243,25 +244,25 @@ MOZ_ReportAssertionFailure(const char* s * * MOZ_ASSERT has no effect in non-debug builds. It is designed to catch bugs * *only* during debugging, not "in the field". */ #ifdef DEBUG /* First the single-argument form. */ # define MOZ_ASSERT_HELPER1(expr) \ do { \ - if (!(expr)) { \ + if (MOZ_UNLIKELY(!(expr))) { \ MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \ MOZ_CRASH(); \ } \ } while (0) /* Now the two-argument form. */ # define MOZ_ASSERT_HELPER2(expr, explain) \ do { \ - if (!(expr)) { \ + if (MOZ_UNLIKELY(!(expr))) { \ MOZ_ReportAssertionFailure(#expr " (" explain ")", __FILE__, __LINE__); \ MOZ_CRASH(); \ } \ } while (0) /* And now, helper macrology up the wazoo. */ /* * Count the number of arguments passed to MOZ_ASSERT, very carefully * tiptoeing around an MSVC bug where it improperly expands __VA_ARGS__ as a