Bug 712939 - Part 3: Replace JS_STATIC_ASSERT in js/src/gc. r=jwalden

Depends on D62273

Differential Revision: https://phabricator.services.mozilla.com/D62275

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2020-02-10 20:34:58 +00:00
parent ff0cf6f648
commit 9e9b473f3b
4 changed files with 7 additions and 8 deletions

View File

@ -832,8 +832,8 @@ class HeapSlotArray {
}
operator const Value*() const {
JS_STATIC_ASSERT(sizeof(GCPtr<Value>) == sizeof(Value));
JS_STATIC_ASSERT(sizeof(HeapSlot) == sizeof(Value));
static_assert(sizeof(GCPtr<Value>) == sizeof(Value));
static_assert(sizeof(HeapSlot) == sizeof(Value));
return reinterpret_cast<const Value*>(array);
}
operator HeapSlot*() const {

View File

@ -24,8 +24,8 @@ GCTrace gcTracer;
#ifdef JS_GC_TRACE
JS_STATIC_ASSERT(NumAllocKinds == unsigned(AllocKind::LIMIT));
JS_STATIC_ASSERT(LastObjectAllocKind == unsigned(AllocKind::OBJECT_LAST));
static_assert(NumAllocKinds == unsigned(AllocKind::LIMIT));
static_assert(LastObjectAllocKind == unsigned(AllocKind::OBJECT_LAST));
static inline void WriteWord(FILE* file, uint64_t data) {
if (file) {
@ -50,7 +50,7 @@ static inline void TraceInt(FILE* file, uint32_t data) {
}
static void TraceString(FILE* file, const char* string) {
JS_STATIC_ASSERT(sizeof(char) == 1);
static_assert(sizeof(char) == 1);
size_t length = strlen(string);
const unsigned charsPerWord = sizeof(uint64_t);

View File

@ -53,7 +53,7 @@ static inline AllocKind GetGCArrayKind(size_t numElements) {
* maximum number of fixed slots is needed then the fixed slots will be
* unused.
*/
JS_STATIC_ASSERT(ObjectElements::VALUES_PER_HEADER == 2);
static_assert(ObjectElements::VALUES_PER_HEADER == 2);
if (numElements > NativeObject::MAX_DENSE_ELEMENTS_COUNT ||
numElements + ObjectElements::VALUES_PER_HEADER >=
SLOTS_TO_THING_KIND_LIMIT) {

View File

@ -40,8 +40,7 @@ using mozilla::TimeStamp;
* larger-numbered reasons to pile up in the last telemetry bucket, or switch
* to GC_REASON_3 and bump the max value.
*/
JS_STATIC_ASSERT(JS::GCReason::NUM_TELEMETRY_REASONS >=
JS::GCReason::NUM_REASONS);
static_assert(JS::GCReason::NUM_TELEMETRY_REASONS >= JS::GCReason::NUM_REASONS);
static inline auto AllPhaseKinds() {
return mozilla::MakeEnumeratedRange(PhaseKind::FIRST, PhaseKind::LIMIT);