Bug 1113955: Still generate regexp jitcode when doing string matching, r=jandem
authorHannes Verschore <hv1989@gmail.com>
Tue, 23 Dec 2014 11:44:45 +0100
changeset 221041 6a3b650204e7
parent 221040 af0a3c1a42e2
child 221042 2815e5bcfef5
push id53271
push userhv1989@gmail.com
push date2014-12-23 10:45 +0000
treeherdermozilla-inbound@6a3b650204e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1113955
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 1113955: Still generate regexp jitcode when doing string matching, r=jandem
js/src/vm/RegExpObject.cpp
js/src/vm/RegExpObject.h
--- a/js/src/vm/RegExpObject.cpp
+++ b/js/src/vm/RegExpObject.cpp
@@ -486,21 +486,18 @@ RegExpShared::compile(JSContext *cx, Han
 
     return compile(cx, fakeySource, input, mode, force);
 }
 
 bool
 RegExpShared::compile(JSContext *cx, HandleAtom pattern, HandleLinearString input,
                       CompilationMode mode, ForceByteCodeEnum force)
 {
-    if (!ignoreCase() && !StringHasRegExpMetaChars(pattern)) {
+    if (!ignoreCase() && !StringHasRegExpMetaChars(pattern))
         canStringMatch = true;
-        parenCount = 0;
-        return true;
-    }
 
     CompileOptions options(cx);
     TokenStream dummyTokenStream(cx, options, nullptr, 0, nullptr);
 
     LifoAllocScope scope(&cx->tempLifoAlloc());
 
     /* Parse the pattern. */
     irregexp::RegExpCompileData data;
@@ -532,17 +529,17 @@ RegExpShared::compile(JSContext *cx, Han
 
     return true;
 }
 
 bool
 RegExpShared::compileIfNecessary(JSContext *cx, HandleLinearString input,
                                  CompilationMode mode, ForceByteCodeEnum force)
 {
-    if (isCompiled(mode, input->hasLatin1Chars(), force) || canStringMatch)
+    if (isCompiled(mode, input->hasLatin1Chars(), force))
         return true;
     return compile(cx, input, mode, force);
 }
 
 RegExpRunStatus
 RegExpShared::execute(JSContext *cx, HandleLinearString input, size_t start,
                       MatchPairs *matches)
 {
--- a/js/src/vm/RegExpObject.h
+++ b/js/src/vm/RegExpObject.h
@@ -180,17 +180,17 @@ class RegExpShared
     // Register a table with this RegExpShared, and take ownership.
     bool addTable(uint8_t *table) {
         return tables.append(table);
     }
 
     /* Accessors */
 
     size_t getParenCount() const {
-        MOZ_ASSERT(isCompiled() || canStringMatch);
+        MOZ_ASSERT(isCompiled());
         return parenCount;
     }
 
     /* Accounts for the "0" (whole match) pair. */
     size_t pairCount() const            { return getParenCount() + 1; }
 
     JSAtom *getSource() const           { return source; }
     RegExpFlag getFlags() const         { return flags; }