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

Unified Diff: src/ast.h

Issue 876001: Initialize reaching definitions state for all flow graph nodes. (Closed)
Patch Set: Incorporated review comments. Created 10 years, 9 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') | no next file with comments »
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 174679ab83c138e3190e6bda3a158baabb89a9e3..205560f586106c8bc1e8c54576b14a64fb9558fa 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -204,6 +204,8 @@ class Expression: public AstNode {
virtual bool IsValidLeftHandSide() { return false; }
+ virtual Variable* AssignedVar() { return NULL; }
+
// Symbols that cannot be parsed as array indices are considered property
// names. We do not treat symbols that can be array indexes as property
// names because [] for string objects is handled only by keyed ICs.
@@ -1278,6 +1280,10 @@ class CountOperation: public Expression {
virtual CountOperation* AsCountOperation() { return this; }
+ virtual Variable* AssignedVar() {
+ return expression()->AsVariableProxy()->AsVariable();
+ }
+
bool is_prefix() const { return is_prefix_; }
bool is_postfix() const { return !is_prefix_; }
Token::Value op() const { return op_; }
@@ -1358,6 +1364,10 @@ class Assignment: public Expression {
Assignment* AsSimpleAssignment() { return !is_compound() ? this : NULL; }
+ virtual Variable* AssignedVar() {
+ return target()->AsVariableProxy()->AsVariable();
+ }
+
Token::Value binary_op() const;
Token::Value op() const { return op_; }
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698