Bug 1151118 - Remove recently orphaned tracing paths; r=jonco
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -685,32 +685,16 @@ MarkInternal(JSTracer* trc, T** thingp)
}
trc->clearTracingDetails();
}
namespace js {
namespace gc {
-template <typename T>
-void
-MarkUnbarriered(JSTracer* trc, T** thingp, const char* name)
-{
- trc->setTracingName(name);
- MarkInternal(trc, thingp);
-}
-
-template <typename T>
-static void
-Mark(JSTracer* trc, BarrieredBase<T*>* thing, const char* name)
-{
- trc->setTracingName(name);
- MarkInternal(trc, thing->unsafeGet());
-}
-
void
MarkPermanentAtom(JSTracer* trc, JSAtom* atom, const char* name)
{
trc->setTracingName(name);
MOZ_ASSERT(atom->isPermanent());
CheckMarkedThing(trc, atom);
@@ -748,56 +732,16 @@ MarkWellKnownSymbol(JSTracer* trc, JS::S
trc->asCallbackTracer()->invoke(&thing, JSTRACE_SYMBOL);
MOZ_ASSERT(thing == sym);
trc->unsetTracingLocation();
}
trc->clearTracingDetails();
}
-} /* namespace gc */
-} /* namespace js */
-
-template <typename T>
-static void
-MarkRoot(JSTracer* trc, T** thingp, const char* name)
-{
- JS_ROOT_MARKING_ASSERT(trc);
- trc->setTracingName(name);
- MarkInternal(trc, thingp);
-}
-
-template <typename T>
-static void
-MarkRange(JSTracer* trc, size_t len, HeapPtr<T*>* vec, const char* name)
-{
- for (size_t i = 0; i < len; ++i) {
- if (vec[i].get()) {
- trc->setTracingIndex(name, i);
- MarkInternal(trc, vec[i].unsafeGet());
- }
- }
-}
-
-template <typename T>
-static void
-MarkRootRange(JSTracer* trc, size_t len, T** vec, const char* name)
-{
- JS_ROOT_MARKING_ASSERT(trc);
- for (size_t i = 0; i < len; ++i) {
- if (vec[i]) {
- trc->setTracingIndex(name, i);
- MarkInternal(trc, &vec[i]);
- }
- }
-}
-
-namespace js {
-namespace gc {
-
template <typename T>
static inline void
CheckIsMarkedThing(T* thingp)
{
#define IS_SAME_TYPE_OR(name, type) mozilla::IsSame<type*, T>::value ||
static_assert(
FOR_EACH_GC_LAYOUT(IS_SAME_TYPE_OR)
false, "Only the base cell layout types are allowed into marking/tracing internals");
@@ -1011,88 +955,16 @@ UpdateIfRelocated(JSRuntime* rt, T** thi
Zone* zone = (*thingp)->zone();
if (zone->isGCCompacting() && IsForwarded(*thingp))
*thingp = Forwarded(*thingp);
return *thingp;
}
-#define DeclMarkerImpl(base, type) \
-void \
-Mark##base(JSTracer* trc, BarrieredBase<type*>* thing, const char* name) \
-{ \
- Mark<type>(trc, thing, name); \
-} \
- \
-void \
-Mark##base##Root(JSTracer* trc, type** thingp, const char* name) \
-{ \
- MarkRoot<type>(trc, thingp, name); \
-} \
- \
-void \
-Mark##base##Unbarriered(JSTracer* trc, type** thingp, const char* name) \
-{ \
- MarkUnbarriered<type>(trc, thingp, name); \
-} \
- \
-/* Explicitly instantiate MarkUnbarriered<type*>. It is referenced from */ \
-/* other translation units and the instantiation might otherwise get */ \
-/* inlined away. */ \
-template void MarkUnbarriered<type>(JSTracer*, type**, const char*); \
- \
-void \
-Mark##base##Range(JSTracer* trc, size_t len, HeapPtr<type*>* vec, const char* name) \
-{ \
- MarkRange<type>(trc, len, vec, name); \
-} \
- \
-void \
-Mark##base##RootRange(JSTracer* trc, size_t len, type** vec, const char* name) \
-{ \
- MarkRootRange<type>(trc, len, vec, name); \
-} \
- \
-bool \
-Is##base##Marked(type** thingp) \
-{ \
- return IsMarkedUnbarriered<type*>(thingp); \
-} \
- \
-bool \
-Is##base##Marked(BarrieredBase<type*>* thingp) \
-{ \
- return IsMarked<type*>(thingp); \
-} \
- \
-bool \
-Is##base##AboutToBeFinalized(type** thingp) \
-{ \
- return IsAboutToBeFinalizedUnbarriered<type*>(thingp); \
-} \
- \
-bool \
-Is##base##AboutToBeFinalized(BarrieredBase<type*>* thingp) \
-{ \
- return IsAboutToBeFinalized<type*>(thingp); \
-} \
- \
-type * \
-Update##base##IfRelocated(JSRuntime* rt, BarrieredBase<type*>* thingp) \
-{ \
- return UpdateIfRelocated<type>(rt, thingp->unsafeGet()); \
-} \
- \
-type * \
-Update##base##IfRelocated(JSRuntime* rt, type** thingp) \
-{ \
- return UpdateIfRelocated<type>(rt, thingp); \
-}
-
} /* namespace gc */
} /* namespace js */
/*** Externally Typed Marking ***/
void
gc::MarkKind(JSTracer* trc, void** thingp, JSGCTraceKind kind)
{
--- a/js/src/gc/Marking.h
+++ b/js/src/gc/Marking.h
@@ -81,74 +81,16 @@ template <typename T>
void
TraceManuallyBarrieredCrossCompartmentEdge(JSTracer* trc, JSObject* src, T* dst,
const char* name);
namespace gc {
/*** Object Marking ***/
-/*
- * These functions expose marking functionality for all of the different GC
- * thing kinds. For each GC thing, there are several variants. As an example,
- * these are the variants generated for JSObject. They are listed from most to
- * least desirable for use:
- *
- * MarkObject(JSTracer* trc, const HeapPtrObject& thing, const char* name);
- * This function should be used for marking JSObjects, in preference to all
- * others below. Use it when you have HeapPtrObject, which automatically
- * implements write barriers.
- *
- * MarkObjectRoot(JSTracer* trc, JSObject* thing, const char* name);
- * This function is only valid during the root marking phase of GC (i.e.,
- * when MarkRuntime is on the stack).
- *
- * MarkObjectUnbarriered(JSTracer* trc, JSObject* thing, const char* name);
- * Like MarkObject, this function can be called at any time. It is more
- * forgiving, since it doesn't demand a HeapPtr as an argument. Its use
- * should always be accompanied by a comment explaining how write barriers
- * are implemented for the given field.
- *
- * Additionally, the functions MarkObjectRange and MarkObjectRootRange are
- * defined for marking arrays of object pointers.
- *
- * The following functions are provided to test whether a GC thing is marked
- * under different circumstances:
- *
- * IsObjectAboutToBeFinalized(JSObject** thing);
- * This function is indended to be used in code used to sweep GC things. It
- * indicates whether the object will will be finialized in the current group
- * of compartments being swept. Note that this will return false for any
- * object not in the group of compartments currently being swept, as even if
- * it is unmarked it may still become marked before it is swept.
- *
- * IsObjectMarked(JSObject** thing);
- * This function is indended to be used in rare cases in code used to mark
- * GC things. It indicates whether the object is currently marked.
- *
- * UpdateObjectIfRelocated(JSObject** thingp);
- * In some circumstances -- e.g. optional weak marking -- it is necessary
- * to look at the pointer before marking it strongly or weakly. In these
- * cases, the following must be called to update the pointer before use.
- */
-
-#define DeclMarker(base, type) \
-void Mark##base(JSTracer* trc, BarrieredBase<type*>* thing, const char* name); \
-void Mark##base##Root(JSTracer* trc, type** thingp, const char* name); \
-void Mark##base##Unbarriered(JSTracer* trc, type** thingp, const char* name); \
-void Mark##base##Range(JSTracer* trc, size_t len, HeapPtr<type*>* thing, const char* name); \
-void Mark##base##RootRange(JSTracer* trc, size_t len, type** thing, const char* name); \
-bool Is##base##Marked(type** thingp); \
-bool Is##base##Marked(BarrieredBase<type*>* thingp); \
-bool Is##base##AboutToBeFinalized(type** thingp); \
-bool Is##base##AboutToBeFinalized(BarrieredBase<type*>* thingp); \
-type* Update##base##IfRelocated(JSRuntime* rt, BarrieredBase<type*>* thingp); \
-type* Update##base##IfRelocated(JSRuntime* rt, type** thingp);
-#undef DeclMarker
-
void
MarkPermanentAtom(JSTracer* trc, JSAtom* atom, const char* name);
void
MarkWellKnownSymbol(JSTracer* trc, JS::Symbol* sym);
/* Return true if the pointer is nullptr, or if it is a tagged pointer to
* nullptr.
@@ -214,26 +156,16 @@ IsAboutToBeFinalizedUnbarriered(T* thing
template <typename T>
bool
IsAboutToBeFinalized(BarrieredBase<T>* thingp);
template <typename T>
bool
IsAboutToBeFinalized(ReadBarriered<T>* thingp);
-inline bool
-IsAboutToBeFinalized(const js::jit::VMFunction** vmfunc)
-{
- /*
- * Preserves entries in the WeakCache<VMFunction, JitCode>
- * iff the JitCode has been marked.
- */
- return false;
-}
-
inline Cell*
ToMarkable(const Value& v)
{
if (v.isMarkable())
return (Cell*)v.toGCThing();
return nullptr;
}