summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/locations.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-02-10 17:08:47 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-02-10 19:12:59 +0000
commitf7a0c4e421b5edaad5b7a15bfff687da28d0b287 (patch)
tree5423a2357661b80d75cb2e3a2b5395a3fe3cd9b5 /compiler/optimizing/locations.h
parent0f2433bfcb02a662fe739e8e2b068abc2958e4c1 (diff)
downloadandroid_art-f7a0c4e421b5edaad5b7a15bfff687da28d0b287.tar.gz
android_art-f7a0c4e421b5edaad5b7a15bfff687da28d0b287.tar.bz2
android_art-f7a0c4e421b5edaad5b7a15bfff687da28d0b287.zip
Improve ParallelMoveResolver to work with pairs.
Change-Id: Ie2a540ffdb78f7f15d69c16a08ca2d3e794f65b9
Diffstat (limited to 'compiler/optimizing/locations.h')
-rw-r--r--compiler/optimizing/locations.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index bf27c5cf7a..9ce8d351a9 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -268,6 +268,20 @@ class Location : public ValueObject {
return value_ == other.value_;
}
+ bool Contains(Location other) const {
+ if (Equals(other)) {
+ return true;
+ } else if (IsFpuRegisterPair() && other.IsFpuRegister()) {
+ return other.reg() == low() || other.reg() == high();
+ } else if (IsRegisterPair() && other.IsRegister()) {
+ return other.reg() == low() || other.reg() == high();
+ } else if (IsDoubleStackSlot() && other.IsStackSlot()) {
+ return (GetStackIndex() == other.GetStackIndex())
+ || (GetStackIndex() + 4 == other.GetStackIndex());
+ }
+ return false;
+ }
+
const char* DebugString() const {
switch (GetKind()) {
case kInvalid: return "I";