From 257a7e65deb01c9e161c83ea5fd7a2b3c862e5e1 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 4 Jul 2011 20:40:05 +0000 Subject: Fixed a bug in the optimizer which was preventi... Fixed a bug in the optimizer which was preventing private methods from being inlined. Also relaxes a condition related to the "liftedTry" problem: the inliner has to exclude certain methods from consideration if there is a value on the stack and the method being inlined has exception handlers. The new condition is as before, except that it does not exclude methods of the "try/finally" variety (i.e. finalizers, but no other exception handlers.) This is necessary to optimize this common pattern: @inline private def foo(body: => Unit) { val saved = something try body finally something = saved } The closure for "body" can be fully eliminated, but only if the contents of foo can be inlined into the caller. Closes #4764, review by rompf. --- test/files/run/private-inline.flags | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/files/run/private-inline.flags (limited to 'test/files/run/private-inline.flags') diff --git a/test/files/run/private-inline.flags b/test/files/run/private-inline.flags new file mode 100644 index 0000000000..eb4d19bcb9 --- /dev/null +++ b/test/files/run/private-inline.flags @@ -0,0 +1 @@ +-optimise \ No newline at end of file -- cgit v1.2.3