Bug 1321277 - Remove use of AutoKeepAtoms from last ditch GC r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 01 Dec 2016 10:49:33 +0000
changeset 324996 c58717d82c4b0aff3cb57620a521028700ee3630
parent 324995 c899c1c54f1e9e095b681f87fcb6db636d600f21
child 324997 75cdb99537b502b06be217a6501da2e898f8bda7
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerssfink
bugs1321277
milestone53.0a1
Bug 1321277 - Remove use of AutoKeepAtoms from last ditch GC r=sfink
js/src/gc/Allocator.cpp
js/src/shell/js.cpp
--- a/js/src/gc/Allocator.cpp
+++ b/js/src/gc/Allocator.cpp
@@ -161,17 +161,16 @@ GCRuntime::tryNewTenuredThing(ExclusiveC
         // chunks available it may also allocate new memory directly.
         t = reinterpret_cast<T*>(refillFreeListFromAnyThread(cx, kind, thingSize));
 
         if (MOZ_UNLIKELY(!t && allowGC && cx->isJSContext())) {
             // We have no memory available for a new chunk; perform an
             // all-compartments, non-incremental, shrinking GC and wait for
             // sweeping to finish.
             JS::PrepareForFullGC(cx->asJSContext());
-            AutoKeepAtoms keepAtoms(cx->perThreadData);
             cx->asJSContext()->gc.gc(GC_SHRINK, JS::gcreason::LAST_DITCH);
             cx->asJSContext()->gc.waitBackgroundSweepOrAllocEnd();
 
             t = tryNewTenuredThing<T, NoGC>(cx, kind, thingSize);
             if (!t)
                 ReportOutOfMemory(cx);
         }
     }
@@ -235,17 +234,16 @@ GCRuntime::gcIfNeededPerAllocation(JSCon
 
     // If we have grown past our GC heap threshold while in the middle of
     // an incremental GC, we're growing faster than we're GCing, so stop
     // the world and do a full, non-incremental GC right now, if possible.
     if (isIncrementalGCInProgress() &&
         cx->zone()->usage.gcBytes() > cx->zone()->threshold.gcTriggerBytes())
     {
         PrepareZoneForGC(cx->zone());
-        AutoKeepAtoms keepAtoms(cx->perThreadData);
         gc(GC_NORMAL, JS::gcreason::INCREMENTAL_TOO_SLOW);
     }
 
     return true;
 }
 
 template <typename T>
 /* static */ void
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1442,17 +1442,16 @@ my_LargeAllocFailCallback(void* data)
     JSRuntime* rt = cx->runtime();
 
     if (!cx->isJSContext())
         return;
 
     MOZ_ASSERT(!rt->isHeapBusy());
 
     JS::PrepareForFullGC(cx);
-    AutoKeepAtoms keepAtoms(cx->perThreadData);
     rt->gc.gc(GC_NORMAL, JS::gcreason::SHARED_MEMORY_LIMIT);
 }
 
 static const uint32_t CacheEntry_SOURCE = 0;
 static const uint32_t CacheEntry_BYTECODE = 1;
 
 static const JSClass CacheEntry_class = {
     "CacheEntryObject", JSCLASS_HAS_RESERVED_SLOTS(2)