[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
msaboff at apple.com
msaboff at apple.com
Wed Dec 22 18:33:09 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit cb86672292dfd30f3b172ecee0dc77f755c302a9
Author: msaboff at apple.com <msaboff at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 13 22:19:48 2010 +0000
2010-12-13 Michael Saboff <msaboff at apple.com>
Reviewed by Oliver Hunt.
REGRESSION: mobileme mail viewing is broken
https://bugs.webkit.org/show_bug.cgi?id=50884
Fixed problem where simple parenthesis (those without capture and
with a fixed count) where not propagating backtrack to labels for
nested parentheses. Also added the nesting level for the parentheses
state created in that case as well.
* yarr/RegexJIT.cpp:
(JSC::Yarr::RegexGenerator::BacktrackDestination::copyBacktrackToLabel):
(JSC::Yarr::RegexGenerator::TermGenerationState::isLastTerm):
(JSC::Yarr::RegexGenerator::ParenthesesTail::generateCode):
(JSC::Yarr::RegexGenerator::generateParenthesesSingle):
2010-12-13 Michael Saboff <msaboff at apple.com>
Reviewed by Oliver Hunt.
REGRESSION: mobileme mail viewing is broken
https://bugs.webkit.org/show_bug.cgi?id=50884
Added a test to check parentheses nesting within parentheses that
don't capture and that are fixed count. There is special handling
for this case in the RegExp JIT code.
* fast/regex/parentheses-expected.txt:
* fast/regex/script-tests/parentheses.js:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 16f5e5e..72cf626 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-13 Michael Saboff <msaboff at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ REGRESSION: mobileme mail viewing is broken
+ https://bugs.webkit.org/show_bug.cgi?id=50884
+
+ Fixed problem where simple parenthesis (those without capture and
+ with a fixed count) where not propagating backtrack to labels for
+ nested parentheses. Also added the nesting level for the parentheses
+ state created in that case as well.
+
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::BacktrackDestination::copyBacktrackToLabel):
+ (JSC::Yarr::RegexGenerator::TermGenerationState::isLastTerm):
+ (JSC::Yarr::RegexGenerator::ParenthesesTail::generateCode):
+ (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
+
2010-12-13 Peter Varga <pvarga at inf.u-szeged.hu>
Reviewed by Gavin Barraclough.
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index e8d39e5..9e562f7 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -572,6 +572,12 @@ class RegexGenerator : private MacroAssembler {
m_nextBacktrack->setLabel(label);
}
+ void copyBacktrackToLabel(BacktrackDestination& rhs)
+ {
+ if (rhs.m_backtrackToLabel)
+ m_backtrackToLabel = rhs.m_backtrackToLabel;
+ }
+
void setBacktrackToLabel(Label* backtrackToLabel)
{
if (!m_backtrackToLabel)
@@ -819,7 +825,7 @@ class RegexGenerator : private MacroAssembler {
{
ASSERT(alternativeValid());
return (t + 1) == alternative()->m_terms.size();
- }
+ }
unsigned getSubParenNum()
{
return m_subParenNum++;
@@ -828,7 +834,7 @@ class RegexGenerator : private MacroAssembler {
{
return !disjunction->m_parent;
}
-
+
void setParenthesesTail(ParenthesesTail* parenthesesTail)
{
m_parenthesesTail = parenthesesTail;
@@ -838,7 +844,7 @@ class RegexGenerator : private MacroAssembler {
{
return m_parenthesesTail;
}
-
+
PatternTerm& lookaheadTerm()
{
ASSERT(alternativeValid());
@@ -1082,7 +1088,7 @@ class RegexGenerator : private MacroAssembler {
if (needJumpForPriorParenTail)
fromPriorBacktrack.link(generator);
m_parenBacktrack.linkAlternativeBacktracks(generator);
- m_withinBacktrackJumps.link(generator);
+ m_withinBacktrackJumps.link(generator);
if (m_term.capture())
generator->store32(Imm32(-1), Address(output, (m_term.parentheses.subpatternId << 1) * sizeof(int)));
@@ -1602,12 +1608,18 @@ class RegexGenerator : private MacroAssembler {
// optimized case - no capture & no quantifier can be handled in a light-weight manner.
if (!term.capture() && (term.quantityType == QuantifierFixedCount)) {
+ m_expressionState.incrementParenNestingLevel();
+
TermGenerationState parenthesesState(disjunction, state.checkedTotal);
generateParenthesesDisjunction(state.term(), parenthesesState, alternativeFrameLocation);
// this expects that any backtracks back out of the parentheses will be in the
// parenthesesState's m_backTrackJumps vector, and that if they need backtracking
// they will have set an entry point on the parenthesesState's m_backtrackLabel.
- state.propagateBacktrackingFrom(this, parenthesesState.getBacktrackDestination());
+ BacktrackDestination& parenthesesBacktrack = parenthesesState.getBacktrackDestination();
+ state.propagateBacktrackingFrom(this, parenthesesBacktrack);
+ state.getBacktrackDestination().copyBacktrackToLabel(parenthesesBacktrack);
+
+ m_expressionState.decrementParenNestingLevel();
} else {
Jump nonGreedySkipParentheses;
Label nonGreedyTryParentheses;
@@ -1636,7 +1648,7 @@ class RegexGenerator : private MacroAssembler {
m_expressionState.incrementParenNestingLevel();
TermGenerationState parenthesesState(disjunction, state.checkedTotal);
-
+
// Save the parenthesesTail for backtracking from nested parens to this one.
parenthesesState.setParenthesesTail(parenthesesTail);
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ae5dabc..ad2a1d2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-12-13 Michael Saboff <msaboff at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ REGRESSION: mobileme mail viewing is broken
+ https://bugs.webkit.org/show_bug.cgi?id=50884
+
+ Added a test to check parentheses nesting within parentheses that
+ don't capture and that are fixed count. There is special handling
+ for this case in the RegExp JIT code.
+
+ * fast/regex/parentheses-expected.txt:
+ * fast/regex/script-tests/parentheses.js:
+
2010-12-13 Chris Fleizach <cfleizach at apple.com>
Reviewed by Beth Dakin.
diff --git a/LayoutTests/fast/regex/parentheses-expected.txt b/LayoutTests/fast/regex/parentheses-expected.txt
index 5a24251..3151aff 100644
--- a/LayoutTests/fast/regex/parentheses-expected.txt
+++ b/LayoutTests/fast/regex/parentheses-expected.txt
@@ -37,6 +37,7 @@ PASS regexp29.exec('Committer:') is null
PASS regexp30.exec('Committer:') is null
PASS regexp31.exec('Committer:') is null
PASS regexp32.exec('Committer:') is null
+PASS regexp33.exec('> <head>') is ['>',undefined,undefined,'>']
PASS 'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/) is ['Bob',undefined,'Bob',undefined,undefined]
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/regex/script-tests/parentheses.js b/LayoutTests/fast/regex/script-tests/parentheses.js
index bb7aeb6..e7b5eb0 100644
--- a/LayoutTests/fast/regex/script-tests/parentheses.js
+++ b/LayoutTests/fast/regex/script-tests/parentheses.js
@@ -137,6 +137,9 @@ shouldBeNull("regexp31.exec('Committer:')");
var regexp32 = /\s*(m(\[[^\]]+\])|m(u?)("[^"]+"))\s*/;
shouldBeNull("regexp32.exec('Committer:')");
+var regexp33 = RegExp('^(?:(?:(a)(xyz|[^>"\'\s]*)?)|(/?>)|.[^\w\s>]*)');
+shouldBe("regexp33.exec('> <head>')","['>',undefined,undefined,'>']");
+
shouldBe("'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/)", "['Bob',undefined,'Bob',undefined,undefined]");
var successfullyParsed = true;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list