| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The pickling package got rather large and confusing with three
separate tasks that each had their own conventions: read JVM classfiles,
read Scala2 pickle info, read Tasty. The classes for each task are now in
separate packages.
|
|\
| |
| | |
Compile from Tasty
|
| |
| |
| |
| |
| | |
We want to ensure that the whole tree is read at phase
frontend. To achieve this, we run an empty traverser over the tree.
|
| |
| |
| |
| |
| | |
These only exist if there was a pickler, and they are not unique
per CompilationUnit.
|
| | |
|
| |
| |
| |
| |
| |
| | |
A missing delta position signifies that the node has
the same position as its parent. Once that case was
added, we can now enable positions when reading from Tasty.
|
| |
| |
| |
| |
| |
| |
| | |
So far: Only one source file is recorded. Should evaluate
whether more are needed. Will programs composed from several
source files be pickled? They will certainly be generated after
inlining, but maybe all that happens after pickling?
|
| | |
|
| |
| |
| |
| |
| |
| | |
Previously, the empty package was always initialized with the empty scope.
This means that separate compilation between files in the empty package
was not possible.
|
| |
| |
| |
| | |
`FromTasty` is a main module which compiles TASTY info instead of sources.
|
| |
| |
| |
| |
| |
| | |
To be able able to post process pickled TASTY tree we let ClassfileParser#run
return any embedded unpickler. The unpickler is further propagated by a new
method ClassFileLoader#load in SymbolLoaders.
|
| | |
|
| |
| |
| |
| |
| |
| | |
After erasure, we may have to replace the closure method by a bridge.
LambdaMetaFactory handles this automatically for most types, but we have
to deal with boxing and unboxing of value classes ourselves.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For a module class V$, the synthesized companion class method looks
like:
val companion$class: V
If V is a value class, after erasure it will look like:
val companion$class: ErasedValueType(V, ...)
This will break SymDenotation#companionClass which relies on the type of
companion$class.
The solution is to not semi-erase the type of companion$class.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This corresponds roughly to step 2 of SIP-15 and to the peephole
optimizations of step 3.
The extractors in TreeExtractors are copied or inspired from
src/compiler/scala/tools/nsc/ast/TreeInfo.scala in scalac.
|
| |
| |
| |
| | |
This method will be needed to implement VCInline.
|
| |
| |
| |
| | |
This fixes the issues reported in SI-5866 and SI-8097
|
| |
| |
| |
| |
| | |
This phase erases ErasedValueType to their underlying type, in scalac
this was done in PostErasure.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There are three ways to erase a value class:
- In most case, it should be semi-erased to an ErasedValueType, which will be
fully erased to its underlying type in ElimErasedValueType.
This corresponds to semiEraseVCs = true in TypeErasure.
- In a few cases, it should be erased like a normal class, so far this
seems to be necessary for:
* The return type of a constructor
* The underlying type of a ThisType
* TypeTree nodes inside New nodes
* TypeApply nodes
* Arrays
In these cases, we set semiEraseVCs = false
- When calling `sigName` it should be erased to its underlying type.
This commit implements all these cases. Note that this breaks most tests
because ElimErasedValueType has not been implemented yet, it is part of
the next commit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For a value class V, let U be the underlying type after
erasure. We add to the companion object of V two cast methods:
def u2evt$(x0: U): ErasedValueType(V, U)
def evt2u$(x0: ErasedValueType(V, U)): U
The casts are used in Erasure to make it typecheck, they are then removed
in ElimErasedValueType (not yet present in this commit). This is
different from the implementation of value classes in Scala 2 (see
SIP-15) which uses `asInstanceOf` which does not typecheck.
|
| | |
|
| |
| |
| |
| |
| | |
This reduces the number of objects created and speeds up subtyping tests
Also make ErasedValueType extend ValueType
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- isSemi is replaced by semiEraseVCs with a different meaning (but is
still unimplemented):
* If true, value classes are semi-erased to ErasedValueType
(they will be fully erased in ElimErasedValueType which is not
yet present in this commit).
* If false, they are erased like normal classes.
- Fix the documentation of the TypeErasure class which was wrong.
- Remove intermediate functions scalaErasureFn, scalaSigFn, javaSigFn
and semiErasureFn. It's clearer to just use erasureFn directly
instead.
- Add an optional parameter semiEraseVCs to TypeErasure#erasure which
will be used in Erasure#Typer when we need to disable semi-erasure.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit tries to disentangle the TypeErasure class and the
TypeErasure object thereby fixing #386.
- Remove the `eraseInfo` method in the TypeErasure object, use `transformInfo`
instead which takes care of using the correct instance of TypeErasure
depending on the symbol to erase.
- Remove the unused method `eraseResult` in the TypeErasure class.
- In `transformInfo`, use the correct instance of the TypeErasure class when
calling `eraseInfo`.
- In the `eraseInfo` method of the TypeErasure class, do not call the
`erasure` method of the TypeErasure object, instead use the `apply`
method of the current instance of TypeErasure.
|
| |
| |
| |
| | |
Fixes #387
|
| | |
|
| |
| |
| |
| | |
It was fixed by #390 and the test was added back in #408.
|
|\ \
| | |
| | | |
Implement/i499
|
| | |
| | |
| | |
| | | |
Was missing before, ffell back to raw printing.
|
| | |
| | |
| | |
| | | |
Implements #499
|
| | |
| | |
| | |
| | | |
Does not fail tests anymore.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Values are the ones that I got as maximum values for compiling dotty itself.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
one.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Was creating correct code, but was assuming that all objects with the same name share
same bits. No need to do it.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Erasure finishes work done by Explicit outer, and registers a post condition that This(outer) is not allowed.
|
| | | |
|