| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |\ \ \ \ \ \ \
| | |_|_|/ / / /
| |/| | | | | | |
Format and content enhance README.md
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Replace bullet points with tables for
- Review labels
- Command overviews
Rescue sbt section from midst of Ant section.
Syntax correct use of ANT_OPTS.
Synchronise IntelliJ menu path to 14.1.
Update OSS repo name. The Central Repository was formerly known
as Maven Central.
Standardise on @-mention instead of @mention.
Mark unfinished section with TODO.
Include a few other minor improvements.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Add link to online version of Programming in Scala
|
| | | |_|_|/ /
| | |/| | | | |
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-9450 Fix triple quoted strings in REPL :power mode
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Some extra synthetic code generated under this mode failed to escape
input before adding it to a literal string. It used to get away with
this most of the time by triple quoting the literal.
This commit reuses Scala string escaping logic buried in `Constant`
to do this properly. Actually, the proper approach would be to build
the synthetic code with trees and quasiquotes, and avoid the mess
of stringly-genererated code.
I threw in some defensive hygiene for the reference to `Nil` while
I was in the neighbourhood.
|
| |\ \ \ \ \ \
| | |/ / / / /
| |/| | | | | |
SI-8346 Re-established soundness of toSet (element type widening)
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
toSet needs to rebuild some child classes, but not others, as toSet is
allowed to widen element types (which the invariant Set normally cannot do),
and some sets rely upon their invariance. Thus, sets that rely upon their
invariance now rebuild themselves into a generic set upon toSet, while those
that do not just sit there.
Note: there was a similar patch previously that fixed the same problem, but
this is a reimplementation to circumvent license issues.
Note: the newBuilder method was benchmarked as (surprisingly!) the most
efficient way to create small sets, so it is used where sets may need to
be rebuild.
|
| |\ \ \ \ \
| | |_|_|/ /
| |/| | | | |
Fix typos in spec, docs and comments
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Since it's a private method, it's safe to just rename it.
|
| |/ / / / |
|
| |\ \ \ \
| | | | | |
| | | | | | |
Sync commit advice to README.md and fix Scabot URL
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
CONTRIBUTING.md offered different advice on commit subject line length
to README.md. Align CONTRIBUTING to README.
Fix Scabot repo URL
|
| |\| | | |
| | |_|/ /
| |/| | | |
Extend documentation contacts
|
| | |/ / |
|
|\ \ \ \
| | | | |
| | | | | |
Inliner heuristic for higher-order methods
|
| |\ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Test that no warning is issued with the default flags when an inlining
fails and the callee is not annotated @inline.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When invoking a higher-order method and the value passed for the
SAM type is either a function literal or a parameter of the callsite
method, inline the higher-order method into the callee.
This is a first version, the heuristics will be refined further.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Handler tables are lists of tuples (try-start, try-end,
handler-start, exception-type). When an instruction throws, the first
handler in the list that covers the instruction and matches the type
is executed. For nested handlers, it is the job of the compiler to
add them to the handler table in the correct order.
When inlining a method, the handlers of the callee are prepended to
the list of handlers in the callsite method. This ensures that the
callee's handlers are tested first if an exception is thrown in the
inlined code.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Data flow analyses take a long time to converge (many seconds) when
analyzing large methods. This commit prevents running analyses that
would take too long. This means for example that callsites in very
large methods are not added to the call graph and will therefore not
be inlined.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
It's not necessary to run it for building the call graph. DCE will
be run anyway later down the pipeline.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Introduce a cache to remember which methods have maxLocals and
maxStack already computed. Before we were computing these values
on every run of eliminateUnreachableCode.
Also update the implementation of eliminateUnreachableCode to keep
correct max values.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fixes the variable indices in the local variable table (debug info)
for inlined locals.
After re-writing a closure invocation to the body method, mark the
callsite method as potentially having dead code. The body method may
return Nothing$, creating new unreachable code in the callsite method.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Plenty of optimizations to make aliasing analysis faster. I cannot
say how much faster: an analysis that used to not terminate now takes
one second.
The lessons are not new:
- avoid boxing (of course)
- avoid allocating in tight loops
- use arrays, avoid hash sets / maps
- specialize for common cases (see SmallBitSet in this commit)
- avoid megamorphic calls
- understand the details of the problem and find those twists that
make it run faster
More explanations in the code.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When entering an exception handler, all values are dropped from the
stack (and the exception value is pushed). The ASM analyzer handles
this by invoking `firstHandlerInstructionFrame.clearStack()`. To
ensure consistent aliasing sets, we need to remove the dropped
values from aliasing sets.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The call graph holds an argInfos field for every callsite, which
contains additional information about the argument passed to the
callee. For example, an argInfo specifies if the argument is a
function literal or a parameter of the callsite method.
Computing the argInfo requires running an ASM analyzer, which is not
cheap. This change assembles the argInfos for callsites that are
created or changed by the inliner / closure optimizer from the
available information instead of just running the analyzer again.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Because that's what the field holds: the parameter types that are SAM
types.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Make InlinerHeuristics a backend component like the others, instead
of nested within the Inliner component.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The new optimizer doesn't have this problem.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Before this change, with `-Yopt-warnings:at-inline-failed` or with
the default options, the inliner would emit inline warnings for failed
attempts of callsites that are not annotated @inline.
A test for this change follows in a later commit, after enabling the
new inliner heuristic for higher-order methods.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Remember in the call graph if a function literal is passed as an
argument to a higher-order function.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
For higher order methods, the call graph contains a map from
parameter positions to SAM types.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
After inlining, inlined callsites are added to the call graph.
For efficiency, the callsites of the callee are copied and adapted
(the alternative would be to re-add the entire method to the call
graph, which involves running data flow analyses).
If the callee is in a class parsed from bytecode (vs a class being
compiled), it might not yet be in the call graph. This commit ensures
that the method is added to the call graph before looking for its
callsites.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Inline requests have a list of post-inline requests: callsites within
the inlined method that should be inlined into the initial callee.
This commit changes the inliner to actually perform post-inline
requests.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The computed value was too large previously: inlining stores receiver
and argument values of the inlined method into locals.
A too large value doesn't cause any bugs, but data flow analyses would
allocate too large frames.
The test (InlinerTest.maxLocalsMaxStackAfterInline) didn't catch the
bug because it tested the methods of the wrong ClassNode. The
CodeGenTools.compileClasses method returns a ClassNode that is created
from the classfile byte array emitted by the compiler. This ClassNode
is a new object and unrelated to the ClassNode used in the compiler
backend. The test now takes the correct ClassNode from the hash map in
the backend's byteCodeRepository.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Avoid producing inline requests for callsites in classes on the
classpath.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
An inline request contains a callsite and a list of post-inlining
requests. A post-inlining request asks to inline an invocation that
is copied from the callee into the callsite method while inlining the
initial callsite.
Post-inlining requests are still ignored for now.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If a class (trait) is a SAM type, store the name and descriptor of the
SAM in the ClassBType's InlineInfo.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Store classes being compiled in a separate hash map. This allows
efficiently traversing all classes being compiled. It also simplifies
limiting the size of the cache of class nodes parsed from classfiles.
Also change the cache of class nodes parsed from classfiles to LRU
instead of FIFO.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Change the hash maps in the call graph to index callsites and
closure instantiations by the containing method. This is beneficial
for implementing inliner heuristics and the closure optimizer.
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-9473 Cleaner references to statically owned symbols
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Ever wonder why `identity("")` typechecks to
`scala.this.Predef.identity("")`?
It turns out that `mkAttributedRef` was importing
`q"$scalaPackageClass.this.Predef._"` for all these years,
rather than `q"$scalaModule.Predef._"`.
This commit makes `mkAttributedRef` special case static owners
by referring the the corresponding module, instead.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-9081 Deprecate public implementation details in TrieMap
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
I added the intended future visibility levels which I used to test
these changes in comments for clarity.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Update eclipse build files
|