mirror of
https://github.com/konsoletyper/teavm.git
synced 2024-12-09 02:00:25 +08:00
Fix strange bug
This commit is contained in:
parent
d912ba4af3
commit
ee1b1035d2
@ -151,10 +151,14 @@ class LoopInversionImpl {
|
||||
}
|
||||
|
||||
private LoopWithExits getLoopWithExits(Map<Loop, LoopWithExits> cache, Loop loop) {
|
||||
return cache.computeIfAbsent(loop, key ->
|
||||
new LoopWithExits(key.getHead(), key.getParent() != null
|
||||
? getLoopWithExits(cache, key.getParent())
|
||||
: null));
|
||||
LoopWithExits result = cache.get(loop);
|
||||
if (result == null) {
|
||||
result = new LoopWithExits(loop.getHead(), loop.getParent() != null
|
||||
? getLoopWithExits(cache, loop.getParent())
|
||||
: null);
|
||||
cache.put(loop, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void sortLoops(LoopWithExits loop, Set<LoopWithExits> visited, List<LoopWithExits> target) {
|
||||
@ -302,9 +306,7 @@ class LoopInversionImpl {
|
||||
|
||||
private IntSet nodesToCopy() {
|
||||
IntSet result = new IntOpenHashSet();
|
||||
int[] nodes = this.nodes.toArray();
|
||||
Arrays.sort(nodes);
|
||||
for (int node : nodes) {
|
||||
for (int node : nodes.toArray()) {
|
||||
if (node == head || (node != bodyStart && !dom.dominates(bodyStart, node))) {
|
||||
result.add(node);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user