diff options
| author | Steve Block <steveblock@google.com> | 2009-11-05 09:23:40 +0000 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2009-11-10 22:41:12 +0000 |
| commit | cac0f67c402d107cdb10971b95719e2ff9c7c76b (patch) | |
| tree | d182c7f87211c6f201a5f038e332336493ebdbe7 /JavaScriptCore/yarr | |
| parent | 4b2ef0f288e7c6c4602f621b7a0e9feed304b70e (diff) | |
| download | external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.zip external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.gz external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.bz2 | |
Merge webkit.org at r50258 : Initial merge by git.
Change-Id: I1a9e1dc4ed654b69174ad52a4f031a07240f37b0
Diffstat (limited to 'JavaScriptCore/yarr')
| -rw-r--r-- | JavaScriptCore/yarr/RegexInterpreter.cpp | 8 | ||||
| -rw-r--r-- | JavaScriptCore/yarr/RegexJIT.cpp | 13 | ||||
| -rw-r--r-- | JavaScriptCore/yarr/RegexJIT.h | 9 |
3 files changed, 13 insertions, 17 deletions
diff --git a/JavaScriptCore/yarr/RegexInterpreter.cpp b/JavaScriptCore/yarr/RegexInterpreter.cpp index aafea3c..d088086 100644 --- a/JavaScriptCore/yarr/RegexInterpreter.cpp +++ b/JavaScriptCore/yarr/RegexInterpreter.cpp @@ -1490,7 +1490,7 @@ public: closeBodyAlternative(); } - void alterantiveBodyDisjunction() + void alternativeBodyDisjunction() { int newAlternativeIndex = m_bodyDisjunction->terms.size(); m_bodyDisjunction->terms[m_currentAlternativeIndex].alternative.next = newAlternativeIndex - m_currentAlternativeIndex; @@ -1499,7 +1499,7 @@ public: m_currentAlternativeIndex = newAlternativeIndex; } - void alterantiveDisjunction() + void alternativeDisjunction() { int newAlternativeIndex = m_bodyDisjunction->terms.size(); m_bodyDisjunction->terms[m_currentAlternativeIndex].alternative.next = newAlternativeIndex - m_currentAlternativeIndex; @@ -1515,9 +1515,9 @@ public: if (alt) { if (disjunction == m_pattern.m_body) - alterantiveBodyDisjunction(); + alternativeBodyDisjunction(); else - alterantiveDisjunction(); + alternativeDisjunction(); } PatternAlternative* alternative = disjunction->m_alternatives[alt]; diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp index d777424..5ce579a 100644 --- a/JavaScriptCore/yarr/RegexJIT.cpp +++ b/JavaScriptCore/yarr/RegexJIT.cpp @@ -1264,7 +1264,7 @@ class RegexGenerator : private MacroAssembler { // complex here in compilation, and in the common case we should end up coallescing the checks. // // FIXME: a nice improvement here may be to stop trying to match sooner, based on the least - // of the minimum-alterantive-lengths. E.g. if I have two alternatives of length 200 and 150, + // of the minimum-alternative-lengths. E.g. if I have two alternatives of length 200 and 150, // and a string of length 100, we'll end up looping index from 0 to 100, checking whether there // is sufficient input to run either alternative (constantly failing). If there had been only // one alternative, or if the shorter alternative had come first, we would have terminated @@ -1309,9 +1309,6 @@ class RegexGenerator : private MacroAssembler { loadPtr(Address(X86Registers::ebp, 2 * sizeof(void*)), output); #endif #elif PLATFORM(ARM) -#if PLATFORM(ARM_TRADITIONAL) - push(ARMRegisters::lr); -#endif push(ARMRegisters::r4); push(ARMRegisters::r5); push(ARMRegisters::r6); @@ -1400,14 +1397,6 @@ void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const } } -int executeRegex(RegexCodeBlock& jitObject, const UChar* input, unsigned start, unsigned length, int* output, int outputArraySize) -{ - if (JSRegExp* fallback = jitObject.getFallback()) - return (jsRegExpExecute(fallback, input, length, start, output, outputArraySize) < 0) ? -1 : output[0]; - - return jitObject.execute(input, start, length, output); -} - }} #endif diff --git a/JavaScriptCore/yarr/RegexJIT.h b/JavaScriptCore/yarr/RegexJIT.h index 5b0df9d..1872f21 100644 --- a/JavaScriptCore/yarr/RegexJIT.h +++ b/JavaScriptCore/yarr/RegexJIT.h @@ -82,7 +82,14 @@ private: }; void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase = false, bool multiline = false); -int executeRegex(RegexCodeBlock& jitObject, const UChar* input, unsigned start, unsigned length, int* output, int outputArraySize); + +inline int executeRegex(RegexCodeBlock& jitObject, const UChar* input, unsigned start, unsigned length, int* output, int outputArraySize) +{ + if (JSRegExp* fallback = jitObject.getFallback()) + return (jsRegExpExecute(fallback, input, length, start, output, outputArraySize) < 0) ? -1 : output[0]; + + return jitObject.execute(input, start, length, output); +} } } // namespace JSC::Yarr |
