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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 2388093003: VM: Make optimized try-catch work in DBC. (Closed)
Patch Set: address comments 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 | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/flow_graph_compiler_dbc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index e4f461e6408809306ad2e8c3f59e579681dffaad..2e98d9f891cf1c0e8fdc3f7b8f1450bada63b04c 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -670,8 +670,17 @@ void FlowGraphCompiler::EmitTrySync(Instruction* instr, intptr_t try_index) {
if (flow_graph().captured_parameters()->Contains(i)) continue;
if ((*idefs)[i]->IsConstant()) continue; // Common constants
Location src = env->LocationAt(i);
+#if defined(TARGET_ARCH_DBC)
+ intptr_t dest_index = kNumberOfCpuRegisters - 1 - i;
+ Location dest = Location::RegisterLocation(dest_index);
+ // Update safepoint bitmap to indicate that the target location
+ // now contains a pointer. With DBC parameters are copied into
+ // the locals area.
+ instr->locs()->SetStackBit(dest_index);
+#else
intptr_t dest_index = i - num_non_copied_params;
Location dest = Location::StackSlot(dest_index);
+#endif
move_instr->AddMove(dest, src);
}
@@ -687,8 +696,13 @@ void FlowGraphCompiler::EmitTrySync(Instruction* instr, intptr_t try_index) {
Location src = env->LocationAt(i);
ASSERT(!src.IsFpuRegister());
ASSERT(!src.IsDoubleStackSlot());
+#if defined(TARGET_ARCH_DBC)
+ intptr_t dest_index = kNumberOfCpuRegisters - 1 - i;
+ Location dest = Location::RegisterLocation(dest_index);
+#else
intptr_t dest_index = i - num_non_copied_params;
Location dest = Location::StackSlot(dest_index);
+#endif
move_instr->AddMove(dest, src);
// Update safepoint bitmap to indicate that the target location
// now contains a pointer.
@@ -845,12 +859,18 @@ void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs,
// with the same instruction (and same location summary) sees a bitmap that
// is larger that StackSize(). It will never be larger than StackSize() +
// live_registers_size.
- ASSERT(bitmap->Length() <= (spill_area_size + live_registers_size));
// The first safepoint will grow the bitmap to be the size of
// spill_area_size but the second safepoint will truncate the bitmap and
// append the live registers to it again. The bitmap produced by both calls
// will be the same.
+#if !defined(TARGET_ARCH_DBC)
+ ASSERT(bitmap->Length() <= (spill_area_size + live_registers_size));
bitmap->SetLength(spill_area_size);
+#else
+ if (bitmap->Length() <= (spill_area_size + live_registers_size)) {
+ bitmap->SetLength(Utils::Maximum(bitmap->Length(), spill_area_size));
+ }
+#endif
// Mark the bits in the stack map in the same order we push registers in
// slow path code (see FlowGraphCompiler::SaveLiveRegisters).
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/flow_graph_compiler_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698