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

Unified Diff: src/ast.h

Issue 660449: Initial implementation of an edge-labeled instruction flow graph. (Closed)
Patch Set: Remove unused depth-first search function. Created 10 years, 10 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/compiler.cc » ('j') | src/data-flow.h » ('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 ba8b9806c122526a86e2db13a1e43a84df865e12..2f2a0bb9328746a3327dd0b067655847ab991b67 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -117,6 +117,9 @@ typedef ZoneList<Handle<Object> > ZoneObjectList;
class AstNode: public ZoneObject {
public:
+ static const int kNoNumber = -1;
+
+ AstNode() : num_(kNoNumber) {}
virtual ~AstNode() { }
virtual void Accept(AstVisitor* v) = 0;
@@ -141,6 +144,13 @@ class AstNode: public ZoneObject {
virtual ObjectLiteral* AsObjectLiteral() { return NULL; }
virtual ArrayLiteral* AsArrayLiteral() { return NULL; }
virtual CompareOperation* AsCompareOperation() { return NULL; }
+
+ int num() { return num_; }
+ void set_num(int n) { num_ = n; }
+
+ private:
+ // Support for ast node numbering.
+ int num_;
};
@@ -181,11 +191,8 @@ class Expression: public AstNode {
kTestValue
};
- static const int kNoLabel = -1;
-
Expression()
: bitfields_(0),
- num_(kNoLabel),
def_(NULL),
defined_vars_(NULL) {}
@@ -215,11 +222,6 @@ class Expression: public AstNode {
// Static type information for this expression.
StaticType* type() { return &type_; }
- int num() { return num_; }
-
- // AST node numbering ordered by evaluation order.
- void set_num(int n) { num_ = n; }
-
// Data flow information.
DefinitionInfo* var_def() { return def_; }
void set_var_def(DefinitionInfo* def) { def_ = def; }
@@ -261,7 +263,6 @@ class Expression: public AstNode {
uint32_t bitfields_;
StaticType type_;
- int num_;
DefinitionInfo* def_;
ZoneList<DefinitionInfo*>* defined_vars_;
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | src/data-flow.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698