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

Unified Diff: runtime/vm/ast.h

Issue 18649003: Partial solution to analyze potentially constant expressions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/lib/symbol_patch.dart ('k') | runtime/vm/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
===================================================================
--- runtime/vm/ast.h (revision 24703)
+++ runtime/vm/ast.h (working copy)
@@ -128,6 +128,8 @@
return NULL;
}
+ virtual bool IsPotentiallyConst() const { return false; }
+
// Analyzes an expression to determine whether it is a compile time
// constant or not. Returns NULL if the expression is not a compile time
// constant. Otherwise, the return value is an approximation of the
@@ -327,6 +329,7 @@
const Instance& literal() const { return literal_; }
+ virtual bool IsPotentiallyConst() const;
virtual const Instance* EvalConstExpr() const {
return &literal();
}
@@ -436,7 +439,7 @@
}
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
-
+ virtual bool IsPotentiallyConst() const;
virtual const Instance* EvalConstExpr() const;
DECLARE_COMMON_NODE_FUNCTIONS(ClosureNode);
@@ -542,6 +545,7 @@
}
virtual const char* Name() const;
+ virtual bool IsPotentiallyConst() const;
virtual const Instance* EvalConstExpr() const;
DECLARE_COMMON_NODE_FUNCTIONS(ComparisonNode);
@@ -579,6 +583,7 @@
}
virtual const char* Name() const;
+ virtual bool IsPotentiallyConst() const;
virtual const Instance* EvalConstExpr() const;
DECLARE_COMMON_NODE_FUNCTIONS(BinaryOpNode);
@@ -616,6 +621,7 @@
}
virtual const char* Name() const;
+ virtual bool IsPotentiallyConst() const;
virtual const Instance* EvalConstExpr() const;
DECLARE_COMMON_NODE_FUNCTIONS(UnaryOpNode);
@@ -958,6 +964,7 @@
virtual void VisitChildren(AstNodeVisitor* visitor) const { }
virtual const Instance* EvalConstExpr() const;
+ virtual bool IsPotentiallyConst() const;
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
DECLARE_COMMON_NODE_FUNCTIONS(LoadLocalNode);
@@ -1323,6 +1330,7 @@
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
+ virtual bool IsPotentiallyConst() const;
virtual const Instance* EvalConstExpr() const;
DECLARE_COMMON_NODE_FUNCTIONS(StaticGetterNode);
« no previous file with comments | « runtime/lib/symbol_patch.dart ('k') | runtime/vm/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698