File tree 2 files changed +20
-5
lines changed 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,25 @@ class CompilationUnit(val source: SourceFile) {
17
17
var tpdTree : tpd.Tree = tpd.EmptyTree
18
18
19
19
def isJava = source.file.name.endsWith(" .java" )
20
-
21
- lazy val pickled : TastyPickler = new TastyPickler ()
22
20
21
+ /**
22
+ * Pickler used to create TASTY sections.
23
+ * Sections: Header, ASTs and Positions are populated by `pickler` phase.
24
+ * Subsequent phases can add new sections.
25
+ */
26
+ lazy val pickler : TastyPickler = new TastyPickler ()
27
+
28
+ /**
29
+ * Addresses in TASTY file of trees, stored by pickling.
30
+ * Note that trees are checked for reference equality,
31
+ * so one can reliably use this function only dirrectly after `pickler`
32
+ */
23
33
var addrOfTree : tpd.Tree => Option [Addr ] = (_ => None )
24
34
35
+ /**
36
+ * Addresses in TASTY file of symbols, stored by pickling.
37
+ * Note that trees are checked for reference equality,
38
+ * so one can reliably use this function only dirrectly after `pickler`
39
+ */
25
40
var addrOfSym : Symbol => Option [Addr ] = (_ => None )
26
41
}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class Pickler extends Phase {
32
32
pickling.println(i " unpickling in run ${ctx.runId}" )
33
33
if (ctx.settings.YtestPickler .value) beforePickling(unit) = tree.show
34
34
35
- val pickler = unit.pickled
35
+ val pickler = unit.pickler
36
36
val treePkl = new TreePickler (pickler)
37
37
treePkl.pickle(tree :: Nil )
38
38
unit.addrOfTree = treePkl.buf.addrOfTree
@@ -41,7 +41,7 @@ class Pickler extends Phase {
41
41
new PositionPickler (pickler, treePkl.buf.addrOfTree).picklePositions(tree :: Nil , tree.pos)
42
42
43
43
def rawBytes = // not needed right now, but useful to print raw format.
44
- unit.pickled .assembleParts().iterator.grouped(10 ).toList.zipWithIndex.map {
44
+ unit.pickler .assembleParts().iterator.grouped(10 ).toList.zipWithIndex.map {
45
45
case (row, i) => s " ${i}0: ${row.mkString(" " )}"
46
46
}
47
47
// println(i"rawBytes = \n$rawBytes%\n%") // DEBUG
@@ -61,7 +61,7 @@ class Pickler extends Phase {
61
61
ctx.definitions.init
62
62
val unpicklers =
63
63
for (unit <- units) yield {
64
- val unpickler = new DottyUnpickler (unit.pickled .assembleParts())
64
+ val unpickler = new DottyUnpickler (unit.pickler .assembleParts())
65
65
unpickler.enter(roots = Set ())
66
66
unpickler
67
67
}
You can’t perform that action at this time.
0 commit comments