| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- private-inline, t8601-closure-elim, inline-in-constructors
- test closure inlining / elimination, which is not yet implemented
in GenBCode. noted in https://github.com/scala-opt/scala/issues/14.
- constant-optimization, t7006
- no constant folding in GenBCode yet.
noted in https://github.com/scala-opt/scala/issues/29.
- patmat_opt_ignore_underscore, patmat_opt_no_nullcheck, patmat_opt_primitive_typetest
- not all optimizations in GenBCode yet.
noted in https://github.com/scala-opt/scala/issues/30.
- t3234
- tests a warning of trait inlining - trait inlining works in
GenBCode
- synchronized
- ignore inliner warnings (they changed a bit)
- t6102
- account for the changed outputo of -Ydebug has under GenBCode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes GenICode prevent the generation of
most unreachable blocks. The new unreachable block prevention code can
be disabled with a compiler flag.
Because full unreachable analysis is no longer necessary for
normal code it makes the unreachable block analysis run only under
-optimise.
A test is included to make sure unreachable code doesn't cause issues
in code gen.
A concrete example will help.
def foo(): X = {
try
return something()
catch {
case e: Throwable =>
println(e)
throw e
}
unreachableCode()
]
Here unreachableCode() is unreachable but GenICode would create ICode
for it and then ASM would turn it into a pile of NOPS.
A previous commit added a reachability analysis step to eliminate
that unreachable code but that added a bit of time to the
compilation process even when optimization was turned off.
This commit avoids generating most unreachable
ICode in the first place so that full reachability analysis is
only needed after doing other optimization work.
The new code works by extending a mechanism that was already in place.
When GenICode encountered a THROW or RETURN it would put the
current block into "ignore" mode so that no further instructions
would be written into the block. However, that ignore mode flag
was itself ignored when it came to figuring out if follow on blocks
should be written. So this commit goes through places like try/catch
and if/else and uses the ignore mode of the current block to decide
whether to create follow on blocks, or if it already has, to kill by
putting them into ignore mode and closing them where they'll be
removed from the method's list of active blocks.
It's not quite as good as full reachability analysis. In particular
because a label def can be emitted before anything that jumps to it,
this simple logic is forced to leave label defs alone and that means
some of them may be unreachable without being removed. However, in
practice it gets close the the benefit of reachability analysis at
very nearly no cost.
|
|
|
|
|
|
|
|
|
|
|
| |
By default we run par test under -optimise. But occasionally we need
to test optimizations in isolation. This commit adds a Ynooptimise
flag that turns the optimize flags off back off after they've been
turned on.
A test is included to ensure that -Ynooptimise turns off optimizations
and an existing test is modified to show that optimizations coming
after -Ynooptimise in command line are enabled.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
GenASM was doing a bunch of stuff to eliminate unreachable exception
handlers, but it was still leaving behind other unreachable blocks, for
instance a finally block associated with an exception handler that got
removed would still be left lying around. ASM would in turn turn those
into a big pile of NOPs, which just take up space uselessly.
This commit replaces all the logic for eliding exception handlers with
a single unreachable block remover that catches unused exception
handlers and a whole lot more.
|