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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 17232004: Fix bug in register allocation at catch entry blocks. (Closed) Base URL: http://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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.cc
===================================================================
--- runtime/vm/flow_graph_allocator.cc (revision 24096)
+++ runtime/vm/flow_graph_allocator.cc (working copy)
@@ -60,6 +60,12 @@
}
+static intptr_t NextInstructionPos(intptr_t pos) {
+ ASSERT(IsInstructionStartPosition(pos));
+ return pos + 2;
+}
+
+
FlowGraphAllocator::FlowGraphAllocator(const FlowGraph& flow_graph)
: flow_graph_(flow_graph),
reaching_defs_(flow_graph),
@@ -512,6 +518,15 @@
range->DefineAt(catch_entry->start_pos()); // Defined at block entry.
ProcessInitialDefinition(defn, range, catch_entry);
}
+ // Block the two registers used by CatchEntryInstr from the 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),
+ start,
+ ToInstructionEnd(NextInstructionPos(start)));
+ BlockLocation(Location::RegisterLocation(kStackTraceObjectReg),
+ start,
+ ToInstructionEnd(NextInstructionPos(start)));
Vyacheslav Egorov (Google) 2013/06/17 15:11:39 Assert that the next instruction is actually Catch
Florian Schneider 2013/06/17 17:35:35 Done.
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698