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

Unified Diff: src/ast.h

Issue 18842: Experimental: periodic merge of the bleeding_edge branch to the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 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
« no previous file with comments | « src/assembler-ia32-inl.h ('k') | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
===================================================================
--- src/ast.h (revision 1168)
+++ src/ast.h (working copy)
@@ -78,6 +78,7 @@
V(RegExpLiteral) \
V(ObjectLiteral) \
V(ArrayLiteral) \
+ V(CatchExtensionObject) \
V(Assignment) \
V(Throw) \
V(Property) \
@@ -728,6 +729,26 @@
};
+// Node for constructing a context extension object for a catch block.
+// The catch context extension object has one property, the catch
+// variable, which should be DontDelete.
+class CatchExtensionObject: public Expression {
+ public:
+ CatchExtensionObject(Literal* key, VariableProxy* value)
+ : key_(key), value_(value) {
+ }
+
+ virtual void Accept(AstVisitor* v);
+
+ Literal* key() const { return key_; }
+ VariableProxy* value() const { return value_; }
+
+ private:
+ Literal* key_;
+ VariableProxy* value_;
+};
+
+
class VariableProxy: public Expression {
public:
virtual void Accept(AstVisitor* v);
@@ -1238,6 +1259,7 @@
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success) = 0;
virtual bool IsTextElement() { return false; }
+ virtual bool IsAnchored() { return false; }
virtual int min_match() = 0;
virtual int max_match() = 0;
// Returns the interval of registers used for captures within this
@@ -1262,6 +1284,7 @@
virtual RegExpDisjunction* AsDisjunction();
virtual Interval CaptureRegisters();
virtual bool IsDisjunction();
+ virtual bool IsAnchored();
virtual int min_match() { return min_match_; }
virtual int max_match() { return max_match_; }
ZoneList<RegExpTree*>* alternatives() { return alternatives_; }
@@ -1281,6 +1304,7 @@
virtual RegExpAlternative* AsAlternative();
virtual Interval CaptureRegisters();
virtual bool IsAlternative();
+ virtual bool IsAnchored();
virtual int min_match() { return min_match_; }
virtual int max_match() { return max_match_; }
ZoneList<RegExpTree*>* nodes() { return nodes_; }
@@ -1307,6 +1331,7 @@
RegExpNode* on_success);
virtual RegExpAssertion* AsAssertion();
virtual bool IsAssertion();
+ virtual bool IsAnchored();
virtual int min_match() { return 0; }
virtual int max_match() { return 0; }
Type type() { return type_; }
@@ -1367,7 +1392,7 @@
// W : non-ASCII word character
// d : ASCII digit
// D : non-ASCII digit
- // . : non-unicode newline
+ // . : non-unicode non-newline
// * : All characters
uc16 standard_type() { return set_.standard_set_type(); }
ZoneList<CharacterRange>* ranges() { return set_.ranges(); }
@@ -1480,6 +1505,7 @@
RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpCapture* AsCapture();
+ virtual bool IsAnchored();
virtual Interval CaptureRegisters();
virtual bool IsCapture();
virtual int min_match() { return body_->min_match(); }
@@ -1501,22 +1527,33 @@
class RegExpLookahead: public RegExpTree {
public:
- RegExpLookahead(RegExpTree* body, bool is_positive)
+ RegExpLookahead(RegExpTree* body,
+ bool is_positive,
+ int capture_count,
+ int capture_from)
: body_(body),
- is_positive_(is_positive) { }
+ is_positive_(is_positive),
+ capture_count_(capture_count),
+ capture_from_(capture_from) { }
+
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpLookahead* AsLookahead();
virtual Interval CaptureRegisters();
virtual bool IsLookahead();
+ virtual bool IsAnchored();
virtual int min_match() { return 0; }
virtual int max_match() { return 0; }
RegExpTree* body() { return body_; }
bool is_positive() { return is_positive_; }
+ int capture_count() { return capture_count_; }
+ int capture_from() { return capture_from_; }
private:
RegExpTree* body_;
bool is_positive_;
+ int capture_count_;
+ int capture_from_;
};
« no previous file with comments | « src/assembler-ia32-inl.h ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698