Skip to content

Conversation

@retronym
Copy link
Member

Since 8ae0fda, the specializion phase eagerly info transforms
all of FunctionN and TupleN. This was done to let us turn off
needless specialization info transforms (which incurs classfile parsing
up the base classes looking for @specialized annotations) of types after
the specialization tree transform is done.

However, in combination with an old fix for scala/bug#5545, we end
up parsing all of the class files of all the variants, just to
unlink them in favour of the info-transformed types.

I note that the test for scala/bug#5545 no longer crashes if the fix
is removed. I have have not investigated the reason.

This commit reworks the scala/bug#5545 to just unlink the stale
symbols directly, rather than calling .info to parse them and
do the same after noticing the ScalaRaw attribute.

@scala-jenkins scala-jenkins added this to the 2.12.14 milestone Mar 24, 2021
@retronym
Copy link
Member Author

retronym commented Mar 24, 2021

Before:

$ scalac -verbose sandbox/test.scala  | grep -E 'loaded class.*(Tuple|Function)'
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0.class) in 1ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcZ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcB$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcC$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcF$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcS$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function0$mcV$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1.class) in 1ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcZD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcDD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcFD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcID$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcJD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcVD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcZF$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcDF$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcFF$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcIF$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcJF$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcVF$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcZI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcDI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcFI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcII$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcJI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcVI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcZJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcDJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcFJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcIJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcJJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function1$mcVJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZDD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDDD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFDD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIDD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJDD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVDD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZDI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDDI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFDI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIDI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJDI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVDI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZDJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDDJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFDJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIDJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJDJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVDJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZID$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDID$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFID$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIID$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJID$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVID$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZII$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDII$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFII$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIII$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJII$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVII$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZIJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDIJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFIJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIIJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJIJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVIJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZJD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDJD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFJD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIJD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJJD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVJD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZJI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDJI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFJI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIJI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJJI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVJI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcZJJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcDJJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcFJJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcIJJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcJJJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Function2$mcVJJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple1.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple1$mcD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple1$mcI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple1$mcJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2.class) in 1ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcZZ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcZC$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcZD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcZI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcZJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcCZ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcCC$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcCD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcCI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcCJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcDZ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcDC$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcDD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcDI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcDJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcIZ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcIC$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcID$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcII$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcIJ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcJZ$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcJC$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcJD$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcJI$sp.class) in 0ms]
[loaded class file /Users/jz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.2/scala-library-2.13.2.jar(scala/Tuple2$mcJJ$sp.class) in 0ms]

After:

$ qscalac -verbose sandbox/test.scala  | grep -E 'loaded class.*(Tuple|Function)'
[loaded class file /Users/jz/code/scala/build/quick/classes/library/scala/Function0.class in 2ms]
[loaded class file /Users/jz/code/scala/build/quick/classes/library/scala/Function1.class in 1ms]
[loaded class file /Users/jz/code/scala/build/quick/classes/library/scala/Function2.class in 1ms]
[loaded class file /Users/jz/code/scala/build/quick/classes/library/scala/Tuple1.class in 2ms]
[loaded class file /Users/jz/code/scala/build/quick/classes/library/scala/Tuple2.class in 2ms]

Since 8ae0fda, the specializion phase eagerly info transforms
all of FunctionN and TupleN. This was done to let us turn off
needless specialization info transforms (which incurs classfile parsing
up the base classes looking for @specialized annotations) of types after
the specialization tree transform is done.

However, in combination with an old fix for scala/bug#5545, we end
up parsing all of the class files of all the variants, just to
unlink them in favour of the info-transformed types.

I note that the test for scala/bug#5545 no longer crashes if the fix
is removed. I have have not investigated the reason.

This commit reworks the scala/bug#5545 to just unlink the stale
symbols directly, rather than calling `.info` to parse them and
do the same after noticing the ScalaRaw attribute.
@retronym retronym force-pushed the topic/specialized-unlink branch from 08be401 to f758d79 Compare March 24, 2021 03:26
Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants