Avoid traversing consecutives in method isArgumentInterval
Change-Id: I027a0b6503ce993d18115d62cf296c79ce1dfc64
diff --git a/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervals.java b/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervals.java
index 0c711b9..df5df48 100644
--- a/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervals.java
+++ b/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervals.java
@@ -7,6 +7,7 @@
import com.android.tools.r8.code.MoveType;
import com.android.tools.r8.dex.Constants;
+import com.android.tools.r8.ir.code.Instruction;
import com.android.tools.r8.ir.code.Value;
import com.android.tools.r8.ir.code.ValueType;
import com.android.tools.r8.utils.CfgPrinter;
@@ -139,15 +140,10 @@
}
public boolean isArgumentInterval() {
- // TODO(ager): This is pretty indirect. We might want to have a more direct indication.
- LiveIntervals current = splitParent;
- while (current.previousConsecutive != null) {
- current = current.previousConsecutive;
- }
- return current.ranges.get(0).isInfinite();
+ Instruction definition = this.splitParent.value.definition;
+ return definition != null && definition.isArgument();
}
-
public LiveIntervals getStartOfConsecutive() {
LiveIntervals current = this;
while (current.previousConsecutive != null) {