summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/locations.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-11-07 10:48:10 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-11-07 14:43:19 +0000
commitf43083d560565aea46c602adb86423daeefe589d (patch)
tree6c812e88723c40ee77ab5c9ba38625a10cc9b364 /compiler/optimizing/locations.h
parentde87f405a5f8a4ffd57f01d0d667188e8f0ca8cd (diff)
downloadandroid_art-f43083d560565aea46c602adb86423daeefe589d.tar.gz
android_art-f43083d560565aea46c602adb86423daeefe589d.tar.bz2
android_art-f43083d560565aea46c602adb86423daeefe589d.zip
Do not update Out after it has a valid location.
Slow paths use LocationSummary to know where to move things around, and they are executed at the end of the code generation. This fix is needed for https://android-review.googlesource.com/#/c/113345/. Change-Id: Id336c6409479b1de6dc839b736a7234d08a7774a
Diffstat (limited to 'compiler/optimizing/locations.h')
-rw-r--r--compiler/optimizing/locations.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index bed688b5e3..d1555d4e11 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -417,6 +417,7 @@ class LocationSummary : public ArenaObject<kArenaAllocMisc> {
LocationSummary(HInstruction* instruction, CallKind call_kind = kNoCall);
void SetInAt(uint32_t at, Location location) {
+ DCHECK(inputs_.Get(at).IsUnallocated() || inputs_.Get(at).IsInvalid());
inputs_.Put(at, location);
}
@@ -429,8 +430,17 @@ class LocationSummary : public ArenaObject<kArenaAllocMisc> {
}
void SetOut(Location location, bool overlaps = true) {
+ DCHECK(output_.IsUnallocated() || output_.IsInvalid());
output_overlaps_ = overlaps;
- output_ = Location(location);
+ output_ = location;
+ }
+
+ void UpdateOut(Location location) {
+ // The only reason for updating an output is for parameters where
+ // we only know the exact stack slot after doing full register
+ // allocation.
+ DCHECK(output_.IsStackSlot() || output_.IsDoubleStackSlot());
+ output_ = location;
}
void AddTemp(Location location) {
@@ -442,6 +452,7 @@ class LocationSummary : public ArenaObject<kArenaAllocMisc> {
}
void SetTempAt(uint32_t at, Location location) {
+ DCHECK(temps_.Get(at).IsUnallocated() || temps_.Get(at).IsInvalid());
temps_.Put(at, location);
}
@@ -528,6 +539,8 @@ class LocationSummary : public ArenaObject<kArenaAllocMisc> {
// Registers that are in use at this position.
RegisterSet live_registers_;
+ ART_FRIEND_TEST(RegisterAllocatorTest, ExpectedInRegisterHint);
+ ART_FRIEND_TEST(RegisterAllocatorTest, SameAsFirstInputHint);
DISALLOW_COPY_AND_ASSIGN(LocationSummary);
};