Index: runtime/vm/flow_graph_allocator.cc |
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc |
index 7b62e3792c3461fd16262c6b9814eb4e6c5622cc..60db301859cdd789889f02bae2815b973f6cd0ab 100644 |
--- a/runtime/vm/flow_graph_allocator.cc |
+++ b/runtime/vm/flow_graph_allocator.cc |
@@ -612,10 +612,6 @@ void FlowGraphAllocator::BuildLiveRanges() { |
} else if (block->IsCatchBlockEntry()) { |
// Process initial definitions. |
CatchBlockEntryInstr* catch_entry = block->AsCatchBlockEntry(); |
-#if defined(TARGET_ARCH_DBC) |
- // TODO(vegorov) support try-catch/finally for DBC. |
- flow_graph_.parsed_function().Bailout("FlowGraphAllocator", "Catch"); |
-#endif |
ProcessEnvironmentUses(catch_entry, catch_entry); // For lazy deopt |
@@ -631,10 +627,17 @@ void FlowGraphAllocator::BuildLiveRanges() { |
// block start to until the end of the instruction so that they are |
// preserved. |
intptr_t start = catch_entry->start_pos(); |
- BlockLocation(Location::RegisterLocation(kExceptionObjectReg), |
+#if !defined(TARGET_ARCH_DBC) |
+ intptr_t exception_reg = kExceptionObjectReg; |
+ intptr_t stacktrace_reg = kStackTraceObjectReg; |
+#else |
+ intptr_t exception_reg = -catch_entry->exception_var().index() - 1; |
zra
2016/10/04 15:22:48
Can you use LocalVarIndex() in stack_frame_dbc.h
Florian Schneider
2016/10/04 17:01:04
Done. Here and in CatchBlockEntryInstr::EmitNative
|
+ intptr_t stacktrace_reg = -catch_entry->stacktrace_var().index() - 1; |
+#endif |
+ BlockLocation(Location::RegisterLocation(exception_reg), |
start, |
ToInstructionEnd(start)); |
- BlockLocation(Location::RegisterLocation(kStackTraceObjectReg), |
+ BlockLocation(Location::RegisterLocation(stacktrace_reg), |
start, |
ToInstructionEnd(start)); |
} |
@@ -657,8 +660,10 @@ void FlowGraphAllocator::BuildLiveRanges() { |
void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn, |
LiveRange* range, |
BlockEntryInstr* block) { |
+#if !defined(TARGET_ARCH_DBC) |
// Save the range end because it may change below. |
intptr_t range_end = range->End(); |
+#endif |
if (defn->IsParameter()) { |
ParameterInstr* param = defn->AsParameter(); |
// Assert that copied and non-copied parameters are mutually exclusive. |
@@ -679,7 +684,7 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn, |
AssignSafepoints(defn, range); |
range->finger()->Initialize(range); |
range->set_assigned_location(Location::RegisterLocation(slot_index)); |
- if (range->End() > kNormalEntryPos) { |
+ if (block->IsGraphEntry() && range->End() > kNormalEntryPos) { |
zra
2016/10/04 15:22:48
Parens around >
Florian Schneider
2016/10/04 17:01:04
Done.
|
LiveRange* tail = range->SplitAt(kNormalEntryPos); |
CompleteRange(tail, Location::kRegister); |
} |
@@ -726,18 +731,22 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn, |
} |
ConvertAllUses(range); |
if (defn->IsParameter() && (range->spill_slot().stack_index() >= 0)) { |
+#if !defined(TARGET_ARCH_DBC) |
zra
2016/10/04 15:22:48
Maybe it would be cleaner to try to use only one #
Florian Schneider
2016/10/04 17:01:04
Done.
|
// Parameters above the frame pointer consume spill slots and are marked |
// in stack maps. |
spill_slots_.Add(range_end); |
quad_spill_slots_.Add(false); |
untagged_spill_slots_.Add(false); |
+#endif |
// Note, all incoming parameters are assumed to be tagged. |
MarkAsObjectAtSafepoints(range); |
} else if (defn->IsConstant() && block->IsCatchBlockEntry()) { |
+#if !defined(TARGET_ARCH_DBC) |
// Constants at catch block entries consume spill slots. |
spill_slots_.Add(range_end); |
quad_spill_slots_.Add(false); |
untagged_spill_slots_.Add(false); |
+#endif |
} |
} |