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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 14682020: Optimize functions containing try-catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_type_propagator.cc
===================================================================
--- runtime/vm/flow_graph_type_propagator.cc (revision 22613)
+++ runtime/vm/flow_graph_type_propagator.cc (working copy)
@@ -668,8 +668,12 @@
// always be wrongly eliminated.
// However there are parameters that are known to match their declared type:
// for example receiver and construction phase.
- const Function& function = block_->parsed_function().function();
- LocalScope* scope = block_->parsed_function().node_sequence()->scope();
+ GraphEntryInstr* graph_entry = block_->AsGraphEntry();
+ // Parameters at catch-blocks have type dynamic.
+ if (graph_entry == NULL) return CompileType::Dynamic();
+
+ const Function& function = graph_entry->parsed_function().function();
+ LocalScope* scope = graph_entry->parsed_function().node_sequence()->scope();
const AbstractType& type = scope->VariableAt(index())->type();
// Parameter is the constructor phase.
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698