-
Enhancement
-
Resolution: Fixed
-
P4
-
9
-
b55
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085607 | emb-9 | Attila Szegedi | P4 | Resolved | Fixed | team |
JDK-8087042 | 8u65 | Attila Szegedi | P4 | Resolved | Fixed | b01 |
JDK-8075004 | 8u60 | Attila Szegedi | P4 | Resolved | Fixed | b08 |
JDK-8138492 | emb-8u65 | Unassigned | P4 | Resolved | Fixed | b01 |
JDK-8076956 | emb-8u60 | Attila Szegedi | P4 | Resolved | Fixed | team |
Static analysis of IfNode doesn't properly recognize terminating branches, resulting in unnecessary widening of some variables. E.g. Octane Crypto benchmark contains this code in its bnpFromString function:
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 256) k = 8; // byte array
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else { this.fromRadix(s,b); return; }
...
Currently, the type of k will be OBJECT after the if/elseif statements. This is due to the fact that the analysis doesn't recognize that the only branch that doesn't set it to INT also terminates, therefore it is impossible to exit the last else branch with k being UNDEFINED.
var k;
if(b == 16) k = 4;
else if(b == 8) k = 3;
else if(b == 256) k = 8; // byte array
else if(b == 2) k = 1;
else if(b == 32) k = 5;
else if(b == 4) k = 2;
else { this.fromRadix(s,b); return; }
...
Currently, the type of k will be OBJECT after the if/elseif statements. This is due to the fact that the analysis doesn't recognize that the only branch that doesn't set it to INT also terminates, therefore it is impossible to exit the last else branch with k being UNDEFINED.
- backported by
-
JDK-8075004 Static analysis of IfNode should consider terminating branches
-
- Resolved
-
-
JDK-8076956 Static analysis of IfNode should consider terminating branches
-
- Resolved
-
-
JDK-8085607 Static analysis of IfNode should consider terminating branches
-
- Resolved
-
-
JDK-8087042 Static analysis of IfNode should consider terminating branches
-
- Resolved
-
-
JDK-8138492 Static analysis of IfNode should consider terminating branches
-
- Resolved
-