Bug 1483275 - Use one definition of js::jit::SimpleArithOperand. r=jandem
authorTed Campbell <tcampbell@mozilla.com>
Tue, 14 Aug 2018 10:56:59 -0400
changeset 431689 a5f5d094aa197489311b13aeed5c67e8c74b1cf8
parent 431688 c13d9e177361e3968314503b474ef0479d004d8a
child 431690 2852ef02208099ba0d9635794ec975d757db9425
push id34451
push userebalazs@mozilla.com
push dateThu, 16 Aug 2018 09:25:15 +0000
treeherdermozilla-central@161817e6d127 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1483275
milestone63.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 1483275 - Use one definition of js::jit::SimpleArithOperand. r=jandem NOTE: This has a slight effect on TI of certain compare operations. A previous patch to make SimpleArithOperand more conservative had only been applied to one copy and then rectifies that. MozReview-Commit-ID: Fj8d7mWufYC
js/src/jit/IonBuilder.cpp
js/src/jit/MIR.cpp
js/src/jit/MIR.h
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -3450,28 +3450,16 @@ IonBuilder::powTrySpecialized(bool* emit
         output = toDouble;
     }
 
     current->push(output);
     *emitted = true;
     return Ok();
 }
 
-static inline bool
-SimpleArithOperand(MDefinition* op)
-{
-    return !op->emptyResultTypeSet()
-        && !op->mightBeType(MIRType::Object)
-        && !op->mightBeType(MIRType::String)
-        && !op->mightBeType(MIRType::Symbol)
-        && !op->mightBeType(MIRType::MagicOptimizedArguments)
-        && !op->mightBeType(MIRType::MagicHole)
-        && !op->mightBeType(MIRType::MagicIsConstructing);
-}
-
 AbortReasonOr<Ok>
 IonBuilder::binaryArithTrySpecialized(bool* emitted, JSOp op, MDefinition* left, MDefinition* right)
 {
     MOZ_ASSERT(*emitted == false);
 
     // Try to emit a specialized binary instruction based on the input types
     // of the operands.
 
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -3333,27 +3333,16 @@ MMul::canOverflow() const
 bool
 MUrsh::fallible() const
 {
     if (bailoutsDisabled())
         return false;
     return !range() || !range()->hasInt32Bounds();
 }
 
-static inline bool
-SimpleArithOperand(MDefinition* op)
-{
-    return !op->mightBeType(MIRType::Object)
-        && !op->mightBeType(MIRType::String)
-        && !op->mightBeType(MIRType::Symbol)
-        && !op->mightBeType(MIRType::MagicOptimizedArguments)
-        && !op->mightBeType(MIRType::MagicHole)
-        && !op->mightBeType(MIRType::MagicIsConstructing);
-}
-
 static bool
 SafelyCoercesToDouble(MDefinition* op)
 {
     // Strings and symbols are unhandled -- visitToDouble() doesn't support them yet.
     // Null is unhandled -- ToDouble(null) == 0, but (0 == null) is false.
     return SimpleArithOperand(op) && !op->mightBeType(MIRType::Null);
 }
 
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -968,16 +968,28 @@ class MDefinition : public MNode
         return AliasType::MayAlias;
     }
 
     virtual bool canRecoverOnBailout() const {
         return false;
     }
 };
 
+static inline bool
+SimpleArithOperand(MDefinition* op)
+{
+    return !op->emptyResultTypeSet()
+        && !op->mightBeType(MIRType::Object)
+        && !op->mightBeType(MIRType::String)
+        && !op->mightBeType(MIRType::Symbol)
+        && !op->mightBeType(MIRType::MagicOptimizedArguments)
+        && !op->mightBeType(MIRType::MagicHole)
+        && !op->mightBeType(MIRType::MagicIsConstructing);
+}
+
 // An MUseDefIterator walks over uses in a definition, skipping any use that is
 // not a definition. Items from the use list must not be deleted during
 // iteration.
 class MUseDefIterator
 {
     const MDefinition* def_;
     MUseIterator current_;