asm merge requestshttps://gitlab.ow2.org/asm/asm/-/merge_requests2023-12-21T12:17:45Zhttps://gitlab.ow2.org/asm/asm/-/merge_requests/388ASM Analyzer: fix regression introduced in fix of bug #317991.2023-12-21T12:17:45ZEric BrunetonASM Analyzer: fix regression introduced in fix of bug #317991.Closes #318009Closes #318009Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/387Fix some issues reported by Gradle about the build script2023-12-11T12:52:41ZRemi ForaxFix some issues reported by Gradle about the build scriptUpgrade JMH plugin, move source/target compat under the java plugin.
Gradle still reports that the project asm-test defines the test launcher implicitly and I have no idea why.Upgrade JMH plugin, move source/target compat under the java plugin.
Gradle still reports that the project asm-test defines the test launcher implicitly and I have no idea why.Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/386Change the build file to use spotless so the build works with Java 17 and Jav...2023-12-11T11:26:02ZRemi ForaxChange the build file to use spotless so the build works with Java 17 and Java 21Change the build file to replace 'com.github.sherter.google-java-format' by spotless.
Spotless executes the jar of google-java-format as a subprocess instead of using the VM that is running the build.
So we can now have a buid that run ...Change the build file to replace 'com.github.sherter.google-java-format' by spotless.
Spotless executes the jar of google-java-format as a subprocess instead of using the VM that is running the build.
So we can now have a buid that run with Java 11, Java 17 and Java 21.
Theoritically, the build should be a little slower but, in practice, i am not able to see any effects thanks to gradle being multithreaded.
Spotless error message is also better, instead of just saying that a file is not correctly formatted, it prints the diff between the file and the file once formatted.Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/385Use Java 11 features when it makes the code better2023-12-11T07:21:03ZRemi ForaxUse Java 11 features when it makes the code betterThis change tests to use immutable List.of()/Set.of()/Map.of() whenever it's possible, so the contract is more clear,
There are other small changes that are just me reading the code and finding things like useless catch, code can be sim...This change tests to use immutable List.of()/Set.of()/Map.of() whenever it's possible, so the contract is more clear,
There are other small changes that are just me reading the code and finding things like useless catch, code can be simplified, etcEric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/384Change the retofitter to be able to rewrite Java 11 bytecode2023-12-10T14:56:44ZRemi ForaxChange the retofitter to be able to rewrite Java 11 bytecodeIt's time to stop using Java 8 as the source version and at least move to Java 11.
I've modified the retrofitter
- so all string concatenations that use invokedynamic since Java 9 are rewritten to use a StringBuilder
(each string buil...It's time to stop using Java 8 as the source version and at least move to Java 11.
I've modified the retrofitter
- so all string concatenations that use invokedynamic since Java 9 are rewritten to use a StringBuilder
(each string builder is isolated to its own static method which is easier to write AND should perform better
because most of our allocation are inside the call to a constructor of an exception).
- to add a new verifier pass that check that we can safely remove the nestmate attributes (NestHost, NestMembers)
Since Java 11, the compiler can directly reference a private member from a nested class without adding an access$ method
using the nestmate attributes instead. Given we want to remove those attributes, the new verifier pass check that
this is safe but not allowing a class to reference a private member from another class.Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/383Update google-java-format to 1.18.12023-12-09T15:51:34ZRemi ForaxUpdate google-java-format to 1.18.1Bump the version of the google-java-format to 1.18.1
This is a controvertial change given that it seems that the new version now rewrite comments (it removes spaces in some of our inline comments).
So a lot of files are changed but sem...Bump the version of the google-java-format to 1.18.1
This is a controvertial change given that it seems that the new version now rewrite comments (it removes spaces in some of our inline comments).
So a lot of files are changed but semantically the code has not changed.Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/382Bump version to support Java 232024-03-21T13:13:00ZRemi ForaxBump version to support Java 23Add Opcodes.V23 to support Java 23.Add Opcodes.V23 to support Java 23.Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/381Remove an extra space at the end of a line.2023-10-18T06:14:38ZEric Spishak-ThomasRemove an extra space at the end of a line.https://gitlab.ow2.org/asm/asm/-/merge_requests/380Add a getArgumentCount() method in Type.2023-09-23T17:58:22ZEric BrunetonAdd a getArgumentCount() method in Type.Closes #318002Closes #318002Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/378Update JaCoCo to version 0.8.102023-06-09T10:06:44ZEvgeny MandrikovUpdate JaCoCo to version 0.8.10Full changelog - https://www.jacoco.org/jacoco/trunk/doc/changes.htmlFull changelog - https://www.jacoco.org/jacoco/trunk/doc/changes.htmlhttps://gitlab.ow2.org/asm/asm/-/merge_requests/377recognize Java 22 version (66)2023-06-08T21:18:33ZEvgeny Mandrikovrecognize Java 22 version (66)Closes #318001Closes #318001https://gitlab.ow2.org/asm/asm/-/merge_requests/376Wrap RuntimeException in AnalyzerException in Analyzer.analyze().2023-05-07T15:30:44ZEric BrunetonWrap RuntimeException in AnalyzerException in Analyzer.analyze().Closes #317998Closes #317998Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/374Fix bug in CheckFrameAnalyzer with static methods.2023-05-07T15:32:17ZEric BrunetonFix bug in CheckFrameAnalyzer with static methods.Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/373Fix an off-by-one in Analyzer.2023-12-04T08:01:57ZEric BrunetonFix an off-by-one in Analyzer.Closes #317991Closes #317991Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/372Add support for 'new' after 'invokespecial <init>' (in bytecode offset order).2023-06-26T17:36:58ZEric BrunetonAdd support for 'new' after 'invokespecial <init>' (in bytecode offset order).The ASM code has always been assuming that an `<init>` call must be after a `NEW` instruction (in bytecode offset order). This assumption was based on the last paragraph of https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#j...The ASM code has always been assuming that an `<init>` call must be after a `NEW` instruction (in bytecode offset order). This assumption was based on the last paragraph of https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.10.2.4, but perhaps wrongly (since an exception to this rule is mentioned). In any case, I realized that this paragraph has been removed in later versions of the spec (https://docs.oracle.com/javase/specs/jvms/se20/html/jvms-4.html#jvms-4.10.2.4).
The following adds support for the case of `NEW` after `<init>`:
- support for forward label references in the stack map table (in `Label`),
- a new abstract type format for forward label references in uninitialized_item stack map items (in `Frame`),
- a corresponding new `Symbol` type to use in the `SymbolTable`'s type table (in `Symbol` and `SymbolTable`).
The new `Symbol` type needs a reference to a `Label`. One option would have been to add a new field, of `Label` type, in `Symbol`. But this would have increased memory usage for all use cases, whereas this new data is only needed in rare cases. Another option would have been to change an existing `String` field of `Symbol` to `Object`, so that we could store either a `String` or a `Label` here, depending on the symbol's type. But this is a kind of hack which was used in previous ASM versions and has been removed since. The option I finally chose is to store a label index in the existing `Symbol.value` field. For this I had to add a new table of labels in `SymbolTable`, and a new hash set of labels as well. Since we don't want to depend on `java.util`, this unfortunately adds quite a bit of code in `SymbolTable`.
Closes #317995Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/371fix ASMifier,2023-01-15T14:17:32ZRemi Foraxfix ASMifier,Fix the version map, Map.put is called twice with the key V20 instead of one with V20 and one with V21.
This is something Map.of() detects but we will never use Map.of() given the backward compatibility requirements of ASM.Fix the version map, Map.put is called twice with the key V20 instead of one with V20 and one with V21.
This is something Map.of() detects but we will never use Map.of() given the backward compatibility requirements of ASM.Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/370Feature/illegal argument error handling2023-01-21T10:24:39ZJustin BlankFeature/illegal argument error handlingTwo changes designed to give more helpful error messages in Frame and CheckMethodAdapter.Two changes designed to give more helpful error messages in Frame and CheckMethodAdapter.https://gitlab.ow2.org/asm/asm/-/merge_requests/369recognize Java 21 version (65)2023-01-14T10:56:50ZRemi Foraxrecognize Java 21 version (65)Add support for Java version 21 (65)Add support for Java version 21 (65)Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/368Add a hook in ClassReader to allow subclasses to get the bytecode offset of v...2022-12-13T07:25:21ZEric BrunetonAdd a hook in ClassReader to allow subclasses to get the bytecode offset of visited instructions.Closes #317982. I propose to add this hook to address #317982. Users can override `ClassReader`, store the last visited offset in a field, and read this field from each `visitXxx` method in `MethodVisitor` to get the bytecode offset of e...Closes #317982. I propose to add this hook to address #317982. Users can override `ClassReader`, store the last visited offset in a field, and read this field from each `visitXxx` method in `MethodVisitor` to get the bytecode offset of each instruction. I checked that this does not impact performance with the `AdapterBenchmark.read_asmCurrent` JMH benchmark.Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/367Add support for line numbers equal to 0.2022-12-13T07:00:25ZEric BrunetonAdd support for line numbers equal to 0.Closes #317989Closes #317989Remi ForaxRemi Forax