| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
Added a deprecation warning for `-optimize`.
Later we'll also graduate `-Yopt` to `-opt`, probably for 2.12.0-M5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
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.
|