Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit bb75502

Browse files
committed
Bug 1735296 - Part 4: Remove unused public APIs for sweeping pointers r=sfink
This should make it hader for users of the public API to put unbarriered pointers in hash tables. Differential Revision: https://phabricator.services.mozilla.com/D128260
1 parent 941897c commit bb75502

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

js/public/GCPolicyAPI.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,6 @@ struct GCPointerPolicy {
111111
// marking.
112112
UnsafeTraceRoot(trc, vp, name);
113113
}
114-
static bool needsSweep(T* vp) {
115-
if (*vp) {
116-
return js::gc::IsAboutToBeFinalizedUnbarriered(vp);
117-
}
118-
return false;
119-
}
120-
static bool traceWeak(JSTracer* trc, T* vp) {
121-
if (*vp) {
122-
return js::TraceManuallyBarrieredWeakEdge(trc, vp, "traceWeak");
123-
}
124-
return true;
125-
}
126114
static bool isTenured(T v) { return !js::gc::IsInsideNursery(v); }
127115
static bool isValid(T v) { return js::gc::IsCellPointerValidOrNull(v); }
128116
};
@@ -165,12 +153,6 @@ struct GCPolicy<JS::Heap<T>> {
165153
static bool needsSweep(JS::Heap<T>* thingp) {
166154
return *thingp && js::gc::EdgeNeedsSweep(thingp);
167155
}
168-
static bool traceWeak(JSTracer* trc, JS::Heap<T>* thingp) {
169-
if (*thingp) {
170-
return js::TraceWeakEdge(trc, thingp, "traceWeak");
171-
}
172-
return true;
173-
}
174156
};
175157

176158
// GCPolicy<UniquePtr<T>> forwards the contained pointer to GCPolicy<T>.

js/public/TracingAPI.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -505,30 +505,12 @@ extern JS_PUBLIC_API void UnsafeTraceManuallyBarrieredEdge(JSTracer* trc,
505505
JSObject** edgep,
506506
const char* name);
507507

508-
// Not part of the public API, but declared here so we can use it in
509-
// GCPolicyAPI.h
510-
template <typename T>
511-
inline bool TraceManuallyBarrieredWeakEdge(JSTracer* trc, T* thingp,
512-
const char* name);
513-
514-
template <typename T>
515-
class WeakHeapPtr;
516-
517-
template <typename T>
518-
inline bool TraceWeakEdge(JSTracer* trc, WeakHeapPtr<T>* thingp,
519-
const char* name);
520-
521508
namespace gc {
522509

523510
// Return true if the given edge is not live and is about to be swept.
524511
template <typename T>
525512
extern JS_PUBLIC_API bool EdgeNeedsSweep(JS::Heap<T>* edgep);
526513

527-
// Not part of the public API, but declared here so we can use it in GCPolicy
528-
// which is.
529-
template <typename T>
530-
bool IsAboutToBeFinalizedUnbarriered(T* thingp);
531-
532514
} // namespace gc
533515

534516
#ifdef DEBUG

0 commit comments

Comments
 (0)