Bug 716142 - Multi-compartment GC (r=igor,jorendorff)
This commit is contained in:
@@ -328,7 +328,7 @@ Statistics::formatData(StatisticsSerializer &ss, uint64_t timestamp)
|
||||
if (ss.isJSON())
|
||||
ss.appendNumber("Timestamp", "%llu", "", (unsigned long long)timestamp);
|
||||
ss.appendNumber("Total Time", "%.1f", "ms", t(total));
|
||||
ss.appendString("Type", compartment ? "compartment" : "global");
|
||||
ss.appendString("Type", wasFullGC ? "global" : "compartment");
|
||||
ss.appendNumber("MMU (20ms)", "%d", "%", int(mmu20 * 100));
|
||||
ss.appendNumber("MMU (50ms)", "%d", "%", int(mmu50 * 100));
|
||||
if (slices.length() > 1 || ss.isJSON())
|
||||
@@ -398,7 +398,7 @@ Statistics::Statistics(JSRuntime *rt)
|
||||
startupTime(PRMJ_Now()),
|
||||
fp(NULL),
|
||||
fullFormat(false),
|
||||
compartment(NULL),
|
||||
wasFullGC(false),
|
||||
nonincrementalReason(NULL)
|
||||
{
|
||||
PodArrayZero(phaseTotals);
|
||||
@@ -492,7 +492,7 @@ Statistics::endGC()
|
||||
phaseTotals[i] += phaseTimes[i];
|
||||
|
||||
if (JSAccumulateTelemetryDataCallback cb = runtime->telemetryCallback) {
|
||||
(*cb)(JS_TELEMETRY_GC_IS_COMPARTMENTAL, compartment ? 1 : 0);
|
||||
(*cb)(JS_TELEMETRY_GC_IS_COMPARTMENTAL, wasFullGC ? 0 : 1);
|
||||
(*cb)(JS_TELEMETRY_GC_MS, t(gcDuration()));
|
||||
(*cb)(JS_TELEMETRY_GC_MARK_MS, t(phaseTimes[PHASE_MARK]));
|
||||
(*cb)(JS_TELEMETRY_GC_SWEEP_MS, t(phaseTimes[PHASE_SWEEP]));
|
||||
@@ -508,9 +508,9 @@ Statistics::endGC()
|
||||
}
|
||||
|
||||
void
|
||||
Statistics::beginSlice(JSCompartment *comp, gcreason::Reason reason)
|
||||
Statistics::beginSlice(bool full, gcreason::Reason reason)
|
||||
{
|
||||
compartment = comp;
|
||||
wasFullGC = full;
|
||||
|
||||
bool first = runtime->gcIncrementalState == gc::NO_INCREMENTAL;
|
||||
if (first)
|
||||
@@ -523,7 +523,7 @@ Statistics::beginSlice(JSCompartment *comp, gcreason::Reason reason)
|
||||
(*cb)(JS_TELEMETRY_GC_REASON, reason);
|
||||
|
||||
if (GCSliceCallback cb = runtime->gcSliceCallback)
|
||||
(*cb)(runtime, first ? GC_CYCLE_BEGIN : GC_SLICE_BEGIN, GCDescription(!!compartment));
|
||||
(*cb)(runtime, first ? GC_CYCLE_BEGIN : GC_SLICE_BEGIN, GCDescription(!wasFullGC));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -542,9 +542,9 @@ Statistics::endSlice()
|
||||
|
||||
if (GCSliceCallback cb = runtime->gcSliceCallback) {
|
||||
if (last)
|
||||
(*cb)(runtime, GC_CYCLE_END, GCDescription(!!compartment));
|
||||
(*cb)(runtime, GC_CYCLE_END, GCDescription(!wasFullGC));
|
||||
else
|
||||
(*cb)(runtime, GC_SLICE_END, GCDescription(!!compartment));
|
||||
(*cb)(runtime, GC_SLICE_END, GCDescription(!wasFullGC));
|
||||
}
|
||||
|
||||
/* Do this after the slice callback since it uses these values. */
|
||||
|
||||
Reference in New Issue
Block a user