Closed scabug closed 13 years ago
Imported From: https://issues.scala-lang.org/browse/SI-3974?orig=1 Reporter: @magarciaEPFL
@paulp said: It occurs to me that the ZipFile bug I've been dealing with for an eternity (which I enclose the stack trace of here because it just hit me again: partest hangs and this is always among the threads) could well be related. I think I will tackle this right now.
"ForkJoinPool-1-worker-3" daemon prio=5 tid=196240800 nid=0x1973de000 runnable [1973dc000]
java.lang.Thread.State: RUNNABLE
at java.util.zip.ZipFile.getNextEntry(Native Method)
at java.util.zip.ZipFile.access$$400(ZipFile.java:29)
at java.util.zip.ZipFile$$2.nextElement(ZipFile.java:313)
- locked <141623488> (a java.util.zip.ZipFile)
at java.util.zip.ZipFile$$2.nextElement(ZipFile.java:299)
at scala.tools.nsc.io.ZipArchive$$$$anon$$1$$$$anon$$2.next(ZipArchive.scala:253)
at scala.tools.nsc.io.ZipArchive$$$$anon$$1$$$$anon$$2.next(ZipArchive.scala:250)
at scala.collection.Iterator$$class.foreach(Iterator.scala:631)
at scala.tools.nsc.io.ZipArchive$$$$anon$$1$$$$anon$$2.foreach(ZipArchive.scala:250)
at scala.collection.IterableLike$$class.foreach(IterableLike.scala:79)
at scala.tools.nsc.io.ZipArchive$$$$anon$$1.foreach(ZipArchive.scala:248)
at scala.tools.nsc.io.ZipContainer$$ZipRootCreator.apply(ZipArchive.scala:145)
at scala.tools.nsc.io.ZipArchive.root(ZipArchive.scala:206)
- locked <1416234e8> (a scala.tools.nsc.io.ZipArchive)
at scala.tools.nsc.io.ZipContainer$$class.iterator(ZipArchive.scala:172)
at scala.tools.nsc.io.ZipArchive.iterator(ZipArchive.scala:199)
at scala.collection.IterableLike$$class.foreach(IterableLike.scala:79)
at scala.tools.nsc.io.AbstractFile.foreach(AbstractFile.scala:84)
at scala.collection.TraversableLike$$class.collect(TraversableLike.scala:271)
at scala.tools.nsc.io.AbstractFile.collect(AbstractFile.scala:84)
at scala.tools.nsc.util.DirectoryClassPath.classes(ClassPath.scala:315)
- locked <141623570> (a scala.tools.nsc.util.DirectoryClassPath)
at scala.tools.nsc.util.MergedClassPath$$$$anonfun$$classes$$3.apply(ClassPath.scala:342)
at scala.tools.nsc.util.MergedClassPath$$$$anonfun$$classes$$3.apply(ClassPath.scala:342)
at scala.collection.LinearSeqOptimized$$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.util.MergedClassPath.classes(ClassPath.scala:342)
- locked <141623638> (a scala.tools.nsc.util.JavaClassPath)
at scala.tools.nsc.symtab.SymbolLoaders$$PackageLoader.doComplete(SymbolLoaders.scala:150)
at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:58)
at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:32)
at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:690)
at scala.tools.nsc.symtab.Definitions$$definitions$$.init(Definitions.scala:828)
at scala.tools.nsc.Global$$Run.<init>(Global.scala:602)
at scala.tools.partest.nest.DirectCompiler.compile(CompileManager.scala:100)
at scala.tools.partest.nest.CompileManager.shouldCompile(CompileManager.scala:165)
at scala.tools.partest.nest.Worker$$$$anonfun$$runTestCommon$$1$$1$$$$anonfun$$10.apply(Worker.scala:496)
at scala.tools.partest.nest.Worker$$$$anonfun$$runTestCommon$$1$$1$$$$anonfun$$10.apply(Worker.scala:496)
at scala.tools.partest.nest.Worker$$$$anonfun$$runTestCommon$$1$$1.apply(Worker.scala:498)
at scala.tools.partest.nest.Worker$$$$anonfun$$runTestCommon$$1$$1.apply(Worker.scala:487)
at scala.tools.partest.nest.Worker.runInContext$$1(Worker.scala:432)
at scala.tools.partest.nest.Worker.runTestCommon$$1(Worker.scala:487)
at scala.tools.partest.nest.Worker.processSingleFile$$1(Worker.scala:558)
at scala.tools.partest.nest.Worker$$$$anonfun$$runTests$$2$$$$anonfun$$apply$$2.apply$$mcV$$sp(Worker.scala:1069)
@paulp said: (In r23423) Sprinkling in some names to avoid reflective calls in the compiler as suggested by magarcia. Closes #3974, no review.
There's a structural invocation in
nsc.ast.parser.Scanners
. Not sure whether there's a performance impact, but doing away with it is easy. Rather than defininglookaheadReader
(inCharArrayReader.scala
) to have a refinement type, give a name to its class:Besides that one, there are three other cases of dynamic dispatch in the compiler sources (granted,
forMSIL
without-optimize
) found after placing a breakpoint atCleanUp
on:case ad@ApplyDynamic(qual0, params) =>