зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1282113 - When we're shutting down the runtime, only allow shutdown GCs. r=terrence
This commit is contained in:
Родитель
7db42bdfbd
Коммит
3bd7eaa33a
|
@ -103,7 +103,6 @@ marker.value.DOMEventBubblingPhase=Bubbling
|
|||
marker.gcreason.label.API=API Call
|
||||
marker.gcreason.label.EAGER_ALLOC_TRIGGER=Eager Allocation Trigger
|
||||
marker.gcreason.label.DESTROY_RUNTIME=Shutdown
|
||||
marker.gcreason.label.DESTROY_CONTEXT=Shutdown
|
||||
marker.gcreason.label.LAST_DITCH=Out of Memory
|
||||
marker.gcreason.label.TOO_MUCH_MALLOC=Too Many Bytes Allocated
|
||||
marker.gcreason.label.ALLOC_TRIGGER=Too Many Allocations
|
||||
|
@ -143,7 +142,6 @@ marker.nurseryCollection=Nursery Collection
|
|||
marker.gcreason.description.API=There was an API call to force garbage collection.
|
||||
marker.gcreason.description.EAGER_ALLOC_TRIGGER=JavaScript returned to the event loop and there were enough bytes allocated since the last GC that a new GC cycle was triggered.
|
||||
marker.gcreason.description.DESTROY_RUNTIME=Firefox destroyed a JavaScript runtime or context, and this was the final garbage collection before shutting down.
|
||||
marker.gcreason.description.DESTROY_CONTEXT=Firefox destroyed a JavaScript runtime or context, and this was the final garbage collection before shutting down.
|
||||
marker.gcreason.description.LAST_DITCH=JavaScript attempted to allocate, but there was no memory available. Doing a full compacting garbage collection as an attempt to free up memory for the allocation.
|
||||
marker.gcreason.description.TOO_MUCH_MALLOC=JavaScript allocated too many bytes, and forced a garbage collection.
|
||||
marker.gcreason.description.ALLOC_TRIGGER=JavaScript allocated too many times, and forced a garbage collection.
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace JS {
|
|||
D(API) \
|
||||
D(EAGER_ALLOC_TRIGGER) \
|
||||
D(DESTROY_RUNTIME) \
|
||||
D(DESTROY_CONTEXT) \
|
||||
D(UNUSED0) \
|
||||
D(LAST_DITCH) \
|
||||
D(TOO_MUCH_MALLOC) \
|
||||
D(ALLOC_TRIGGER) \
|
||||
|
|
|
@ -161,7 +161,6 @@ compartment.
|
|||
* "API"
|
||||
* "EAGER_ALLOC_TRIGGER"
|
||||
* "DESTROY_RUNTIME"
|
||||
* "DESTROY_CONTEXT"
|
||||
* "LAST_DITCH"
|
||||
* "TOO_MUCH_MALLOC"
|
||||
* "ALLOC_TRIGGER"
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
Object.getOwnPropertyNames(this);
|
||||
setGCCallback({
|
||||
action: "majorGC",
|
||||
phases: "begin"
|
||||
});
|
||||
selectforgc(this);
|
|
@ -6280,6 +6280,11 @@ GCRuntime::checkIfGCAllowedInCurrentState(JS::gcreason::Reason reason)
|
|||
if (rt->mainThread.suppressGC)
|
||||
return false;
|
||||
|
||||
// Only allow shutdown GCs when we're destroying the runtime. This keeps
|
||||
// the GC callback from triggering a nested GC and resetting global state.
|
||||
if (rt->isBeingDestroyed() && !IsShutdownGC(reason))
|
||||
return false;
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
if (deterministicOnly && !IsDeterministicGCReason(reason))
|
||||
return false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче