Commit 8bebb7df authored by msaboff@apple.com's avatar msaboff@apple.com

2010-06-28 Michael Saboff <msaboff@apple.com>

        Reviewed by Darin Adler.

        Bug 41238 - RegExp performance slow on Dromaeo benchmark

        Other javascript engines appear to cache prior results of regular 
        expression operations.

        Suggest adding some sort of caching mechanism to regular expression 
        processing.

        Added a single entry cache of match() results to RegExp class.

        Also added performance improvements to UString == operator.
        First check the impls for equality.  Then get the length of
        each of the non-null impls.  Next check the sizes for equality.
        Then check the data for the case of different impls that point 
        to the same data (most likely due to substrings from the beginning of
        another string).  Lastly we check the underlying data for equality.

        Refactored Vector<>::operator=() method into a separate copy() method 
        that it calls.  The copy() method is explicitly used for deep copying.

        * runtime/RegExp.cpp:
        (JSC::RegExp::RegExp):
        (JSC::RegExp::match):
        * runtime/RegExp.h:
        * runtime/UString.h:
        (JSC::operator==):
        * wtf/Vector.h:
        (WTF::::operator):
        (WTF::::copy):

2010-12-09  Michael Saboff  <msaboff@apple.com>

        Reviewed by Darin Adler.

        Added test to verify proper operation of backtrack labels.
        https://bugs.webkit.org/show_bug.cgi?id=50579

        * fast/regex/parentheses-expected.txt:
        * fast/regex/script-tests/parentheses.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 67dc2b25
2010-06-28 Michael Saboff <msaboff@apple.com>
Reviewed by Darin Adler.
Bug 41238 - RegExp performance slow on Dromaeo benchmark
Other javascript engines appear to cache prior results of regular
expression operations.
Suggest adding some sort of caching mechanism to regular expression
processing.
Added a single entry cache of match() results to RegExp class.
Also added performance improvements to UString == operator.
First check the impls for equality. Then get the length of
each of the non-null impls. Next check the sizes for equality.
Then check the data for the case of different impls that point
to the same data (most likely due to substrings from the beginning of
another string). Lastly we check the underlying data for equality.
Refactored Vector<>::operator=() method into a separate copy() method
that it calls. The copy() method is explicitly used for deep copying.
* runtime/RegExp.cpp:
(JSC::RegExp::RegExp):
(JSC::RegExp::match):
* runtime/RegExp.h:
* runtime/UString.h:
(JSC::operator==):
* wtf/Vector.h:
(WTF::::operator):
(WTF::::copy):
<<<<<<< .mine
2010-12-09 Michael Saboff <msaboff@apple.com>
Reviewed by Darin Adler.
Changed setting of backtrack labels to not overwrite a prior
label. Where losing prior labe which then reverted back to
next character label.
https://bugs.webkit.org/show_bug.cgi?id=50579
* yarr/RegexJIT.cpp:
(JSC::Yarr::RegexGenerator::BacktrackDestination::setBacktrackToLabel):
=======
2010-12-08 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
......@@ -131,6 +179,7 @@
* JavaScriptCore.xcodeproj/project.pbxproj:
>>>>>>> .r73612
2010-12-08 Oliver Hunt <oliver@apple.com>
Reviewed by Gavin Barraclough.
......
......@@ -561,7 +561,8 @@ class RegexGenerator : private MacroAssembler {
void setBacktrackToLabel(Label* backtrackToLabel)
{
m_backtrackToLabel = backtrackToLabel;
if (!m_backtrackToLabel)
m_backtrackToLabel = backtrackToLabel;
}
void setBacktrackJumpList(JumpList* jumpList)
......
2010-12-09 Michael Saboff <msaboff@apple.com>
Reviewed by Darin Adler.
Added test to verify proper operation of backtrack labels.
https://bugs.webkit.org/show_bug.cgi?id=50579
* fast/regex/parentheses-expected.txt:
* fast/regex/script-tests/parentheses.js:
2010-12-09 Peter Beverloo <peter@lvp-media.com>
Reviewed by Maciej Stachowiak.
......
......@@ -30,6 +30,7 @@ PASS regexp23.exec('<html xmlns="http://www.w3.org/1999/xhtml"') is ['"http://ww
PASS regexp24.exec('123') is null
PASS regexp25.exec('this is a test') is ['this','this',undefined]
PASS regexp25.exec('!this is a test') is null
PASS regexp26.exec('aaa') is ['aaa',undefined,undefined]
PASS 'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/) is ['Bob',undefined,'Bob',undefined,undefined]
PASS successfullyParsed is true
......
......@@ -77,6 +77,9 @@ var regexp25 = /^\s*(\*|[\w\-]+)(\b|$)?/;
shouldBe("regexp25.exec('this is a test')", "['this','this',undefined]");
shouldBeNull("regexp25.exec('!this is a test')");
var regexp26 = /a(b)(a*)|aaa/;
shouldBe("regexp26.exec('aaa')", "['aaa',undefined,undefined]");
shouldBe("'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/)", "['Bob',undefined,'Bob',undefined,undefined]");
var successfullyParsed = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment