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

Unified Diff: src/jsregexp.cc

Issue 10383280: Remove unnecessary code for non-zero-length global regexps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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
Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index cbd0b26a2acc6b30003cbe5183a4bc68609bd858..cc067955873cc63f79fca26c416a2f8dea9deac4 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -5901,7 +5901,12 @@ RegExpEngine::CompilationResult RegExpEngine::Compile(
macro_assembler.SetCurrentPositionFromEnd(max_length);
}
- macro_assembler.set_global(is_global);
+ if (is_global) {
+ macro_assembler.set_global_flag(
+ (data->tree->min_match() > 0)
+ ? RegExpMacroAssembler::GLOBAL_NO_ZERO_LENGTH_MATCH
+ : RegExpMacroAssembler::GLOBAL);
+ }
return compiler.Assemble(&macro_assembler,
node,

Powered by Google App Engine
This is Rietveld 408576698