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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 2388093003: VM: Make optimized try-catch work in DBC. (Closed)
Patch Set: addressed comments, fix bug in CheckClass Created 4 years, 2 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 | « no previous file | runtime/vm/flow_graph_compiler.cc » ('j') | runtime/vm/intermediate_language_dbc.cc » ('J')
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 7b62e3792c3461fd16262c6b9814eb4e6c5622cc..34e0b0bbfc3c51488235e70c8a8ea9c19d377d68 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -11,6 +11,7 @@
#include "vm/flow_graph_compiler.h"
#include "vm/log.h"
#include "vm/parser.h"
+#include "vm/stack_frame.h"
namespace dart {
@@ -612,10 +613,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 +628,19 @@ 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)
+ const Register exception_reg = kExceptionObjectReg;
+ const Register stacktrace_reg = kStackTraceObjectReg;
+#else
+ const intptr_t exception_reg =
+ LocalVarIndex(0, catch_entry->exception_var().index());
+ const intptr_t stacktrace_reg =
+ LocalVarIndex(0, catch_entry->stacktrace_var().index());
+#endif
+ BlockLocation(Location::RegisterLocation(exception_reg),
start,
ToInstructionEnd(start));
- BlockLocation(Location::RegisterLocation(kStackTraceObjectReg),
+ BlockLocation(Location::RegisterLocation(stacktrace_reg),
start,
ToInstructionEnd(start));
}
@@ -657,8 +663,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 +687,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)) {
LiveRange* tail = range->SplitAt(kNormalEntryPos);
CompleteRange(tail, Location::kRegister);
}
@@ -726,6 +734,7 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
}
ConvertAllUses(range);
if (defn->IsParameter() && (range->spill_slot().stack_index() >= 0)) {
Vyacheslav Egorov (Google) 2016/10/04 17:07:54 I thought we don't support spilling on DBC. How do
Florian Schneider 2016/10/04 17:11:02 You're right. This should be UNREACHABLE() in DBC.
Vyacheslav Egorov (Google) 2016/10/04 17:55:31 I am still not completely sure how this stuff mana
+#if !defined(TARGET_ARCH_DBC)
// Parameters above the frame pointer consume spill slots and are marked
// in stack maps.
spill_slots_.Add(range_end);
@@ -738,6 +747,9 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
spill_slots_.Add(range_end);
quad_spill_slots_.Add(false);
untagged_spill_slots_.Add(false);
+#else
+ MarkAsObjectAtSafepoints(range);
+#endif
}
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.cc » ('j') | runtime/vm/intermediate_language_dbc.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698