mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1233831 - Part 2: Expose JS::gcreason::ExplainReason to embedders; r=terrence
This renames the internal function `js::gcstats::ExplainReason` to `JS::gcreason::ExplainReason` and publicly exposes it to embedders.
This commit is contained in:
parent
974eaa8140
commit
59008f94c6
@ -128,6 +128,12 @@ enum Reason {
|
||||
NUM_TELEMETRY_REASONS = 100
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a statically allocated C string explaining the given GC reason.
|
||||
*/
|
||||
extern JS_PUBLIC_API(const char*)
|
||||
ExplainReason(JS::gcreason::Reason reason);
|
||||
|
||||
} /* namespace gcreason */
|
||||
|
||||
/*
|
||||
|
@ -600,7 +600,7 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList
|
||||
}
|
||||
|
||||
#define FMT " %6" PRIu64
|
||||
fprintf(stderr, "MinorGC: %20s %5.1f%% %4d " FMT, js::gcstats::ExplainReason(reason),
|
||||
fprintf(stderr, "MinorGC: %20s %5.1f%% %4d " FMT, JS::gcreason::ExplainReason(reason),
|
||||
promotionRate * 100, numActiveChunks_, totalTime);
|
||||
for (auto &entry : PrintList) {
|
||||
fprintf(stderr, FMT, entry.time);
|
||||
|
@ -48,8 +48,8 @@ js::gcstats::ExplainInvocationKind(JSGCInvocationKind gckind)
|
||||
return "Shrinking";
|
||||
}
|
||||
|
||||
const char*
|
||||
js::gcstats::ExplainReason(JS::gcreason::Reason reason)
|
||||
JS_PUBLIC_API(const char*)
|
||||
JS::gcreason::ExplainReason(JS::gcreason::Reason reason)
|
||||
{
|
||||
switch (reason) {
|
||||
#define SWITCH_REASON(name) \
|
||||
|
@ -423,7 +423,6 @@ struct MOZ_RAII AutoSCC
|
||||
};
|
||||
|
||||
const char* ExplainInvocationKind(JSGCInvocationKind gckind);
|
||||
const char* ExplainReason(JS::gcreason::Reason reason);
|
||||
|
||||
} /* namespace gcstats */
|
||||
} /* namespace js */
|
||||
|
@ -8519,7 +8519,7 @@ GarbageCollectionEvent::Create(JSRuntime* rt, ::js::gcstats::Statistics& stats,
|
||||
// reasons this data is stored and replicated on each slice. Each
|
||||
// slice used to have its own GCReason, but now they are all the
|
||||
// same.
|
||||
data->reason = gcstats::ExplainReason(range.front().reason);
|
||||
data->reason = gcreason::ExplainReason(range.front().reason);
|
||||
MOZ_ASSERT(data->reason);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user