Loading js/src/gc/GCEnum.h +63 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * GC-internal enum definitions. */ #ifndef gc_GCEnum_h #define gc_GCEnum_h Loading @@ -12,13 +16,71 @@ namespace js { namespace gc { /* Mark colors to pass to markIfUnmarked. */ // Mark colors to pass to markIfUnmarked. enum class MarkColor : uint32_t { Black = 0, Gray }; // The phases of an incremental GC. #define GCSTATES(D) \ D(NotActive) \ D(MarkRoots) \ D(Mark) \ D(Sweep) \ D(Finalize) \ D(Compact) \ D(Decommit) enum class State { #define MAKE_STATE(name) name, GCSTATES(MAKE_STATE) #undef MAKE_STATE }; // Reasons we reset an ongoing incremental GC or perform a non-incremental GC. #define GC_ABORT_REASONS(D) \ D(None) \ D(NonIncrementalRequested) \ D(AbortRequested) \ D(Unused1) \ D(IncrementalDisabled) \ D(ModeChange) \ D(MallocBytesTrigger) \ D(GCBytesTrigger) \ D(ZoneChange) \ D(CompartmentRevived) enum class AbortReason { #define MAKE_REASON(name) name, GC_ABORT_REASONS(MAKE_REASON) #undef MAKE_REASON }; #define JS_FOR_EACH_ZEAL_MODE(D) \ D(RootsChange, 1) \ D(Alloc, 2) \ D(FrameGC, 3) \ D(VerifierPre, 4) \ D(FrameVerifierPre, 5) \ D(GenerationalGC, 7) \ D(IncrementalRootsThenFinish, 8) \ D(IncrementalMarkAllThenFinish, 9) \ D(IncrementalMultipleSlices, 10) \ D(IncrementalMarkingValidator, 11) \ D(ElementsBarrier, 12) \ D(CheckHashTablesOnMinorGC, 13) \ D(Compact, 14) \ D(CheckHeapAfterGC, 15) \ D(CheckNursery, 16) \ D(IncrementalSweepThenFinish, 17) enum class ZealMode { #define ZEAL_MODE(name, value) name = value, JS_FOR_EACH_ZEAL_MODE(ZEAL_MODE) #undef ZEAL_MODE Limit = 17 }; } /* namespace gc */ } /* namespace js */ Loading js/src/jsgc.h +5 −72 Original line number Diff line number Diff line Loading @@ -4,7 +4,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* JS Garbage Collector. */ /* * JS engine garbage collector API. */ #ifndef jsgc_h #define jsgc_h Loading Loading @@ -32,38 +34,6 @@ class Nursery; namespace gc { #define GCSTATES(D) \ D(NotActive) \ D(MarkRoots) \ D(Mark) \ D(Sweep) \ D(Finalize) \ D(Compact) \ D(Decommit) enum class State { #define MAKE_STATE(name) name, GCSTATES(MAKE_STATE) #undef MAKE_STATE }; // Reasons we reset an ongoing incremental GC or perform a non-incremental GC. #define GC_ABORT_REASONS(D) \ D(None) \ D(NonIncrementalRequested) \ D(AbortRequested) \ D(Unused1) \ D(IncrementalDisabled) \ D(ModeChange) \ D(MallocBytesTrigger) \ D(GCBytesTrigger) \ D(ZoneChange) \ D(CompartmentRevived) enum class AbortReason { #define MAKE_REASON(name) name, GC_ABORT_REASONS(MAKE_REASON) #undef MAKE_REASON }; /* * Map from C++ type to alloc kind for non-object types. JSObject does not have * a 1:1 mapping, so must use Arena::thingSize. Loading @@ -84,16 +54,8 @@ template <typename T> struct ParticipatesInCC {}; JS_FOR_EACH_TRACEKIND(EXPAND_PARTICIPATES_IN_CC) #undef EXPAND_PARTICIPATES_IN_CC /* The number of GC cycles an empty chunk can survive before been released. */ const size_t MAX_EMPTY_CHUNK_AGE = 4; extern bool InitializeStaticData(); } /* namespace gc */ class InterpreterFrame; extern void TraceRuntime(JSTracer* trc); Loading Loading @@ -272,31 +234,6 @@ inline void CheckValueAfterMovingGC(const JS::Value& value); #endif // JSGC_HASH_TABLE_CHECKS #define JS_FOR_EACH_ZEAL_MODE(D) \ D(RootsChange, 1) \ D(Alloc, 2) \ D(FrameGC, 3) \ D(VerifierPre, 4) \ D(FrameVerifierPre, 5) \ D(GenerationalGC, 7) \ D(IncrementalRootsThenFinish, 8) \ D(IncrementalMarkAllThenFinish, 9) \ D(IncrementalMultipleSlices, 10) \ D(IncrementalMarkingValidator, 11) \ D(ElementsBarrier, 12) \ D(CheckHashTablesOnMinorGC, 13) \ D(Compact, 14) \ D(CheckHeapAfterGC, 15) \ D(CheckNursery, 16) \ D(IncrementalSweepThenFinish, 17) enum class ZealMode { #define ZEAL_MODE(name, value) name = value, JS_FOR_EACH_ZEAL_MODE(ZEAL_MODE) #undef ZEAL_MODE Limit = 17 }; enum VerifierType { PreBarrierVerifier }; Loading @@ -317,14 +254,10 @@ void DumpArenaInfo(); #else static inline void VerifyBarriers(JSRuntime* rt, VerifierType type) { } VerifyBarriers(JSRuntime* rt, VerifierType type) {} static inline void MaybeVerifyBarriers(JSContext* cx, bool always = false) { } MaybeVerifyBarriers(JSContext* cx, bool always = false) {} #endif Loading Loading
js/src/gc/GCEnum.h +63 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * GC-internal enum definitions. */ #ifndef gc_GCEnum_h #define gc_GCEnum_h Loading @@ -12,13 +16,71 @@ namespace js { namespace gc { /* Mark colors to pass to markIfUnmarked. */ // Mark colors to pass to markIfUnmarked. enum class MarkColor : uint32_t { Black = 0, Gray }; // The phases of an incremental GC. #define GCSTATES(D) \ D(NotActive) \ D(MarkRoots) \ D(Mark) \ D(Sweep) \ D(Finalize) \ D(Compact) \ D(Decommit) enum class State { #define MAKE_STATE(name) name, GCSTATES(MAKE_STATE) #undef MAKE_STATE }; // Reasons we reset an ongoing incremental GC or perform a non-incremental GC. #define GC_ABORT_REASONS(D) \ D(None) \ D(NonIncrementalRequested) \ D(AbortRequested) \ D(Unused1) \ D(IncrementalDisabled) \ D(ModeChange) \ D(MallocBytesTrigger) \ D(GCBytesTrigger) \ D(ZoneChange) \ D(CompartmentRevived) enum class AbortReason { #define MAKE_REASON(name) name, GC_ABORT_REASONS(MAKE_REASON) #undef MAKE_REASON }; #define JS_FOR_EACH_ZEAL_MODE(D) \ D(RootsChange, 1) \ D(Alloc, 2) \ D(FrameGC, 3) \ D(VerifierPre, 4) \ D(FrameVerifierPre, 5) \ D(GenerationalGC, 7) \ D(IncrementalRootsThenFinish, 8) \ D(IncrementalMarkAllThenFinish, 9) \ D(IncrementalMultipleSlices, 10) \ D(IncrementalMarkingValidator, 11) \ D(ElementsBarrier, 12) \ D(CheckHashTablesOnMinorGC, 13) \ D(Compact, 14) \ D(CheckHeapAfterGC, 15) \ D(CheckNursery, 16) \ D(IncrementalSweepThenFinish, 17) enum class ZealMode { #define ZEAL_MODE(name, value) name = value, JS_FOR_EACH_ZEAL_MODE(ZEAL_MODE) #undef ZEAL_MODE Limit = 17 }; } /* namespace gc */ } /* namespace js */ Loading
js/src/jsgc.h +5 −72 Original line number Diff line number Diff line Loading @@ -4,7 +4,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* JS Garbage Collector. */ /* * JS engine garbage collector API. */ #ifndef jsgc_h #define jsgc_h Loading Loading @@ -32,38 +34,6 @@ class Nursery; namespace gc { #define GCSTATES(D) \ D(NotActive) \ D(MarkRoots) \ D(Mark) \ D(Sweep) \ D(Finalize) \ D(Compact) \ D(Decommit) enum class State { #define MAKE_STATE(name) name, GCSTATES(MAKE_STATE) #undef MAKE_STATE }; // Reasons we reset an ongoing incremental GC or perform a non-incremental GC. #define GC_ABORT_REASONS(D) \ D(None) \ D(NonIncrementalRequested) \ D(AbortRequested) \ D(Unused1) \ D(IncrementalDisabled) \ D(ModeChange) \ D(MallocBytesTrigger) \ D(GCBytesTrigger) \ D(ZoneChange) \ D(CompartmentRevived) enum class AbortReason { #define MAKE_REASON(name) name, GC_ABORT_REASONS(MAKE_REASON) #undef MAKE_REASON }; /* * Map from C++ type to alloc kind for non-object types. JSObject does not have * a 1:1 mapping, so must use Arena::thingSize. Loading @@ -84,16 +54,8 @@ template <typename T> struct ParticipatesInCC {}; JS_FOR_EACH_TRACEKIND(EXPAND_PARTICIPATES_IN_CC) #undef EXPAND_PARTICIPATES_IN_CC /* The number of GC cycles an empty chunk can survive before been released. */ const size_t MAX_EMPTY_CHUNK_AGE = 4; extern bool InitializeStaticData(); } /* namespace gc */ class InterpreterFrame; extern void TraceRuntime(JSTracer* trc); Loading Loading @@ -272,31 +234,6 @@ inline void CheckValueAfterMovingGC(const JS::Value& value); #endif // JSGC_HASH_TABLE_CHECKS #define JS_FOR_EACH_ZEAL_MODE(D) \ D(RootsChange, 1) \ D(Alloc, 2) \ D(FrameGC, 3) \ D(VerifierPre, 4) \ D(FrameVerifierPre, 5) \ D(GenerationalGC, 7) \ D(IncrementalRootsThenFinish, 8) \ D(IncrementalMarkAllThenFinish, 9) \ D(IncrementalMultipleSlices, 10) \ D(IncrementalMarkingValidator, 11) \ D(ElementsBarrier, 12) \ D(CheckHashTablesOnMinorGC, 13) \ D(Compact, 14) \ D(CheckHeapAfterGC, 15) \ D(CheckNursery, 16) \ D(IncrementalSweepThenFinish, 17) enum class ZealMode { #define ZEAL_MODE(name, value) name = value, JS_FOR_EACH_ZEAL_MODE(ZEAL_MODE) #undef ZEAL_MODE Limit = 17 }; enum VerifierType { PreBarrierVerifier }; Loading @@ -317,14 +254,10 @@ void DumpArenaInfo(); #else static inline void VerifyBarriers(JSRuntime* rt, VerifierType type) { } VerifyBarriers(JSRuntime* rt, VerifierType type) {} static inline void MaybeVerifyBarriers(JSContext* cx, bool always = false) { } MaybeVerifyBarriers(JSContext* cx, bool always = false) {} #endif Loading