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

Unified Diff: src/regexp/jsregexp.h

Issue 1451373003: Revert of Experimental support for RegExp lookbehind. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/regexp/interpreter-irregexp.cc ('k') | src/regexp/jsregexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/jsregexp.h
diff --git a/src/regexp/jsregexp.h b/src/regexp/jsregexp.h
index d6a74ea19d77159ff8e4c4332330273e37c89748..537bdff8e2ac43daeebaae9b47e3c71f4e726e5a 100644
--- a/src/regexp/jsregexp.h
+++ b/src/regexp/jsregexp.h
@@ -387,17 +387,17 @@
VISIT(Text)
-#define FOR_EACH_REG_EXP_TREE_TYPE(VISIT) \
- VISIT(Disjunction) \
- VISIT(Alternative) \
- VISIT(Assertion) \
- VISIT(CharacterClass) \
- VISIT(Atom) \
- VISIT(Quantifier) \
- VISIT(Capture) \
- VISIT(Lookaround) \
- VISIT(BackReference) \
- VISIT(Empty) \
+#define FOR_EACH_REG_EXP_TREE_TYPE(VISIT) \
+ VISIT(Disjunction) \
+ VISIT(Alternative) \
+ VISIT(Assertion) \
+ VISIT(CharacterClass) \
+ VISIT(Atom) \
+ VISIT(Quantifier) \
+ VISIT(Capture) \
+ VISIT(Lookahead) \
+ VISIT(BackReference) \
+ VISIT(Empty) \
VISIT(Text)
@@ -603,7 +603,7 @@
RegExpCompiler* compiler,
int characters_filled_in,
bool not_at_start) = 0;
- static const int kNodeIsTooComplexForGreedyLoops = kMinInt;
+ static const int kNodeIsTooComplexForGreedyLoops = -1;
virtual int GreedyLoopTextLength() { return kNodeIsTooComplexForGreedyLoops; }
// Only returns the successor for a text node of length 1 that matches any
// character and that has no guards on it.
@@ -827,14 +827,14 @@
class TextNode: public SeqRegExpNode {
public:
- TextNode(ZoneList<TextElement>* elms, bool read_backward,
- RegExpNode* on_success)
- : SeqRegExpNode(on_success), elms_(elms), read_backward_(read_backward) {}
- TextNode(RegExpCharacterClass* that, bool read_backward,
+ TextNode(ZoneList<TextElement>* elms,
RegExpNode* on_success)
: SeqRegExpNode(on_success),
- elms_(new (zone()) ZoneList<TextElement>(1, zone())),
- read_backward_(read_backward) {
+ elms_(elms) { }
+ TextNode(RegExpCharacterClass* that,
+ RegExpNode* on_success)
+ : SeqRegExpNode(on_success),
+ elms_(new(zone()) ZoneList<TextElement>(1, zone())) {
elms_->Add(TextElement::CharClass(that), zone());
}
virtual void Accept(NodeVisitor* visitor);
@@ -845,7 +845,6 @@
int characters_filled_in,
bool not_at_start);
ZoneList<TextElement>* elements() { return elms_; }
- bool read_backward() { return read_backward_; }
void MakeCaseIndependent(Isolate* isolate, bool is_one_byte);
virtual int GreedyLoopTextLength();
virtual RegExpNode* GetSuccessorOfOmnivorousTextNode(
@@ -874,7 +873,6 @@
int* checked_up_to);
int Length();
ZoneList<TextElement>* elms_;
- bool read_backward_;
};
@@ -927,16 +925,15 @@
class BackReferenceNode: public SeqRegExpNode {
public:
- BackReferenceNode(int start_reg, int end_reg, bool read_backward,
+ BackReferenceNode(int start_reg,
+ int end_reg,
RegExpNode* on_success)
: SeqRegExpNode(on_success),
start_reg_(start_reg),
- end_reg_(end_reg),
- read_backward_(read_backward) {}
+ end_reg_(end_reg) { }
virtual void Accept(NodeVisitor* visitor);
int start_register() { return start_reg_; }
int end_register() { return end_reg_; }
- bool read_backward() { return read_backward_; }
virtual void Emit(RegExpCompiler* compiler, Trace* trace);
virtual int EatsAtLeast(int still_to_find,
int recursion_depth,
@@ -953,7 +950,6 @@
private:
int start_reg_;
int end_reg_;
- bool read_backward_;
};
@@ -1078,7 +1074,6 @@
return true;
}
virtual RegExpNode* FilterOneByte(int depth, bool ignore_case);
- virtual bool read_backward() { return false; }
protected:
int GreedyLoopTextLengthForAlternative(GuardedAlternative* alternative);
@@ -1155,12 +1150,12 @@
class LoopChoiceNode: public ChoiceNode {
public:
- LoopChoiceNode(bool body_can_be_zero_length, bool read_backward, Zone* zone)
+ explicit LoopChoiceNode(bool body_can_be_zero_length, Zone* zone)
: ChoiceNode(2, zone),
loop_node_(NULL),
continue_node_(NULL),
- body_can_be_zero_length_(body_can_be_zero_length),
- read_backward_(read_backward) {}
+ body_can_be_zero_length_(body_can_be_zero_length)
+ { }
void AddLoopAlternative(GuardedAlternative alt);
void AddContinueAlternative(GuardedAlternative alt);
virtual void Emit(RegExpCompiler* compiler, Trace* trace);
@@ -1174,7 +1169,6 @@
RegExpNode* loop_node() { return loop_node_; }
RegExpNode* continue_node() { return continue_node_; }
bool body_can_be_zero_length() { return body_can_be_zero_length_; }
- virtual bool read_backward() { return read_backward_; }
virtual void Accept(NodeVisitor* visitor);
virtual RegExpNode* FilterOneByte(int depth, bool ignore_case);
@@ -1189,7 +1183,6 @@
RegExpNode* loop_node_;
RegExpNode* continue_node_;
bool body_can_be_zero_length_;
- bool read_backward_;
};
@@ -1445,7 +1438,9 @@
at_start_ == UNKNOWN;
}
TriBool at_start() { return at_start_; }
- void set_at_start(TriBool at_start) { at_start_ = at_start; }
+ void set_at_start(bool at_start) {
+ at_start_ = at_start ? TRUE_VALUE : FALSE_VALUE;
+ }
Label* backtrack() { return backtrack_; }
Label* loop_label() { return loop_label_; }
RegExpNode* stop_node() { return stop_node_; }
« no previous file with comments | « src/regexp/interpreter-irregexp.cc ('k') | src/regexp/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698