[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
barraclough at apple.com
barraclough at apple.com
Wed Dec 22 17:50:17 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1a56bac0f607f87881750877c306b7b9643299f2
Author: barraclough at apple.com <barraclough at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 1 02:46:28 2010 +0000
JavaScriptCore: Fixed review comments following bug #48101.
Mostly typos, plus gave quantifyInfinite a symbolic name.
Reviewed by Darin Adler.
* yarr/RegexCompiler.cpp:
(JSC::Yarr::RegexPatternConstructor::quantifyAtom):
(JSC::Yarr::RegexPatternConstructor::checkForTerminalParentheses):
* yarr/RegexInterpreter.cpp:
(JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
(JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
(JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
(JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
* yarr/RegexJIT.cpp:
(JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
(JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
(JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
* yarr/RegexParser.h:
(JSC::Yarr::Parser::parseTokens):
(JSC::Yarr::parse):
LayoutTests: Ooops, file checked in with incorrect properties.
Reviewed by Darin Adler.
* fast/regex/script-tests/repeat-match-waldemar.js: Removed property svn:executable.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 1b323c9..7df9712 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-11-30 Gavin Barraclough <barraclough at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fixed review comments following bug #48101.
+ Mostly typos, plus gave quantifyInfinite a symbolic name.
+
+ * yarr/RegexCompiler.cpp:
+ (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
+ (JSC::Yarr::RegexPatternConstructor::checkForTerminalParentheses):
+ * yarr/RegexInterpreter.cpp:
+ (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
+ (JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
+ (JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
+ (JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
+ (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
+ (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
+ * yarr/RegexParser.h:
+ (JSC::Yarr::Parser::parseTokens):
+ (JSC::Yarr::parse):
+
2010-11-30 Steve Falkenburg <sfalken at apple.com>
Reviewed by Darin Adler.
@@ -233,16 +256,16 @@
Bug 48101 - Yarr gives different results for /(?:a*?){2,}/
- The test cases in the linked mozilla bug demostrate a couple of
+ The test cases in the linked mozilla bug demonstrate a couple of
problems in subpattern matching. These bugs lie in the optimized
cases - for matching parentheses with a quantity count of 1, and
for matching greedy quantified parentheses at the end of a regex
(which do not backtrack).
In both of these cases we are failing to correctly handle empty
- matches. In the case of parenthese-single matches (quantity count
+ matches. In the case of parentheses-single matches (quantity count
one) we are failing to test for empty matches at all. In the case
- of terminal subpattern matches we do currenty check, however there
+ of terminal subpattern matches we do currently check, however there
is a subtler bug here too. In the case of an empty match we will
presently immediately fall through to the next alternative (or
complete the regex match), whereas upon a failed match we should
@@ -254,7 +277,7 @@
which point the non-greedy a?? will match, and as such the result
should be "ab", not "a").
- Terminal sunpattern matching contains a second bug, too. The frame
+ Terminal subpattern matching contains a second bug, too. The frame
location values in the subpattern should be being allocated with
the outer disjunction's frame (as we do for the parentheses-single
optimization). Consider the following three regexes:
diff --git a/JavaScriptCore/yarr/RegexCompiler.cpp b/JavaScriptCore/yarr/RegexCompiler.cpp
index 06ecbad..a56b5b9 100644
--- a/JavaScriptCore/yarr/RegexCompiler.cpp
+++ b/JavaScriptCore/yarr/RegexCompiler.cpp
@@ -595,7 +595,7 @@ public:
term.quantify(min, QuantifierFixedCount);
m_alternative->m_terms.append(copyTerm(term));
// NOTE: this term is interesting from an analysis perspective, in that it can be ignored.....
- m_alternative->lastTerm().quantify((max == UINT_MAX) ? max : max - min, greedy ? QuantifierGreedy : QuantifierNonGreedy);
+ m_alternative->lastTerm().quantify((max == quantifyInfinite) ? max : max - min, greedy ? QuantifierGreedy : QuantifierNonGreedy);
if (m_alternative->lastTerm().type == PatternTerm::TypeParenthesesSubpattern)
m_alternative->lastTerm().parentheses.isCopy = true;
}
@@ -734,7 +734,8 @@ public:
// This optimization identifies sets of parentheses that we will never need to backtrack.
// In these cases we do not need to store state from prior iterations.
// We can presently avoid backtracking for:
- // * a set of parens at the end of the regular expression (last term in any of the alternatives of the main body disjunction).
+ // * where the parens are at the end of the regular expression (last term in any of the
+ // alternatives of the main body disjunction).
// * where the parens are non-capturing, and quantified unbounded greedy (*).
// * where the parens do not contain any capturing subpatterns.
void checkForTerminalParentheses()
@@ -745,13 +746,13 @@ public:
return;
Vector<PatternAlternative*>& alternatives = m_pattern.m_body->m_alternatives;
- for (unsigned i =0; i < alternatives.size(); ++i) {
+ for (size_t i = 0; i < alternatives.size(); ++i) {
Vector<PatternTerm>& terms = alternatives[i]->m_terms;
if (terms.size()) {
PatternTerm& term = terms.last();
if (term.type == PatternTerm::TypeParenthesesSubpattern
&& term.quantityType == QuantifierGreedy
- && term.quantityCount == UINT_MAX
+ && term.quantityCount == quantifyInfinite
&& !term.capture())
term.parentheses.isTerminal = true;
}
diff --git a/JavaScriptCore/yarr/RegexInterpreter.cpp b/JavaScriptCore/yarr/RegexInterpreter.cpp
index 164158e..f362f6f 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.cpp
+++ b/JavaScriptCore/yarr/RegexInterpreter.cpp
@@ -719,7 +719,7 @@ public:
if (term.capture()) {
// Technically this access to inputPosition should be accessing the begin term's
// inputPosition, but for repeats other than fixed these values should be
- // the same anyway! (we don't pre-check for greedy or non-greedy matches.)
+ // the same anyway! (We don't pre-check for greedy or non-greedy matches.)
ASSERT((&term - term.atom.parenthesesWidth)->type == ByteTerm::TypeParenthesesSubpatternOnceBegin);
ASSERT((&term - term.atom.parenthesesWidth)->inputPosition == term.inputPosition);
unsigned subpatternId = term.atom.subpatternId;
@@ -739,7 +739,7 @@ public:
{
ASSERT(term.type == ByteTerm::TypeParenthesesSubpatternTerminalBegin);
ASSERT(term.atom.quantityType == QuantifierGreedy);
- ASSERT(term.atom.quantityCount == UINT_MAX);
+ ASSERT(term.atom.quantityCount == quantifyInfinite);
ASSERT(!term.capture());
BackTrackInfoParenthesesTerminal* backTrack = reinterpret_cast<BackTrackInfoParenthesesTerminal*>(context->frame + term.frameLocation);
@@ -765,7 +765,7 @@ public:
{
ASSERT(term.type == ByteTerm::TypeParenthesesSubpatternTerminalBegin);
ASSERT(term.atom.quantityType == QuantifierGreedy);
- ASSERT(term.atom.quantityCount == UINT_MAX);
+ ASSERT(term.atom.quantityCount == quantifyInfinite);
ASSERT(!term.capture());
// If we backtrack to this point, we have failed to match this iteration of the parens.
@@ -777,7 +777,7 @@ public:
bool backtrackParenthesesTerminalEnd(ByteTerm&, DisjunctionContext*)
{
// 'Terminal' parentheses are at the end of the regex, and as such a match past end
- // should always be returned as a successful match - we should never becktrack to here.
+ // should always be returned as a successful match - we should never backtrack to here.
ASSERT_NOT_REACHED();
return false;
}
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index acbd458..1eac667 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -624,7 +624,7 @@ class RegexGenerator : private MacroAssembler {
add32(Imm32(1), countRegister);
add32(Imm32(1), index);
- if (term.quantityCount != 0xffffffff) {
+ if (term.quantityCount != quantifyInfinite) {
branch32(NotEqual, countRegister, Imm32(term.quantityCount)).linkTo(loop, this);
failures.append(jump());
} else
@@ -662,7 +662,7 @@ class RegexGenerator : private MacroAssembler {
loadFromFrame(term.frameLocation, countRegister);
atEndOfInput().linkTo(hardFail, this);
- if (term.quantityCount != 0xffffffff)
+ if (term.quantityCount != quantifyInfinite)
branch32(Equal, countRegister, Imm32(term.quantityCount), hardFail);
if (m_pattern.m_ignoreCase && isASCIIAlpha(ch)) {
readCharacter(state.inputOffset(), character);
@@ -749,7 +749,7 @@ class RegexGenerator : private MacroAssembler {
add32(Imm32(1), countRegister);
add32(Imm32(1), index);
- if (term.quantityCount != 0xffffffff) {
+ if (term.quantityCount != quantifyInfinite) {
branch32(NotEqual, countRegister, Imm32(term.quantityCount)).linkTo(loop, this);
failures.append(jump());
} else
diff --git a/JavaScriptCore/yarr/RegexParser.h b/JavaScriptCore/yarr/RegexParser.h
index f964be4..8392cdf 100644
--- a/JavaScriptCore/yarr/RegexParser.h
+++ b/JavaScriptCore/yarr/RegexParser.h
@@ -33,6 +33,8 @@
namespace JSC { namespace Yarr {
+static const unsigned quantifyInfinite = UINT_MAX;
+
enum BuiltInCharacterClassID {
DigitClassID,
SpaceClassID,
@@ -594,13 +596,13 @@ private:
case '*':
consume();
- parseQuantifier(lastTokenWasAnAtom, 0, UINT_MAX);
+ parseQuantifier(lastTokenWasAnAtom, 0, quantifyInfinite);
lastTokenWasAnAtom = false;
break;
case '+':
consume();
- parseQuantifier(lastTokenWasAnAtom, 1, UINT_MAX);
+ parseQuantifier(lastTokenWasAnAtom, 1, quantifyInfinite);
lastTokenWasAnAtom = false;
break;
@@ -619,7 +621,7 @@ private:
unsigned max = min;
if (tryConsume(','))
- max = peekIsDigit() ? consumeNumber() : UINT_MAX;
+ max = peekIsDigit() ? consumeNumber() : quantifyInfinite;
if (tryConsume('}')) {
if (min <= max)
@@ -861,7 +863,7 @@ private:
*/
template<class Delegate>
-const char* parse(Delegate& delegate, const UString& pattern, unsigned backReferenceLimit = UINT_MAX)
+const char* parse(Delegate& delegate, const UString& pattern, unsigned backReferenceLimit = quantifyInfinite)
{
return Parser<Delegate>(delegate, pattern, backReferenceLimit).parse();
}
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e36c440..aee850b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-30 Gavin Barraclough <barraclough at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Ooops, file checked in with incorrect properties.
+
+ * fast/regex/script-tests/repeat-match-waldemar.js: Removed property svn:executable.
+
2010-11-30 Martin Robinson <mrobinson at igalia.com>
Rebaseline a GTK+ test.
diff --git a/LayoutTests/fast/regex/script-tests/repeat-match-waldemar.js b/LayoutTests/fast/regex/script-tests/repeat-match-waldemar.js
old mode 100755
new mode 100644
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list