Bug 1204613 - Add a static_assert that ProfileEntry::{Flags,Category} do not overlap; r=djvj

--HG--
extra : rebase_source : d5c6e873e2f10479b92da829d93af0a36bba6f82
This commit is contained in:
Nick Fitzgerald 2015-09-14 11:57:00 +02:00
parent 5a4f8d8260
commit 89e4d96d13

View File

@ -67,8 +67,11 @@ class ProfileEntry
// into baseline.
OSR = 0x08,
// Union of all flags.
ALL = IS_CPP_ENTRY|FRAME_LABEL_COPY|BEGIN_PSEUDO_JS|OSR,
// Mask for removing all flags except the category information.
CATEGORY_MASK = ~IS_CPP_ENTRY & ~FRAME_LABEL_COPY & ~BEGIN_PSEUDO_JS & ~OSR
CATEGORY_MASK = ~ALL
};
// Keep these in sync with browser/devtools/performance/modules/global.js
@ -87,6 +90,9 @@ class ProfileEntry
LAST = EVENTS
};
static_assert((static_cast<int>(Category::FIRST) & Flags::ALL) == 0,
"The category bitflags should not intersect with the other flags!");
// All of these methods are marked with the 'volatile' keyword because SPS's
// representation of the stack is stored such that all ProfileEntry
// instances are volatile. These methods would not be available unless they