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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 337503003: Fix a bug in ParallelMoveResolver::AllocateScratchRegister, where we end up allocating PC on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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_compiler.h ('k') | tests/language/memory_swap_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 37268)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -1237,12 +1237,14 @@
}
-intptr_t ParallelMoveResolver::AllocateScratchRegister(Location::Kind kind,
- intptr_t blocked,
- intptr_t register_count,
- bool* spilled) {
+intptr_t ParallelMoveResolver::AllocateScratchRegister(
+ Location::Kind kind,
+ intptr_t blocked,
+ intptr_t first_free_register,
+ intptr_t last_free_register,
+ bool* spilled) {
intptr_t scratch = -1;
- for (intptr_t reg = 0; reg < register_count; reg++) {
+ for (intptr_t reg = first_free_register; reg <= last_free_register; reg++) {
if ((blocked != reg) &&
IsScratchLocation(Location::MachineRegisterLocation(kind, reg))) {
scratch = reg;
@@ -1252,9 +1254,10 @@
if (scratch == -1) {
*spilled = true;
- for (intptr_t reg = 0; reg < register_count; reg++) {
+ for (intptr_t reg = first_free_register; reg <= last_free_register; reg++) {
if (blocked != reg) {
scratch = reg;
+ break;
}
}
} else {
@@ -1273,7 +1276,8 @@
reg_ = static_cast<FpuRegister>(
resolver_->AllocateScratchRegister(Location::kFpuRegister,
blocked,
- kNumberOfFpuRegisters,
+ 0,
+ kNumberOfFpuRegisters - 1,
&spilled_));
if (spilled_) {
@@ -1297,7 +1301,8 @@
reg_ = static_cast<Register>(
resolver_->AllocateScratchRegister(Location::kRegister,
blocked,
- kNumberOfCpuRegisters,
+ kFirstFreeCpuRegister,
+ kLastFreeCpuRegister,
&spilled_));
if (spilled_) {
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | tests/language/memory_swap_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698