Bug 1171722 - Part 1: Add gcreason to GCSliceCallback. r=fitzgen

This commit is contained in:
Eric Rahm 2015-06-10 21:31:31 -07:00
Родитель 4b28879d7b
Коммит feb635048a
2 изменённых файлов: 5 добавлений и 4 удалений

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

@ -332,9 +332,10 @@ enum GCProgress {
struct JS_PUBLIC_API(GCDescription) {
bool isCompartment_;
JSGCInvocationKind invocationKind_;
gcreason::Reason reason_;
GCDescription(bool isCompartment, JSGCInvocationKind kind)
: isCompartment_(isCompartment), invocationKind_(kind) {}
GCDescription(bool isCompartment, JSGCInvocationKind kind, gcreason::Reason reason)
: isCompartment_(isCompartment), invocationKind_(kind), reason_(reason) {}
char16_t* formatSliceMessage(JSRuntime* rt) const;
char16_t* formatSummaryMessage(JSRuntime* rt) const;

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

@ -945,7 +945,7 @@ Statistics::beginSlice(const ZoneGCStats& zoneStats, JSGCInvocationKind gckind,
bool wasFullGC = zoneStats.isCollectingAllZones();
if (sliceCallback)
(*sliceCallback)(runtime, first ? JS::GC_CYCLE_BEGIN : JS::GC_SLICE_BEGIN,
JS::GCDescription(!wasFullGC, gckind));
JS::GCDescription(!wasFullGC, gckind, reason));
}
}
@ -977,7 +977,7 @@ Statistics::endSlice()
bool wasFullGC = zoneStats.isCollectingAllZones();
if (sliceCallback)
(*sliceCallback)(runtime, last ? JS::GC_CYCLE_END : JS::GC_SLICE_END,
JS::GCDescription(!wasFullGC, gckind));
JS::GCDescription(!wasFullGC, gckind, slices.back().reason));
}
/* Do this after the slice callback since it uses these values. */