Bug 1079068: Move mightBeMagicType in MIR.cpp; r=h4writer
authorBenjamin Bouvier <benj@benj.me>
Wed, 08 Oct 2014 16:29:14 +0200
changeset 224791 aea1690f59476d4f1e964e0febed6041dff66e34
parent 224790 1d454aaf1dec70298aa89ba79c890acab32f85a5
child 224792 e0b3b8c184243a3e849d01bbac8b28eee35c0660
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersh4writer
bugs1079068
milestone35.0a1
Bug 1079068: Move mightBeMagicType in MIR.cpp; r=h4writer
js/src/jit/MIR.cpp
js/src/jit/MIR.h
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -219,16 +219,28 @@ MDefinition::congruentIfOperandsEqual(co
 
 MDefinition *
 MDefinition::foldsTo(TempAllocator &alloc)
 {
     // In the default case, there are no constants to fold.
     return this;
 }
 
+bool
+MDefinition::mightBeMagicType() const
+{
+    if (IsMagicType(type()))
+        return true;
+
+    if (MIRType_Value != type())
+        return false;
+
+    return !resultTypeSet() || resultTypeSet()->hasType(types::Type::MagicArgType());
+}
+
 MDefinition *
 MInstruction::foldsToStoredValue(TempAllocator &alloc, MDefinition *loaded)
 {
     // If the type are matching then we return the value which is used as
     // argument of the store.
     if (loaded->type() != type()) {
         // If we expect to read a type which is more generic than the type seen
         // by the store, then we box the value used by the store.
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -591,25 +591,17 @@ class MDefinition : public MNode
             return true;
 
         if (MIRType_Value != this->type())
             return false;
 
         return !resultTypeSet() || resultTypeSet()->mightBeMIRType(type);
     }
 
-    bool mightBeMagicType() const {
-        if (IsMagicType(type()))
-            return true;
-
-        if (MIRType_Value != type())
-            return false;
-
-        return !resultTypeSet() || resultTypeSet()->hasType(types::Type::MagicArgType());
-    }
+    bool mightBeMagicType() const;
 
     // Float32 specialization operations (see big comment in IonAnalysis before the Float32
     // specialization algorithm).
     virtual bool isFloat32Commutative() const { return false; }
     virtual bool canProduceFloat32() const { return false; }
     virtual bool canConsumeFloat32(MUse *use) const { return false; }
     virtual void trySpecializeFloat32(TempAllocator &alloc) {}
 #ifdef DEBUG