diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2017-02-17 09:51:07 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2017-02-17 19:40:33 +1000 |
commit | 09c7edc8a83caaa03127574d38c70a2e5e3b294d (patch) | |
tree | e4ed4adea5afc0a8ca7fc28250438901a7cf55aa /src/compiler/scala/tools/util | |
parent | 502e3c6296e5e997549b7e496e0bbfa62c522110 (diff) | |
download | scala-09c7edc8a83caaa03127574d38c70a2e5e3b294d.tar.gz scala-09c7edc8a83caaa03127574d38c70a2e5e3b294d.tar.bz2 scala-09c7edc8a83caaa03127574d38c70a2e5e3b294d.zip |
Faster and simpler Java 9 classpath implementation
- Take advantage of the `/packages` index provided by the
jrt file system to avoid (expensive) Files.exist for
non-existent entries across the full list of modules.
- Extends ClassPath directly which leads to a simpler
implemnentation that using the base class.
- Add a unit test that shows we can read classes and packages
from the Java standard library.
Fixes scala/scala-dev#306
With this change bootstrap time under Java 9 was comparable to
Java 8. Before, it was about 40% slower.
Diffstat (limited to 'src/compiler/scala/tools/util')
-rw-r--r-- | src/compiler/scala/tools/util/PathResolver.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala index 188cabbc8d..f845656980 100644 --- a/src/compiler/scala/tools/util/PathResolver.scala +++ b/src/compiler/scala/tools/util/PathResolver.scala @@ -234,7 +234,7 @@ final class PathResolver(settings: Settings) { // Assemble the elements! def basis = List[Traversable[ClassPath]]( - JImageDirectoryLookup.apply(), // 0. The Java 9 classpath (backed by the jrt:/ virtual system) + JrtClassPath.apply(), // 0. The Java 9 classpath (backed by the jrt:/ virtual system, if available) classesInPath(javaBootClassPath), // 1. The Java bootstrap class path. contentsOfDirsInPath(javaExtDirs), // 2. The Java extension class path. classesInExpandedPath(javaUserClassPath), // 3. The Java application class path. |