summaryrefslogtreecommitdiff
path: root/test/files/instrumented/inline-in-constructors/test_3.scala
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-08-07 19:03:33 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-08-07 19:03:33 +0200
commit4caa766e85b6ee2b1629450df9a18bb76380ee12 (patch)
tree48d5919db9007e6b609d77f638850aaf119d20e8 /test/files/instrumented/inline-in-constructors/test_3.scala
parentd8b35a11d67c2a597f1d93456b341a650b542520 (diff)
downloadscala-4caa766e85b6ee2b1629450df9a18bb76380ee12.tar.gz
scala-4caa766e85b6ee2b1629450df9a18bb76380ee12.tar.bz2
scala-4caa766e85b6ee2b1629450df9a18bb76380ee12.zip
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.
Diffstat (limited to 'test/files/instrumented/inline-in-constructors/test_3.scala')
-rw-r--r--test/files/instrumented/inline-in-constructors/test_3.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/instrumented/inline-in-constructors/test_3.scala b/test/files/instrumented/inline-in-constructors/test_3.scala
new file mode 100644
index 0000000000..c4d4cc5f37
--- /dev/null
+++ b/test/files/instrumented/inline-in-constructors/test_3.scala
@@ -0,0 +1,15 @@
+import scala.tools.partest.instrumented.Instrumentation._
+import instrumented._
+
+object Test {
+ def main(args: Array[String]) {
+ // force predef initialization before profiling
+ Predef
+ MyPredef
+ startProfiling()
+ val a = new Foo(2)
+ val b = new Bar(true)
+ stopProfiling()
+ printStatistics()
+ }
+}