You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The discussion at scala/scala#2620
uncovered that the ICode-based optimizer's DCE doesn't eliminate a redundant conditional jump,
where both branches lead to one and the same instruction.
The example showing the above is test/files/jvm/bytecode-test-example/Foo_1.scala reproduced below:
class Foo_1 {
def foo(x: AnyRef): Int = {
val bool = x == null
if (x != null)
1
else
0
}
}
With GenASM and -optimise we get the two conditional jumps that bytecode-test-example.check expects:
/**
* Simplifies branches that need not be taken to get to their destination:
* (1) conditional jump followed by unconditional jump, both to the same destination.
* (2) (conditional or unconditional) jump to a destination that is the next program point anyway.
* Details in `branchOverGoto()` and in `jumpToNext()`
*
* @author Miguel Garcia, http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/
*/
The discussion at scala/scala#2620
uncovered that the ICode-based optimizer's DCE doesn't eliminate a redundant conditional jump,
where both branches lead to one and the same instruction.
The example showing the above is
test/files/jvm/bytecode-test-example/Foo_1.scala
reproduced below:With GenASM and
-optimise
we get the two conditional jumps thatbytecode-test-example.check
expects:including a useless
(useless because, whether the conditional jump is taken or not,
L1
is the target anyway)The text was updated successfully, but these errors were encountered: