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

Unified Diff: src/jsregexp.cc

Issue 9771: Propagation of choice start set. (Closed)
Patch Set: Created 12 years, 1 month 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/jsregexp.h ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index d09d2fa336d9cadc287edb81e9a62254cc00ccc1..1afaccfbf55694c4149be405b57c699437afb344 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -1545,6 +1545,21 @@ void Analysis::VisitEnd(EndNode* that) {
}
+class AddDispatchRange {
+ public:
+ AddDispatchRange(Analysis* analysis) : analysis_(analysis) { }
+ void Call(uc32 from, DispatchTable::Entry entry);
+ private:
+ Analysis* analysis_;
+};
+
+
+void AddDispatchRange::Call(uc32 from, DispatchTable::Entry entry) {
+ CharacterRange range(from, entry.to());
+ analysis_->table()->AddRange(range, analysis_->choice_index());
+}
+
+
void Analysis::VisitChoice(ChoiceNode* node) {
if (node->visited()) return;
node->set_visited(true);
@@ -1556,6 +1571,9 @@ void Analysis::VisitChoice(ChoiceNode* node) {
data.Analyze(choices->at(i).node());
}
node->set_visited(false);
+ if (table() != NULL) {
+ data.table()->ForEach(AddDispatchRange(this));
+ }
}
« no previous file with comments | « src/jsregexp.h ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698