aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Enable emmiting byte code for all tests. Compile Dotty.Dmitry Petrashko2015-04-301-28/+13
| | | | Hurray!
* LazyVals: last fix that allows to compile -deep dotc.Dmitry Petrashko2015-04-301-1/+1
|
* Fix spurious warnings in TreeChecker.Dmitry Petrashko2015-04-301-2/+1
|
* Fix bug in transformAfter: transform the last denotation in cycle.Dmitry Petrashko2015-04-301-1/+3
|
* fix a bug in transformAfter: iterate over a new denotation instead of an old ↵Dmitry Petrashko2015-04-301-1/+1
| | | | one.
* LazyVals: eagerly enter private symbols.Dmitry Petrashko2015-04-301-6/+6
|
* LazyVals: Synchronized is `Object => Object` after erasure, #505Dmitry Petrashko2015-04-301-2/+5
|
* LazyVals - do not rely on absence of name clashes in scope.Dmitry Petrashko2015-04-301-3/+3
| | | | | Was creating correct code, but was assuming that all objects with the same name share same bits. No need to do it.
* Disable failing tests. See #503Dmitry Petrashko2015-04-302-0/+0
|
* LazyVals: expected value of flag takes only tree values, no need to use long.Dmitry Petrashko2015-04-301-1/+1
|
* We do not plan to have more than Int.MaxValue of lazy vals.Dmitry Petrashko2015-04-301-1/+1
|
* Update comment on ExplicitOuter.Dmitry Petrashko2015-04-301-1/+1
|
* Fix tpd.ref(sum) to work after erasure.Dmitry Petrashko2015-04-301-1/+11
| | | | Erasure finishes work done by Explicit outer, and registers a post condition that This(outer) is not allowed.
* Make Lazy-vals generated fields private.Dmitry Petrashko2015-04-301-2/+5
|
* LazyValues: minor post-erasure changes.Dmitry Petrashko2015-04-301-2/+3
|
* Remove code duplication in LazyVals.Dmitry Petrashko2015-04-301-13/+7
| | | | Also fixes problem with capturedVars, as no local vars are created.
* Make LazyVals.getOffset work on j.l.Class instead of taking the instance.Dmitry Petrashko2015-04-302-4/+4
|
* LazyVals: Emitting switch instruction requires default case.Dmitry Petrashko2015-04-301-1/+3
|
* LazyVals: create less names.Dmitry Petrashko2015-04-301-15/+29
|
* LazyVals: filter out flag combinations that do not make sense.Dmitry Petrashko2015-04-301-2/+2
|
* LazyVals needs to run after Mixin.Dmitry Petrashko2015-04-301-3/+3
|
* tpd.WhileDo helper.Dmitry Petrashko2015-04-301-0/+11
|
* Compiler: add comment on problems in late phases.Dmitry Petrashko2015-04-301-2/+2
|
* Mixing should make initialisers out of lazy vals.Dmitry Petrashko2015-04-301-1/+3
|
* Fix two infinite cycles in transformAfter.Dmitry Petrashko2015-04-301-3/+3
| | | | | | | | | | if symbol is defining starting from this phase current.validFor.firstPhaseId < phase.id is always true. If additionally f changes the initial symbol, (current ne symbol.current) will always be true. Else if a symbol has a single denotation that spawns all periods, which is changed, second cycle becomes infinite.
* LV runs after memoize. Use setters.Dmitry Petrashko2015-04-301-13/+13
|
* Generate getters for modules in LV.Dmitry Petrashko2015-04-301-4/+7
|
* Getters now also makes getters for lazy vals.Dmitry Petrashko2015-04-301-7/+13
|
* Add a test for a deferred object in interface.Dmitry Petrashko2015-04-301-0/+6
|
* Make LazyVals implement non-static modules. Move LV after erasure.Dmitry Petrashko2015-04-302-40/+39
|
* Mixin: do not remove Module Flag.Dmitry Petrashko2015-04-301-1/+1
|
* Remove dead code in ConstructorsMartin Odersky2015-04-301-4/+2
| | | | | The intoConstr method is never called with argument inSuperCall = true. So code dependent on it can be dropped.
* Fix changeOwnerAfter by adding transformDenotations method.Martin Odersky2015-04-303-10/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the previous commit, we get a bad owner for the "typedArgs" var in `dotc.typer.Applications`. What happens is the following (@DarkDimius figured it out): Here's the code in question: val result = { var typedArg = ... (code that captures typedArg) } There's an interplay between 3 mini-phases, which run in interleaved succession in the same group: Memoize CapturedVars Constructors The following events happen in the order they are written: 1. typedArg is noted to be captured, so prepareValDef in CapturedVars installs a new denotation, valid after CapturedVars, with a Ref type. 2. Memoize in transformDefDef creates a field for `result` and changes the owner of all definitions in the right-hand side to the field, using `changeOwnerAfter`. This gives `typedArg` a new denotation with the owner being the field `result$local` and a validity period from Memoize + 1 to CapturedVars + 1 (because CapturedVars has already installed a new denotation). 3. Constructors runs intoConstructor which changes the owner again. All code with the field as current owner becomes owned by the constructor. But unfortunately `typedArg` is owned by the getter `result`, because that's the denotation installed by the preceding phase, CapturedVars. So its owner stays the `getter` even though its definition is now part of the constructor. Boom, -Ycheck fails. The fix applied here adds a new method `transformAfter` which can transform all future denotations of a symbol. `changeOwnerAfter` uses this method to become insensitive to the order in which denotations are installed. Morale: State is hard.
* Reset some flags for bridges.Martin Odersky2015-04-301-1/+3
| | | | | Bridges are never accessors, deferred, or lazy. Scalac removes these flags, I guess this was dropped as an oversight. The change is needed to make the next commit work.
* Allow FutureDefs in changeOwnerMartin Odersky2015-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without it, the previous commit make LazyVals blow up wgen compiling dotc/transform. I could not fugure out why, but here is the stacktrace I saw. dotty.tools.dotc.core.Denotations$NotDefinedHere: demanding denotation of method $anonfun at phase seqLiterals(17) outside defined interval: defined periods are Period(22..22, run = 2) at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:598) at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1221) at dotty.tools.dotc.core.Types$NamedType.denotAt(Types.scala:1206) at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1194) at dotty.tools.dotc.ast.Trees$DenotingTree.denot(Trees.scala:270) at dotty.tools.dotc.ast.Trees$Tree.symbol(Trees.scala:187) at dotty.tools.dotc.ast.TypedTreeInfo$$anonfun$localSyms$1.apply(TreeInfo.scala:437) at dotty.tools.dotc.ast.TypedTreeInfo$$anonfun$localSyms$1.apply(TreeInfo.scala:437) at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:728) at scala.collection.immutable.List.foreach(List.scala:381) at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:727) at dotty.tools.dotc.ast.TypedTreeInfo$class.localSyms(TreeInfo.scala:437) at dotty.tools.dotc.ast.tpd$.localSyms(tpd.scala:19) at dotty.tools.dotc.ast.TreeTypeMap.transformDefs(TreeTypeMap.scala:116) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:98) at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181) at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181) at scala.collection.immutable.List.loop$1(List.scala:172) at scala.collection.immutable.List.mapConserve(List.scala:188) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1181) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181) at dotty.tools.dotc.ast.Trees$Instance$TreeMap$$anonfun$transform$2.apply(Trees.scala:1181) at scala.collection.immutable.List.loop$1(List.scala:172) at scala.collection.immutable.List.mapConserve(List.scala:188) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1181) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1094) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1100) at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:108) at dotty.tools.dotc.ast.TreeTypeMap.apply(TreeTypeMap.scala:129) at dotty.tools.dotc.ast.tpd$TreeOps$.loop$1(tpd.scala:565) at dotty.tools.dotc.ast.tpd$TreeOps$.changeOwner$extension(tpd.scala:568) at dotty.tools.dotc.transform.LazyVals.transformLocalValDef(LazyVals.scala:110) at dotty.tools.dotc.transform.LazyVals.transformValDef(LazyVals.scala:64)
* Make Constructors change owners.Dmitry Petrashko2015-04-301-5/+5
|
* Make Memoize not depend on prepareForDefDef.Dmitry Petrashko2015-04-301-23/+11
| | | | | | | | | | | | | [@darkdimius] I see no good reason for this, as it creates tight coupling between `ifs` in two methods. [@odersky] The reason is probably in the deleted comment: // allocate field early so that initializer has the right owner for subsequent phases in // the group. We now transform the rhs in subsequent phases with the getter as owner, where before it was the field. It is not clear to me whether this matters or not. [Update] We figured out the problem: It was a missing changeOwnerAfter in Constructor. Added to next commit.
* Mixin: needs to call transformFollowing to make memoize run on traitInits.Dmitry Petrashko2015-04-301-2/+3
|
* Merge pull request #506 from dotty-staging/update-commentsodersky2015-04-283-3/+8
|\ | | | | Update comments on ParamForwarding and SuperAccessors.
| * Display compiled files in case of exceptionMartin Odersky2015-04-281-1/+6
| | | | | | | | | | This is useful for reproducing a problem. It tells us in particular in what order fiels were compiled.
| * Update comments on ParamForwarding and SuperAccessors.Dmitry Petrashko2015-04-282-2/+2
|/
* Merge pull request #495 from dotty-staging/refactor/SuperAccessorsDmitry Petrashko2015-04-2823-533/+562
|\ | | | | Refactor/super accessors
| * Remove trailing whitespaceMartin Odersky2015-04-2312-62/+62
| | | | | | | | | | I have figured out how to make this the default in Eclipse, so hopefully we won't see many repeats of this.
| * Add runsAfterGroupOf constraint to ExtensionMethodsMartin Odersky2015-04-221-0/+2
| |
| * Swap Pickler and FirstTransformMartin Odersky2015-04-221-1/+1
| | | | | | | | This means we now also pickle Imports and NamedArgs.
| * Unpickle ImportsMartin Odersky2015-04-223-3/+33
| | | | | | | | | | | | Was missing before. Needed a tweak in PlainPrinter for printing import symbol references (their denotation is not current after pickling, so they would have printed differently after and before pickling).
| * Anchor import symbols at current ownerMartin Odersky2015-04-222-3/+3
| | | | | | | | | | Needed to harmonize behavior of Typer/Namer and tpd. This is needed for making pickling, then unpickling the identity.
| * Roll some of FirstTransform functionaility into PostTyperMartin Odersky2015-04-223-75/+76
| | | | | | | | | | Everything that needs to be done before pickling moves to PostTyper. The idea is that we want to make Pickler come before FirstTransform.
| * Remove dead skipJava code from FirstTransform.Martin Odersky2015-04-221-5/+1
| | | | | | | | | | Frontend already drops all Java compilation units, so there's nothing to do for FirstTransform.
| * Roll SyntheticMethods into PostTyperMartin Odersky2015-04-223-23/+26
| |