diff options
author | Moonchild <moonchild@palemoon.org> | 2022-05-25 18:33:46 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-05-25 18:33:46 +0000 |
commit | cd55d0fbe4e5dddfc7e0bcc97ffa8a5a9febaff2 (patch) | |
tree | 6ac4b39944482f62a472488792b9345e43b28148 /js/src/gc | |
parent | 46c9f72fc0b85a800d003774d3298c66e56de913 (diff) | |
download | uxp-cd55d0fbe4e5dddfc7e0bcc97ffa8a5a9febaff2.tar.gz |
Issue #1742 - Remove the ambiguous portions of gc that dealt with tagged
pointers for shapes.
Nobody likes "isNullLike(obj)" when trying to garbage collect. It either is or
is not. Master Yoda would be pleased with this change.
Diffstat (limited to 'js/src/gc')
-rw-r--r-- | js/src/gc/Barrier.h | 4 | ||||
-rw-r--r-- | js/src/gc/Heap.h | 7 | ||||
-rw-r--r-- | js/src/gc/Marking.cpp | 2 | ||||
-rw-r--r-- | js/src/gc/Marking.h | 8 |
4 files changed, 2 insertions, 19 deletions
diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index d10fb4321c..25f153207f 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -261,8 +261,6 @@ struct InternalBarrierMethods<T*> { static bool isMarkable(T* v) { return v != nullptr; } - static bool isMarkableTaggedPointer(T* v) { return !IsNullTaggedPointer(v); } - static void preBarrier(T* v) { T::writeBarrierPre(v); } static void postBarrier(T** vp, T* prev, T* next) { T::writeBarrierPost(vp, prev, next); } @@ -282,7 +280,6 @@ template <> struct InternalBarrierMethods<Value> { static bool isMarkable(const Value& v) { return v.isGCThing(); } - static bool isMarkableTaggedPointer(const Value& v) { return isMarkable(v); } static void preBarrier(const Value& v) { DispatchTyped(PreBarrierFunctor<Value>(), v); @@ -318,7 +315,6 @@ template <> struct InternalBarrierMethods<jsid> { static bool isMarkable(jsid id) { return JSID_IS_GCTHING(id); } - static bool isMarkableTaggedPointer(jsid id) { return isMarkable(id); } static void preBarrier(jsid id) { DispatchTyped(PreBarrierFunctor<jsid>(), id); } static void postBarrier(jsid* idp, jsid prev, jsid next) {} diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h index 2a10420943..e97aec7469 100644 --- a/js/src/gc/Heap.h +++ b/js/src/gc/Heap.h @@ -315,10 +315,6 @@ class TenuredCell : public Cell MOZ_ALWAYS_INLINE void unmark(uint32_t color) const; MOZ_ALWAYS_INLINE void copyMarkBitsFrom(const TenuredCell* src); - // Note: this is in TenuredCell because JSObject subclasses are sometimes - // used tagged. - static MOZ_ALWAYS_INLINE bool isNullLike(const Cell* thing) { return !thing; } - // Access to the arena. inline Arena* arena() const; inline AllocKind getAllocKind() const; @@ -1300,7 +1296,7 @@ TenuredCell::isInsideZone(JS::Zone* zone) const TenuredCell::readBarrier(TenuredCell* thing) { MOZ_ASSERT(!CurrentThreadIsIonCompiling()); - MOZ_ASSERT(!isNullLike(thing)); + MOZ_ASSERT(thing); // It would be good if barriers were never triggered during collection, but // at the moment this can happen e.g. when rekeying tables containing @@ -1333,7 +1329,6 @@ AssertSafeToSkipBarrier(TenuredCell* thing); TenuredCell::writeBarrierPre(TenuredCell* thing) { MOZ_ASSERT(!CurrentThreadIsIonCompiling()); - MOZ_ASSERT_IF(thing, !isNullLike(thing)); if (!thing) return; diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 241a1df20d..da8da5c6b5 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -501,7 +501,7 @@ void js::TraceNullableRoot(JSTracer* trc, T* thingp, const char* name) { AssertRootMarkingPhase(trc); - if (InternalBarrierMethods<T>::isMarkableTaggedPointer(*thingp)) + if (InternalBarrierMethods<T>::isMarkable(*thingp)) DispatchToTracer(trc, ConvertToBase(thingp), name); } diff --git a/js/src/gc/Marking.h b/js/src/gc/Marking.h index 2b9e7ace1f..40b331b311 100644 --- a/js/src/gc/Marking.h +++ b/js/src/gc/Marking.h @@ -414,14 +414,6 @@ ToMarkable(Cell* cell) return cell; } -// Return true if the pointer is nullptr, or if it is a tagged pointer to -// nullptr. -MOZ_ALWAYS_INLINE bool -IsNullTaggedPointer(void* p) -{ - return uintptr_t(p) <= LargestTaggedNullCellPointer; -} - // Wrap a GC thing pointer into a new Value or jsid. The type system enforces // that the thing pointer is a wrappable type. template <typename S, typename T> |