Bug 1238417 - Part 4: Enable recover instruction for RegExpMatcher and RegExpTester. r=h4writer
authorTooru Fujisawa <arai_a@mac.com>
Wed, 13 Jan 2016 08:27:25 +0900
changeset 314819 3406521ad1b0bb0eed13139a3964464cc6dfdd5d
parent 314818 78f6d81df68d78bc6f15db4f9741f0ee98e40fab
child 314820 0f84ebf2449323f50e0454682fe4e19e9e9fc646
push id5703
push userraliiev@mozilla.com
push dateMon, 07 Mar 2016 14:18:41 +0000
treeherdermozilla-beta@31e373ad5b5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersh4writer
bugs1238417
milestone46.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 1238417 - Part 4: Enable recover instruction for RegExpMatcher and RegExpTester. r=h4writer
js/src/jit/MIR.h
js/src/vm/RegExpObject.h
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -7556,20 +7556,17 @@ class MRegExpMatcher
     }
     MDefinition* sticky() const {
         return getOperand(3);
     }
 
     bool writeRecoverData(CompactBufferWriter& writer) const override;
 
     bool canRecoverOnBailout() const override {
-        // XXX: always return false for now, to work around bug 1132128.
-        if (false && regexp()->isRegExp())
-            return !regexp()->toRegExp()->source()->needUpdateLastIndex();
-        return false;
+        return true;
     }
 
     bool possiblyCalls() const override {
         return true;
     }
 };
 
 class MRegExpTester
@@ -7616,23 +7613,17 @@ class MRegExpTester
     }
 
     bool possiblyCalls() const override {
         return true;
     }
 
     bool writeRecoverData(CompactBufferWriter& writer) const override;
     bool canRecoverOnBailout() const override {
-        // RegExpTester has a side-effect on the regexp object's lastIndex
-        // when sticky or global flags are set.
-        // Return false unless we are sure it's not the case.
-        // XXX: always return false for now, to work around bug 1132128.
-        if (false && regexp()->isRegExp())
-            return !regexp()->toRegExp()->source()->needUpdateLastIndex();
-        return false;
+        return true;
     }
 };
 
 template <class Policy1>
 class MStrReplace
   : public MTernaryInstruction,
     public Mix3Policy<StringPolicy<0>, Policy1, StringPolicy<2> >::Data
 {
--- a/js/src/vm/RegExpObject.h
+++ b/js/src/vm/RegExpObject.h
@@ -423,20 +423,16 @@ class RegExpObject : public NativeObject
         flags |= global() ? GlobalFlag : 0;
         flags |= ignoreCase() ? IgnoreCaseFlag : 0;
         flags |= multiline() ? MultilineFlag : 0;
         flags |= sticky() ? StickyFlag : 0;
         flags |= unicode() ? UnicodeFlag : 0;
         return RegExpFlag(flags);
     }
 
-    bool needUpdateLastIndex() const {
-        return sticky() || global();
-    }
-
     /* Flags. */
 
     void setIgnoreCase(bool enabled) {
         setSlot(IGNORE_CASE_FLAG_SLOT, BooleanValue(enabled));
     }
 
     void setGlobal(bool enabled) {
         setSlot(GLOBAL_FLAG_SLOT, BooleanValue(enabled));