Changeset 225695 in webkit for trunk/Source/JavaScriptCore/yarr/YarrJIT.h
- Timestamp:
- Dec 8, 2017, 12:32:42 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/yarr/YarrJIT.h
r221052 r225695 39 39 #endif 40 40 41 #if CPU(ARM64) || (CPU(X86_64) && !OS(WINDOWS)) 42 #define JIT_ALL_PARENS_EXPRESSIONS 43 constexpr size_t patternContextBufferSize = 8192; // Space caller allocates to save nested parenthesis context 44 #endif 45 41 46 namespace JSC { 42 47 … … 48 53 class YarrCodeBlock { 49 54 #if CPU(X86_64) || CPU(ARM64) 55 #ifdef JIT_ALL_PARENS_EXPRESSIONS 56 typedef MatchResult (*YarrJITCode8)(const LChar* input, unsigned start, unsigned length, int* output, void* freeParenContext, unsigned parenContextSize) YARR_CALL; 57 typedef MatchResult (*YarrJITCode16)(const UChar* input, unsigned start, unsigned length, int* output, void* freeParenContext, unsigned parenContextSize) YARR_CALL; 58 typedef MatchResult (*YarrJITCodeMatchOnly8)(const LChar* input, unsigned start, unsigned length, void*, void* freeParenContext, unsigned parenContextSize) YARR_CALL; 59 typedef MatchResult (*YarrJITCodeMatchOnly16)(const UChar* input, unsigned start, unsigned length, void*, void* freeParenContext, unsigned parenContextSize) YARR_CALL; 60 #else 50 61 typedef MatchResult (*YarrJITCode8)(const LChar* input, unsigned start, unsigned length, int* output) YARR_CALL; 51 62 typedef MatchResult (*YarrJITCode16)(const UChar* input, unsigned start, unsigned length, int* output) YARR_CALL; 52 63 typedef MatchResult (*YarrJITCodeMatchOnly8)(const LChar* input, unsigned start, unsigned length) YARR_CALL; 53 64 typedef MatchResult (*YarrJITCodeMatchOnly16)(const UChar* input, unsigned start, unsigned length) YARR_CALL; 65 #endif 54 66 #else 55 67 typedef EncodedMatchResult (*YarrJITCode8)(const LChar* input, unsigned start, unsigned length, int* output) YARR_CALL; … … 82 94 void set16BitCodeMatchOnly(MacroAssemblerCodeRef matchOnly) { m_matchOnly16 = matchOnly; } 83 95 96 #ifdef JIT_ALL_PARENS_EXPRESSIONS 97 MatchResult execute(const LChar* input, unsigned start, unsigned length, int* output, void* freeParenContext, unsigned parenContextSize) 98 { 99 ASSERT(has8BitCode()); 100 return MatchResult(reinterpret_cast<YarrJITCode8>(m_ref8.code().executableAddress())(input, start, length, output, freeParenContext, parenContextSize)); 101 } 102 103 MatchResult execute(const UChar* input, unsigned start, unsigned length, int* output, void* freeParenContext, unsigned parenContextSize) 104 { 105 ASSERT(has16BitCode()); 106 return MatchResult(reinterpret_cast<YarrJITCode16>(m_ref16.code().executableAddress())(input, start, length, output, freeParenContext, parenContextSize)); 107 } 108 109 MatchResult execute(const LChar* input, unsigned start, unsigned length, void* freeParenContext, unsigned parenContextSize) 110 { 111 ASSERT(has8BitCodeMatchOnly()); 112 return MatchResult(reinterpret_cast<YarrJITCodeMatchOnly8>(m_matchOnly8.code().executableAddress())(input, start, length, 0, freeParenContext, parenContextSize)); 113 } 114 115 MatchResult execute(const UChar* input, unsigned start, unsigned length, void* freeParenContext, unsigned parenContextSize) 116 { 117 ASSERT(has16BitCodeMatchOnly()); 118 return MatchResult(reinterpret_cast<YarrJITCodeMatchOnly16>(m_matchOnly16.code().executableAddress())(input, start, length, 0, freeParenContext, parenContextSize)); 119 } 120 #else 84 121 MatchResult execute(const LChar* input, unsigned start, unsigned length, int* output) 85 122 { … … 105 142 return MatchResult(reinterpret_cast<YarrJITCodeMatchOnly16>(m_matchOnly16.code().executableAddress())(input, start, length)); 106 143 } 144 #endif 107 145 108 146 #if ENABLE(REGEXP_TRACING)
Note:
See TracChangeset
for help on using the changeset viewer.