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

Unified Diff: src/ast.h

Issue 149069: Changed RegExp parser to use a recursive data structure instead of stack-based recursion. (Closed)
Patch Set: Removed static nonparticipating capture optimization. Not worth the complexity. Created 11 years, 6 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 | « no previous file | src/parser.cc » ('j') | src/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 15d762f051fad9b51e085ed0b8b74122a9e7c105..64d61cca351b8d944bb693de4640f9cead847471 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1575,16 +1575,10 @@ class RegExpQuantifier: public RegExpTree {
};
-enum CaptureAvailability {
- CAPTURE_AVAILABLE,
- CAPTURE_UNREACHABLE,
- CAPTURE_PERMANENTLY_UNREACHABLE
-};
-
class RegExpCapture: public RegExpTree {
public:
explicit RegExpCapture(RegExpTree* body, int index)
- : body_(body), index_(index), available_(CAPTURE_AVAILABLE) { }
+ : body_(body), index_(index) { }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
@@ -1600,16 +1594,11 @@ class RegExpCapture: public RegExpTree {
virtual int max_match() { return body_->max_match(); }
RegExpTree* body() { return body_; }
int index() { return index_; }
- inline CaptureAvailability available() { return available_; }
- inline void set_available(CaptureAvailability availability) {
- available_ = availability;
- }
static int StartRegister(int index) { return index * 2; }
static int EndRegister(int index) { return index * 2 + 1; }
private:
RegExpTree* body_;
int index_;
- CaptureAvailability available_;
};
« no previous file with comments | « no previous file | src/parser.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698