Bug 1113955: Still generate regexp jitcode when doing string matching, r=jandem

This commit is contained in:
Hannes Verschore 2014-12-23 11:44:45 +01:00
parent c0d5a6c306
commit ebd370c69f
2 changed files with 3 additions and 6 deletions

View File

@ -491,11 +491,8 @@ 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);
@ -537,7 +534,7 @@ 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);
}

View File

@ -185,7 +185,7 @@ class RegExpShared
/* Accessors */
size_t getParenCount() const {
MOZ_ASSERT(isCompiled() || canStringMatch);
MOZ_ASSERT(isCompiled());
return parenCount;
}