| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
Previously only the FrontEnd got a fresh FreshNameCreator for
each run, the other phases used a global one instead. This means
that compiling the same file several times would create different
synthetic names and classes on each run.
|
|
|
|
|
|
|
|
|
| |
... to tag inlined calls. Perform typings and transformations
of inlined calls in a context that refers to the INlined node
in its InlinedCall property.
The idea is that we can use this to issue better error
positions. This remains to be implemented.
|
| |
|
|
|
|
|
|
|
|
| |
GenBCode has an implicit assumption that I wasn't aware of:
GetStatic should not be emitted against a valid selector.
If it is, GenBCode messes up the stack by not pop-ing the selector.
Surprisingly, this transformation is perfumed in nsc by flatten.
|
| |
|
|
|
|
|
|
|
| |
Previously they were all lifted into a match with the came cases.
Now the first cases are handled directly by by the catch. If one
of the cases can not be handled the old scheme is applied to to it
and all subsequent cases.
|
|
|
|
|
|
|
| |
As a funny side-effect this allows to execute arbitrary code in static
initialisers:
@static val a: Unit = {println("loaded")}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To test this with sbt, see
https://github.com/lampepfl/dotty/wiki/Using-Dotty-with-sbt
The following flags are added:
- -Yforce-sbt-phases: Run the phases used by sbt for incremental compilation
(ExtractDependencies and ExtractAPI) even if the compiler is ran outside of
sbt, for debugging.
- -Ydump-sbt-inc: For every compiled foo.scala, output the API
representation and dependencies used for sbt incremental compilation
in foo.inc, implies -Yforce-sbt-phases.
This commit introduces two new phases which do not transform trees:
- `ExtractDependencies` which extracts the dependency information of the current
compilation unit and sends it to sbt via callbacks
- `ExtractAPI` which creates a representation of the API of the current compilation
unit and sends it to sbt via callbacks
Briefly, when a file changes sbt will recompile it, if its API has
changed (determined by what `ExtractAPI` sent) then sbt will determine
which reverse-dependencies (determined by what `ExtractDependencies`
sent) of the API have to be recompiled depending on what changed.
See http://www.scala-sbt.org/0.13/docs/Understanding-Recompilation.html for
more information on how sbt incremental compilation works.
This phase was originally based on
https://github.com/adriaanm/scala/tree/sbt-api-consolidate/src/compiler/scala/tools/sbt
which attempts to integrate the sbt phases into scalac (and is itself based
on https://github.com/sbt/sbt/tree/0.13/compile/interface/src/main/scala/xsbt),
but it has been heavily refactored and adapted to Dotty. The main
functional differences are:
- ExtractDependencies runs right after Frontend (so that we don't lose
dependency informations because of the simplifications done by PostTyper),
but ExtractAPI runs right after PostTyper (so that SuperAccessors are
part of the API).
- `ExtractAPI` only extract types as they are defined and never "as seen
from" some some specific prefix, see its documentation for more details.
- `ExtractDependenciesTraverser` and `ExtractUsedNames` have been fused into
one tree traversal in `ExtractDependenciesCollector`.
TODO: Try to run these phases in parallel with the rest of the compiler
pipeline since they're independent (except for the sbt callbacks in `GenBCode`) ?
|
| |
|
| |
|
|
|
|
| |
It's done in a separate ArrayConstructors phase now.
|
| |
|
|
|
|
| |
Give a one-line explanation what each phase does in Compiler.
|
|
|
|
|
| |
Mode is used from a lot of low-level code, does not just reflect Typer info.
So it makes more sense top to place it in the core package.
|
|\
| |
| | |
Implement most of the Scala.js IR code generator.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Notable things that are missing at this point:
* Pattern matching
* Try
* Most of the JavaScript interop
|
|\ \
| | |
| | | |
Implement @static sip.
|
| |/
| |
| |
| |
| |
| |
| |
| | |
This pull request implements most of machinery needed for
https://github.com/scala/scala.github.com/pull/491
Only 3-rd check is not implemented by this commit.
I propose to get this in faster to fix #1149
|
|\ \
| |/
|/| |
Change lambdalift - fasttrack
|
| | |
|
|\ \
| | |
| | | |
Initial infrastructure and hello world for the Scala.js back-end.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This required the ability to instantiate a different `Platform`
depending on settings, which, in turn, required to defer the
initialization of `ContextBase.platform`.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Scala.js back-end can be enabled with the `-scalajs`
command-line option. Currently, it adds one phase to the pipeline,
which emits .sjsir files from trees.
A sandbox project `sjsSandbox`, in `sandbox/scalajs/`, can be used
to easily test Scala.js compilation. One can run the `main()`
method of the `hello.world` object with
> sjsSandbox/run
The back-end only contains the bare mimimum to compile the hello
world application in the sandbox. Anything else will blow up
(for example, primitive method calls). It is a work-in-progress.
|
|\ \
| |/
|/| |
Special case pattern matching against abstract types with class tags
|
| |
| |
| |
| |
| |
| |
| | |
Now diagnoses missing ClassTags of abstract types
as implicit failures.
Also: Simpler API of tpd.clsOf.
|
|/
|
|
|
|
|
|
| |
Fix blocker bug reported in #1114
I dislike this fix as now phase needs to know in advance
if it will ever need a companion for the class.
On the bright side, this change makes it clear
which phases need companions
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this commit and the previous one, partest should finally correctly
log the output of the compiler and display it at the end of its
execution if compilation failed.
Also make sure the initial Reporter in a Context is _not_ a ThrowingReporter.
Previously, the initial Reporter was always overriden in Compiler by
rootReporter so it had no effect, but this is not the case anymore, and
the negative junit tests fail with the ThrowingReporter since they throw
an exception instead of exiting with a certain number of errors.
|
| |
|
|\
| |
| | |
Make Definitions survive recompilation of core definitions.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Symbols are not stable between runs, so if some symbol referred
to from Definitions gets recompiled, there are then two Symbols
that are both visible, one referenced from Definitions, the other
the one that got compiled.
Thos led to a crash when e.g. compiling scala.Short, because the
newly compiled symbol was not recognized as a primitive value
class.
The present commit tries to make systematic changes without regard
to simplicity or aesthetics. This will be polished in future commits.
// ### comments signal areas that need further attention.
|
|/
|
|
|
|
|
| |
This transform makes sure that all private member selections from
AndTypes are performed from the first component of AndType.
This is needed for correctness of erasure.
See `tests/run/PrivateAnd.scala`
|
|
|
|
| |
Needed to make builds deterministic.
|
|
|
|
|
| |
Makes self types explicit, if this is needed to identify
a member in a select. Fixes #789.
|
|
|
|
|
|
|
|
|
| |
Now, PostTyper replaces constant expressions with literals. If we wait any longer
then any tree rewriting of an application node would have to do constant folding again,
which is a hassle.
With the previous late Literalize phase, constant expressions consisting of operations
and arguments lost their constantness in PostTyper.
|
| |
|
|
|
|
|
| |
Phase lifts tries that would be illegal because they execute on non-empty
expression stacks.
|
|
|
|
| |
Non-local returns are now implemented.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
VCInline is split into two phases:
- VCInlineMethods (before Erasure) replaces value class method calls
by calls to extension methods
- VCElideAllocations (after Erasure) handles == and optimizing the
unboxing of a boxed value class, as VCInline did before.
This should not affect anything currently, but in the future we will have
phases before Erasure that mangle names (like TypeSpecializer, see #630),
being able to put these phases after VCInlineMethods means that
VCInlineMethods does not need to know anything about how these phases
mangle names, this reduces the coupling between phases. The trade-off is
that VCInlineMethods needs to deal with type parameters and multiple
parameter lists whereas VCInline didn't.
|
|
|
|
|
|
|
|
|
|
| |
New miniphase CheckRentrant verifies that compiled program is
without vars accessible through global roots if -Ycheck-reentrant
option is set.
Known shortcoming: Array elements are currently not considered as vars. This
is because in many programs arrays are used as an efficient container
for immutable fields.
|
|\
| |
| | |
Fix trait constructors
|
| |
| |
| |
| |
| |
| |
| |
| | |
It did not do enough to carry its own weight, in particular because DenotationTransformers do have
a price - every encountered denotation in the whole program is passed through them. The name change
from <init> to $init$ was all it did, that is now rolled into Mixin.
Also renamed IMPLCLASS_CONSTRUCTOR to TRAIT_CONSTRUCTOR.
|
|/
|
|
| |
Not needed right now, but will be useful later.
|
|\
| |
| | |
Partest output redirection over context.reporter
|
| | |
|