Bug 1549986 - Make all concrete implementations of JSTracer final to aid devirtualization r=sfink?

Differential Revision: https://phabricator.services.mozilla.com/D30362

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jon Coppeard 2019-05-09 08:39:23 +00:00
Родитель 6d85f4e2fa
Коммит 94e50ef5a8
11 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -1369,7 +1369,7 @@ static bool NondeterministicGetWeakMapKeys(JSContext* cx, unsigned argc,
return true; return true;
} }
class HasChildTracer : public JS::CallbackTracer { class HasChildTracer final : public JS::CallbackTracer {
RootedValue child_; RootedValue child_;
bool found_; bool found_;

Просмотреть файл

@ -12,7 +12,7 @@
namespace js { namespace js {
namespace gc { namespace gc {
struct ClearEdgesTracer : public JS::CallbackTracer { struct ClearEdgesTracer final : public JS::CallbackTracer {
ClearEdgesTracer(); ClearEdgesTracer();
#ifdef DEBUG #ifdef DEBUG

Просмотреть файл

@ -4066,7 +4066,7 @@ bool GCRuntime::shouldPreserveJITCode(Realm* realm,
} }
#ifdef DEBUG #ifdef DEBUG
class CompartmentCheckTracer : public JS::CallbackTracer { class CompartmentCheckTracer final : public JS::CallbackTracer {
void onChild(const JS::GCCellPtr& thing) override; void onChild(const JS::GCCellPtr& thing) override;
public: public:

Просмотреть файл

@ -149,7 +149,7 @@ void CheckHashTablesAfterMovingGC(JSRuntime* rt);
void CheckHeapAfterGC(JSRuntime* rt); void CheckHeapAfterGC(JSRuntime* rt);
#endif #endif
struct MovingTracer : JS::CallbackTracer { struct MovingTracer final : public JS::CallbackTracer {
explicit MovingTracer(JSRuntime* rt) explicit MovingTracer(JSRuntime* rt)
: CallbackTracer(rt, TraceWeakMapKeysValues) {} : CallbackTracer(rt, TraceWeakMapKeysValues) {}

Просмотреть файл

@ -3371,7 +3371,7 @@ FOR_EACH_PUBLIC_TAGGED_GC_POINTER_TYPE(INSTANTIATE_INTERNAL_MARKING_FUNCTIONS)
*/ */
#ifdef DEBUG #ifdef DEBUG
struct AssertNonGrayTracer : public JS::CallbackTracer { struct AssertNonGrayTracer final : public JS::CallbackTracer {
explicit AssertNonGrayTracer(JSRuntime* rt) : JS::CallbackTracer(rt) {} explicit AssertNonGrayTracer(JSRuntime* rt) : JS::CallbackTracer(rt) {}
void onChild(const JS::GCCellPtr& thing) override { void onChild(const JS::GCCellPtr& thing) override {
MOZ_ASSERT(!thing.asCell()->isMarkedGray()); MOZ_ASSERT(!thing.asCell()->isMarkedGray());
@ -3379,7 +3379,7 @@ struct AssertNonGrayTracer : public JS::CallbackTracer {
}; };
#endif #endif
class UnmarkGrayTracer : public JS::CallbackTracer { class UnmarkGrayTracer final : public JS::CallbackTracer {
public: public:
// We set weakMapAction to DoNotTraceWeakMaps because the cycle collector // We set weakMapAction to DoNotTraceWeakMaps because the cycle collector
// will fix up any color mismatches involving weakmaps when it runs. // will fix up any color mismatches involving weakmaps when it runs.

Просмотреть файл

@ -415,7 +415,7 @@ void js::gc::GCRuntime::traceRuntimeCommon(JSTracer* trc,
} }
#ifdef DEBUG #ifdef DEBUG
class AssertNoRootsTracer : public JS::CallbackTracer { class AssertNoRootsTracer final : public JS::CallbackTracer {
void onChild(const JS::GCCellPtr& thing) override { void onChild(const JS::GCCellPtr& thing) override {
MOZ_CRASH("There should not be any roots after finishRoots"); MOZ_CRASH("There should not be any roots after finishRoots");
} }

Просмотреть файл

@ -266,7 +266,7 @@ static bool IsMarkedOrAllocated(TenuredCell* cell) {
return cell->isMarkedAny(); return cell->isMarkedAny();
} }
struct CheckEdgeTracer : public JS::CallbackTracer { struct CheckEdgeTracer final : public JS::CallbackTracer {
VerifyNode* node; VerifyNode* node;
explicit CheckEdgeTracer(JSRuntime* rt) explicit CheckEdgeTracer(JSRuntime* rt)
: JS::CallbackTracer(rt), node(nullptr) {} : JS::CallbackTracer(rt), node(nullptr) {}

Просмотреть файл

@ -71,7 +71,7 @@ static bool ConstructCCW(JSContext* cx, const JSClass* globalClasp,
return true; return true;
} }
class CCWTestTracer : public JS::CallbackTracer { class CCWTestTracer final : public JS::CallbackTracer {
void onChild(const JS::GCCellPtr& thing) override { void onChild(const JS::GCCellPtr& thing) override {
numberOfThingsTraced++; numberOfThingsTraced++;

Просмотреть файл

@ -15,7 +15,7 @@
#include "js/SourceText.h" // JS::Source{Ownership,Text} #include "js/SourceText.h" // JS::Source{Ownership,Text}
#include "jsapi-tests/tests.h" #include "jsapi-tests/tests.h"
class TestTracer : public JS::CallbackTracer { class TestTracer final : public JS::CallbackTracer {
void onChild(const JS::GCCellPtr& thing) override { void onChild(const JS::GCCellPtr& thing) override {
if (thing.asCell() == expectedCell && thing.kind() == expectedKind) { if (thing.asCell() == expectedCell && thing.kind() == expectedKind) {
found = true; found = true;

Просмотреть файл

@ -1006,7 +1006,7 @@ extern JS_FRIEND_API int JS::IsGCPoisoning() {
#endif #endif
} }
struct DumpHeapTracer : public JS::CallbackTracer, public WeakMapTracer { struct DumpHeapTracer final : public JS::CallbackTracer, public WeakMapTracer {
const char* prefix; const char* prefix;
FILE* output; FILE* output;
mozilla::MallocSizeOf mallocSizeOf; mozilla::MallocSizeOf mallocSizeOf;

Просмотреть файл

@ -191,7 +191,7 @@ Value Node::exposeToJS() const {
// A JS::CallbackTracer subclass that adds a Edge to a Vector for each // A JS::CallbackTracer subclass that adds a Edge to a Vector for each
// edge on which it is invoked. // edge on which it is invoked.
class EdgeVectorTracer : public JS::CallbackTracer { class EdgeVectorTracer final : public JS::CallbackTracer {
// The vector to which we add Edges. // The vector to which we add Edges.
EdgeVector* vec; EdgeVector* vec;