summaryrefslogtreecommitdiff
path: root/chapter25/src/main/java/com/seaofnodes
diff options
context:
space:
mode:
Diffstat (limited to 'chapter25/src/main/java/com/seaofnodes')
-rw-r--r--chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java b/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java
index 5ed4382f..4d357fda 100644
--- a/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java
+++ b/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java
@@ -90,12 +90,10 @@ public class PhiNode extends Node {
// phi loop widening part
if( r instanceof LoopNode && // Only around loops
- t != _type && // Types changed and are falling (the optimistic case, expected to fall forever)
- !t.isConstant() && // No need to widen constants
- t instanceof TypeInteger newi && // Only widen integers
- (!(_type instanceof TypeInteger oldi) || newi._widen <= oldi._widen) ) {
+ t instanceof TypeInteger ti && // Only widen integers
+ !ti.isConstant() ) { // No need to widen constants
// Widen, to prevent infinite falling of TypeIntegers
- return newi.same_but_slightly_wider_than();
+ return ti.same_but_slightly_wider_than();
}
return t;