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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 16693006: Initial implementation of on-stack replacement (OSR). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up for review. 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
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 82a923358ce3cacc9ff85b802f564cd30c97ee14..fddb1dba5a44c3813741fb86f2872ffbd106e28c 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();

Powered by Google App Engine
This is Rietveld 408576698