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

Unified Diff: runtime/vm/parser.cc

Issue 15935005: Remove pseudo-node from LoadLocalNode and replace it with a proper AST node. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
« runtime/vm/flow_graph_builder.cc ('K') | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 23217)
+++ runtime/vm/parser.cc (working copy)
@@ -1517,13 +1517,7 @@
// Simple test if a node is side effect free.
static bool IsSimpleLocalOrLiteralNode(AstNode* node) {
- if (node->IsLiteralNode()) {
- return true;
- }
- if (node->IsLoadLocalNode() && !node->AsLoadLocalNode()->HasPseudo()) {
- return true;
- }
- return false;
+ return node->IsLiteralNode() || node->IsLoadLocalNode();
}
@@ -5417,7 +5411,7 @@
// Do not add statements with no effect (e.g., LoadLocalNode).
if ((statement != NULL) && statement->IsLoadLocalNode()) {
// Skip load local.
- statement = statement->AsLoadLocalNode()->pseudo();
+ continue;
}
if (statement != NULL) {
if (!dead_code_allowed && abrupt_completing_seen) {
@@ -6883,7 +6877,7 @@
bool Parser::IsAssignableExpr(AstNode* expr) {
- return (expr->IsLoadLocalNode() && !expr->AsLoadLocalNode()->HasPseudo()
+ return (expr->IsLoadLocalNode()
&& (!expr->AsLoadLocalNode()->local().is_final()))
|| expr->IsLoadStaticFieldNode()
|| expr->IsStaticGetterNode()
@@ -7176,7 +7170,10 @@
}
// The result is a pair of the (side effects of the) cascade sequence
// followed by the (value of the) receiver temp variable load.
- return new LoadLocalNode(cascade_pos, cascade_receiver_var, cascade);
+ return new CommaNode(
+ cascade_pos,
+ cascade,
+ new LoadLocalNode(cascade_pos, cascade_receiver_var));
}
@@ -7787,9 +7784,10 @@
AstNode* store = CreateAssignmentNode(left_expr, add);
// The result is a pair of the (side effects of the) store followed by
// the (value of the) initial value temp variable load.
- LoadLocalNode* load_res =
- new LoadLocalNode(postfix_expr_pos, temp, store);
- return load_res;
+ return new CommaNode(
+ postfix_expr_pos,
+ store,
+ new LoadLocalNode(postfix_expr_pos, temp));
}
return postfix_expr;
}
« runtime/vm/flow_graph_builder.cc ('K') | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698