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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 12643004: The complete fix for issue 8919. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 19657)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -2720,20 +2720,25 @@
if (super_function->IsNull()) {
// Could not resolve super operator. Generate call noSuchMethod() of the
// super class instead.
- // Even though noSuchMethod most likely does not return,
- // we save the stored value if in case the result is needed.
- ValueGraphVisitor for_value(owner(), temp_index());
- node->value()->Visit(&for_value);
- Append(for_value);
- Do(BuildStoreExprTemp(for_value.value()));
-
- const LocalVariable* temp =
- owner()->parsed_function().expression_temp_var();
- AstNode* value = new LoadLocalNode(node->token_pos(), temp);
ArgumentListNode* arguments = new ArgumentListNode(node->token_pos());
arguments->Add(node->array());
arguments->Add(node->index_expr());
- arguments->Add(value);
+
+ // Even though noSuchMethod most likely does not return,
+ // we save the stored value if the result is needed.
+ if (result_is_needed) {
+ ValueGraphVisitor for_value(owner(), temp_index());
+ node->value()->Visit(&for_value);
+ Append(for_value);
+ Do(BuildStoreExprTemp(for_value.value()));
+
+ const LocalVariable* temp =
+ owner()->parsed_function().expression_temp_var();
+ AstNode* value = new LoadLocalNode(node->token_pos(), temp);
+ arguments->Add(value);
+ } else {
+ arguments->Add(node->value());
+ }
StaticCallInstr* call =
BuildStaticNoSuchMethodCall(node->super_class(),
node->array(),
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698