Bug 1146364 - use resumeAfter after effectful instructions. r=nbp
authorLars T Hansen <lhansen@mozilla.com>
Tue, 24 Mar 2015 09:06:03 +0100
changeset 265549 6229a2b58212102344fc13881703d3cae17e9490
parent 265548 6e7d781ad81ed484f777934e1a6e2ef89f7f7992
child 265550 a106024f6b0da57d2e25a1b8b34a3ff17edddef3
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1146364
milestone39.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 1146364 - use resumeAfter after effectful instructions. r=nbp
js/src/jit/MCallOptimize.cpp
--- a/js/src/jit/MCallOptimize.cpp
+++ b/js/src/jit/MCallOptimize.cpp
@@ -2694,16 +2694,19 @@ IonBuilder::inlineAtomicsCompareExchange
 
     MCompareExchangeTypedArrayElement *cas =
         MCompareExchangeTypedArrayElement::New(alloc(), elements, index, arrayType,
                                                oldvalToWrite, newvalToWrite);
     cas->setResultType(getInlineReturnType());
     current->add(cas);
     current->push(cas);
 
+    if (!resumeAfter(cas))
+        return InliningStatus_Error;
+
     return InliningStatus_Inlined;
 }
 
 IonBuilder::InliningStatus
 IonBuilder::inlineAtomicsLoad(CallInfo &callInfo)
 {
     if (callInfo.argc() != 2 || callInfo.constructing()) {
         trackOptimizationOutcome(TrackedOutcome::CantInlineNativeBadForm);
@@ -2722,16 +2725,20 @@ IonBuilder::inlineAtomicsLoad(CallInfo &
 
     MLoadUnboxedScalar *load =
         MLoadUnboxedScalar::New(alloc(), elements, index, arrayType,
                                 DoesRequireMemoryBarrier);
     load->setResultType(getInlineReturnType());
     current->add(load);
     current->push(load);
 
+    // Loads are considered effectful (they execute a memory barrier).
+    if (!resumeAfter(load))
+        return InliningStatus_Error;
+
     return InliningStatus_Inlined;
 }
 
 IonBuilder::InliningStatus
 IonBuilder::inlineAtomicsStore(CallInfo &callInfo)
 {
     if (callInfo.argc() != 3 || callInfo.constructing()) {
         trackOptimizationOutcome(TrackedOutcome::CantInlineNativeBadForm);
@@ -2758,16 +2765,19 @@ IonBuilder::inlineAtomicsStore(CallInfo 
         current->add(toWrite->toInstruction());
     }
     MStoreUnboxedScalar *store =
         MStoreUnboxedScalar::New(alloc(), elements, index, toWrite, arrayType,
                                  DoesRequireMemoryBarrier);
     current->add(store);
     current->push(value);
 
+    if (!resumeAfter(store))
+        return InliningStatus_Error;
+
     return InliningStatus_Inlined;
 }
 
 IonBuilder::InliningStatus
 IonBuilder::inlineAtomicsFence(CallInfo &callInfo)
 {
     if (callInfo.argc() != 0 || callInfo.constructing()) {
         trackOptimizationOutcome(TrackedOutcome::CantInlineNativeBadForm);
@@ -2775,16 +2785,20 @@ IonBuilder::inlineAtomicsFence(CallInfo 
     }
 
     callInfo.setImplicitlyUsedUnchecked();
 
     MMemoryBarrier *fence = MMemoryBarrier::New(alloc());
     current->add(fence);
     pushConstant(UndefinedValue());
 
+    // Fences are considered effectful (they execute a memory barrier).
+    if (!resumeAfter(fence))
+        return InliningStatus_Error;
+
     return InliningStatus_Inlined;
 }
 
 IonBuilder::InliningStatus
 IonBuilder::inlineAtomicsBinop(CallInfo &callInfo, JSFunction *target)
 {
     if (callInfo.argc() != 3 || callInfo.constructing()) {
         trackOptimizationOutcome(TrackedOutcome::CantInlineNativeBadForm);
@@ -2826,16 +2840,19 @@ IonBuilder::inlineAtomicsBinop(CallInfo 
         current->add(toWrite->toInstruction());
     }
     MAtomicTypedArrayElementBinop *binop =
         MAtomicTypedArrayElementBinop::New(alloc(), k, elements, index, arrayType, toWrite);
     binop->setResultType(getInlineReturnType());
     current->add(binop);
     current->push(binop);
 
+    if (!resumeAfter(binop))
+        return InliningStatus_Error;
+
     return InliningStatus_Inlined;
 }
 
 bool
 IonBuilder::atomicsMeetsPreconditions(CallInfo &callInfo, Scalar::Type *arrayType)
 {
     if (callInfo.getArg(0)->type() != MIRType_Object)
         return false;