Backed out changeset 49aa36d0b28a and eaf2526ffd90 (bug 1146696) for jit-test failures on a CLOSED TREE
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 27 Mar 2015 15:04:35 +0000
changeset 266422 aef75ff8a91166c258a166384275ca8697707fd5
parent 266421 49aa36d0b28abd98101719a75e6b70c0daf4782f
child 266423 44e454b5e93b64cdb77a025c5d6b8d8ca5c2926e
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1146696
milestone39.0a1
backs out49aa36d0b28abd98101719a75e6b70c0daf4782f
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 49aa36d0b28a and eaf2526ffd90 (bug 1146696) for jit-test failures on a CLOSED TREE
js/src/gc/Allocator.cpp
js/src/gc/GCRuntime.h
js/src/jit-test/tests/gc/bug-1146696.js
--- a/js/src/gc/Allocator.cpp
+++ b/js/src/gc/Allocator.cpp
@@ -227,38 +227,38 @@ FOR_ALL_NON_OBJECT_GC_LAYOUTS(DECL_ALLOC
 #undef DECL_ALLOCATOR_INSTANCES
 
 template <typename T, AllowGC allowGC>
 /* static */ T *
 GCRuntime::tryNewTenuredThing(ExclusiveContext *cx, AllocKind kind, size_t thingSize)
 {
     T *t = reinterpret_cast<T *>(cx->arenas()->allocateFromFreeList(kind, thingSize));
     if (!t)
-        t = reinterpret_cast<T *>(refillFreeListFromAnyThread<allowGC>(cx, kind, thingSize));
+        t = reinterpret_cast<T *>(refillFreeListFromAnyThread<allowGC>(cx, kind));
 
     checkIncrementalZoneState(cx, t);
     TraceTenuredAlloc(t, kind);
     return t;
 }
 
 template <AllowGC allowGC>
 /* static */ void *
-GCRuntime::refillFreeListFromAnyThread(ExclusiveContext *cx, AllocKind thingKind, size_t thingSize)
+GCRuntime::refillFreeListFromAnyThread(ExclusiveContext *cx, AllocKind thingKind)
 {
     MOZ_ASSERT(cx->arenas()->freeLists[thingKind].isEmpty());
 
     if (cx->isJSContext())
-        return refillFreeListFromMainThread<allowGC>(cx->asJSContext(), thingKind, thingSize);
+        return refillFreeListFromMainThread<allowGC>(cx->asJSContext(), thingKind);
 
     return refillFreeListOffMainThread(cx, thingKind);
 }
 
 template <AllowGC allowGC>
 /* static */ void *
-GCRuntime::refillFreeListFromMainThread(JSContext *cx, AllocKind thingKind, size_t thingSize)
+GCRuntime::refillFreeListFromMainThread(JSContext *cx, AllocKind thingKind)
 {
     JSRuntime *rt = cx->runtime();
     MOZ_ASSERT(!rt->isHeapBusy(), "allocating while under GC");
     MOZ_ASSERT_IF(allowGC, !rt->currentThreadHasExclusiveAccess());
 
     // Try to allocate; synchronize with background GC threads if necessary.
     void *thing = tryRefillFreeListFromMainThread(cx, thingKind);
     if (MOZ_LIKELY(thing))
@@ -272,21 +272,17 @@ GCRuntime::refillFreeListFromMainThread(
             return nullptr;
 
         JS::PrepareForFullGC(rt);
         AutoKeepAtoms keepAtoms(cx->perThreadData);
         rt->gc.gc(GC_SHRINK, JS::gcreason::LAST_DITCH);
     }
 
     // Retry the allocation after the last-ditch GC.
-    // Note that due to GC callbacks we might already have allocated an arena
-    // for this thing kind!
-    thing = cx->arenas()->allocateFromFreeList(thingKind, thingSize);
-    if (!thing)
-        thing = tryRefillFreeListFromMainThread(cx, thingKind);
+    thing = tryRefillFreeListFromMainThread(cx, thingKind);
     if (thing)
         return thing;
 
     // We are really just totally out of memory.
     MOZ_ASSERT(allowGC, "A fallible allocation must not report OOM on failure.");
     ReportOutOfMemory(cx);
     return nullptr;
 }
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -874,21 +874,19 @@ class GCRuntime
     ArenaHeader *allocateArena(Chunk *chunk, Zone *zone, AllocKind kind, const AutoLockGC &lock);
     void arenaAllocatedDuringGC(JS::Zone *zone, ArenaHeader *arena);
 
     // Allocator internals
     bool gcIfNeededPerAllocation(JSContext *cx);
     template <typename T>
     static void checkIncrementalZoneState(ExclusiveContext *cx, T *t);
     template <AllowGC allowGC>
-    static void *refillFreeListFromAnyThread(ExclusiveContext *cx, AllocKind thingKind,
-                                             size_t thingSize);
+    static void *refillFreeListFromAnyThread(ExclusiveContext *cx, AllocKind thingKind);
     template <AllowGC allowGC>
-    static void *refillFreeListFromMainThread(JSContext *cx, AllocKind thingKind,
-                                              size_t thingSize);
+    static void *refillFreeListFromMainThread(JSContext *cx, AllocKind thingKind);
     static void *tryRefillFreeListFromMainThread(JSContext *cx, AllocKind thingKind);
     static void *refillFreeListOffMainThread(ExclusiveContext *cx, AllocKind thingKind);
 
     /*
      * Return the list of chunks that can be released outside the GC lock.
      * Must be called either during the GC or with the GC lock taken.
      */
     ChunkPool expireEmptyChunkPool(bool shrinkBuffers, const AutoLockGC &lock);
deleted file mode 100644
--- a/js/src/jit-test/tests/gc/bug-1146696.js
+++ /dev/null
@@ -1,19 +0,0 @@
-dbg1 = new Debugger();
-root2 = newGlobal();
-dbg1.memory.onGarbageCollection = function(){}
-dbg1.addDebuggee(root2);
-for (var j = 0; j < 9999; ++j) {
-    try {
-        a
-    } catch (e) {}
-}
-gcparam("maxBytes", gcparam("gcBytes") + 1);
-function g(i) {
-    if (i == 0)
-        return;
-    var x = "";
-    function f() {}
-    eval('');
-    g(i - 1);
-}
-g(8000);