My ISV is suspecting that ccertain optmizations ignore the possibility of
a RTE when determining the scope in which the optimizations can be applied.
This example class shows the type of error we've been seeing. The JIT
will incorrectly optimize out the false->true->false and the wrong flag
value is found in the exception handler.
class Foo {
boolean b;
void bar() {
b = false;
Irrelevant.code();
b = true;
RTE_capable.call();
b = false;
Irrelevant.morecode();
}
void callThisEnoughTimesToTriggerTheJIT() {
try {
bar();
} catch(Excption e) {
if(b) System.out.println("Correct");
else System.out.println("Fail");
}
}
}
This exists for JDK1,2,1, and JDK1.2.2.
There is a workaround available, but they feel that it may cause other optimizations problem by not considering RTE.
a RTE when determining the scope in which the optimizations can be applied.
This example class shows the type of error we've been seeing. The JIT
will incorrectly optimize out the false->true->false and the wrong flag
value is found in the exception handler.
class Foo {
boolean b;
void bar() {
b = false;
Irrelevant.code();
b = true;
RTE_capable.call();
b = false;
Irrelevant.morecode();
}
void callThisEnoughTimesToTriggerTheJIT() {
try {
bar();
} catch(Excption e) {
if(b) System.out.println("Correct");
else System.out.println("Fail");
}
}
}
This exists for JDK1,2,1, and JDK1.2.2.
There is a workaround available, but they feel that it may cause other optimizations problem by not considering RTE.