Bug 897574 - Fix GGC opt build failure; r=sfink
authorTerrence Cole <terrence@mozilla.com>
Wed, 24 Jul 2013 15:33:02 -0700
changeset 152177 1061bb130aec8da3ca8daa7d9485e82067b2827c
parent 152176 0fe49015e35df945fdafb898e7832e321f8ac2a3
child 152178 04bde6c5fb165433967ab88f2d51d9648714cedc
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs897574
milestone25.0a1
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
Bug 897574 - Fix GGC opt build failure; r=sfink
js/src/gc/StoreBuffer.h
js/src/jsapi.cpp
--- a/js/src/gc/StoreBuffer.h
+++ b/js/src/gc/StoreBuffer.h
@@ -374,16 +374,17 @@ class StoreBuffer
     MonoTypeBuffer<CellPtrEdge> bufferCell;
     MonoTypeBuffer<SlotEdge> bufferSlot;
     MonoTypeBuffer<WholeCellEdges> bufferWholeCell;
     RelocatableMonoTypeBuffer<ValueEdge> bufferRelocVal;
     RelocatableMonoTypeBuffer<CellPtrEdge> bufferRelocCell;
     GenericBuffer bufferGeneric;
 
     JSRuntime *runtime;
+    const Nursery &nursery_;
 
     void *buffer;
 
     bool aboutToOverflow;
     bool overflowed;
     bool enabled;
 
     /* TODO: profile to find the ideal size for these. */
@@ -395,20 +396,20 @@ class StoreBuffer
     static const size_t RelocCellBufferSize = 1 * 1024 * sizeof(CellPtrEdge);
     static const size_t GenericBufferSize = 1 * 1024 * sizeof(int);
     static const size_t TotalSize = ValueBufferSize + CellBufferSize +
                                     SlotBufferSize + WholeCellBufferSize +
                                     RelocValueBufferSize + RelocCellBufferSize +
                                     GenericBufferSize;
 
   public:
-    explicit StoreBuffer(JSRuntime *rt)
+    explicit StoreBuffer(JSRuntime *rt, const Nursery &nursery)
       : bufferVal(this), bufferCell(this), bufferSlot(this), bufferWholeCell(this),
         bufferRelocVal(this), bufferRelocCell(this), bufferGeneric(this),
-        runtime(rt), buffer(NULL), aboutToOverflow(false), overflowed(false),
+        runtime(rt), nursery_(nursery), buffer(NULL), aboutToOverflow(false), overflowed(false),
         enabled(false)
     {}
 
     bool enable();
     void disable();
     bool isEnabled() { return enabled; }
 
     bool clear();
@@ -448,17 +449,17 @@ class StoreBuffer
     /* Insert an entry into the generic buffer. */
     template <typename T>
     void putGeneric(const T &t) {
         bufferGeneric.put(t);
     }
 
     /* Insert or update a callback entry. */
     void putCallback(CallbackRef::MarkCallback callback, Cell *key, void *data) {
-        if (!key->isTenured())
+        if (nursery_.isInside(key))
             bufferGeneric.put(CallbackRef(callback, key, data));
     }
 
     /* Mark the source of all edges in the store buffer. */
     void mark(JSTracer *trc);
 
     /* We cannot call InParallelSection directly because of a circular dependency. */
     bool inParallelSection() const;
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -820,17 +820,17 @@ JSRuntime::JSRuntime(JSUseHelperThreads 
     gcIncrementalEnabled(true),
     gcGenerationalEnabled(true),
     gcManipulatingDeadZones(false),
     gcObjectsMarkedInDeadZones(0),
     gcPoke(false),
     heapState(Idle),
 #ifdef JSGC_GENERATIONAL
     gcNursery(thisFromCtor()),
-    gcStoreBuffer(thisFromCtor()),
+    gcStoreBuffer(thisFromCtor(), gcNursery),
 #endif
 #ifdef JS_GC_ZEAL
     gcZeal_(0),
     gcZealFrequency(0),
     gcNextScheduled(0),
     gcDeterministicOnly(false),
     gcIncrementalLimit(0),
 #endif