From f0d913b51dbe1a098e813aa08197eef9c6cbf737 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 10 Dec 2013 11:04:26 +0100 Subject: SI-8062 Fix inliner cycle with recursion, separate compilation ICodeReaders, which decompiles JVM bytecode to ICode, was not setting the `recursive` attribute of `IMethod`. This meant that the inliner got into a cycle, repeatedly inlining the recursive call. The method name `filter` was needed to trigger this as the inliner heuristically treats that as a more attractive inlining candidate, based on `isMonadicMethod`. This commit: - refactors the checking / setting of `virtual` - adds this to ICodeReaders - tests the case involving `invokevirtual` I'm not sure how to setup a test that fails without the other changes to `ICodeReader` (for invokestatic and invokespecial). --- test/files/pos/t8062.flags | 1 + test/files/pos/t8062/A_1.scala | 5 +++++ test/files/pos/t8062/B_2.scala | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 test/files/pos/t8062.flags create mode 100644 test/files/pos/t8062/A_1.scala create mode 100644 test/files/pos/t8062/B_2.scala (limited to 'test') diff --git a/test/files/pos/t8062.flags b/test/files/pos/t8062.flags new file mode 100644 index 0000000000..49d036a887 --- /dev/null +++ b/test/files/pos/t8062.flags @@ -0,0 +1 @@ +-optimize diff --git a/test/files/pos/t8062/A_1.scala b/test/files/pos/t8062/A_1.scala new file mode 100644 index 0000000000..ca0411dae8 --- /dev/null +++ b/test/files/pos/t8062/A_1.scala @@ -0,0 +1,5 @@ +package warmup + +object Warmup { + def filter[A](p: Any => Boolean): Any = filter[Any](p) +} diff --git a/test/files/pos/t8062/B_2.scala b/test/files/pos/t8062/B_2.scala new file mode 100644 index 0000000000..f0a6761488 --- /dev/null +++ b/test/files/pos/t8062/B_2.scala @@ -0,0 +1,3 @@ +object Test { + warmup.Warmup.filter[Any](x => false) +} -- cgit v1.2.3