diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 7547594b2c55..45164358a2b5 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1369,7 +1369,7 @@ static bool NondeterministicGetWeakMapKeys(JSContext* cx, unsigned argc, return true; } -class HasChildTracer : public JS::CallbackTracer { +class HasChildTracer final : public JS::CallbackTracer { RootedValue child_; bool found_; diff --git a/js/src/gc/DeletePolicy.h b/js/src/gc/DeletePolicy.h index 4f66ef3d2f3e..5213af08f837 100644 --- a/js/src/gc/DeletePolicy.h +++ b/js/src/gc/DeletePolicy.h @@ -12,7 +12,7 @@ namespace js { namespace gc { -struct ClearEdgesTracer : public JS::CallbackTracer { +struct ClearEdgesTracer final : public JS::CallbackTracer { ClearEdgesTracer(); #ifdef DEBUG diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index 89d00b78c423..54a4452ca9af 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -4066,7 +4066,7 @@ bool GCRuntime::shouldPreserveJITCode(Realm* realm, } #ifdef DEBUG -class CompartmentCheckTracer : public JS::CallbackTracer { +class CompartmentCheckTracer final : public JS::CallbackTracer { void onChild(const JS::GCCellPtr& thing) override; public: diff --git a/js/src/gc/GCInternals.h b/js/src/gc/GCInternals.h index 484cc65dccd6..74548850a550 100644 --- a/js/src/gc/GCInternals.h +++ b/js/src/gc/GCInternals.h @@ -149,7 +149,7 @@ void CheckHashTablesAfterMovingGC(JSRuntime* rt); void CheckHeapAfterGC(JSRuntime* rt); #endif -struct MovingTracer : JS::CallbackTracer { +struct MovingTracer final : public JS::CallbackTracer { explicit MovingTracer(JSRuntime* rt) : CallbackTracer(rt, TraceWeakMapKeysValues) {} diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 1eaf4a41dbf5..d51a2a31c29d 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -3371,7 +3371,7 @@ FOR_EACH_PUBLIC_TAGGED_GC_POINTER_TYPE(INSTANTIATE_INTERNAL_MARKING_FUNCTIONS) */ #ifdef DEBUG -struct AssertNonGrayTracer : public JS::CallbackTracer { +struct AssertNonGrayTracer final : public JS::CallbackTracer { explicit AssertNonGrayTracer(JSRuntime* rt) : JS::CallbackTracer(rt) {} void onChild(const JS::GCCellPtr& thing) override { MOZ_ASSERT(!thing.asCell()->isMarkedGray()); @@ -3379,7 +3379,7 @@ struct AssertNonGrayTracer : public JS::CallbackTracer { }; #endif -class UnmarkGrayTracer : public JS::CallbackTracer { +class UnmarkGrayTracer final : public JS::CallbackTracer { public: // We set weakMapAction to DoNotTraceWeakMaps because the cycle collector // will fix up any color mismatches involving weakmaps when it runs. diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index 38761be2932f..c39a8f85eebb 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -415,7 +415,7 @@ void js::gc::GCRuntime::traceRuntimeCommon(JSTracer* trc, } #ifdef DEBUG -class AssertNoRootsTracer : public JS::CallbackTracer { +class AssertNoRootsTracer final : public JS::CallbackTracer { void onChild(const JS::GCCellPtr& thing) override { MOZ_CRASH("There should not be any roots after finishRoots"); } diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index 4f7180925b21..f5e5154a27d2 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -266,7 +266,7 @@ static bool IsMarkedOrAllocated(TenuredCell* cell) { return cell->isMarkedAny(); } -struct CheckEdgeTracer : public JS::CallbackTracer { +struct CheckEdgeTracer final : public JS::CallbackTracer { VerifyNode* node; explicit CheckEdgeTracer(JSRuntime* rt) : JS::CallbackTracer(rt), node(nullptr) {} diff --git a/js/src/jsapi-tests/testGCMarking.cpp b/js/src/jsapi-tests/testGCMarking.cpp index 317042f6e3b0..1f6b8310f48e 100644 --- a/js/src/jsapi-tests/testGCMarking.cpp +++ b/js/src/jsapi-tests/testGCMarking.cpp @@ -71,7 +71,7 @@ static bool ConstructCCW(JSContext* cx, const JSClass* globalClasp, return true; } -class CCWTestTracer : public JS::CallbackTracer { +class CCWTestTracer final : public JS::CallbackTracer { void onChild(const JS::GCCellPtr& thing) override { numberOfThingsTraced++; diff --git a/js/src/jsapi-tests/testPrivateGCThingValue.cpp b/js/src/jsapi-tests/testPrivateGCThingValue.cpp index 353306aee5d9..4fe18007dca4 100644 --- a/js/src/jsapi-tests/testPrivateGCThingValue.cpp +++ b/js/src/jsapi-tests/testPrivateGCThingValue.cpp @@ -15,7 +15,7 @@ #include "js/SourceText.h" // JS::Source{Ownership,Text} #include "jsapi-tests/tests.h" -class TestTracer : public JS::CallbackTracer { +class TestTracer final : public JS::CallbackTracer { void onChild(const JS::GCCellPtr& thing) override { if (thing.asCell() == expectedCell && thing.kind() == expectedKind) { found = true; diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index 6d3dc98a8ae4..16b81ab35e14 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -1006,7 +1006,7 @@ extern JS_FRIEND_API int JS::IsGCPoisoning() { #endif } -struct DumpHeapTracer : public JS::CallbackTracer, public WeakMapTracer { +struct DumpHeapTracer final : public JS::CallbackTracer, public WeakMapTracer { const char* prefix; FILE* output; mozilla::MallocSizeOf mallocSizeOf; diff --git a/js/src/vm/UbiNode.cpp b/js/src/vm/UbiNode.cpp index 118ee88d9eb6..f051eef0622c 100644 --- a/js/src/vm/UbiNode.cpp +++ b/js/src/vm/UbiNode.cpp @@ -191,7 +191,7 @@ Value Node::exposeToJS() const { // A JS::CallbackTracer subclass that adds a Edge to a Vector for each // edge on which it is invoked. -class EdgeVectorTracer : public JS::CallbackTracer { +class EdgeVectorTracer final : public JS::CallbackTracer { // The vector to which we add Edges. EdgeVector* vec;