asm merge requestshttps://gitlab.ow2.org/asm/asm/-/merge_requests2018-01-13T07:39:32Zhttps://gitlab.ow2.org/asm/asm/-/merge_requests/95Resolve "Ability to call Type#getElementType with specific number of dimensions"2018-01-13T07:39:32ZEric BrunetonResolve "Ability to call Type#getElementType with specific number of dimensions"Closes #317798Closes #317798Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/143Make it easier for ASM users to work with EA releases of the JDK2018-09-24T07:29:33ZraphwMake it easier for ASM users to work with EA releases of the JDKAllow disabling class file version check in class reader to better allow ASM users to work with EA releases of the JVM after version numbers are increased.
Makes a formerly package-private constructor accessible. As many ASM users sha...Allow disabling class file version check in class reader to better allow ASM users to work with EA releases of the JVM after version numbers are increased.
Makes a formerly package-private constructor accessible. As many ASM users shade ASM, it is already easily possible to use this constructor by creating a subclass in the org.objectweb.asm package that invokes this constructor with the appropriate access rights but it would be nicer to get a more official way to access the constructor.https://gitlab.ow2.org/asm/asm/-/merge_requests/180Call interpreter.copyOperation consistently2018-06-15T17:00:33ZJason ZauggCall interpreter.copyOperation consistentlyBefore this change, `Frame.execute` did not invoke the interpreter's
`copyOperation` method for all values that are pushed on the frame's
when executing some copying instructions.
For example, in the case of `SWAP`, `copyOperation` is i...Before this change, `Frame.execute` did not invoke the interpreter's
`copyOperation` method for all values that are pushed on the frame's
when executing some copying instructions.
For example, in the case of `SWAP`, `copyOperation` is invoked:
value2 = pop();
value1 = pop();
push(interpreter.copyOperation(insn, value2));
push(interpreter.copyOperation(insn, value1));
For `DUP` on the other hand, the original value is pushed onto the
stack without notifying the interpreter:
value1 = pop();
push(value1);
push(interpreter.copyOperation(insn, value1));
This leads to a problem for the `SourceInterpreter`, which collects
for every value a set of potential producer instructions. Given the
bytecode sequence
NEW java/lang/Object
DUP
INVOKESPECIAL java/lang/Object.<init> ()V
In the frame of the `INVOKESPECIAL` instruction, the value on the stack
lists as its producer the `NEW` operation instead of the `DUP`, which
not expected.https://gitlab.ow2.org/asm/asm/-/merge_requests/183WIP: Make ClassWriter reusable2018-06-27T01:50:57ZJason ZauggWIP: Make ClassWriter reusableAdds a `clear()` method to `ClassWriter` to allow the user to
reuse it to write another class without needing to allocate
new buffers for the constant pool, etc.
Furthermore, add a mode that enabled internal reuse of of
buffers class wr...Adds a `clear()` method to `ClassWriter` to allow the user to
reuse it to write another class without needing to allocate
new buffers for the constant pool, etc.
Furthermore, add a mode that enabled internal reuse of of
buffers class writing.
Exposes an overload of `toByteArray` that does not require
a copy of the internal buffer, but rather returns the `ByteVector`
directly. `ByteVector` has been updated to expose its contents
in a read-only manner as a `ByteBuffer` or a `ByteArrayInputStream`.
I've made an initial attempt to include this in the benchmark
framework.
```
# VM version: JDK 1.8.0_162, VM 25.162-b12
Benchmark Mode Cnt Score Error Units
GeneratorBenchmark.asm6_1 thrpt 20 874896.336 ± 10360.316 ops/s
GeneratorBenchmark.asm6_1:+memory.used thrpt 20 ≈ 0 bytes
GeneratorBenchmark.asm6_1:·gc.alloc.rate thrpt 20 2777.524 ± 31.962 MB/sec
GeneratorBenchmark.asm6_1:·gc.alloc.rate.norm thrpt 20 5000.001 ± 0.003 B/op
GeneratorBenchmark.asm6_1:·gc.churn.PS_Eden_Space thrpt 20 2689.738 ± 71.334 MB/sec
GeneratorBenchmark.asm6_1:·gc.churn.PS_Eden_Space.norm thrpt 20 4841.558 ± 101.258 B/op
GeneratorBenchmark.asm6_1:·gc.churn.PS_Survivor_Space thrpt 20 0.162 ± 0.044 MB/sec
GeneratorBenchmark.asm6_1:·gc.churn.PS_Survivor_Space.norm thrpt 20 0.291 ± 0.079 B/op
GeneratorBenchmark.asm6_1:·gc.count thrpt 20 264.000 counts
GeneratorBenchmark.asm6_1:·gc.time thrpt 20 176.000 ms
GeneratorBenchmark.asm6_1_reuse thrpt 20 1053280.540 ± 38925.306 ops/s
GeneratorBenchmark.asm6_1_reuse:+memory.used thrpt 20 ≈ 0 bytes
GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate thrpt 20 1525.059 ± 56.375 MB/sec
GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate.norm thrpt 20 2280.001 ± 0.002 B/op
GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Eden_Space thrpt 20 1455.204 ± 57.245 MB/sec
GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Eden_Space.norm thrpt 20 2175.987 ± 47.373 B/op
GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Survivor_Space thrpt 20 0.171 ± 0.046 MB/sec
GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Survivor_Space.norm thrpt 20 0.257 ± 0.070 B/op
GeneratorBenchmark.asm6_1_reuse:·gc.count thrpt 20 248.000 counts
GeneratorBenchmark.asm6_1_reuse:·gc.time thrpt 20 166.000 ms
```
```
# VM version: JDK 10.0.1, VM 10.0.1+10
Benchmark Mode Cnt Score Error Units
GeneratorBenchmark.asm6_1 thrpt 20 808490.379 ± 9597.741 ops/s
GeneratorBenchmark.asm6_1:·gc.alloc.rate thrpt 20 2567.604 ± 30.110 MB/sec
GeneratorBenchmark.asm6_1:·gc.alloc.rate.norm thrpt 20 5000.001 ± 0.002 B/op
GeneratorBenchmark.asm6_1:·gc.churn.CodeHeap_'non-profiled_nmethods' thrpt 20 0.008 ± 0.002 MB/sec
GeneratorBenchmark.asm6_1:·gc.churn.CodeHeap_'non-profiled_nmethods'.norm thrpt 20 0.016 ± 0.004 B/op
GeneratorBenchmark.asm6_1:·gc.churn.G1_Old_Gen thrpt 20 2574.135 ± 84.224 MB/sec
GeneratorBenchmark.asm6_1:·gc.churn.G1_Old_Gen.norm thrpt 20 5012.769 ± 155.361 B/op
GeneratorBenchmark.asm6_1:·gc.count thrpt 20 235.000 counts
GeneratorBenchmark.asm6_1:·gc.time thrpt 20 250.000 ms
GeneratorBenchmark.asm6_1_reuse thrpt 20 874917.363 ± 2517.632 ops/s
GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate thrpt 20 1266.731 ± 4.102 MB/sec
GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate.norm thrpt 20 2280.001 ± 0.002 B/op
GeneratorBenchmark.asm6_1_reuse:·gc.churn.CodeHeap_'non-profiled_nmethods' thrpt 20 0.004 ± 0.002 MB/sec
GeneratorBenchmark.asm6_1_reuse:·gc.churn.CodeHeap_'non-profiled_nmethods'.norm thrpt 20 0.008 ± 0.004 B/op
GeneratorBenchmark.asm6_1_reuse:·gc.churn.G1_Old_Gen thrpt 20 1266.407 ± 62.495 MB/sec
GeneratorBenchmark.asm6_1_reuse:·gc.churn.G1_Old_Gen.norm thrpt 20 2279.504 ± 113.687 B/op
GeneratorBenchmark.asm6_1_reuse:·gc.count thrpt 20 144.000 counts
GeneratorBenchmark.asm6_1_reuse:·gc.time thrpt 20 147.000 ms
```https://gitlab.ow2.org/asm/asm/-/merge_requests/190WIP: Unknown signatur with Groovy-Eclipse compiler2018-07-26T08:09:53ZTobias GruetzmacherWIP: Unknown signatur with Groovy-Eclipse compilerThis shows a problem where the Groovy-Eclipse compiler creates a type
signature of `!+Ljava/lang/Object;`, which asm cannot parse.
I'm not sure (and wasn't able to find information) about this problem (except reports where people have t...This shows a problem where the Groovy-Eclipse compiler creates a type
signature of `!+Ljava/lang/Object;`, which asm cannot parse.
I'm not sure (and wasn't able to find information) about this problem (except reports where people have the same problem: https://github.com/johnrengelman/shadow/issues/379) or even about what those signatures (`!+`) are supposed to be.
Background: I encountered this problem with the [maven-dependency-plugin](https://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html) while analysing a project compiled with the Groovy-Eclipse compiler, which contained this particular Lambda...
Any help would be appreciated.
PS: I submitted this as a merge request (and not an issue) to show the problem with a test case I built - If you need an additional issue, I can open one, too.https://gitlab.ow2.org/asm/asm/-/merge_requests/223Change the API and/or use defensive copy to prevent the user from modifying…2019-03-17T08:55:25ZEric BrunetonChange the API and/or use defensive copy to prevent the user from modifying…Change the API and/or use defensive copy to prevent the user from modifying internal data structures. This requires one backward incompatible change, namely the removal of the ClassReader.b field. I think this is acceptable, as this shou...Change the API and/or use defensive copy to prevent the user from modifying internal data structures. This requires one backward incompatible change, namely the removal of the ClassReader.b field. I think this is acceptable, as this should normally be rarely used. The changes to ConstantDynamic are not backward incompatible, because this API was experimental up to now. The (unrelated) change of TypePath to a final class is also not an issue, because its unique constructor was package private. There is an inevitable performance impact, especially on ClassReader, but only when using the constructors using a byte array (the stream constructors don't use defensive copy).
This fixes some issues found with PMD in https://gitlab.ow2.org/asm/asm/merge_requests/222. Benchmark results:
```
Benchmark Mode Cnt Score Error Units
AdapterBenchmark.getClassInfo_asm6_1 thrpt 30 14077,888 ± 33,809 ops/s
AdapterBenchmark.getClassInfo_asmCurrent thrpt 30 10941,547 ± 23,452 ops/s
AdapterBenchmark.read_asm6_1 thrpt 30 643,338 ± 1,550 ops/s
AdapterBenchmark.read_asmCurrent thrpt 30 640,690 ± 1,481 ops/s
```Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/188Avoid double-compilation of :asm2018-12-01T12:36:10ZNikita SkvortcovAvoid double-compilation of :asmReuse production classes of ":asm" project. Postpone retrofitting until a jar of production classes is required (e.g., for publishing). Use raw production classes as dependencies of tools, required to produce the jar.
This also allows th...Reuse production classes of ":asm" project. Postpone retrofitting until a jar of production classes is required (e.g., for publishing). Use raw production classes as dependencies of tools, required to produce the jar.
This also allows the project to be correctly imported by Intellij IDEAhttps://gitlab.ow2.org/asm/asm/-/merge_requests/220when testing, do not load classes that are tagged as preview2019-01-13T23:39:08ZRemi Foraxwhen testing, do not load classes that are tagged as previewclassfiles tagged as preview (with the minor version set to 65535/-1) can not be loaded by a VM unless the VM is started with the flag --enable-preview so this patch disable the loading of preview classes during the testclassfiles tagged as preview (with the minor version set to 65535/-1) can not be loaded by a VM unless the VM is started with the flag --enable-preview so this patch disable the loading of preview classes during the testEric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/243Use a thread local to avoid having to override or call deprecated methods in...2019-02-23T10:10:36ZEric BrunetonUse a thread local to avoid having to override or call deprecated methods in...Use a thread local to avoid having to override or call deprecated methods in MethodVisitor subclasses. See the comments in MethodVisitor. It is possible to get the same behavior by using an unused bit of 'opcode' as the 'preventRedirect'...Use a thread local to avoid having to override or call deprecated methods in MethodVisitor subclasses. See the comments in MethodVisitor. It is possible to get the same behavior by using an unused bit of 'opcode' as the 'preventRedirect' flag, but this would be a non-generic and hacky method.Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/249Fix NPE in CheckMethodAdapter2019-02-23T14:22:28ZEvgeny MandrikovFix NPE in CheckMethodAdapterFixes #317869Fixes #317869https://gitlab.ow2.org/asm/asm/-/merge_requests/257Cache the CONSTANT_InvokeDynamic constants.2019-03-02T15:06:49ZEric BrunetonCache the CONSTANT_InvokeDynamic constants.I made new measurements which confirm that this does not degrade performance for pre Java 8 classes, and slightly increases performance for classes with CONSTANT_InvokeDynamic constants.I made new measurements which confirm that this does not degrade performance for pre Java 8 classes, and slightly increases performance for classes with CONSTANT_InvokeDynamic constants.Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/268Make build jars reproducible2019-08-07T12:17:20ZVladimir SitnikovMake build jars reproduciblefixes https://gitlab.ow2.org/asm/asm/issues/317879fixes https://gitlab.ow2.org/asm/asm/issues/317879https://gitlab.ow2.org/asm/asm/-/merge_requests/273Publish the license to Maven. It will be available at URLs such as...2019-09-12T07:40:36ZEric BrunetonPublish the license to Maven. It will be available at URLs such as...Publish the license to Maven. It will be available at URLs such as https://repo1.maven.org/maven2/org/ow2/asm/asm/7.2/asm-7.2-LICENSE.txt.
Closes #317881Publish the license to Maven. It will be available at URLs such as https://repo1.maven.org/maven2/org/ow2/asm/asm/7.2/asm-7.2-LICENSE.txt.
Closes #317881https://gitlab.ow2.org/asm/asm/-/merge_requests/279Add an abstract MemberVisitor class to be able to reduce code duplication in...2019-11-25T19:10:22ZEric BrunetonAdd an abstract MemberVisitor class to be able to reduce code duplication in...Add an abstract MemberVisitor class to be able to reduce code duplication in ClassReader. Not sure if the class and/or its methods must be public.
Results of 3 benchmark runs with this change:
Benchmark Mode C...Add an abstract MemberVisitor class to be able to reduce code duplication in ClassReader. Not sure if the class and/or its methods must be public.
Results of 3 benchmark runs with this change:
Benchmark Mode Cnt Score Error Units
AdapterBenchmark.read_asm7_1 thrpt 30 623,892 ± 1,506 ops/s
AdapterBenchmark.read_asmCurrent thrpt 30 621,629 ± 1,835 ops/s
Benchmark Mode Cnt Score Error Units
AdapterBenchmark.read_asm7_1 thrpt 30 624,589 ± 1,260 ops/s
AdapterBenchmark.read_asmCurrent thrpt 30 622,971 ± 2,541 ops/s
Benchmark Mode Cnt Score Error Units
AdapterBenchmark.read_asm7_1 thrpt 30 623,515 ± 1,680 ops/s
AdapterBenchmark.read_asmCurrent thrpt 30 622,151 ± 1,619 ops/s
and without it:
Benchmark Mode Cnt Score Error Units
AdapterBenchmark.read_asm7_1 thrpt 30 624,141 ± 1,511 ops/s
AdapterBenchmark.read_asmCurrent thrpt 30 625,117 ± 1,653 ops/s
Benchmark Mode Cnt Score Error Units
AdapterBenchmark.read_asm7_1 thrpt 30 607,326 ± 1,285 ops/s
AdapterBenchmark.read_asmCurrent thrpt 30 621,902 ± 1,259 ops/s
Benchmark Mode Cnt Score Error Units
AdapterBenchmark.read_asm7_1 thrpt 30 623,548 ± 1,490 ops/s
AdapterBenchmark.read_asmCurrent thrpt 30 621,814 ± 1,579 ops/sRemi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/280Added ClassLoader argument for constructor in ClassReader.2019-12-14T10:27:19ZMaroš PrejsaAdded ClassLoader argument for constructor in ClassReader.https://gitlab.ow2.org/asm/asm/-/merge_requests/284update bnd gradle plugin to 5.0.02020-03-20T20:18:28ZRemi Foraxupdate bnd gradle plugin to 5.0.0update bnd gradle plugin version
It seems that the previous version is not available anymore ??update bnd gradle plugin version
It seems that the previous version is not available anymore ??Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/287Fix code to allow empty record by using a new flag ACC_RECORD2020-04-01T18:03:51ZRemi ForaxFix code to allow empty record by using a new flag ACC_RECORDAllow empty record by flagging all record classes with ACC_RECORDAllow empty record by flagging all record classes with ACC_RECORDEric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/289Shorts, Bytes, Chars and Booleans are int values2020-04-16T22:25:16ZIdan HorowitzShorts, Bytes, Chars and Booleans are int valuesThis change fixes an exception that is thrown when analyzing load instructions with Short/Byte/Character/Boolean values.
Example stack trace:
`Caused by: java.lang.IllegalArgumentException: Illegal LDC constant 10
at org.objectweb.asm...This change fixes an exception that is thrown when analyzing load instructions with Short/Byte/Character/Boolean values.
Example stack trace:
`Caused by: java.lang.IllegalArgumentException: Illegal LDC constant 10
at org.objectweb.asm.tree.analysis.BasicInterpreter.newOperation(BasicInterpreter.java:145)
at org.objectweb.asm.tree.analysis.BasicInterpreter.newOperation(BasicInterpreter.java:52)
at org.objectweb.asm.tree.analysis.Frame.execute(Frame.java:270)
at org.objectweb.asm.tree.analysis.Analyzer.analyze(Analyzer.java:200)
... 8 more`https://gitlab.ow2.org/asm/asm/-/merge_requests/296Update MethodWriter.java2020-07-20T14:14:50ZZhang QingsongUpdate MethodWriter.java- update previousFrameOffset for Frame Type F_NEW, too.- update previousFrameOffset for Frame Type F_NEW, too.https://gitlab.ow2.org/asm/asm/-/merge_requests/301Allows classes extending ClassReader to decide if visit MethodParameters2020-12-20T08:02:29ZGuillermo VarelaAllows classes extending ClassReader to decide if visit MethodParametersWith https://gitlab.ow2.org/asm/asm/-/merge_requests/278 MethodParameters attribute is skipped when using SKIP_DEBUG. That's stopping us from upgrading to a newer ASM version.
Having the decision being made in a protected method we coul...With https://gitlab.ow2.org/asm/asm/-/merge_requests/278 MethodParameters attribute is skipped when using SKIP_DEBUG. That's stopping us from upgrading to a newer ASM version.
Having the decision being made in a protected method we could override it and start using a new version of ASM.
For clarity, not using the SKIP_DEBUG flag would not work for our case as that would include too much of extra things. Having a customizable condition for MethodParameters was the cleanest change I could came up with.Remi ForaxRemi Forax