From a3b10d134401f21c33ce51abd65d3404700ed479 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Sun, 20 Dec 2015 15:35:05 +0100 Subject: Postpone tree compaction till all phases finish operating TASTY. Linker adds new sections. Wait for sections to be added and then compact. --- src/dotty/tools/dotc/core/tasty/TastyPickler.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/tasty/TastyPickler.scala') diff --git a/src/dotty/tools/dotc/core/tasty/TastyPickler.scala b/src/dotty/tools/dotc/core/tasty/TastyPickler.scala index e4f9a3092..83e6020d5 100644 --- a/src/dotty/tools/dotc/core/tasty/TastyPickler.scala +++ b/src/dotty/tools/dotc/core/tasty/TastyPickler.scala @@ -13,13 +13,13 @@ import ast.tpd class TastyPickler { private val sections = new mutable.ArrayBuffer[(TastyName.NameRef, TastyBuffer)] + val uuid = UUID.randomUUID() private val headerBuffer = { val buf = new TastyBuffer(24) for (ch <- header) buf.writeByte(ch.toByte) buf.writeNat(MajorVersion) buf.writeNat(MinorVersion) - val uuid = UUID.randomUUID() buf.writeUncompressedLong(uuid.getMostSignificantBits) buf.writeUncompressedLong(uuid.getLeastSignificantBits) buf @@ -31,6 +31,7 @@ class TastyPickler { sections += ((nameBuffer.nameIndex(name), buf)) def assembleParts(): Array[Byte] = { + treePkl.compactify() def lengthWithLength(buf: TastyBuffer) = { buf.assemble() buf.length + natSize(buf.length) -- cgit v1.2.3