summaryrefslogtreecommitdiff
path: root/test/junit/scala/tools/nsc/backend/jvm/DefaultMethodTest.scala
Commit message (Collapse)AuthorAgeFilesLines
* Emit trait method bodies in staticsJason Zaugg2016-06-281-3/+2
| | | | | | | | | | | | | | | | | | | | 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.
* Clean up bytecode testing methods.Lukas Rytz2016-05-201-1/+1
|
* Better abstraction for bytecode tests. Also organize some imports.Lukas Rytz2016-05-201-8/+7
|
* Rename nsc.backend.jvm.CodeGenTools to testing.BytecodeTestingLukas Rytz2016-05-201-1/+1
|
* Reduce boilerplate in compiler JUnit tests (#5158)Jason Zaugg2016-05-161-7/+1
| | | | | | | | | | | | | | | | Many JUnit tests share a compiler instance between all test cases in a class to reduce overhead. This commit refactors the mechanism to reduce the boilerplate. In the new scheme: - Using the `@ClassRule` hook in JUnit, we create a per-class map for each test class. - Per-class values are registered from the test class itself by calling `cached("someKey", () => mkExpensiveThing)` - At the end of the test, the entries in this map are `close()`-ed (if they implement `Closable`), and are released for garbage collection.)
* Remove -Y settings that are no longer used in 2.12Lukas Rytz2016-02-161-1/+1
| | | | | | Added a deprecation warning for `-optimize`. Later we'll also graduate `-Yopt` to `-opt`, probably for 2.12.0-M5.
* Don't create inline requests for callsites that cannot be inlinedLukas Rytz2015-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | When traversing the call graph and collecting inline reqeusts, rule out callsites that we already know cannot be inlined. Note that we cannot perform all necessary checks already at this stage: checks that depend on the callee body (the inlined code) are deferred until the callsite is actually inlined. The reason is that the code may change. Example: @inline final def f = try 1 catch { case _: Throwable => 2 } @inline final def g = f def t = println(g) When collecting inline requests, the body of g invokes the public method f, so g could be inlined into t. However, once f is inlined into g, the body of g contains a try-catch block. Now we cannot inline g into t anymore, because the call stack at the g callsite is non-empty (the stack is cleared when entering a handler).
* Allow BCode to emit default interface methodsJason Zaugg2015-08-111-0/+43
A DefDef owned by a trait may now have have a method body. Such a method must be emitted without ACC_ABSTRACT, and with the code attribute. Tested by intercepting the compile pipeline and adding the DEFAULTMETHOD flag and a method body before running the backend.