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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1417733007: VM: Fix bug with ??= expressions using await. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: added test, addressed comments Created 5 years, 1 month 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 | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 84ffb0ebd1c7ecb4db4929e1af1679d66ee0c8ea..1c4325c33256440bde8d933a9eaba3983882b1a2 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -1338,37 +1338,8 @@ void EffectGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) {
}
}
return;
- } else if (node->kind() == Token::kIFNULL) {
- // left ?? right. This operation cannot be overloaded.
- // temp = left; temp === null ? right : temp
- ValueGraphVisitor for_left_value(owner());
- node->left()->Visit(&for_left_value);
- Append(for_left_value);
- Do(BuildStoreExprTemp(for_left_value.value()));
-
- LocalVariable* temp_var = owner()->parsed_function().expression_temp_var();
- LoadLocalNode* load_temp =
- new(Z) LoadLocalNode(Scanner::kNoSourcePos, temp_var);
- LiteralNode* null_constant =
- new(Z) LiteralNode(Scanner::kNoSourcePos, Object::null_instance());
- ComparisonNode* check_is_null =
- new(Z) ComparisonNode(Scanner::kNoSourcePos,
- Token::kEQ_STRICT,
- load_temp,
- null_constant);
- TestGraphVisitor for_test(owner(), Scanner::kNoSourcePos);
- check_is_null->Visit(&for_test);
-
- ValueGraphVisitor for_right_value(owner());
- node->right()->Visit(&for_right_value);
- for_right_value.Do(BuildStoreExprTemp(for_right_value.value()));
-
- ValueGraphVisitor for_temp(owner());
- // Nothing to do, left value is already loaded into temp.
-
- Join(for_test, for_right_value, for_temp);
- return;
}
+ ASSERT(node->kind() != Token::kIFNULL);
ValueGraphVisitor for_left_value(owner());
node->left()->Visit(&for_left_value);
Append(for_left_value);
@@ -1442,37 +1413,6 @@ void ValueGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) {
}
ReturnDefinition(BuildLoadExprTemp());
return;
- } else if (node->kind() == Token::kIFNULL) {
- // left ?? right. This operation cannot be overloaded.
- // temp = left; temp === null ? right : temp
- ValueGraphVisitor for_left_value(owner());
- node->left()->Visit(&for_left_value);
- Append(for_left_value);
- Do(BuildStoreExprTemp(for_left_value.value()));
-
- LocalVariable* temp_var = owner()->parsed_function().expression_temp_var();
- LoadLocalNode* load_temp =
- new(Z) LoadLocalNode(Scanner::kNoSourcePos, temp_var);
- LiteralNode* null_constant =
- new(Z) LiteralNode(Scanner::kNoSourcePos, Object::null_instance());
- ComparisonNode* check_is_null =
- new(Z) ComparisonNode(Scanner::kNoSourcePos,
- Token::kEQ_STRICT,
- load_temp,
- null_constant);
- TestGraphVisitor for_test(owner(), Scanner::kNoSourcePos);
- check_is_null->Visit(&for_test);
-
- ValueGraphVisitor for_right_value(owner());
- node->right()->Visit(&for_right_value);
- for_right_value.Do(BuildStoreExprTemp(for_right_value.value()));
-
- ValueGraphVisitor for_temp(owner());
- // Nothing to do, left value is already loaded into temp.
-
- Join(for_test, for_right_value, for_temp);
- ReturnDefinition(BuildLoadExprTemp());
- return;
}
EffectGraphVisitor::VisitBinaryOpNode(node);
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698