diff options
author | Lars Bak <bak@google.com> | 2017-07-14 08:12:41 +0200 |
---|---|---|
committer | Lars Bak <bak@google.com> | 2017-07-14 08:12:41 +0200 |
commit | d6868d33a233569769fda3d8e18db42281a9528e (patch) | |
tree | 155b62ad595947cf8473572792f952041ab15acd /src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java | |
parent | 787d44d2fc67d976f5f97d8c9aaa023369b8f179 (diff) | |
download | r8-d6868d33a233569769fda3d8e18db42281a9528e.tar.gz |
Fixes a race condition when running R8.
2f4517160f9ce402be795a6555f68b8129cb09da
Bug:
Change-Id: I9c73bc0b9db9feef1cd2b02e62af21861aee6367
Diffstat (limited to 'src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java')
-rw-r--r-- | src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java b/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java index af99a36ae..fe59b791b 100644 --- a/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java +++ b/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java @@ -38,6 +38,8 @@ import it.unimi.dsi.fastutil.ints.IntArraySet; import it.unimi.dsi.fastutil.ints.IntIterator; import it.unimi.dsi.fastutil.ints.IntSet; import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.Iterator; @@ -136,7 +138,7 @@ public class LinearScanRegisterAllocator implements RegisterAllocator { private List<LiveIntervals> inactive = new LinkedList<>(); // List of intervals that no register has been allocated to sorted by first live range. private PriorityQueue<LiveIntervals> unhandled = - new PriorityQueue<>((o1, o2) -> Integer.compare(o1.getStart(), o2.getStart())); + new PriorityQueue<>(Comparator.comparingInt(LiveIntervals::getStart)); // The first register used for parallel moves. After register allocation the parallel move // temporary registers are [firstParallelMoveTemporary, maxRegisterNumber]. |