diff --git a/devtools/client/locales/en-US/markers.properties b/devtools/client/locales/en-US/markers.properties index 196febfa77f0..11fe9bd7feaa 100644 --- a/devtools/client/locales/en-US/markers.properties +++ b/devtools/client/locales/en-US/markers.properties @@ -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. diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h index c95ab18b1ac0..d49582f74719 100644 --- a/js/public/GCAPI.h +++ b/js/public/GCAPI.h @@ -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) \ diff --git a/js/src/doc/Debugger/Debugger.Memory.md b/js/src/doc/Debugger/Debugger.Memory.md index 99af0f3399c6..a5ccd93cda5f 100644 --- a/js/src/doc/Debugger/Debugger.Memory.md +++ b/js/src/doc/Debugger/Debugger.Memory.md @@ -161,7 +161,6 @@ compartment. * "API" * "EAGER_ALLOC_TRIGGER" * "DESTROY_RUNTIME" - * "DESTROY_CONTEXT" * "LAST_DITCH" * "TOO_MUCH_MALLOC" * "ALLOC_TRIGGER" diff --git a/js/src/jit-test/tests/gc/bug1282113.js b/js/src/jit-test/tests/gc/bug1282113.js new file mode 100644 index 000000000000..88d128a0ffa1 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug1282113.js @@ -0,0 +1,6 @@ +Object.getOwnPropertyNames(this); +setGCCallback({ + action: "majorGC", + phases: "begin" +}); +selectforgc(this); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 86835469ea98..4be8272381f6 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -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;