diff options
author | James Iry <jamesiry@gmail.com> | 2013-02-24 06:28:45 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-02-25 16:09:33 -0800 |
commit | 4f2d784a09e5df244ebbee33d23cf931fcacb740 (patch) | |
tree | 57c23a178881adc61362eb53379b262b09450197 /test/files/jvm/t7006/Foo_1.scala | |
parent | e9f6511094c1e616719221970a9f3eec39c72905 (diff) | |
download | scala-4f2d784a09e5df244ebbee33d23cf931fcacb740.tar.gz scala-4f2d784a09e5df244ebbee33d23cf931fcacb740.tar.bz2 scala-4f2d784a09e5df244ebbee33d23cf931fcacb740.zip |
SI-7006 Simplify jump-only block destination determination
With proper reachability analysis, the code for finding the final
destination of jump-only blocks was more complicated than needed. This
commit simplifies and speeds up that process using a standard
Tortoise and Hare algorithm on a Map from jump-only blocks to their
immediate destinations.
Test t7006 is increased a bit to make sure we don't get stuck on
infinite loops and to make sure we're deleting all but the essential
jump.
Diffstat (limited to 'test/files/jvm/t7006/Foo_1.scala')
-rw-r--r-- | test/files/jvm/t7006/Foo_1.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/files/jvm/t7006/Foo_1.scala b/test/files/jvm/t7006/Foo_1.scala index f84269daf2..995619ce6b 100644 --- a/test/files/jvm/t7006/Foo_1.scala +++ b/test/files/jvm/t7006/Foo_1.scala @@ -1,9 +1,10 @@ class Foo_1 { def foo { try { - val x = 3 + val x = 3 // this will be optimized away, leaving a useless jump only block } finally { print("hello") } + while(true){} // ensure infinite loop doesn't break the algoirthm } } |