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

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

Issue 1630633002: [regexp] correctly advance zero length matches for global/unicode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@backrefbounds
Patch Set: Created 4 years, 11 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/regexp/regexp-macro-assembler.h
diff --git a/src/regexp/regexp-macro-assembler.h b/src/regexp/regexp-macro-assembler.h
index a80d961b1bd374e20e3527d4bc2294803ec36eb6..b236431bf234b624c4d26f85b6b2b4ceb1b545ee 100644
--- a/src/regexp/regexp-macro-assembler.h
+++ b/src/regexp/regexp-macro-assembler.h
@@ -160,21 +160,25 @@ class RegExpMacroAssembler {
void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; }
bool slow_safe() { return slow_safe_compiler_; }
- enum GlobalMode { NOT_GLOBAL, GLOBAL, GLOBAL_NO_ZERO_LENGTH_CHECK };
+ enum GlobalMode {
+ NOT_GLOBAL,
+ GLOBAL_NO_ZERO_LENGTH_CHECK,
+ GLOBAL,
+ GLOBAL_UNICODE
erikcorry 2016/01/27 10:31:31 You need a warning here that the ordering of the m
Yang 2016/01/27 12:19:20 I was thinking about adding a static check below,
+ };
// Set whether the regular expression has the global flag. Exiting due to
// a failure in a global regexp may still mean success overall.
inline void set_global_mode(GlobalMode mode) { global_mode_ = mode; }
inline bool global() { return global_mode_ != NOT_GLOBAL; }
- inline bool global_with_zero_length_check() {
- return global_mode_ == GLOBAL;
- }
+ inline bool global_with_zero_length_check() { return global_mode_ >= GLOBAL; }
+ inline bool global_unicode() { return global_mode_ == GLOBAL_UNICODE; }
Isolate* isolate() const { return isolate_; }
Zone* zone() const { return zone_; }
private:
bool slow_safe_compiler_;
- bool global_mode_;
+ GlobalMode global_mode_;
Isolate* isolate_;
Zone* zone_;
};

Powered by Google App Engine
This is Rietveld 408576698