Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1409)

Unified Diff: src/regexp/regexp-parser.cc

Issue 2813893002: [regexp] Consider surrogate pairs when optimizing disjunctions (Closed)
Patch Set: DCHECK(!IsLeadSurrogate) Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/regexp/regexp-ast.h ('k') | test/mjsunit/regress/regress-641091.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-parser.cc
diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc
index 3d2261a9199f02638c710579b083369451ba581a..a860959dc67911bf9e3ce07464e89bbcbb9fa372 100644
--- a/src/regexp/regexp-parser.cc
+++ b/src/regexp/regexp-parser.cc
@@ -283,8 +283,7 @@ RegExpTree* RegExpParser::ParseDisjunction() {
CharacterRange::AddClassEscape('.', ranges, false, zone());
}
- RegExpCharacterClass* cc =
- new (zone()) RegExpCharacterClass(ranges, false);
+ RegExpCharacterClass* cc = new (zone()) RegExpCharacterClass(ranges);
builder->AddCharacterClass(cc);
break;
}
@@ -392,7 +391,7 @@ RegExpTree* RegExpParser::ParseDisjunction() {
CharacterRange::AddClassEscape(c, ranges,
unicode() && ignore_case(), zone());
RegExpCharacterClass* cc =
- new (zone()) RegExpCharacterClass(ranges, false);
+ new (zone()) RegExpCharacterClass(ranges);
builder->AddCharacterClass(cc);
break;
}
@@ -408,7 +407,7 @@ RegExpTree* RegExpParser::ParseDisjunction() {
return ReportError(CStrVector("Invalid property name"));
}
RegExpCharacterClass* cc =
- new (zone()) RegExpCharacterClass(ranges, false);
+ new (zone()) RegExpCharacterClass(ranges);
builder->AddCharacterClass(cc);
} else {
// With /u, no identity escapes except for syntax characters
@@ -1548,7 +1547,9 @@ RegExpTree* RegExpParser::ParseCharacterClass() {
ranges->Add(CharacterRange::Everything(), zone());
is_negated = !is_negated;
}
- return new (zone()) RegExpCharacterClass(ranges, is_negated);
+ RegExpCharacterClass::Flags flags;
+ if (is_negated) flags = RegExpCharacterClass::NEGATED;
+ return new (zone()) RegExpCharacterClass(ranges, flags);
}
@@ -1722,7 +1723,7 @@ void RegExpBuilder::AddCharacterClass(RegExpCharacterClass* cc) {
void RegExpBuilder::AddCharacterClassForDesugaring(uc32 c) {
AddTerm(new (zone()) RegExpCharacterClass(
- CharacterRange::List(zone(), CharacterRange::Singleton(c)), false));
+ CharacterRange::List(zone(), CharacterRange::Singleton(c))));
}
« no previous file with comments | « src/regexp/regexp-ast.h ('k') | test/mjsunit/regress/regress-641091.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698