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

Unified Diff: vm/locations.cc

Issue 10443013: Add support for temp locations and port Load-/StoreStaticField to use locations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | « vm/locations.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/locations.cc
===================================================================
--- vm/locations.cc (revision 7955)
+++ vm/locations.cc (working copy)
@@ -30,8 +30,8 @@
blocked_registers[i] = false;
}
- // Mark all fixed registers as used.
- for (intptr_t i = 0; i < count(); i++) {
+ // Mark all fixed input, temp and output registers as used.
+ for (intptr_t i = 0; i < input_count(); i++) {
Location loc = in(i);
if (loc.kind() == Location::kRegister) {
ASSERT(!blocked_registers[loc.reg()]);
@@ -39,6 +39,19 @@
}
}
+ for (intptr_t i = 0; i < temp_count(); i++) {
+ Location loc = temp(i);
+ if (loc.kind() == Location::kRegister) {
+ ASSERT(!blocked_registers[loc.reg()]);
+ blocked_registers[loc.reg()] = true;
+ }
+ }
+
+ if (out().kind() == Location::kRegister) {
+ ASSERT(!blocked_registers[out().reg()]);
+ blocked_registers[out().reg()] = true;
srdjan 2012/05/24 18:57:16 We should be able to have the same input/temp and
+ }
+
// Do not allocate known registers.
blocked_registers[CTX] = true;
if (TMP != kNoRegister) {
@@ -46,7 +59,7 @@
}
// Allocate all unallocated input locations.
- for (intptr_t i = 0; i < count(); i++) {
+ for (intptr_t i = 0; i < input_count(); i++) {
Location loc = in(i);
if (loc.kind() == Location::kUnallocated) {
ASSERT(loc.policy() == Location::kRequiresRegister);
@@ -55,6 +68,16 @@
}
}
+ // Allocate all unallocated temp locations.
+ for (intptr_t i = 0; i < temp_count(); i++) {
+ Location loc = temp(i);
+ if (loc.kind() == Location::kUnallocated) {
+ ASSERT(loc.policy() == Location::kRequiresRegister);
+ set_temp(i, Location::RegisterLocation(
+ AllocateFreeRegister(&blocked_registers)));
+ }
+ }
+
Location result_location = out();
if (result_location.kind() == Location::kUnallocated) {
switch (result_location.policy()) {
« no previous file with comments | « vm/locations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698