Bug 854400 - Disable double conversion in parallel mode r=bhackett
authorNicholas D. Matsakis <nmatsakis@mozilla.com>
Wed, 08 May 2013 14:08:38 -0400
changeset 138157 378d4fe10c1f1d09ee92b24208034bf87c72ecda
parent 138156 838eaf27333430933f0d5b33a720c19b0112aeff
child 138158 fee19aa62f5db0621b605fd83041926bbec13b6a
push id3752
push userlsblakk@mozilla.com
push dateMon, 13 May 2013 17:21:10 +0000
treeherdermozilla-aurora@1580544aef0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs854400
milestone23.0a1
Bug 854400 - Disable double conversion in parallel mode r=bhackett
js/src/ion/IonBuilder.cpp
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -6224,18 +6224,24 @@ IonBuilder::jsop_getelem_dense()
     id = idInt32;
 
     // Get the elements vector.
     MInstruction *elements = MElements::New(obj);
     current->add(elements);
 
     // If we can load the element as a definite double, make sure to check that
     // the array has been converted to homogenous doubles first.
+    //
+    // NB: We disable this optimization in parallel execution mode
+    // because it is inherently not threadsafe (how do you convert the
+    // array atomically when there might be concurrent readers)?
     types::StackTypeSet *objTypes = obj->resultTypeSet();
+    ExecutionMode executionMode = info().executionMode();
     bool loadDouble =
+        executionMode == SequentialExecution &&
         !barrier &&
         loopDepth_ &&
         !readOutOfBounds &&
         !needsHoleCheck &&
         knownType == JSVAL_TYPE_DOUBLE &&
         objTypes &&
         objTypes->convertDoubleElements(cx) == types::StackTypeSet::AlwaysConvertToDoubles;
     if (loadDouble)