Skip to content

Rebase on ASM 6.2 #5

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

Closed
retronym opened this issue May 30, 2018 · 12 comments
Closed

Rebase on ASM 6.2 #5

retronym opened this issue May 30, 2018 · 12 comments
Assignees

Comments

@retronym
Copy link
Member

retronym commented May 30, 2018

$ git remote add upstream-asm https://gitlab.ow2.org/asm/asm
$ git fetch upstream-asm --tags
$ git push origin ASM_6_2

ASM_6_0...ASM_6_2

$ git log  --oneline ASM_6_0..v6.0.0-scala-1
fdb06854 (tag: v6.0.0-scala-1, origin/s-6.0) [asm-cherry-pick] Fill exception message for max String literal length
ea125bd4 [asm-cherry-pick] Fix findItemByIndex in case of hash collisions
0e5b0ab9 [asm-cherry-pick] Call interpreter.copyInstruction consistently
3210f654 [asm-cherry-pick] Multiple methods for initializing analysis values
41733544 [asm-cherry-pick] Allow setting stack values in analysis frames
75c9cfb8 [asm-cherry-pick] Clarify the doc of MethodInsnNode.owner
8f28b7f2 [asm-cherry-pick] Fix typos
f71d8867 [asm-cherry-pick] Use MethodWriter to compute maxLocals / maxStack
84e71cf2 [asm-cherry-pick] Log names on method size overflow
6665e1ff [asm-cherry-pick] Associate LabelNodes with their corresponding label
958c576a [asm-cherry-pick] Ensure instructions belong only to one list
4f7acc2e [asm-cherry-pick] asm.CustomAttribute class
145c8595 [asm-cherry-pick] Build infrastructure
665ea289 Remove trailing whitespace
937747f7 Update `@links`, `@associates`
7a11f0df Update imports
1ae83b79 Update package clauses
794b6628 Move sources to src/main/java/scala/tools/asm
273fcf82 Convert all line endings to unix
8e73bfa4 Remove unused files
000a5395 [asm-cherry-pick] Script for deleting unused files and preparing sources
$ git cherry-pick 679bfd52
[s-6.2 d324049b] [asm-cherry-pick] Script for deleting unused files and preparing sources

$ bash -x scripts/selectAndPrepareSources

$ git push --set-upstream retronym s-6.2

$ git cherry-pick 145c8595
[s-6.2 ef09c20b] [asm-cherry-pick] Build infrastructure
[success] Total time: 0 s, completed 30/05/2018 8:38:07 PM
[warn] MiMa will NOT run because no mimaPreviousVersion is provided.
[info] Compiling 94 Java sources to /Users/jz/code/scala-asm/target/classes...
[warn] bootstrap class path not set in conjunction with -source 1.5
[warn] source value 1.5 is obsolete and will be removed in a future release
[warn] -options.
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:40: package aQute.bnd.header does not exist
[error] import aQute.bnd.header.Attrs;
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:41: package aQute.bnd.header does not exist
[error] import aQute.bnd.header.Parameters;
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:42: package aQute.bnd.osgi does not exist
[error] import aQute.bnd.osgi.Analyzer;
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:43: package aQute.bnd.osgi does not exist
[error] import aQute.bnd.osgi.Constants;
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:44: package aQute.bnd.osgi does not exist
[error] import aQute.bnd.osgi.EmbeddedResource;
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:45: package aQute.bnd.osgi does not exist
[error] import aQute.bnd.osgi.Jar;
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:46: package aQute.bnd.service does not exist
[error] import aQute.bnd.service.AnalyzerPlugin;
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:48: cannot find symbol
[error]   symbol: class AnalyzerPlugin
[error] public class ModuleInfoBndPlugin implements AnalyzerPlugin {
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:56: cannot find symbol
[error]   symbol:   class Analyzer
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]   public boolean analyzeJar(Analyzer analyzer) throws Exception {
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:57: cannot find symbol
[error]   symbol:   variable Constants
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]     String moduleName = analyzer.getProperty(MODULE_NAME, analyzer.getProperty(Constants.BUNDLE_SYMBOLICNAME));
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:58: cannot find symbol
[error]   symbol:   variable Constants
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]     String moduleVersion =  analyzer.getProperty(MODULE_VERSION, analyzer.getProperty(Constants.BUNDLE_VERSION));
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:60: cannot find symbol
[error]   symbol:   variable Constants
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]     String exportPackages = analyzer.getProperty(MODULE_EXPORTS, analyzer.getProperty(Constants.EXPORT_PACKAGE));
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:75: cannot find symbol
[error]   symbol:   class Parameters
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]       Parameters requireParams = analyzer.parseHeader(requireModules);
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:77: cannot find symbol
[error]   symbol:   class Attrs
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]         Attrs attrs = requireParams.get(requireName);
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:86: cannot find symbol
[error]   symbol:   class Parameters
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]       Parameters exportParams = analyzer.parseHeader(exportPackages);
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:104: cannot find symbol
[error]   symbol:   class Jar
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]     Jar jar = analyzer.getJar();
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:105: cannot find symbol
[error]   symbol:   class EmbeddedResource
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]     EmbeddedResource moduleInfo = new EmbeddedResource(bytecode, System.currentTimeMillis());
[error] /Users/jz/code/scala-asm/src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java:105: cannot find symbol
[error]   symbol:   class EmbeddedResource
[error]   location: class scala.tools.asm.tools.ModuleInfoBndPlugin
[error]     EmbeddedResource moduleInfo = new EmbeddedResource(bytecode, System.currentTimeMillis());
[error] (compile:compileIncremental) javac returned nonzero exit code
[error] Total time: 1 s, completed 30/05/2018 8:38:08 PM
/code/scala-asm on s-6.2*
$ git commit -a -m "Remove unneeded parts of asm: ModuleInfoBndPlugin / Retrofitter"
[s-6.2 048c0792] Remove unneeded parts of asm: ModuleInfoBndPlugin / Retrofitter
 3 files changed, 398 deletions(-)
 delete mode 100644 src/main/java/scala/tools/asm/tools/ModuleInfoBndPlugin.java
 delete mode 100644 src/main/java/scala/tools/asm/tools/Retrofitter.java
 delete mode 100644 src/main/java/scala/tools/asm/tools/jdk1.5.0.12.txt.gz

$ git commit -a -m "Disable javadoc linting"
[s-6.2 0a56eca7] Disable javadoc linting
 1 file changed, 1 insertion(+), 1 deletion(-)

$ git cherry-pick 145c8595..fdb06854

$ git rebase -i 257c4b95 # squash `-Xdoclint:none` change into `Build infrastructure"
$ git diff head
diff --git a/versions.properties b/versions.properties
index ad86745dd7..d8dc24c899 100644
--- a/versions.properties
+++ b/versions.properties
@@ -7,5 +7,5 @@ starr.version=2.13.0-M4
 # Other usages:
 #  - scala-asm: jar content included in scala-compiler
 #  - jline: shaded with JarJar and included in scala-compiler
-scala-asm.version=6.0.0-scala-1
+scala-asm.version=6.0-22-gdbf7433
 jline.version=2.14.6

$ git co 2.13.x; sbt 'partest --pos --neg --run --terse'
...
[success] Total time: 437 s, completed 30/05/2018 9:05:35 PM
@retronym
Copy link
Member Author

retronym commented May 30, 2018

@lrytz It's the first time I've done this. Thanks for the great instructions. Could you check I've followed them correctly? I haven't done the work of reviewing the diff in ASM in full yet, I remember you'd started that process.

My branch is at https://github.com/retronym/scala-asm/tree/s-6.2

@lrytz
Copy link
Member

lrytz commented May 30, 2018

Could you replace the commit retronym@7299c39 by an update to scripts/gitignoreSelectFiles in retronym@d324049 ?

@lrytz
Copy link
Member

lrytz commented May 30, 2018

Wow are there really 532 comits between 6.0 and 6.2 !?!

@lrytz
Copy link
Member

lrytz commented May 30, 2018

Something looks wrong; your branch seems to build on top of https://github.com/scala/scala-asm/tree/ASM_6_0, not 6_2.

@lrytz
Copy link
Member

lrytz commented May 30, 2018

The scripts will need some updating, because the repository structure changed quite a bit between 6.0 and 6.2

@retronym
Copy link
Member Author

retronym commented May 31, 2018

I've redone the rebase, updating the gitignore and scripts and merging the asm-cherry-pick commits.

The branch still needs a round of cleanup, and a few changes in scala/scala, but it looks to be passing the test suite.

The upstream code has been through a reformat, so just about every patch required some manual work. Above that, there have been some renames and some structural changes that required some careful merging.

retronym added a commit to retronym/scala that referenced this issue Jun 6, 2018
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 motivation, other than just keeping current, is getting
support for Java 9/10/11 updates to the classfile format.

This PR will fail to build until we publish artifact
from scala/scala-asm.
retronym added a commit to retronym/scala that referenced this issue Jun 6, 2018
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.
@retronym
Copy link
Member Author

retronym commented Jun 6, 2018

@lrytz This branch is ready for a final round of review. scala/scala#6733 contains the compiler changes.

@lrytz
Copy link
Member

lrytz commented Jun 6, 2018

Looks good, thank you for solving all the conflicts! The script changes can be squashed.

@mkurz
Copy link

mkurz commented Jun 6, 2018

Maybe it's time to try to get all the patches into the official asm repo?

@lrytz
Copy link
Member

lrytz commented Jun 6, 2018

See https://gitlab.ow2.org/asm/asm/issues/317828#note_36176

@retronym
Copy link
Member Author

retronym commented Jun 7, 2018

@lrytz I tried to cut tag and release, but ran into a problem with the release script: https://travis-ci.org/scala/scala-asm/builds/389051634

$ jdk_switcher use openjdk6
Switching to OpenJDK6 (java-1.6.0-openjdk-amd64), JAVA_HOME will be set to /usr/lib/jvm/java-6-openjdk-amd64
update-java-alternatives: directory does not exist: /usr/lib/jvm/java-1.6.0-openjdk-amd64
...
...

17.77s$ sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install openjdk-6-jdk
Reading package lists...

In the last released build, jdk_switcher has the same error, and also preceded the apt-get, but JDK6 seemed to be on the path by the time the build ran.

retronym added a commit to retronym/scala that referenced this issue Jun 7, 2018
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.
@retronym
Copy link
Member Author

retronym commented Jun 7, 2018

scala-asm 6.2.0-scala-2 is now released. I worked around the JDK6 problem on Travis by using JDK8 to build.

retronym added a commit to retronym/scala that referenced this issue Jun 7, 2018
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.
retronym added a commit to retronym/scala that referenced this issue Jun 7, 2018
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.
lrytz pushed a commit to retronym/scala that referenced this issue Jun 7, 2018
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
@retronym retronym closed this as completed Jun 9, 2018
retronym added a commit to retronym/scala that referenced this issue Jun 20, 2018
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
retronym added a commit to retronym/scala that referenced this issue Jun 20, 2018
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
retronym added a commit to retronym/scala that referenced this issue Jun 20, 2018
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
retronym added a commit to retronym/scala that referenced this issue Jun 20, 2018
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
retronym added a commit to retronym/scala that referenced this issue Jun 20, 2018
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
isaacl pushed a commit to isaacl/scala that referenced this issue Jul 2, 2018
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
ElfoLiNk pushed a commit to ElfoLiNk/scala that referenced this issue Aug 18, 2018
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
ElfoLiNk pushed a commit to ElfoLiNk/scala that referenced this issue Aug 18, 2018
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
adriaanm pushed a commit to adriaanm/scala that referenced this issue May 23, 2019
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

(cherry picked from commit 79b7f2a)
adriaanm pushed a commit to adriaanm/scala that referenced this issue May 23, 2019
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

(cherry picked from commit 79b7f2a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants