-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2766 sourceFile null causes NPE #2767
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The compiler interface subclasses `scala.tools.nsc.Global`, and loading this new subclass before each `compile` task forces HotSpot JIT to deoptimize larges swathes of compiled code. It's a bit like SBT has rigged the dice to always descend the longest ladder in a game of Snakes and Ladders. The slowdown seems to be larger with Scala 2.12. There are a number of variables at play, but I think the main factor here is that we now rely on JIT to devirtualize calls to final methods in traits whereas we used to emit static calls. JIT does a good job at this, so long as classloading doesn't undo that good work. This commit extends the existing `ClassLoaderCache` to encompass the classloader that includes the compiler interface JAR. I've resorted to adding a var to `AnalyzingCompiler` to inject the dependency to get the cache to the spot I need it without binary incompatible changes to the intervening method signatures.
SD-232 Recycle classloaders to be anti-hostile to JIT
This changes the output to: ``` > show externalDependencyClasspath [info] Updating {file:/xxx/hello/}root... [info] Resolving jline#jline;2.12.1 ... [info] Done updating. [info] * Attributed(/Users/xxx/.sbt/boot/scala-2.11.8/lib/scala-library.jar) [info] * Attributed(/Users/xxx/.ivy2/cache/commons-io/commons-io/jars/commons-io- 2.4.jar) ```
[0.13.13] Improve `show` when key returns a `Seq`
eed3si9n
approved these changes
Oct 25, 2016
Could you create a forward port for sbt 1.0? |
avdv
added a commit
to avdv/zinc
that referenced
this pull request
Oct 25, 2016
This avoids an NPE when accessing position info in case `sourcePath` or `sourceFile` are `null`. See sbt/sbt#2766 for a stack trace.
Sure thing, done. Thanks for merging! |
eed3si9n
added a commit
to sbt/zinc
that referenced
this pull request
Oct 31, 2016
Forward port of sbt/sbt#2767
7 tasks
eed3si9n
pushed a commit
to eed3si9n/scala
that referenced
this pull request
May 14, 2019
This avoids an NPE when accessing position info in case `sourcePath` or `sourceFile` are `null`. See sbt/sbt#2766 for a stack trace.
lrytz
pushed a commit
to lrytz/scala
that referenced
this pull request
Nov 5, 2019
This avoids an NPE when accessing position info in case `sourcePath` or `sourceFile` are `null`. See sbt/sbt#2766 for a stack trace. Rewritten from sbt/zinc@e2a249a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #2766