summaryrefslogtreecommitdiff
path: root/test/files/instrumented
Commit message (Collapse)AuthorAgeFilesLines
* Emit trait method bodies in staticsJason Zaugg2016-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | And use this as the target of the default methods or statically resolved super or $init calls. The call-site change is predicated on `-Yuse-trait-statics` as a stepping stone for experimentation / bootstrapping. I have performed this transformation in the backend, rather than trying to reflect this in the view from Scala symbols + ASTs. We also need to add an restriction related to invokespecial to Java parents: to support a super call to one of these to implement a super accessor, the interface must be listed as a direct parent of the class. The static method names has a trailing $ added to avoid duplicate name and signature errors in classfiles.
* Rename -Yopt to -opt, -Yopt-warnings to -opt-warningsLukas Rytz2016-05-251-1/+1
| | | | Keep -Yopt-inline-heuristics and -Yopt-trace unchanged
* Remove manual mixins in JFunctionN.v2.12.0-M3-dc9effeJason Zaugg2016-03-181-5/+1
| | | | | | | | | | | | | | | | | | | These manual mixins were forwarding to the impl classes have just been removed. We can now rely on default methods instead. Update Tests: - Fix test/files/pos/t1237.scala, we can't have an outer field in an interface, always use the outer method. - Don't crash on meaningless trait early init fields test/files/neg/t2796.scala - Remove impl class relate parts of inner class test - Remove impl class relate parts of elidable test - Remove impl class related reflection test. - Remove test solely about trait impl classes renaming - Update check file with additional stub symbol error - Disable unstable parts of serialization test. - TODO explain, and reset the expectation
* Use invokedynamic for structural calls, symbol literals, lamba ser.Jason Zaugg2016-01-291-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous encodings created static fields in the enclosing class to host caches. However, this isn't an option once emit code in default methods of interfaces, as Java interfaces don't allow private static fields. We could continue to emit fields, and make them public when added to traits. Or, as chosen in this commit, we can emulate a call-site specific static field by using invokedynamic: when the call site is linked, our bootstrap methid can perform one-time computation, and we can capture the result in the CallSite. To implement this, I've allowed encoding of arbitrary invokedynamic calls in ApplyDynamic. The encoding is: ApplyDynamic( NoSymbol.newTermSymbol(TermName("methodName")).setInfo(invokedType) Literal(Constant(bootstrapMethodSymbol)) :: ( Literal(Constant(staticArg0)) :: Literal(Constant(staticArgN)) :: Nil ) ::: (dynArg0 :: dynArgN :: Nil) ) So far, static args may be `MethodType`, numeric or string literals, or method symbols, all of which can be converted to constant pool entries. `MethodTypes` are transformed to the erased JVM type and are converted to descriptors as String constants. I've taken advantage of this for symbol literal caching and for the structural call site cache. I've also included a test case that shows how a macro could target this (albeit using private APIs) to cache compiled regexes. I haven't managed to use this for LambdaMetafactory yet, not sure if the facility is general enough.
* Remove GenASM, merge remaining common code snippetsSimon Ochsenreither2015-10-271-1/+1
| | | | | | | | With GenBCode being the default and only supported backend for Java 8, we can get rid of GenASM. This commit also fixes/migrates/moves to pending/deletes tests which depended on GenASM before.
* Fix several tests under GenBCodeLukas Rytz2015-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - 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
* SI-8050 [Avian] Skip instrumented testsSimon Ochsenreither2013-12-084-19/+37
| | | | | | | | | | Instrumentation is (currently) not supported on Avian. This causes - tests instrumented/InstrumentationTest.scala and - instrumented/inline-in-constructors to fail. Let's skip these tests on Avian.
* Force several tests to run using inline delambdafication.James Iry2013-11-061-1/+1
| | | | | | The differences when running with method based delambdafication aren't important enough yet to create specialized versions that use method based delambdafication.
* Maintenance of Predef.Paul Phillips2013-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Deprecates much of Predef and scala.Console, especially: - the read* methods (see below) - the set{Out,Err,In} methods (see SI-4793) 2) Removed long-deprecated: - Predef#exit - Predef#error should have gone, but could not due to sbt At least the whole source base has now been future-proofed against the eventual removal of Predef#error. The low justification for the read* methods should be readily apparent: they are little used and have no call to be in global namespace, especially given their weird ad hoc semantics and unreasonably tempting names such as readBoolean(). 3) Segregated the deprecated elements in Predef from the part which still thrives. 4) Converted all the standard Predef implicits into implicit classes, value classes where possible: - ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value) - SeqCharSequence, ArrayCharSequence (non-value) Non-implicit deprecated stubs prop up the names of the formerly converting methods.
* Optimize primitive Array(e1, ..., en)Jason Zaugg2012-11-071-1/+23
| | | | | | | Expands an existing optimization for reference arrays to apply to primitives, as well. Fixes one aspect of SI-6247.
* Revert "Expand optimization of Array(e1, ..., en) to primitive arrays."Jason Zaugg2012-11-061-23/+1
| | | | This reverts commit 8265175ecc42293997d59049f430396c77a2b891.
* Expand optimization of Array(e1, ..., en) to primitive arrays.Jason Zaugg2012-11-041-1/+23
|
* SI-6611 Tighten up an unsafe array optimizationJason Zaugg2012-11-032-0/+14
| | | | | The net was cast too wide and was unsafely optimizing away array copies.
* Enable inlining in constructors.Grzegorz Kossakowski2012-08-075-0/+39
| | | | | | | | | | | | | | | | | 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.
* Instrument all classes in `instrumented` package.Grzegorz Kossakowski2012-07-262-0/+20
| | | | | | | | | | | | | | | Extend instrumenting infrastructure to instrument classes in `instrumented` package. This is useful because very often you need to put your classes into non-empty package. E.g. inliner doesn't work properly with empty package at the moment so in order to test any behaviour we need to put classes in some other package that is instrumented. Added testing code for that to instrumentation test-case. Review by @phaller.
* Partest: add `instrumented` test category.Grzegorz Kossakowski2012-07-163-0/+33
--- (taken from README) Tests in `instrumented/` directory are executed the same way as in `run/` but they have additional byte-code instrumentation performed for profiling. You should put your tests in `instrumented/` directory if you are interested in method call counts. Examples include tests for specialization (you want to count boxing and unboxing method calls) or high-level tests for optimizer where you are interested if methods are successfuly inlined (so they should not be called at runtime) or closures are eliminated (so no constructors of closures are called). Check `scala.tools.partest.instrumented.Instrumentation` to learn how to use the instrumentation infrastructure. The instrumentation itself is achieved by attaching a Java agent to the forked VM process that injects calls to profiler. Check `scala.tools.partest.javaagent.ProfilingAgent` for details. --- A few notes on low-level details of this change: * Partest now depends on asm library for byte-code instrumentation (`build.xml`) * Build additional jar called `scala-partest-javaagent.jar` that is used with `-javaagent:` option. (`build.xml`) * Set `-javaagent:` option for all tests in `instrumented/` directory. (`RunnerManger.scala`) * Introduce a new category of tests called `instrumented`. * Add one instrumented test to demonstrate usage and test new infrastructure itself. (`InstrumentationTest.scala`) Review by @phaller.