Changeset 112454 in webkit for trunk/Source/JavaScriptCore/yarr


Ignore:
Timestamp:
Mar 28, 2012, 3:18:20 PM (13 years ago)
Author:
[email protected]
Message:

Yarr: if we're not using the output array, don't populate it!
https://bugs.webkit.org/show_bug.cgi?id=82519

Reviewed by Sam Weinig.

../JavaScriptCore:

Add a new variant of the match method to RegExp that returns a MatchResult,
and modify YarrJIT to be able to compile code that doesn't use an output vector.

This is a 3% progression on v8-regexp.

  • JavaScriptCore.xcodeproj/project.pbxproj:
    • Moved MatchResult into its own header.
  • assembler/AbstractMacroAssembler.h:
    • Added missing include.
  • runtime/MatchResult.h: Added.

(MatchResult::MatchResult):
(MatchResult):
(MatchResult::failed):
(MatchResult::operator bool):
(MatchResult::empty):

  • Moved MatchResult into its own header.
  • runtime/RegExp.cpp:

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

  • Changed due to execute & representation changes.

(JSC::RegExp::compileMatchOnly):
(JSC::RegExp::compileIfNecessaryMatchOnly):

  • Added helper to compile MatchOnly code.

(JSC::RegExp::invalidateCode):
(JSC::RegExp::matchCompareWithInterpreter):
(JSC::RegExp::printTraceData):

  • Changed due representation changes.
  • runtime/RegExp.h:

(RegExp):
(JSC::RegExp::hasCode):

  • Made YarrCodeBlock a member.
  • runtime/RegExpConstructor.h:

(RegExpConstructor):
(JSC::RegExpConstructor::performMatch):

  • Added no-ovector form.
  • runtime/RegExpMatchesArray.cpp:

(JSC::RegExpMatchesArray::reifyAllProperties):

  • Match now takes a reference to ovector, not a pointer.
  • runtime/RegExpObject.h:

(JSC):

  • Moved MatchResult into its own header.
  • runtime/StringPrototype.cpp:

(JSC::stringProtoFuncSplit):

  • Match now takes a reference to ovector, not a pointer.
  • testRegExp.cpp:

(testOneRegExp):

  • Match now takes a reference to ovector, not a pointer.
  • yarr/YarrJIT.cpp:

(Yarr):
(YarrGenerator):
(JSC::Yarr::YarrGenerator::initCallFrame):
(JSC::Yarr::YarrGenerator::removeCallFrame):
(JSC::Yarr::YarrGenerator::setSubpatternStart):
(JSC::Yarr::YarrGenerator::setSubpatternEnd):
(JSC::Yarr::YarrGenerator::clearSubpatternStart):
(JSC::Yarr::YarrGenerator::setMatchStart):
(JSC::Yarr::YarrGenerator::getMatchStart):

  • Added helper functions to intermediate access to output.

(JSC::Yarr::YarrGenerator::generateDotStarEnclosure):
(JSC::Yarr::YarrGenerator::generate):
(JSC::Yarr::YarrGenerator::backtrack):
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::compile):

  • Changed to use the new helpers, only generate subpatterns if IncludeSubpatterns.

(JSC::Yarr::jitCompile):

  • Needs to template of MatchOnly or IncludeSubpatterns.
  • yarr/YarrJIT.h:

(YarrCodeBlock):
(JSC::Yarr::YarrCodeBlock::set8BitCode):
(JSC::Yarr::YarrCodeBlock::set16BitCode):
(JSC::Yarr::YarrCodeBlock::has8BitCodeMatchOnly):
(JSC::Yarr::YarrCodeBlock::has16BitCodeMatchOnly):
(JSC::Yarr::YarrCodeBlock::set8BitCodeMatchOnly):
(JSC::Yarr::YarrCodeBlock::set16BitCodeMatchOnly):
(JSC::Yarr::YarrCodeBlock::execute):
(JSC::Yarr::YarrCodeBlock::clear):

  • Added a second set of CodeRefs, so that we can compile RexExps with/without subpattern matching.

../WebCore:

  • ForwardingHeaders/runtime/MatchResult.h: Added.
  • ForwardingHeaders/yarr/YarrJIT.h: Added.
    • Added forwarding headers.
Location:
trunk/Source/JavaScriptCore/yarr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp

    r112192 r112454  
    3838namespace JSC { namespace Yarr {
    3939
     40template<YarrJITCompileMode compileMode>
    4041class YarrGenerator : private MacroAssembler {
    4142    friend void jitCompile(JSGlobalData*, YarrCodeBlock& jitObject, const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline);
     
    5152
    5253    static const RegisterID returnRegister = ARMRegisters::r0;
     54    static const RegisterID returnRegister2 = ARMRegisters::r1;
    5355#elif CPU(MIPS)
    5456    static const RegisterID input = MIPSRegisters::a0;
     
    6163
    6264    static const RegisterID returnRegister = MIPSRegisters::v0;
     65    static const RegisterID returnRegister2 = MIPSRegisters::v1;
    6366#elif CPU(SH4)
    6467    static const RegisterID input = SH4Registers::r4;
     
    7174
    7275    static const RegisterID returnRegister = SH4Registers::r0;
     76    static const RegisterID returnRegister2 = SH4Registers::r1;
    7377#elif CPU(X86)
    7478    static const RegisterID input = X86Registers::eax;
     
    8185
    8286    static const RegisterID returnRegister = X86Registers::eax;
     87    static const RegisterID returnRegister2 = X86Registers::edx;
    8388#elif CPU(X86_64)
    8489    static const RegisterID input = X86Registers::edi;
     
    9196
    9297    static const RegisterID returnRegister = X86Registers::eax;
     98    static const RegisterID returnRegister2 = X86Registers::edx;
    9399#endif
    94100
     
    304310    {
    305311        jump(Address(stackPointerRegister, frameLocation * sizeof(void*)));
     312    }
     313
     314    void initCallFrame()
     315    {
     316        unsigned callFrameSize = m_pattern.m_body->m_callFrameSize;
     317        if (callFrameSize)
     318            subPtr(Imm32(callFrameSize * sizeof(void*)), stackPointerRegister);
     319    }
     320    void removeCallFrame()
     321    {
     322        unsigned callFrameSize = m_pattern.m_body->m_callFrameSize;
     323        if (callFrameSize)
     324            addPtr(Imm32(callFrameSize * sizeof(void*)), stackPointerRegister);
     325    }
     326
     327    // Used to record subpatters, should only be called if compileMode is IncludeSubpatterns.
     328    void setSubpatternStart(RegisterID reg, unsigned subpattern)
     329    {
     330        ASSERT(subpattern);
     331        ASSERT(compileMode == IncludeSubpatterns);
     332        store32(reg, Address(output, (subpattern << 1) * sizeof(int)));
     333    }
     334    void setSubpatternEnd(RegisterID reg, unsigned subpattern)
     335    {
     336        ASSERT(subpattern);
     337        ASSERT(compileMode == IncludeSubpatterns);
     338        store32(reg, Address(output, ((subpattern << 1) + 1) * sizeof(int)));
     339    }
     340    void clearSubpatternStart(unsigned subpattern)
     341    {
     342        ASSERT(subpattern);
     343        ASSERT(compileMode == IncludeSubpatterns);
     344        store32(TrustedImm32(-1), Address(output, (subpattern << 1) * sizeof(int)));
     345    }
     346
     347    // We use one of three different strategies to track the start of the current match,
     348    // while matching.
     349    // 1) If the pattern has a fixed size, do nothing! - we calculate the value lazily
     350    //    at the end of matching. This is irrespective of compileMode, and in this case
     351    //    these methods should never be called.
     352    // 2) If we're compiling IncludeSubpatterns, 'output' contains a pointer to an output
     353    //    vector, store the match start in the output vector.
     354    // 3) If we're compiling MatchOnly, 'output' is unused, store the match start directly
     355    //    in this register.
     356    void setMatchStart(RegisterID reg)
     357    {
     358        ASSERT(!m_pattern.m_body->m_hasFixedSize);
     359        if (compileMode == IncludeSubpatterns)
     360            store32(reg, output);
     361        else
     362            move(reg, output);
     363    }
     364    void getMatchStart(RegisterID reg)
     365    {
     366        ASSERT(!m_pattern.m_body->m_hasFixedSize);
     367        if (compileMode == IncludeSubpatterns)
     368            load32(output, reg);
     369        else
     370            move(output, reg);
    306371    }
    307372
     
    10701135        JumpList foundEndingNewLine;
    10711136
    1072         if (m_pattern.m_body->m_hasFixedSize) {
    1073             move(index, matchPos);
    1074             sub32(Imm32(m_checked), matchPos);
    1075         } else
    1076             load32(Address(output), matchPos);
     1137        ASSERT(!m_pattern.m_body->m_hasFixedSize);
     1138        getMatchStart(matchPos);
    10771139
    10781140        saveStartIndex.append(branchTest32(Zero, matchPos));
     
    10941156            op.m_jumps.append(branchTest32(NonZero, matchPos));
    10951157
    1096         store32(matchPos, Address(output));
     1158        ASSERT(!m_pattern.m_body->m_hasFixedSize);
     1159        setMatchStart(matchPos);
    10971160
    10981161        move(index, matchPos);
     
    13161379               
    13171380                // Adjust the stack pointer to remove the pattern's frame.
    1318                 if (m_pattern.m_body->m_callFrameSize)
    1319                     addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
     1381                removeCallFrame();
    13201382
    13211383                // Load appropriate values into the return register and the first output
     
    13271389                    if (priorAlternative->m_minimumSize)
    13281390                        sub32(Imm32(priorAlternative->m_minimumSize), returnRegister);
    1329                     store32(returnRegister, output);
     1391                    if (compileMode == IncludeSubpatterns)
     1392                        store32(returnRegister, output);
    13301393                } else
    1331                     load32(Address(output), returnRegister);
    1332                 store32(index, Address(output, 4));
     1394                    getMatchStart(returnRegister);
     1395                if (compileMode == IncludeSubpatterns)
     1396                    store32(index, Address(output, 4));
     1397                move(index, returnRegister2);
     1398
    13331399                generateReturn();
    13341400
     
    15131579                // offsets only afterwards, at the point the results array is
    15141580                // being accessed.
    1515                 if (term->capture()) {
    1516                     int offsetId = term->parentheses.subpatternId << 1;
     1581                if (term->capture() && compileMode == IncludeSubpatterns) {
    15171582                    int inputOffset = term->inputPosition - m_checked;
    15181583                    if (term->quantityType == QuantifierFixedCount)
     
    15211586                        move(index, indexTemporary);
    15221587                        add32(Imm32(inputOffset), indexTemporary);
    1523                         store32(indexTemporary, Address(output, offsetId * sizeof(int)));
     1588                        setSubpatternStart(indexTemporary, term->parentheses.subpatternId);
    15241589                    } else
    1525                         store32(index, Address(output, offsetId * sizeof(int)));
     1590                        setSubpatternStart(index, term->parentheses.subpatternId);
    15261591                }
    15271592                break;
     
    15491614                // offsets only afterwards, at the point the results array is
    15501615                // being accessed.
    1551                 if (term->capture()) {
    1552                     int offsetId = (term->parentheses.subpatternId << 1) + 1;
     1616                if (term->capture() && compileMode == IncludeSubpatterns) {
    15531617                    int inputOffset = term->inputPosition - m_checked;
    15541618                    if (inputOffset) {
    15551619                        move(index, indexTemporary);
    15561620                        add32(Imm32(inputOffset), indexTemporary);
    1557                         store32(indexTemporary, Address(output, offsetId * sizeof(int)));
     1621                        setSubpatternEnd(indexTemporary, term->parentheses.subpatternId);
    15581622                    } else
    1559                         store32(index, Address(output, offsetId * sizeof(int)));
     1623                        setSubpatternEnd(index, term->parentheses.subpatternId);
    15601624                }
    15611625
     
    16471711
    16481712            case OpMatchFailed:
    1649                 if (m_pattern.m_body->m_callFrameSize)
    1650                     addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
    1651                 move(TrustedImm32(-1), returnRegister);
     1713                removeCallFrame();
     1714                move(TrustedImmPtr((void*)WTF::notFound), returnRegister);
     1715                move(TrustedImm32(0), returnRegister2);
    16521716                generateReturn();
    16531717                break;
     
    17441808                        if (!m_pattern.m_body->m_hasFixedSize) {
    17451809                            if (alternative->m_minimumSize == 1)
    1746                                 store32(index, Address(output));
     1810                                setMatchStart(index);
    17471811                            else {
    17481812                                move(index, regT0);
     
    17511815                                else
    17521816                                    add32(TrustedImm32(1), regT0);
    1753                                 store32(regT0, Address(output));
     1817                                setMatchStart(regT0);
    17541818                            }
    17551819                        }
     
    18371901                if (needsToUpdateMatchStart && alternative->m_minimumSize == 1) {
    18381902                    // index is already incremented by 1, so just store it now!
    1839                     store32(index, Address(output));
     1903                    setMatchStart(index);
    18401904                    needsToUpdateMatchStart = false;
    18411905                }
     
    18611925                if (needsToUpdateMatchStart) {
    18621926                    if (!m_pattern.m_body->m_minimumSize)
    1863                         store32(index, Address(output));
     1927                        setMatchStart(index);
    18641928                    else {
    18651929                        move(index, regT0);
    18661930                        sub32(Imm32(m_pattern.m_body->m_minimumSize), regT0);
    1867                         store32(regT0, Address(output));
     1931                        setMatchStart(regT0);
    18681932                    }
    18691933                }
     
    18871951                matchFailed.link(this);
    18881952
    1889                 if (m_pattern.m_body->m_callFrameSize)
    1890                     addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
    1891                 move(TrustedImm32(-1), returnRegister);
     1953                removeCallFrame();
     1954                move(TrustedImmPtr((void*)WTF::notFound), returnRegister);
     1955                move(TrustedImm32(0), returnRegister2);
    18921956                generateReturn();
    18931957                break;
     
    20562120
    20572121                // We only need to backtrack to thispoint if capturing or greedy.
    2058                 if (term->capture() || term->quantityType == QuantifierGreedy) {
     2122                if ((term->capture() && compileMode == IncludeSubpatterns) || term->quantityType == QuantifierGreedy) {
    20592123                    m_backtrackingState.link(this);
    20602124
    20612125                    // If capturing, clear the capture (we only need to reset start).
    2062                     if (term->capture())
    2063                         store32(TrustedImm32(-1), Address(output, (term->parentheses.subpatternId << 1) * sizeof(int)));
     2126                    if (term->capture() && compileMode == IncludeSubpatterns)
     2127                        clearSubpatternStart(term->parentheses.subpatternId);
    20642128
    20652129                    // If Greedy, jump to the end.
     
    24512515        loadPtr(Address(X86Registers::ebp, 3 * sizeof(void*)), index);
    24522516        loadPtr(Address(X86Registers::ebp, 4 * sizeof(void*)), length);
    2453         loadPtr(Address(X86Registers::ebp, 5 * sizeof(void*)), output);
     2517        if (compileMode == IncludeSubpatterns)
     2518            loadPtr(Address(X86Registers::ebp, 5 * sizeof(void*)), output);
    24542519    #else
    2455         loadPtr(Address(X86Registers::ebp, 2 * sizeof(void*)), output);
     2520        if (compileMode == IncludeSubpatterns)
     2521            loadPtr(Address(X86Registers::ebp, 2 * sizeof(void*)), output);
    24562522    #endif
    24572523#elif CPU(ARM)
     
    24622528        push(ARMRegisters::r8); // scratch register
    24632529#endif
    2464         move(ARMRegisters::r3, output);
     2530        if (compileMode == IncludeSubpatterns)
     2531            move(ARMRegisters::r3, output);
    24652532#elif CPU(SH4)
    24662533        push(SH4Registers::r11);
     
    25122579
    25132580        Jump hasInput = checkInput();
    2514         move(TrustedImm32(-1), returnRegister);
     2581        move(TrustedImmPtr((void*)WTF::notFound), returnRegister);
     2582        move(TrustedImm32(0), returnRegister2);
    25152583        generateReturn();
    25162584        hasInput.link(this);
    25172585
    2518         for (unsigned i = 0; i < m_pattern.m_numSubpatterns + 1; ++i)
    2519             store32(TrustedImm32(-1), Address(output, (i << 1) * sizeof(int)));
     2586        if (compileMode == IncludeSubpatterns) {
     2587            for (unsigned i = 0; i < m_pattern.m_numSubpatterns + 1; ++i)
     2588                store32(TrustedImm32(-1), Address(output, (i << 1) * sizeof(int)));
     2589        }
    25202590
    25212591        if (!m_pattern.m_body->m_hasFixedSize)
    2522             store32(index, Address(output));
    2523 
    2524         if (m_pattern.m_body->m_callFrameSize)
    2525             subPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
     2592            setMatchStart(index);
     2593
     2594        initCallFrame();
    25262595
    25272596        // Compile the pattern to the internal 'YarrOp' representation.
     
    25412610        LinkBuffer linkBuffer(*globalData, this, REGEXP_CODE_ID);
    25422611        m_backtrackingState.linkDataLabels(linkBuffer);
    2543         if (m_charSize == Char8)
    2544             jitObject.set8BitCode(linkBuffer.finalizeCode());
    2545         else
    2546             jitObject.set16BitCode(linkBuffer.finalizeCode());
     2612
     2613        if (compileMode == MatchOnly) {
     2614            if (m_charSize == Char8)
     2615                jitObject.set8BitCodeMatchOnly(linkBuffer.finalizeCode());
     2616            else
     2617                jitObject.set16BitCodeMatchOnly(linkBuffer.finalizeCode());
     2618        } else {
     2619            if (m_charSize == Char8)
     2620                jitObject.set8BitCode(linkBuffer.finalizeCode());
     2621            else
     2622                jitObject.set16BitCode(linkBuffer.finalizeCode());
     2623        }
    25472624        jitObject.setFallBack(m_shouldFallBack);
    25482625    }
     
    25782655};
    25792656
    2580 void jitCompile(YarrPattern& pattern, YarrCharSize charSize, JSGlobalData* globalData, YarrCodeBlock& jitObject)
     2657void jitCompile(YarrPattern& pattern, YarrCharSize charSize, JSGlobalData* globalData, YarrCodeBlock& jitObject, YarrJITCompileMode mode)
    25812658{
    2582     YarrGenerator(pattern, charSize).compile(globalData, jitObject);
     2659    if (mode == MatchOnly)
     2660        YarrGenerator<MatchOnly>(pattern, charSize).compile(globalData, jitObject);
     2661    else
     2662        YarrGenerator<IncludeSubpatterns>(pattern, charSize).compile(globalData, jitObject);
    25832663}
    25842664
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.h

    r103641 r112454  
    3030
    3131#include "JSGlobalData.h"
    32 #include "MacroAssembler.h"
     32#include "MacroAssemblerCodeRef.h"
     33#include "MatchResult.h"
    3334#include "UString.h"
    3435#include "Yarr.h"
     
    4950
    5051class YarrCodeBlock {
    51     typedef int (*YarrJITCode8)(const LChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
    52     typedef int (*YarrJITCode16)(const UChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
     52#if CPU(X86_64)
     53    typedef MatchResult (*YarrJITCode8)(const LChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
     54    typedef MatchResult (*YarrJITCode16)(const UChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
     55    typedef MatchResult (*YarrJITCodeMatchOnly8)(const LChar* input, unsigned start, unsigned length) YARR_CALL;
     56    typedef MatchResult (*YarrJITCodeMatchOnly16)(const UChar* input, unsigned start, unsigned length) YARR_CALL;
     57#else
     58    typedef EncodedMatchResult (*YarrJITCode8)(const LChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
     59    typedef EncodedMatchResult (*YarrJITCode16)(const UChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
     60    typedef EncodedMatchResult (*YarrJITCodeMatchOnly8)(const LChar* input, unsigned start, unsigned length) YARR_CALL;
     61    typedef EncodedMatchResult (*YarrJITCodeMatchOnly16)(const UChar* input, unsigned start, unsigned length) YARR_CALL;
     62#endif
    5363
    5464public:
     
    6474    void setFallBack(bool fallback) { m_needFallBack = fallback; }
    6575    bool isFallBack() { return m_needFallBack; }
     76
    6677    bool has8BitCode() { return m_ref8.size(); }
    6778    bool has16BitCode() { return m_ref16.size(); }
    68     void set8BitCode(MacroAssembler::CodeRef ref) { m_ref8 = ref; }
    69     void set16BitCode(MacroAssembler::CodeRef ref) { m_ref16 = ref; }
     79    void set8BitCode(MacroAssemblerCodeRef ref) { m_ref8 = ref; }
     80    void set16BitCode(MacroAssemblerCodeRef ref) { m_ref16 = ref; }
    7081
    71     int execute(const LChar* input, unsigned start, unsigned length, int* output)
     82    bool has8BitCodeMatchOnly() { return m_matchOnly8.size(); }
     83    bool has16BitCodeMatchOnly() { return m_matchOnly16.size(); }
     84    void set8BitCodeMatchOnly(MacroAssemblerCodeRef matchOnly) { m_matchOnly8 = matchOnly; }
     85    void set16BitCodeMatchOnly(MacroAssemblerCodeRef matchOnly) { m_matchOnly16 = matchOnly; }
     86
     87    MatchResult execute(const LChar* input, unsigned start, unsigned length, int* output)
    7288    {
    7389        ASSERT(has8BitCode());
    74         return reinterpret_cast<YarrJITCode8>(m_ref8.code().executableAddress())(input, start, length, output);
     90        return MatchResult(reinterpret_cast<YarrJITCode8>(m_ref8.code().executableAddress())(input, start, length, output));
    7591    }
    7692
    77     int execute(const UChar* input, unsigned start, unsigned length, int* output)
     93    MatchResult execute(const UChar* input, unsigned start, unsigned length, int* output)
    7894    {
    7995        ASSERT(has16BitCode());
    80         return reinterpret_cast<YarrJITCode16>(m_ref16.code().executableAddress())(input, start, length, output);
     96        return MatchResult(reinterpret_cast<YarrJITCode16>(m_ref16.code().executableAddress())(input, start, length, output));
    8197    }
     98
     99    MatchResult execute(const LChar* input, unsigned start, unsigned length)
     100    {
     101        ASSERT(has8BitCodeMatchOnly());
     102        return MatchResult(reinterpret_cast<YarrJITCodeMatchOnly8>(m_matchOnly8.code().executableAddress())(input, start, length));
     103    }
     104
     105    MatchResult execute(const UChar* input, unsigned start, unsigned length)
     106    {
     107        ASSERT(has16BitCodeMatchOnly());
     108        return MatchResult(reinterpret_cast<YarrJITCodeMatchOnly16>(m_matchOnly16.code().executableAddress())(input, start, length));
     109    }
     110
    82111#if ENABLE(REGEXP_TRACING)
    83112    void *getAddr() { return m_ref.code().executableAddress(); }
    84113#endif
    85114
     115    void clear()
     116    {
     117        m_ref8 = MacroAssemblerCodeRef();
     118        m_ref16 = MacroAssemblerCodeRef();
     119        m_matchOnly8 = MacroAssemblerCodeRef();
     120        m_matchOnly16 = MacroAssemblerCodeRef();
     121        m_needFallBack = false;
     122    }
     123
    86124private:
    87     MacroAssembler::CodeRef m_ref8;
    88     MacroAssembler::CodeRef m_ref16;
     125    MacroAssemblerCodeRef m_ref8;
     126    MacroAssemblerCodeRef m_ref16;
     127    MacroAssemblerCodeRef m_matchOnly8;
     128    MacroAssemblerCodeRef m_matchOnly16;
    89129    bool m_needFallBack;
    90130};
    91131
    92 void jitCompile(YarrPattern&, YarrCharSize, JSGlobalData*, YarrCodeBlock& jitObject);
    93 
    94 inline int execute(YarrCodeBlock& jitObject, const LChar* input, unsigned start, unsigned length, int* output)
    95 {
    96     return jitObject.execute(input, start, length, output);
    97 }
    98 
    99 inline int execute(YarrCodeBlock& jitObject, const UChar* input, unsigned start, unsigned length, int* output)
    100 {
    101     return jitObject.execute(input, start, length, output);
    102 }
     132enum YarrJITCompileMode {
     133    MatchOnly,
     134    IncludeSubpatterns
     135};
     136void jitCompile(YarrPattern&, YarrCharSize, JSGlobalData*, YarrCodeBlock& jitObject, YarrJITCompileMode = IncludeSubpatterns);
    103137
    104138} } // namespace JSC::Yarr
Note: See TracChangeset for help on using the changeset viewer.