-
Notifications
You must be signed in to change notification settings - Fork 3.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
[backport] Upgrade to scala-asm 6.2 #7089
Conversation
Avoid performance problem after ASM upgrade in prod/cons analysis ASM 6.2 now creates a new Frame inside the loop in which `newExceptionValue` is called. We were including this frame in the case-class equality of the pseudo-instruction, `ExceptionProducer`, and upon receiving new instances each time the `ProdCons` analysis massively slowed down. This commit just captures the data we need: the stack top of the handler frame. Upgrade to scala-asm 6.2 See: scala/scala-asm#5 Upstream changes in ASM: scala/scala-asm@ASM_6_0...ASM_6_2 http://asm.ow2.io/versions.html The motivations, other than just keeping current, are: - support for Java 9/10/11 updates to the classfile format. - reducing needless String => Array[Char] conversions thanks to internal changes in ASM. This PR will fail to build until we publish artifact from scala/scala-asm. Includes a workaround for scala/bug#10418 Move to the standard way of defining a custom asm.Attribute It seems we don't need CustomAttr in our fork of scala-asm, we can just override Attribute.write. Customise label handling without needing to modify ASM directly Comment on our customizations to asm.tree.*Node
@retronym how do you estimate the risk for regressions? |
I'd be happy to get this change into 2.12.x. As one test, we do a ASM seems to be pretty well tested itself these days. |
@lrytz could you do this diff and merge if it looks good? |
I've published a bootstrapped distribution as
And produced a
https://gist.github.com/25b1cf35e039d8a6fb3ab838e98dfa6f The diff has only one class of change: // access flags 0x1
public <init>(Lscala/util/matching/Regex$MatchIterator;)V
- // parameter final $outer
+ // parameter final synthetic $outer
ALOAD 1
IFNONNULL L0
ACONST_NULL What's the cause of that? |
The same change occured when the original PR was merged to 2.13.x. I don't think we noticed. Javac marks its outer parameters with class Test {
class Inner {};
}
@lrytz thoughts? |
Related? scala/bug#10880 |
Oh, my mistake. The baseline for comparison should be a self-bootstrapped build of the base commit to include #6672, which adds the |
this made a bunch of projects become green again in the Scala 2.12-on-JDK-10 community build 🎉 |
Scala 2.12.7 is due today. However given that Java 11 will be released next week and a couple of days later ASM 7.0 will be released as well would it make sense to postpone the Scala 2.12.7 release for like 10 days to also pull in ASM 7.0? |
I find it too risky to pull in a major version bump of ASM like that on 2.12. (Let alone that I hope to merge the last PR for 2.12.7 this morning ;-)) We'll definitely look into ASM 7 for 2.13.x, and possibly back port to 2.12.x later. Note that we only officially support Java 8 both on 2.12 and 2.13. We will try to improve JDK 11 support for the 2.12 series over time, but I think Feb is a reasonable time frame given that 2.12.0 will soon have been out for two years. PS: If you need faster support, we do have commercial offerings for that... |
@adriaanm Thanks, I understand. |
Ok, thanks for raising this in any case! I don't follow the ASM list myself, so it's a good reminder we should bump soon at least on 2.13.x :-) |
(scala/community-build#742 can't catch every possible issue, but it does assure that 2.12.7 can't have a JDK compatibility bug as bad as the one that forced the withdrawal of 2.12.5. so there's that.) |
@adriaanm @SethTisue ASM 7.0 beta released! The final release should happen "Problably in a few weeks.". Let's use it in Scala 2.13? |
Asm 7 provides support for java 11. Java 11 is the next lts version after java 8 so a big deal for corporates |
@mkeskells See above comment. |
@mkurz I saw it - that's why I made the comment |
is there at least one specific known issue that upgrading to ASM 7 for 2.12.8 would fix...? that would change the benefit vs. risk calculation. perhaps we could do the upgrade for 2.13.x and then decide later whether known issues justify a backport for 2.12.8 |
there isn't a specific issue that we are looking for, and see what issues occur on 2.13 seems like a good plan, and then its an down to seeing which is harder - maintaining the differences and backport/forward-port issues or upgrading |
ASM 7 released! Would it be nice to have that in |
Any chance you upgrade to ASM 7 until |
#7384 :-) |
@lrytz Nice! Thanks! |
|
Backported as part of scala#7089 The benchmarks project in the 2.12.x branch doesn't have scala-compiler in its classpath. As CI doesn't run, or even compile, the benchmarks, the compile error wasn't caught.
Backport #6733 to 2.12.x in order to fix scala/bug#10717