зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1421358 - Remove GCRuntime::notifyDidPaint and refresh_frame_slices.enabled pref. r=jonco
MozReview-Commit-ID: HBh0qyPckKv
This commit is contained in:
Родитель
5a9bc69d68
Коммит
0e43a76787
|
@ -2728,10 +2728,6 @@ nsJSContext::EnsureStatics()
|
|||
"javascript.options.mem.gc_dynamic_mark_slice",
|
||||
(void *)JSGC_DYNAMIC_MARK_SLICE);
|
||||
|
||||
Preferences::RegisterCallbackAndCall(SetMemoryPrefChangedCallbackBool,
|
||||
"javascript.options.mem.gc_refresh_frame_slices_enabled",
|
||||
(void *)JSGC_REFRESH_FRAME_SLICES_ENABLED);
|
||||
|
||||
Preferences::RegisterCallbackAndCall(SetMemoryPrefChangedCallbackBool,
|
||||
"javascript.options.mem.gc_dynamic_heap_growth",
|
||||
(void *)JSGC_DYNAMIC_HEAP_GROWTH);
|
||||
|
|
|
@ -553,15 +553,6 @@ LoadJSGCMemoryOptions(const char* aPrefName, void* /* aClosure */)
|
|||
continue;
|
||||
}
|
||||
|
||||
matchName.RebindLiteral(PREF_MEM_OPTIONS_PREFIX "gc_refresh_frame_slices_enabled");
|
||||
if (memPrefName == matchName ||
|
||||
(gRuntimeServiceDuringInit && index == 15)) {
|
||||
bool prefValue = GetWorkerPref(matchName, false);
|
||||
UpdateOtherJSGCMemoryOption(rts, JSGC_REFRESH_FRAME_SLICES_ENABLED,
|
||||
prefValue ? 0 : 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
nsAutoCString message("Workers don't support the 'mem.");
|
||||
message.Append(memPrefName);
|
||||
|
|
|
@ -95,7 +95,6 @@ struct JSSettings
|
|||
JSSettings_JSGC_SLICE_TIME_BUDGET,
|
||||
JSSettings_JSGC_DYNAMIC_HEAP_GROWTH,
|
||||
JSSettings_JSGC_DYNAMIC_MARK_SLICE,
|
||||
JSSettings_JSGC_REFRESH_FRAME_SLICES,
|
||||
// JSGC_MODE not supported
|
||||
|
||||
// This must be last so that we get an accurate count.
|
||||
|
|
|
@ -244,14 +244,6 @@ typedef enum JSGCParamKey {
|
|||
*/
|
||||
JSGC_COMPACTING_ENABLED = 23,
|
||||
|
||||
/**
|
||||
* If true, painting can trigger IGC slices.
|
||||
*
|
||||
* Pref: javascript.options.mem.gc_refresh_frame_slices_enabled
|
||||
* Default: RefreshFrameSlicesEnabled
|
||||
*/
|
||||
JSGC_REFRESH_FRAME_SLICES_ENABLED = 24,
|
||||
|
||||
/**
|
||||
* Factor for triggering a GC based on JSGC_ALLOCATION_THRESHOLD
|
||||
*
|
||||
|
@ -390,7 +382,7 @@ struct Zone;
|
|||
D(DOM_IPC) \
|
||||
D(DOM_WORKER) \
|
||||
D(INTER_SLICE_GC) \
|
||||
D(REFRESH_FRAME) \
|
||||
D(UNUSED1) \
|
||||
D(FULL_GC_TIMER) \
|
||||
D(SHUTDOWN_CC) \
|
||||
D(UNUSED2) \
|
||||
|
|
|
@ -370,8 +370,7 @@ MinorGC(JSContext* cx, unsigned argc, Value* vp)
|
|||
_("allocationThreshold", JSGC_ALLOCATION_THRESHOLD, true) \
|
||||
_("minEmptyChunkCount", JSGC_MIN_EMPTY_CHUNK_COUNT, true) \
|
||||
_("maxEmptyChunkCount", JSGC_MAX_EMPTY_CHUNK_COUNT, true) \
|
||||
_("compactingEnabled", JSGC_COMPACTING_ENABLED, true) \
|
||||
_("refreshFrameSlicesEnabled", JSGC_REFRESH_FRAME_SLICES_ENABLED, true)
|
||||
_("compactingEnabled", JSGC_COMPACTING_ENABLED, true)
|
||||
|
||||
static const struct ParamInfo {
|
||||
const char* name;
|
||||
|
|
|
@ -60,9 +60,7 @@ enum class AbortReason {
|
|||
#define JS_FOR_EACH_ZEAL_MODE(D) \
|
||||
D(RootsChange, 1) \
|
||||
D(Alloc, 2) \
|
||||
D(FrameGC, 3) \
|
||||
D(VerifierPre, 4) \
|
||||
D(FrameVerifierPre, 5) \
|
||||
D(GenerationalGC, 7) \
|
||||
D(IncrementalRootsThenFinish, 8) \
|
||||
D(IncrementalMarkAllThenFinish, 9) \
|
||||
|
|
|
@ -240,13 +240,6 @@ class GCSchedulingTunables
|
|||
*/
|
||||
ActiveThreadData<bool> dynamicMarkSliceEnabled_;
|
||||
|
||||
/*
|
||||
* JSGC_REFRESH_FRAME_SLICES_ENABLED
|
||||
*
|
||||
* Controls whether painting can trigger IGC slices.
|
||||
*/
|
||||
ActiveThreadData<bool> refreshFrameSlicesEnabled_;
|
||||
|
||||
/*
|
||||
* JSGC_MIN_EMPTY_CHUNK_COUNT
|
||||
* JSGC_MAX_EMPTY_CHUNK_COUNT
|
||||
|
@ -274,7 +267,6 @@ class GCSchedulingTunables
|
|||
double highFrequencyHeapGrowthMin() const { return highFrequencyHeapGrowthMin_; }
|
||||
double lowFrequencyHeapGrowth() const { return lowFrequencyHeapGrowth_; }
|
||||
bool isDynamicMarkSliceEnabled() const { return dynamicMarkSliceEnabled_; }
|
||||
bool areRefreshFrameSlicesEnabled() const { return refreshFrameSlicesEnabled_; }
|
||||
unsigned minEmptyChunkCount(const AutoLockGC&) const { return minEmptyChunkCount_; }
|
||||
unsigned maxEmptyChunkCount() const { return maxEmptyChunkCount_; }
|
||||
|
||||
|
@ -804,7 +796,6 @@ class GCRuntime
|
|||
void traceRuntime(JSTracer* trc, AutoLockForExclusiveAccess& lock);
|
||||
void traceRuntimeForMinorGC(JSTracer* trc, AutoLockForExclusiveAccess& lock);
|
||||
|
||||
void notifyDidPaint();
|
||||
void shrinkBuffers();
|
||||
void onOutOfMallocMemory();
|
||||
void onOutOfMallocMemory(const AutoLockGC& lock);
|
||||
|
@ -1387,13 +1378,6 @@ class GCRuntime
|
|||
ActiveThreadData<MarkingValidator*> markingValidator;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Indicates that a GC slice has taken place in the middle of an animation
|
||||
* frame, rather than at the beginning. In this case, the next slice will be
|
||||
* delayed so that we don't get back-to-back slices.
|
||||
*/
|
||||
ActiveThreadData<bool> interFrameGC;
|
||||
|
||||
/*
|
||||
* Default budget for incremental GC slice. See js/SliceBudget.h.
|
||||
*
|
||||
|
|
|
@ -325,9 +325,6 @@ namespace TuningDefaults {
|
|||
/* JSGC_DYNAMIC_MARK_SLICE */
|
||||
static const bool DynamicMarkSliceEnabled = false;
|
||||
|
||||
/* JSGC_REFRESH_FRAME_SLICES_ENABLED */
|
||||
static const bool RefreshFrameSlicesEnabled = true;
|
||||
|
||||
/* JSGC_MIN_EMPTY_CHUNK_COUNT */
|
||||
static const uint32_t MinEmptyChunkCount = 1;
|
||||
|
||||
|
@ -942,7 +939,6 @@ GCRuntime::GCRuntime(JSRuntime* rt) :
|
|||
#ifdef JS_GC_ZEAL
|
||||
markingValidator(nullptr),
|
||||
#endif
|
||||
interFrameGC(false),
|
||||
defaultTimeBudget_(TuningDefaults::DefaultTimeBudget),
|
||||
incrementalAllowed(true),
|
||||
compactingEnabled(TuningDefaults::CompactingEnabled),
|
||||
|
@ -990,9 +986,7 @@ const char* gc::ZealModeHelpText =
|
|||
" 0: (None) Normal amount of collection (resets all modes)\n"
|
||||
" 1: (RootsChange) Collect when roots are added or removed\n"
|
||||
" 2: (Alloc) Collect when every N allocations (default: 100)\n"
|
||||
" 3: (FrameGC) Collect when the window paints (browser only)\n"
|
||||
" 4: (VerifierPre) Verify pre write barriers between instructions\n"
|
||||
" 5: (FrameVerifierPre) Verify pre write barriers between paints\n"
|
||||
" 7: (GenerationalGC) Collect the nursery every N nursery allocations\n"
|
||||
" 8: (IncrementalRootsThenFinish) Incremental GC in two slices: 1) mark roots 2) finish collection\n"
|
||||
" 9: (IncrementalMarkAllThenFinish) Incremental GC in two slices: 1) mark all 2) new marking and finish\n"
|
||||
|
@ -1378,9 +1372,6 @@ GCSchedulingTunables::setParameter(JSGCParamKey key, uint32_t value, const AutoL
|
|||
case JSGC_MAX_EMPTY_CHUNK_COUNT:
|
||||
setMaxEmptyChunkCount(value);
|
||||
break;
|
||||
case JSGC_REFRESH_FRAME_SLICES_ENABLED:
|
||||
refreshFrameSlicesEnabled_ = value != 0;
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unknown GC parameter.");
|
||||
}
|
||||
|
@ -1446,7 +1437,6 @@ GCSchedulingTunables::GCSchedulingTunables()
|
|||
highFrequencyHeapGrowthMin_(TuningDefaults::HighFrequencyHeapGrowthMin),
|
||||
lowFrequencyHeapGrowth_(TuningDefaults::LowFrequencyHeapGrowth),
|
||||
dynamicMarkSliceEnabled_(TuningDefaults::DynamicMarkSliceEnabled),
|
||||
refreshFrameSlicesEnabled_(TuningDefaults::RefreshFrameSlicesEnabled),
|
||||
minEmptyChunkCount_(TuningDefaults::MinEmptyChunkCount),
|
||||
maxEmptyChunkCount_(TuningDefaults::MaxEmptyChunkCount)
|
||||
{}
|
||||
|
@ -1534,9 +1524,6 @@ GCSchedulingTunables::resetParameter(JSGCParamKey key, const AutoLockGC& lock)
|
|||
case JSGC_MAX_EMPTY_CHUNK_COUNT:
|
||||
setMaxEmptyChunkCount(TuningDefaults::MaxEmptyChunkCount);
|
||||
break;
|
||||
case JSGC_REFRESH_FRAME_SLICES_ENABLED:
|
||||
refreshFrameSlicesEnabled_ = TuningDefaults::RefreshFrameSlicesEnabled;
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unknown GC parameter.");
|
||||
}
|
||||
|
@ -1598,8 +1585,6 @@ GCRuntime::getParameter(JSGCParamKey key, const AutoLockGC& lock)
|
|||
return tunables.maxEmptyChunkCount();
|
||||
case JSGC_COMPACTING_ENABLED:
|
||||
return compactingEnabled;
|
||||
case JSGC_REFRESH_FRAME_SLICES_ENABLED:
|
||||
return tunables.areRefreshFrameSlicesEnabled();
|
||||
default:
|
||||
MOZ_ASSERT(key == JSGC_NUMBER);
|
||||
return uint32_t(number);
|
||||
|
@ -7286,7 +7271,6 @@ GCRuntime::gcCycle(bool nonincrementalByAPI, SliceBudget& budget, JS::gcreason::
|
|||
AutoTraceSession session(rt, JS::HeapState::MajorCollecting);
|
||||
|
||||
majorGCTriggerReason = JS::gcreason::NO_REASON;
|
||||
interFrameGC = true;
|
||||
|
||||
number++;
|
||||
if (!isIncrementalGCInProgress())
|
||||
|
@ -7595,30 +7579,6 @@ GCRuntime::abortGC()
|
|||
collect(false, SliceBudget::unlimited(), JS::gcreason::ABORT_GC);
|
||||
}
|
||||
|
||||
void
|
||||
GCRuntime::notifyDidPaint()
|
||||
{
|
||||
MOZ_ASSERT(CurrentThreadCanAccessRuntime(rt));
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
if (hasZealMode(ZealMode::FrameVerifierPre))
|
||||
verifyPreBarriers();
|
||||
|
||||
if (hasZealMode(ZealMode::FrameGC)) {
|
||||
JS::PrepareForFullGC(rt->activeContextFromOwnThread());
|
||||
gc(GC_NORMAL, JS::gcreason::REFRESH_FRAME);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (isIncrementalGCInProgress() && !interFrameGC && tunables.areRefreshFrameSlicesEnabled()) {
|
||||
JS::PrepareForIncrementalGC(rt->activeContextFromOwnThread());
|
||||
gcSlice(JS::gcreason::REFRESH_FRAME);
|
||||
}
|
||||
|
||||
interFrameGC = false;
|
||||
}
|
||||
|
||||
static bool
|
||||
ZonesSelected(JSRuntime* rt)
|
||||
{
|
||||
|
|
|
@ -1490,9 +1490,6 @@ pref("javascript.options.mem.gc_dynamic_heap_growth", true);
|
|||
// Override SpiderMonkey default (false).
|
||||
pref("javascript.options.mem.gc_dynamic_mark_slice", true);
|
||||
|
||||
// JSGC_REFRESH_FRAME_SLICES_ENABLED
|
||||
pref("javascript.options.mem.gc_refresh_frame_slices_enabled", true);
|
||||
|
||||
// JSGC_ALLOCATION_THRESHOLD
|
||||
pref("javascript.options.mem.gc_allocation_threshold_mb", 30);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче