Bug 621072 - Don't bake JS_THREAD_DATA(cx)->interruptFlags into traces (r=igor)
authorBill McCloskey <wmccloskey@mozilla.com>
Thu, 23 Dec 2010 15:14:33 -0800
changeset 59924 6255a0255dc2565b5b4210c00090fa8bdc8d2dfd
parent 59923 74c70b60cf8b1ff4e88512b7565d1f0b4ac8333e
child 59925 c867532946e8889b153024b1ea0ab10e1018a9d9
push id17820
push usercleary@mozilla.com
push dateTue, 04 Jan 2011 21:40:57 +0000
treeherdermozilla-central@969691cfe40e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersigor
bugs621072
milestone2.0b8pre
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 621072 - Don't bake JS_THREAD_DATA(cx)->interruptFlags into traces (r=igor)
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -2345,17 +2345,23 @@ TraceRecorder::TraceRecorder(JSContext* 
 
     if (fragment == fragment->root) {
         /*
          * We poll the operation callback request flag. It is updated asynchronously whenever
          * the callback is to be invoked. We can use w.nameImmpNonGC here as JIT-ed code is per
          * thread and cannot outlive the corresponding JSThreadData.
          */
         w.comment("begin-interruptFlags-check");
-        LIns* flagptr = w.nameImmpNonGC((void *) &JS_THREAD_DATA(cx)->interruptFlags);
+        /* FIXME: See bug 621140 for moving interruptCounter to the compartment. */
+#ifdef JS_THREADSAFE
+        void *interrupt = (void*) &cx->runtime->interruptCounter;
+#else
+        void *interrupt = (void*) &JS_THREAD_DATA(cx)->interruptFlags;
+#endif
+        LIns* flagptr = w.nameImmpNonGC(interrupt);
         LIns* x = w.ldiVolatile(flagptr);
         guard(true, w.eqi0(x), TIMEOUT_EXIT);
         w.comment("end-interruptFlags-check");
 
         /*
          * Count the number of iterations run by a trace, so that we can blacklist if
          * the trace runs too few iterations to be worthwhile. Do this only if the methodjit
          * is on--otherwise we must try to trace as much as possible.