зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1233831 - Part 1: Call the callback on nursery collections; r=terrence
This commit adds the `js::gcstats::Statistics::{begin,end}NurseryCollection` methods which calls the nursery collection callback, if present, and additionally handles counting minor GCs (which used to be inline in js::Nursery::collect).
This commit is contained in:
Родитель
445de2814b
Коммит
974eaa8140
|
@ -418,8 +418,7 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList
|
|||
|
||||
rt->gc.incMinorGcNumber();
|
||||
|
||||
rt->gc.stats.count(gcstats::STAT_MINOR_GC);
|
||||
|
||||
rt->gc.stats.beginNurseryCollection(reason);
|
||||
TraceMinorGCStart();
|
||||
|
||||
int64_t timestampStart_total = PRMJ_Now();
|
||||
|
@ -563,6 +562,7 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList
|
|||
if (totalTime > 1000)
|
||||
rt->addTelemetry(JS_TELEMETRY_GC_MINOR_REASON_LONG, reason);
|
||||
|
||||
rt->gc.stats.endNurseryCollection(reason);
|
||||
TraceMinorGCEnd();
|
||||
|
||||
if (enableProfiling_ && totalTime >= profileThreshold_) {
|
||||
|
|
|
@ -191,6 +191,23 @@ struct Statistics
|
|||
counts[s]++;
|
||||
}
|
||||
|
||||
void beginNurseryCollection(JS::gcreason::Reason reason) {
|
||||
count(STAT_MINOR_GC);
|
||||
if (nurseryCollectionCallback) {
|
||||
(*nurseryCollectionCallback)(runtime,
|
||||
JS::GCNurseryProgress::GC_NURSERY_COLLECTION_START,
|
||||
reason);
|
||||
}
|
||||
}
|
||||
|
||||
void endNurseryCollection(JS::gcreason::Reason reason) {
|
||||
if (nurseryCollectionCallback) {
|
||||
(*nurseryCollectionCallback)(runtime,
|
||||
JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END,
|
||||
reason);
|
||||
}
|
||||
}
|
||||
|
||||
int64_t beginSCC();
|
||||
void endSCC(unsigned scc, int64_t start);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче