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

Unified Diff: runtime/vm/flow_graph_allocator.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.cc ('k') | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.cc
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index fddde8096132e78a4fdb1563cd92a257a605f72d..d878f8d276536482541beb591e10d3352d2d84b9 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -510,16 +510,7 @@ void FlowGraphAllocator::BuildLiveRanges() {
Definition* defn = (*catch_entry->initial_definitions())[i];
LiveRange* range = GetLiveRange(defn->ssa_temp_index());
range->DefineAt(catch_entry->start_pos()); // Defined at block entry.
-
- // Save range->End() because it may change in ProcessInitialDefinition.
- intptr_t range_end = range->End();
ProcessInitialDefinition(defn, range, catch_entry);
- spill_slots_.Add(range_end);
- quad_spill_slots_.Add(false);
-
- if (defn->IsParameter() && range->spill_slot().stack_index() >= 0) {
- MarkAsObjectAtSafepoints(range);
- }
}
}
}
@@ -532,16 +523,7 @@ void FlowGraphAllocator::BuildLiveRanges() {
LiveRange* range = GetLiveRange(defn->ssa_temp_index());
range->AddUseInterval(graph_entry->start_pos(), graph_entry->end_pos());
range->DefineAt(graph_entry->start_pos());
-
- // Save range->End() because it may change in ProcessInitialDefinition.
- intptr_t range_end = range->End();
ProcessInitialDefinition(defn, range, graph_entry);
- if (defn->IsParameter() && flow_graph_.num_copied_params() > 0) {
- spill_slots_.Add(range_end);
- quad_spill_slots_.Add(false);
-
- MarkAsObjectAtSafepoints(range);
- }
}
}
@@ -549,6 +531,8 @@ void FlowGraphAllocator::BuildLiveRanges() {
void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
LiveRange* range,
BlockEntryInstr* block) {
+ // Save the range end because it may change below.
+ intptr_t range_end = range->End();
if (defn->IsParameter()) {
ParameterInstr* param = defn->AsParameter();
// Assert that copied and non-copied parameters are mutually exclusive.
@@ -579,6 +563,17 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
CompleteRange(tail, Location::kRegister);
}
ConvertAllUses(range);
+ if (defn->IsParameter() && (range->spill_slot().stack_index() >= 0)) {
+ // Parameters above the frame pointer consume spill slots and are marked
+ // in stack maps.
+ spill_slots_.Add(range_end);
+ quad_spill_slots_.Add(false);
+ MarkAsObjectAtSafepoints(range);
+ } else if (defn->IsConstant() && block->IsCatchBlockEntry()) {
+ // Constants at catch block entries consume spill slots.
+ spill_slots_.Add(range_end);
+ quad_spill_slots_.Add(false);
+ }
}
@@ -1617,7 +1612,6 @@ void FlowGraphAllocator::AllocateSpillSlotFor(LiveRange* range) {
}
}
-
// Set spill slot expiration boundary to the live range's end.
spill_slots_[idx] = end;
if (need_quad) {
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698