Bug 1376961 - Inline CurrentThreadIsHeapBusy in START_ASSERT_SAME_COMPARTMENT to avoid a TLS lookup for each compartment check. r=jonco
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 28 Jun 2017 16:11:47 -0700
changeset 366674 e54513aa792225bdef5d7c0165f1d86ed189bcef
parent 366673 ed5cc84d317f8c1148eed57f69fd1f91e0eb4cac
child 366675 8b0b1a47321a212e29bd9cfecbe80e0bfa04fe25
push id45679
push usercbook@mozilla.com
push dateThu, 29 Jun 2017 13:53:31 +0000
treeherderautoland@365525f12a1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1376961
milestone56.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 1376961 - Inline CurrentThreadIsHeapBusy in START_ASSERT_SAME_COMPARTMENT to avoid a TLS lookup for each compartment check. r=jonco
js/src/jscntxtinlines.h
--- a/js/src/jscntxtinlines.h
+++ b/js/src/jscntxtinlines.h
@@ -195,17 +195,17 @@ class CompartmentChecker
     }
 };
 
 /*
  * Don't perform these checks when called from a finalizer. The checking
  * depends on other objects not having been swept yet.
  */
 #define START_ASSERT_SAME_COMPARTMENT()                                 \
-    if (JS::CurrentThreadIsHeapBusy())                                  \
+    if (cx->heapState != JS::HeapState::Idle)                           \
         return;                                                         \
     CompartmentChecker c(cx)
 
 template <class T1> inline void
 releaseAssertSameCompartment(JSContext* cx, const T1& t1)
 {
     START_ASSERT_SAME_COMPARTMENT();
     c.check(t1);