Ignore:
Timestamp:
Nov 17, 2010, 5:15:56 AM (15 years ago)
Author:
Csaba Osztrogonác
Message:

YARR JIT should fallback to YARR Interpreter instead of PCRE.
https://bugs.webkit.org/show_bug.cgi?id=46719

Patch by Peter Varga <[email protected]> on 2010-11-17
Reviewed by Gavin Barraclough.

Remove the ENABLE_YARR macro and the option of matching regular
expressions with PCRE from JavaScriptCore.

JavaScriptCore:

  • runtime/JSGlobalData.h:
  • runtime/RegExp.cpp:

(JSC::RegExp::compile):
(JSC::RegExp::match):

  • tests/mozilla/expected.html:
  • wtf/Platform.h:
  • yarr/RegexCompiler.cpp:
  • yarr/RegexCompiler.h:
  • yarr/RegexInterpreter.cpp:

(JSC::Yarr::byteCompileRegex):

  • yarr/RegexInterpreter.h:
  • yarr/RegexJIT.cpp:

(JSC::Yarr::jitCompileRegex):

  • yarr/RegexJIT.h:

(JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
(JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
(JSC::Yarr::RegexCodeBlock::getFallback):
(JSC::Yarr::RegexCodeBlock::isFallback):
(JSC::Yarr::RegexCodeBlock::setFallback):
(JSC::Yarr::executeRegex):

  • yarr/RegexParser.h:
  • yarr/RegexPattern.h:

LayoutTests:

  • fast/js/regexp-look-ahead-empty-expected.txt:
  • fast/js/regexp-overflow-expected.txt:
  • fast/js/script-tests/regexp-overflow.js:
  • fast/js/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.2/15.10.2.5_Term/S15.10.2.5_A1_T4-expected.txt:
  • fast/js/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.2/15.10.2.8_Atom/S15.10.2.8_A2_T1-expected.txt:
  • fast/js/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.6/15.10.6.2_RegExp.prototype.exec/S15.10.6.2_A1_T6-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/yarr/RegexJIT.cpp

    r68207 r72197  
    3232#include "MacroAssembler.h"
    3333#include "RegexCompiler.h"
    34 
    35 #include "pcre.h" // temporary, remove when fallback is removed.
     34#include "RegexInterpreter.h" // temporary, remove when fallback is removed.
    3635
    3736#if ENABLE(YARR_JIT)
     
    15331532};
    15341533
    1535 void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const UString& patternString, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline)
     1534void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const UString& patternString, unsigned& numSubpatterns, const char*& error, BumpPointerAllocator* allocator, bool ignoreCase, bool multiline)
    15361535{
    15371536    RegexPattern pattern(ignoreCase, multiline);
     
    15471546    }
    15481547
    1549     JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase;
    1550     JSRegExpMultilineOption multilineOption = multiline ? JSRegExpMultiline : JSRegExpSingleLine;
    1551     jitObject.setFallback(jsRegExpCompile(reinterpret_cast<const UChar*>(patternString.characters()), patternString.length(), ignoreCaseOption, multilineOption, &numSubpatterns, &error));
     1548    jitObject.setFallback(byteCompileRegex(pattern, allocator));
    15521549}
    15531550
Note: See TracChangeset for help on using the changeset viewer.