-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Port JVM backend refactor from Scala 2 #15322
Conversation
b51f668
to
fc9b098
Compare
test performance please |
1 similar comment
This comment was marked as outdated.
This comment was marked as outdated.
performance test scheduled: 4 job(s) in queue, 1 running. |
Performance test finished successfully: Visit https://dotty-bench.epfl.ch/15322/ to see the changes. Benchmarks is based on merging with main (8d13cbb) |
fc9b098
to
cfbb763
Compare
cfbb763
to
0b96142
Compare
compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
Outdated
Show resolved
Hide resolved
The commits "Don't create semanticdb files when writing to JAR" and "Use JarWriter only when target jar is empty" don't seem to belong to this PR. They don't correspond to anything in the mentioned scala/scala PRs. The last commit about whitespace should be squashed with relevant previous commits. Sorry for the very late review. :s It was a bit of a daunting one. |
fyi @lrytz |
0b96142
to
2dd0f68
Compare
Yes, that's a thing to issues present only in Scala 3. During the refactoring I was present with some silent issues, producing empty jars or containing only a single file even though jar size suggested it has more data. It happened due to content malformation - in case if output directory ( |
2dd0f68
to
fa42975
Compare
Could https://github.com/lampepfl/dotty/blob/main/docs/_docs/internals/backend.md be updated too? It seems that the schema at the top is outdated with respect to this refactoring. |
…fined as JAR. (#16790) Change extracted from #15322 where the issue was discovered Writing to outputDirectory when it is a JAR can lead to producing malformed file, it is using FileOutputStream which works somehow correct, but if we would open the same JAR again in later phase (eg. genBCode) header of the file would be malformed: the result file grows in size respectively to provided input, but we can read only files written by SemanticDB phase.
fa42975
to
46a3b13
Compare
happy to see this springing back to life — I'm curious if there's a specific motivation for reviving it, or if you just happen to be getting around to it |
@sjrd The mentioned changes were extracted and merged in a separate PR along with updated documentation. So if you'll have a bit of spare time it should be read for a new round of review. |
I have put it at the top of my TODO list. I should have time for this tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, the second commit is 99% fixups for the first commit, and only 1% of its changes actually correspond to its commit message.
At least squash them. Even better: still extract the second commit but in a way that its changes are really only about what it says it does. The corresponding commit in Scala 2 is tiny.
Otherwise, looks good.
46a3b13
to
fa96482
Compare
The corresponding commit has no real value in the case of Scala 3 - there is no optimizer in the JVM backend, because of that I've decided to squash the changes together. |
It's a cold day in hell today!!! 🎉🎉🎉 Thank you so much @WojciechMazur and @sjrd for seeing this through! |
This PR ports scala/scala#6124 introduces backend parallelism, on top of the previously ported changes introduced in #15322 Adds Scala2 flags: * `-Yjar-compression-level:N` * `-Ybackend-parallelism:N` * `-Ybackend-worker-queue:N`
This PR ports JVM backend refactor from Scala 2 as part of the #14912 thread.
It squashes changes based on the PRs:
The last refactor introducing backend parallelism would be introduced in the follow up PR