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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 17233003: Reapply "Initial implementation of on-stack replacement (OSR)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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_inliner.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
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 0ffb7f069370614b490e2ca9945c816bac7f8fa9..7366821de3841e7c18876a65f21d28b81c46b331 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -691,8 +691,14 @@ CompileType ParameterInstr::ComputeType() const {
// However there are parameters that are known to match their declared type:
// for example receiver and construction phase.
GraphEntryInstr* graph_entry = block_->AsGraphEntry();
- // Parameters at catch-blocks have type dynamic.
- if (graph_entry == NULL) return CompileType::Dynamic();
+ // Parameters at catch blocks and OSR entries have type dynamic.
+ //
+ // TODO(kmillikin): Use the actual type of the parameter at OSR entry.
+ // The code below is not safe for OSR because it doesn't necessarily use
+ // the correct scope.
+ if ((graph_entry == NULL) || graph_entry->IsCompiledForOsr()) {
+ return CompileType::Dynamic();
+ }
const Function& function = graph_entry->parsed_function().function();
LocalScope* scope = graph_entry->parsed_function().node_sequence()->scope();
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698