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

Unified Diff: src/regexp-macro-assembler.h

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
« no previous file with comments | « src/jsregexp.cc ('k') | src/regexp-macro-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp-macro-assembler.h
diff --git a/src/regexp-macro-assembler.h b/src/regexp-macro-assembler.h
index 5b2cf4aa8f5ce119cd5bcd246442a71166cf51fb..98d38ddc7acf38748e8ae977b5d60ac2b4a30113 100644
--- a/src/regexp-macro-assembler.h
+++ b/src/regexp-macro-assembler.h
@@ -184,14 +184,18 @@ class RegExpMacroAssembler {
void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; }
bool slow_safe() { return slow_safe_compiler_; }
+ enum GlobalFlag { NOT_GLOBAL, GLOBAL, GLOBAL_NO_ZERO_LENGTH_MATCH };
Erik Corry 2012/06/04 08:00:11 I think GlobalMode would be better than GlobalFlag
// Set whether the regular expression has the global flag. Exiting due to
// a failure in a global regexp may still mean success overall.
- void set_global(bool global) { global_ = global; }
- bool global() { return global_; }
+ inline void set_global_flag(GlobalFlag flag) { global_flag_ = flag; }
+ inline bool global() { return global_flag_ != NOT_GLOBAL; }
+ inline bool global_with_zero_length_match() {
Erik Corry 2012/06/04 08:00:11 global_with_zero_length_check()
+ return global_flag_ == GLOBAL;
+ }
private:
bool slow_safe_compiler_;
- bool global_;
+ bool global_flag_;
};
« no previous file with comments | « src/jsregexp.cc ('k') | src/regexp-macro-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698