File tree 2 files changed +5
-19
lines changed
compiler/src/dotty/tools/dotc
2 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -609,33 +609,18 @@ object Symbols {
609
609
* This will force the info of the class.
610
610
*/
611
611
def tree (implicit ctx : Context ): tpd.Tree /* tpd.PackageDef | tpd.TypeDef | tpd.EmptyTree */ = {
612
- load()
613
- myTree
614
- }
615
-
616
- /** If this is either:
617
- * - a top-level class loaded from TASTY with `-tasty`
618
- * then return the bytes of the tasty.
619
- */
620
- def pickled (implicit ctx : Context ): Array [Byte ] = {
621
- load()
622
- myTasty
623
- }
624
-
625
- private def load ()(implicit ctx : Context ): Unit = {
626
612
denot.info
627
613
// TODO: Consider storing this tree like we store lazy trees for inline functions
628
614
if (unpickler != null && ! denot.isAbsent) {
629
615
assert(myTree.isEmpty)
630
616
val body = unpickler.body(ctx.addMode(Mode .ReadPositions ))
631
617
myTree = body.headOption.getOrElse(tpd.EmptyTree )
632
- if (ctx.settings.tasty.value)
633
- myTasty = unpickler.unpickler.bytes
634
- unpickler = null
618
+ if (! ctx.settings.tasty.value)
619
+ unpickler = null
635
620
}
621
+ myTree
636
622
}
637
623
private [this ] var myTree : tpd.Tree /* tpd.PackageDef | tpd.TypeDef | tpd.EmptyTree */ = tpd.EmptyTree
638
- private [this ] var myTasty : Array [Byte ] = _
639
624
private [dotc] var unpickler : tasty.DottyUnpickler = _
640
625
641
626
private [dotc] def registerTree (tree : tpd.TypeDef )(implicit ctx : Context ): Unit = {
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ class ReadTastyTreesFromClasses extends FrontEnd {
28
28
else {
29
29
val unit = CompilationUnit .mkCompilationUnit(clsd, unpickled, forceTrees = true )
30
30
val cls = clsd.symbol.asClass
31
- unit.pickled += (cls -> cls.pickled)
31
+ unit.pickled += (cls -> cls.unpickler.unpickler.bytes)
32
+ cls.unpickler = null
32
33
Some (unit)
33
34
}
34
35
}
You can’t perform that action at this time.
0 commit comments