Bug 1466633 - GCManagedDeletePolicy: do not clear edges during GC, r=jonco
☠☠ backed out by a8231f7c5073 ☠ ☠
authorSteve Fink <sfink@mozilla.com>
Tue, 05 Jun 2018 17:41:12 -0700
changeset 422050 17bb0a45975b93c4003e4436706e3caf7c44d9fd
parent 422049 bdf9bd1db757904ed0323367fdee278ff94567f8
child 422051 1e833c6a3ba2a4d592868fd2167e94c1cb933004
push id34114
push userbtara@mozilla.com
push dateSat, 09 Jun 2018 15:31:58 +0000
treeherdermozilla-central@e02a5155d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1466633
milestone62.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 1466633 - GCManagedDeletePolicy: do not clear edges during GC, r=jonco
js/src/gc/DeletePolicy.h
--- a/js/src/gc/DeletePolicy.h
+++ b/js/src/gc/DeletePolicy.h
@@ -2,16 +2,17 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef gc_DeletePolicy_h
 #define gc_DeletePolicy_h
 
+#include "gc/Barrier.h"
 #include "js/TracingAPI.h"
 #ifdef ENABLE_BIGINT
 #include "vm/BigIntType.h"
 #endif
 
 namespace js {
 namespace gc {
 
@@ -68,18 +69,23 @@ IsClearEdgesTracer(JSTracer *trc)
  * into the object and make it safe to delete.
  */
 template <typename T>
 struct GCManagedDeletePolicy
 {
     void operator()(const T* constPtr) {
         if (constPtr) {
             auto ptr = const_cast<T*>(constPtr);
-            gc::ClearEdgesTracer trc;
-            ptr->trace(&trc);
+            if (JS::CurrentThreadIsHeapCollecting()) {
+                MOZ_ASSERT(js::CurrentThreadIsGCSweeping());
+                // Do not attempt to clear out storebuffer edges.
+            } else {
+                gc::ClearEdgesTracer trc;
+                ptr->trace(&trc);
+            }
             js_delete(ptr);
         }
     }
 };
 
 } // namespace js
 
 #endif // gc_DeletePolicy_h