From 4caa766e85b6ee2b1629450df9a18bb76380ee12 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Tue, 7 Aug 2012 19:03:33 +0200 Subject: Enable inlining in constructors. Inlining in constructors has been disabled a long time ago due to some VerifyErrors. Unfortunately, @dragos cannot recall what exactly was the problem. I tried to enable inlining in constructors and I didn't see any problem. `Predef.assert` calls in class constructors are one of the biggest contributors to closure allocation in a compiler so we better off get rid of it. Added a test-case that checks if inlining in constructors works properly. Review by @magarciaEPFL and @paulp. --- test/files/instrumented/inline-in-constructors/bar_2.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test/files/instrumented/inline-in-constructors/bar_2.scala (limited to 'test/files/instrumented/inline-in-constructors/bar_2.scala') diff --git a/test/files/instrumented/inline-in-constructors/bar_2.scala b/test/files/instrumented/inline-in-constructors/bar_2.scala new file mode 100644 index 0000000000..418dac5a67 --- /dev/null +++ b/test/files/instrumented/inline-in-constructors/bar_2.scala @@ -0,0 +1,7 @@ +package instrumented + +/** Class that uses assert compiled in previous compiler run so we check if + inlining in constructors works across different compilation runs */ +class Bar(x: Boolean) { + MyPredef.assert(x, "not true: " + x) +} -- cgit v1.2.3