Bug 1113025. Fix MGetDOMMember::congruentTo to work correctly. r=jandem
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 02 Jan 2015 17:09:05 -0500
changeset 247744 576a73e44f6341c8385c2c7b034975d0d178dd0b
parent 247743 e27e73cca9fc6ddc3ca1b34a245aa330ae79c03c
child 247745 936b4df5458073dc1a05f7b8384a6283c75685da
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1113025
milestone37.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 1113025. Fix MGetDOMMember::congruentTo to work correctly. r=jandem
js/src/jit/MIR.h
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -10600,24 +10600,28 @@ class MGetDOMProperty
     bool valueMayBeInSlot() const {
         return info_->isLazilyCachedInSlot;
     }
     MDefinition *object() {
         return getOperand(0);
     }
 
     bool congruentTo(const MDefinition *ins) const {
+        if (!ins->isGetDOMProperty())
+            return false;
+
+        return congruentTo(ins->toGetDOMProperty());
+    }
+
+    bool congruentTo(const MGetDOMProperty *ins) const {
         if (!isDomMovable())
             return false;
 
-        if (!ins->isGetDOMProperty())
-            return false;
-
         // Checking the jitinfo is the same as checking the constant function
-        if (!(info() == ins->toGetDOMProperty()->info()))
+        if (!(info() == ins->info()))
             return false;
 
         return congruentIfOperandsEqual(ins);
     }
 
     AliasSet getAliasSet() const {
         JSJitInfo::AliasSet aliasSet = domAliasSet();
         if (aliasSet == JSJitInfo::AliasNone)
@@ -10630,17 +10634,18 @@ class MGetDOMProperty
 
     bool possiblyCalls() const {
         return true;
     }
 };
 
 class MGetDOMMember : public MGetDOMProperty
 {
-    // We inherit everything from MGetDOMProperty except our possiblyCalls value
+    // We inherit everything from MGetDOMProperty except our
+    // possiblyCalls value and the congruentTo behavior.
     explicit MGetDOMMember(const JSJitInfo *jitinfo)
         : MGetDOMProperty(jitinfo)
     {
     }
 
   public:
     INSTRUCTION_HEADER(GetDOMMember)
 
@@ -10651,16 +10656,23 @@ class MGetDOMMember : public MGetDOMProp
         if (!res || !res->init(alloc, obj, guard, globalGuard))
             return nullptr;
         return res;
     }
 
     bool possiblyCalls() const {
         return false;
     }
+
+    bool congruentTo(const MDefinition *ins) const {
+        if (!ins->isGetDOMMember())
+            return false;
+
+        return MGetDOMProperty::congruentTo(ins->toGetDOMMember());
+    }
 };
 
 class MStringLength
   : public MUnaryInstruction,
     public StringPolicy<0>::Data
 {
     explicit MStringLength(MDefinition *string)
       : MUnaryInstruction(string)