| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Replacing or types by their dominators and implicit conversions
caused the code to do the right thing anyway, but with the arrival
of true or-types, this became a static error.
|
|
|
|
|
|
|
|
|
|
|
| |
The closures generated by elimByName did not get the InSuperCall
flag set. This caused problems in lambda lift which led to a
verify error for the new version CollectionStrawMan6. That version
replaces explicit function parameters in class LazyList by
by-name parameters.
Also: Clarify logic for liftLocals in LambdaLift (liftLocals caused the immediate
problem but was in the end not to blame).
|
| |
|
|
|
|
| |
See t5375.scala for details.
|
|
|
|
|
|
|
|
|
|
|
| |
CollectDependencies had incorrect handling of `Ident`s.
If it had ever met an `Ident` to a symbol defined outside of current
owner-chain(e.g. Predef.println) it would issue narrowTo(enclosingClass).
This is very conservative and leads to memory leaks
even in trivial lambdas.
My lambda-lift-foo groes stronger :-)
|
| |
|
| |
|
|
|
|
|
|
|
| |
1. Make clearer what markFree is supposed to do and get
rid of `propagated` mode bit.
2. Harden copyParams so that we make sure corresponding
parameters and fields are copied.
|
| |
|
|
|
|
|
|
|
| |
Simplifications in order to avoid the freqent special
casing of constructors and prepare the way for
proper handling of trait constructors (which cause
problems; see pending/pos/llift.scala.
|
| |
|
| |
|
|
|
|
|
|
| |
If lambda lift needs to create an outer path from a constructor, the
path needs to start from the $outer parameter of the constructor, not
the this of the enclosing class, which is not yet available.
|
| |
|
|
|
|
|
|
|
| |
Reason: A lifted module is no longer a module (i.e. singleton object) in the scope
to which it is lifted.
Fixes #689.
|
| |
|
|
|
|
|
| |
Proxy references in constructors can't be left as fields because
they can happen before the supercall.
|
|
|
|
|
|
|
|
| |
If an inner class has proxy fields, we missed so far the assignment sfrom
the proxy parameters in the primary constructor of the class to the proxy
fields.
Test case tries several variations of this.
|
|
|
|
|
|
|
|
|
|
| |
LambdaLift needs to compute outer.path at the phase in which
the results are constructed, i.e. phase lambdaLift.next. Or else
we get an error in outer.path for lost fo files, including pos/Fileish.scala
as a minimized test case. Previously outer as computed at phase lambdaLift.
The reason for this is that lambdaLift name mangles inner classes, which
causes outer acessors to be not found. We now correct for the problem
in outer.path itself, by calling outerAccessor only at a safe phase.
|
|
|
|
|
| |
Lambdas should stay inside static objects if they reference to them with
a This or Ident. Fixes test case `llist.scala` but demonstrates another problem.
|
|
|
|
|
|
|
|
| |
See https://github.com/lampepfl/dotty/pull/624#issuecomment-107064519
for a lengthy explanation.
We now solve the problem in LambdaLift. The formerly failing tests are
all reverted to theor original, failing, version.
|
|
|
|
|
|
| |
class is also the top-level class"
This reverts commit 6898d2c296326779d373ef0e0b84e4451550120a.
|
|
|
|
| |
also the top-level class
|
| |
|
|
|
|
| |
package.
|
| |
|
|
|
|
|
|
| |
Otherwise we will need to rewrite references to `This` of class be references on ModuleVal.
This is less efficient(instead of calling method statically known to be final, you have virtual call) and less jvm-friendly,
as needs additional instructions to get to ModuleVal.
|
|
|
|
| |
It is now redundant.
|
|
|
|
|
| |
I have figured out how to make this the default in Eclipse, so hopefully
we won't see many repeats of this.
|
|
|
|
|
| |
Idents of lifted symbols become class members, need to carry the right
reference with the right prefix as type.
|
|
|
|
|
| |
After lambdaLift, methods are no longer local to cosntructors, so their
inSuperCall flag is reset.
|
|
|
|
|
|
|
| |
Documentation around markFree and narrowLiftedOwner was added.
i480 was minimzed and dependencies on dotc were removed. (+1 squashed commit)
Squashed commits:
[1a84054] Test cases for #480
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix two errors, where the first masked the second:
1) Variables defined in a method are not free variables of that method. This was mispredicated before
and caused liftedOwner to be updated to the class enclosing the method, thereby preventing any method
that refers to a local parameter or symbol to be hoisted.
Once this was fixed, methods were hoisted too far out. Test case in #480a, which takes code from Definitions.
This was fixed by
2) markFree is updated to do an additional narrowLiftedOwner so that, if a free variable gets a proxy
in an enclosing class, any inner classes and methods are kept within that class.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lazy trees can live longer than runs, so it is important
that they capture as little as possible. In particular they
should not capture contexts.
This change led with a ripple through effect to many changes
where operations now have to parameterzied with contexts, in
particular in what concerns tree folding.
The changes in turn uncovered some areas where dotc was
incompatible with scalac, and flagged correct things as errors.
These will be fixed in the next commits.
Another small twist: EmptyTrees will not be read in delayed mode,
so that one can check for lacking definitions without deserializing
the rhs.
|
|
|
|
|
|
|
|
|
|
| |
1) Rename `decls` to `unforcedDecls` to make it clear that
it is danegrous to use.
2) Prefer `info.decls` over `unforcedDecls`.
This fixes the problem reported in #305 where the primary
constructor was not found.
|
|
|
|
| |
LambdaMetafactory expects environment to go first.
|
|\
| |
| | |
Fix/#266 lambda lift
|
| |
| |
| |
| |
| |
| |
| |
| | |
A lot of cases were missing before and caused failures
in the newly added test in TreeChecker#typedThis.
Now we assure that all this references appear inside
the referenced class.
|
|/
|
|
|
| |
Now the default phase of treeTransformPhase is phase.next, we
can remove all overrides that specify the same phase.
|
|
|
|
|
| |
State moved into local transforms which are allocated one per unit.
Thsi allows lambda lifters on different units to run in parallel.
|
|
|
|
|
|
|
| |
This allows to move to a functional implementation later.
Only exception: CapturedVars still uses init() because it
contains a (dubious!) interaction with intialization and
transformSym. Looking at this next.
|
|
|
|
| |
Typed MemberDef trees now take the modifiers from their symbol's data.
|
|
|
|
|
| |
To be combinable with follow-up mini-phases the lift operation needs to handle Thickets specially.
This commit factors out the behavior from LambdaLift, so that Flatten can do the same thing.
|
|
|
|
| |
Some changes needed so that Flatten can run after LambdaLift
|
| |
|
| |
|
|
|
|
|
| |
If a symbol becomes a class field, references to it need to be selections, or
else we get a "bad type" assertion violation in TreeChecker.
|
|
|
|
|
|
| |
... so that they do not spill over between compilation units. It would be better to wipe the maps after
processing a compilation unit, but right now we do not have a hook for that. A better solution should
be possible once we replace init by "prepareUnit/transformUnit".
|
|
|
|
|
| |
Nested methods cannot refer to labels in theior environment. Needs a fix in TailCalls.
Moved failing test to pending.
|
|
|
|
| |
Several fixes to LambdaLift. The test suite now succeeds with LambdaLift enabled.
|