зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1364547 - Tell Gecko whether a slice is a final slice, r=jonco,mccr8
--HG-- extra : rebase_source : ea028988b3515cdc441af8f7c2c1ba0794482494
This commit is contained in:
Родитель
51871e1507
Коммит
2c8f69a305
|
@ -2211,9 +2211,9 @@ DOMGCSliceCallback(JSContext* aCx, JS::GCProgress aProgress, const JS::GCDescrip
|
|||
|
||||
case JS::GC_SLICE_END:
|
||||
|
||||
// The GC has more work to do, so schedule another GC slice.
|
||||
// Schedule another GC slice if the GC has more work to do.
|
||||
nsJSContext::KillInterSliceGCTimer();
|
||||
if (!sShuttingDown) {
|
||||
if (!sShuttingDown && !aDesc.isComplete_) {
|
||||
CallCreateInstance("@mozilla.org/timer;1", &sInterSliceGCTimer);
|
||||
sInterSliceGCTimer->SetTarget(SystemGroup::EventTargetFor(TaskCategory::GarbageCollection));
|
||||
sInterSliceGCTimer->InitWithNamedFuncCallback(InterSliceGCTimerFired,
|
||||
|
|
|
@ -332,11 +332,12 @@ enum GCProgress {
|
|||
|
||||
struct JS_PUBLIC_API(GCDescription) {
|
||||
bool isZone_;
|
||||
bool isComplete_;
|
||||
JSGCInvocationKind invocationKind_;
|
||||
gcreason::Reason reason_;
|
||||
|
||||
GCDescription(bool isZone, JSGCInvocationKind kind, gcreason::Reason reason)
|
||||
: isZone_(isZone), invocationKind_(kind), reason_(reason) {}
|
||||
GCDescription(bool isZone, bool isComplete, JSGCInvocationKind kind, gcreason::Reason reason)
|
||||
: isZone_(isZone), isComplete_(isComplete), invocationKind_(kind), reason_(reason) {}
|
||||
|
||||
char16_t* formatSliceMessage(JSContext* cx) const;
|
||||
char16_t* formatSummaryMessage(JSContext* cx) const;
|
||||
|
|
|
@ -961,7 +961,7 @@ Statistics::beginSlice(const ZoneGCStats& zoneStats, JSGCInvocationKind gckind,
|
|||
bool wasFullGC = zoneStats.isCollectingAllZones();
|
||||
if (sliceCallback) {
|
||||
JSContext* cx = TlsContext.get();
|
||||
JS::GCDescription desc(!wasFullGC, gckind, reason);
|
||||
JS::GCDescription desc(!wasFullGC, false, gckind, reason);
|
||||
if (first)
|
||||
(*sliceCallback)(cx, JS::GC_CYCLE_BEGIN, desc);
|
||||
(*sliceCallback)(cx, JS::GC_SLICE_BEGIN, desc);
|
||||
|
@ -1011,7 +1011,7 @@ Statistics::endSlice()
|
|||
bool wasFullGC = zoneStats.isCollectingAllZones();
|
||||
if (sliceCallback) {
|
||||
JSContext* cx = TlsContext.get();
|
||||
JS::GCDescription desc(!wasFullGC, gckind, slices_.back().reason);
|
||||
JS::GCDescription desc(!wasFullGC, last, gckind, slices_.back().reason);
|
||||
(*sliceCallback)(cx, JS::GC_SLICE_END, desc);
|
||||
if (last)
|
||||
(*sliceCallback)(cx, JS::GC_CYCLE_END, desc);
|
||||
|
|
Загрузка…
Ссылка в новой задаче