Bug 927939 - Wrappers for nursery allocated objects should be finalized in the background r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Tue, 05 Nov 2013 10:15:33 +0000
changeset 153608 aa71e5360811dad7407af13aba6ea7bf170e300f
parent 153607 d4fdcf5f3c04afaef636a1777cf0bc35a6c2e0f9
child 153609 6fe3a73c35d88a3b5c54a18c4f9eadabab1431f0
push id25596
push userryanvm@gmail.com
push dateTue, 05 Nov 2013 20:28:59 +0000
treeherdermozilla-central@8b89e6626298 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs927939
milestone28.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 927939 - Wrappers for nursery allocated objects should be finalized in the background r=terrence
js/src/jswrapper.cpp
--- a/js/src/jswrapper.cpp
+++ b/js/src/jswrapper.cpp
@@ -176,19 +176,22 @@ CrossCompartmentWrapper::~CrossCompartme
 bool Wrapper::finalizeInBackground(Value priv)
 {
     if (!priv.isObject())
         return true;
 
     /*
      * Make the 'background-finalized-ness' of the wrapper the same as the
      * wrapped object, to allow transplanting between them.
+     *
+     * If the wrapped object is in the nursery then we know it doesn't have a
+     * finalizer, and so background finalization is ok.
      */
     if (IsInsideNursery(priv.toObject().runtimeFromMainThread(), &priv.toObject()))
-        return false;
+        return true;
     return IsBackgroundFinalized(priv.toObject().tenuredGetAllocKind());
 }
 
 #define PIERCE(cx, wrapper, pre, op, post)                      \
     JS_BEGIN_MACRO                                              \
         bool ok;                                                \
         {                                                       \
             AutoCompartment call(cx, wrappedObject(wrapper));   \