зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ff0cf6f648
Коммит
9e9b473f3b
|
@ -832,8 +832,8 @@ class HeapSlotArray {
|
||||||
}
|
}
|
||||||
|
|
||||||
operator const Value*() const {
|
operator const Value*() const {
|
||||||
JS_STATIC_ASSERT(sizeof(GCPtr<Value>) == sizeof(Value));
|
static_assert(sizeof(GCPtr<Value>) == sizeof(Value));
|
||||||
JS_STATIC_ASSERT(sizeof(HeapSlot) == sizeof(Value));
|
static_assert(sizeof(HeapSlot) == sizeof(Value));
|
||||||
return reinterpret_cast<const Value*>(array);
|
return reinterpret_cast<const Value*>(array);
|
||||||
}
|
}
|
||||||
operator HeapSlot*() const {
|
operator HeapSlot*() const {
|
||||||
|
|
|
@ -24,8 +24,8 @@ GCTrace gcTracer;
|
||||||
|
|
||||||
#ifdef JS_GC_TRACE
|
#ifdef JS_GC_TRACE
|
||||||
|
|
||||||
JS_STATIC_ASSERT(NumAllocKinds == unsigned(AllocKind::LIMIT));
|
static_assert(NumAllocKinds == unsigned(AllocKind::LIMIT));
|
||||||
JS_STATIC_ASSERT(LastObjectAllocKind == unsigned(AllocKind::OBJECT_LAST));
|
static_assert(LastObjectAllocKind == unsigned(AllocKind::OBJECT_LAST));
|
||||||
|
|
||||||
static inline void WriteWord(FILE* file, uint64_t data) {
|
static inline void WriteWord(FILE* file, uint64_t data) {
|
||||||
if (file) {
|
if (file) {
|
||||||
|
@ -50,7 +50,7 @@ static inline void TraceInt(FILE* file, uint32_t data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TraceString(FILE* file, const char* string) {
|
static void TraceString(FILE* file, const char* string) {
|
||||||
JS_STATIC_ASSERT(sizeof(char) == 1);
|
static_assert(sizeof(char) == 1);
|
||||||
|
|
||||||
size_t length = strlen(string);
|
size_t length = strlen(string);
|
||||||
const unsigned charsPerWord = sizeof(uint64_t);
|
const unsigned charsPerWord = sizeof(uint64_t);
|
||||||
|
|
|
@ -53,7 +53,7 @@ static inline AllocKind GetGCArrayKind(size_t numElements) {
|
||||||
* maximum number of fixed slots is needed then the fixed slots will be
|
* maximum number of fixed slots is needed then the fixed slots will be
|
||||||
* unused.
|
* unused.
|
||||||
*/
|
*/
|
||||||
JS_STATIC_ASSERT(ObjectElements::VALUES_PER_HEADER == 2);
|
static_assert(ObjectElements::VALUES_PER_HEADER == 2);
|
||||||
if (numElements > NativeObject::MAX_DENSE_ELEMENTS_COUNT ||
|
if (numElements > NativeObject::MAX_DENSE_ELEMENTS_COUNT ||
|
||||||
numElements + ObjectElements::VALUES_PER_HEADER >=
|
numElements + ObjectElements::VALUES_PER_HEADER >=
|
||||||
SLOTS_TO_THING_KIND_LIMIT) {
|
SLOTS_TO_THING_KIND_LIMIT) {
|
||||||
|
|
|
@ -40,8 +40,7 @@ using mozilla::TimeStamp;
|
||||||
* larger-numbered reasons to pile up in the last telemetry bucket, or switch
|
* larger-numbered reasons to pile up in the last telemetry bucket, or switch
|
||||||
* to GC_REASON_3 and bump the max value.
|
* to GC_REASON_3 and bump the max value.
|
||||||
*/
|
*/
|
||||||
JS_STATIC_ASSERT(JS::GCReason::NUM_TELEMETRY_REASONS >=
|
static_assert(JS::GCReason::NUM_TELEMETRY_REASONS >= JS::GCReason::NUM_REASONS);
|
||||||
JS::GCReason::NUM_REASONS);
|
|
||||||
|
|
||||||
static inline auto AllPhaseKinds() {
|
static inline auto AllPhaseKinds() {
|
||||||
return mozilla::MakeEnumeratedRange(PhaseKind::FIRST, PhaseKind::LIMIT);
|
return mozilla::MakeEnumeratedRange(PhaseKind::FIRST, PhaseKind::LIMIT);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче