Loading js/src/gc/GCInternals.h +28 −0 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 definitions. */ #ifndef gc_GCInternals_h #define gc_GCInternals_h Loading Loading @@ -235,6 +239,30 @@ class MOZ_RAII AutoEmptyNursery : public AutoAssertEmptyNursery explicit AutoEmptyNursery(JSContext* cx); }; extern void DelayCrossCompartmentGrayMarking(JSObject* src); inline bool IsOOMReason(JS::gcreason::Reason reason) { return reason == JS::gcreason::LAST_DITCH || reason == JS::gcreason::MEM_PRESSURE; } inline void RelocationOverlay::forwardTo(Cell* cell) { MOZ_ASSERT(!isForwarded()); // The location of magic_ is important because it must never be valid to see // the value Relocated there in a GC thing that has not been moved. static_assert(offsetof(RelocationOverlay, magic_) == offsetof(JSObject, group_) && offsetof(RelocationOverlay, magic_) == offsetof(js::Shape, base_) && offsetof(RelocationOverlay, magic_) == offsetof(JSString, d.u1.flags), "RelocationOverlay::magic_ is in the wrong location"); magic_ = Relocated; newLocation_ = cell; } } /* namespace gc */ } /* namespace js */ Loading js/src/jsgc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -5049,7 +5049,7 @@ NextIncomingCrossCompartmentPointer(JSObject* prev, bool unlink) } void js::DelayCrossCompartmentGrayMarking(JSObject* src) js::gc::DelayCrossCompartmentGrayMarking(JSObject* src) { MOZ_ASSERT(IsGrayListObject(src)); Loading js/src/jsgc.h +0 −10 Original line number Diff line number Diff line Loading @@ -61,9 +61,6 @@ PrepareForDebugGC(JSRuntime* rt); /* Functions for managing cross compartment gray pointers. */ extern void DelayCrossCompartmentGrayMarking(JSObject* src); extern void NotifyGCNukeWrapper(JSObject* o); Loading Loading @@ -190,13 +187,6 @@ NewMemoryStatisticsObject(JSContext* cx); const char* StateName(State state); inline bool IsOOMReason(JS::gcreason::Reason reason) { return reason == JS::gcreason::LAST_DITCH || reason == JS::gcreason::MEM_PRESSURE; } } /* namespace gc */ /* Use this to avoid assertions when manipulating the wrapper map. */ Loading js/src/jsgcinlines.h +0 −15 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ #include "mozilla/Maybe.h" #include "gc/GCTrace.h" #include "gc/RelocationOverlay.h" #include "gc/Zone.h" #include "gc/ArenaList-inl.h" Loading Loading @@ -345,20 +344,6 @@ class ZoneCellIter : public ZoneCellIter<TenuredCell> { GCType* operator ->() const { return get(); } }; inline void RelocationOverlay::forwardTo(Cell* cell) { MOZ_ASSERT(!isForwarded()); // The location of magic_ is important because it must never be valid to see // the value Relocated there in a GC thing that has not been moved. static_assert(offsetof(RelocationOverlay, magic_) == offsetof(JSObject, group_) && offsetof(RelocationOverlay, magic_) == offsetof(js::Shape, base_) && offsetof(RelocationOverlay, magic_) == offsetof(JSString, d.u1.flags), "RelocationOverlay::magic_ is in the wrong location"); magic_ = Relocated; newLocation_ = cell; } } /* namespace gc */ } /* namespace js */ Loading Loading
js/src/gc/GCInternals.h +28 −0 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 definitions. */ #ifndef gc_GCInternals_h #define gc_GCInternals_h Loading Loading @@ -235,6 +239,30 @@ class MOZ_RAII AutoEmptyNursery : public AutoAssertEmptyNursery explicit AutoEmptyNursery(JSContext* cx); }; extern void DelayCrossCompartmentGrayMarking(JSObject* src); inline bool IsOOMReason(JS::gcreason::Reason reason) { return reason == JS::gcreason::LAST_DITCH || reason == JS::gcreason::MEM_PRESSURE; } inline void RelocationOverlay::forwardTo(Cell* cell) { MOZ_ASSERT(!isForwarded()); // The location of magic_ is important because it must never be valid to see // the value Relocated there in a GC thing that has not been moved. static_assert(offsetof(RelocationOverlay, magic_) == offsetof(JSObject, group_) && offsetof(RelocationOverlay, magic_) == offsetof(js::Shape, base_) && offsetof(RelocationOverlay, magic_) == offsetof(JSString, d.u1.flags), "RelocationOverlay::magic_ is in the wrong location"); magic_ = Relocated; newLocation_ = cell; } } /* namespace gc */ } /* namespace js */ Loading
js/src/jsgc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -5049,7 +5049,7 @@ NextIncomingCrossCompartmentPointer(JSObject* prev, bool unlink) } void js::DelayCrossCompartmentGrayMarking(JSObject* src) js::gc::DelayCrossCompartmentGrayMarking(JSObject* src) { MOZ_ASSERT(IsGrayListObject(src)); Loading
js/src/jsgc.h +0 −10 Original line number Diff line number Diff line Loading @@ -61,9 +61,6 @@ PrepareForDebugGC(JSRuntime* rt); /* Functions for managing cross compartment gray pointers. */ extern void DelayCrossCompartmentGrayMarking(JSObject* src); extern void NotifyGCNukeWrapper(JSObject* o); Loading Loading @@ -190,13 +187,6 @@ NewMemoryStatisticsObject(JSContext* cx); const char* StateName(State state); inline bool IsOOMReason(JS::gcreason::Reason reason) { return reason == JS::gcreason::LAST_DITCH || reason == JS::gcreason::MEM_PRESSURE; } } /* namespace gc */ /* Use this to avoid assertions when manipulating the wrapper map. */ Loading
js/src/jsgcinlines.h +0 −15 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ #include "mozilla/Maybe.h" #include "gc/GCTrace.h" #include "gc/RelocationOverlay.h" #include "gc/Zone.h" #include "gc/ArenaList-inl.h" Loading Loading @@ -345,20 +344,6 @@ class ZoneCellIter : public ZoneCellIter<TenuredCell> { GCType* operator ->() const { return get(); } }; inline void RelocationOverlay::forwardTo(Cell* cell) { MOZ_ASSERT(!isForwarded()); // The location of magic_ is important because it must never be valid to see // the value Relocated there in a GC thing that has not been moved. static_assert(offsetof(RelocationOverlay, magic_) == offsetof(JSObject, group_) && offsetof(RelocationOverlay, magic_) == offsetof(js::Shape, base_) && offsetof(RelocationOverlay, magic_) == offsetof(JSString, d.u1.flags), "RelocationOverlay::magic_ is in the wrong location"); magic_ = Relocated; newLocation_ = cell; } } /* namespace gc */ } /* namespace js */ Loading