asm merge requestshttps://gitlab.ow2.org/asm/asm/-/merge_requests2020-12-19T07:57:58Zhttps://gitlab.ow2.org/asm/asm/-/merge_requests/304Use consistent exceptions in InstructionAdapter.2020-12-19T07:57:58ZEric BrunetonUse consistent exceptions in InstructionAdapter.Closes #317922Closes #317922Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/305Add an analyzeAndComputeMaxs() method in Analyzer.2020-12-21T09:25:08ZEric BrunetonAdd an analyzeAndComputeMaxs() method in Analyzer.Closes #317921Closes #317921Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/306Add some input validations in ClassReader.2020-12-21T07:06:41ZEric BrunetonAdd some input validations in ClassReader.Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/307Add support for jdk 17 (V17)2021-01-12T23:25:01ZRemi ForaxAdd support for jdk 17 (V17)Add support for jdk 17 (V17) also fix some typos (stuff) and refactor Arrays.asList(array).stream() to Arrays.stream(array)Add support for jdk 17 (V17) also fix some typos (stuff) and refactor Arrays.asList(array).stream() to Arrays.stream(array)Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/308Tests that requires preview features should only run if the preview features ...2021-01-03T15:03:47ZRemi ForaxTests that requires preview features should only run if the preview features of the right JDK are enabledTest for jdk 14 and jdk 15 requires the "--enable-preview" on the command line.
This patch
- changes the tests to declare if a test requires --enable-preview or not
and run them only if the flag is present on the command line
- fix Uti...Test for jdk 14 and jdk 15 requires the "--enable-preview" on the command line.
This patch
- changes the tests to declare if a test requires --enable-preview or not
and run them only if the flag is present on the command line
- fix Util.getMajorJavaVersion() because Java 1.8.0 is detected as Java 1 and not Java 8
- update bnd version because of https://github.com/bndtools/bnd/issues/3903
With that, using gradle 6.7.1, with the PMD conf updated and if jacoco release a version compatible with Java 15 (still stuck with Java 14), the build can run on Java 15.
The ultimate goal is to prepare the build to be able to run on Java 17 which is a LTS and which should not have any preview feature that changes the classfile.Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/309Update JaCoCo to version 0.8.62020-12-23T16:13:06ZEvgeny MandrikovUpdate JaCoCo to version 0.8.6https://gitlab.ow2.org/asm/asm/-/merge_requests/310Resolve "ClassRemapper doesn't remap annotation values"2021-01-28T18:39:17ZEric BrunetonResolve "ClassRemapper doesn't remap annotation values"Closes #317929Closes #317929Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/311Use consistent exceptions in checkTypeRef.2021-01-27T18:32:23ZEric BrunetonUse consistent exceptions in checkTypeRef.Closes #317930Closes #317930Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/312Use consistent exceptions in visitLabel.2021-01-27T18:27:58ZEric BrunetonUse consistent exceptions in visitLabel.Closes #317931Closes #317931Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/313Draft: Add map method for method local variables2021-09-19T10:16:09ZJamie MansfieldDraft: Add map method for method local variablesI'm going to leave this as a draft for a brief time - I want to discuss the change with a few projects that I know remap local variables, and try to make this as workable for them as possible.I'm going to leave this as a draft for a brief time - I want to discuss the change with a few projects that I know remap local variables, and try to make this as workable for them as possible.https://gitlab.ow2.org/asm/asm/-/merge_requests/314Improve performance of ClassReader.readStream()2021-05-28T11:08:06ZСергей ЦыпановImprove performance of ClassReader.readStream()Hello, `ClassReader.readStream()` can be reworked to improve it's performance and reduce memory consumption. Currently there are two major problems about it:
- we always allocate a buffer of the same size which is often several times big...Hello, `ClassReader.readStream()` can be reworked to improve it's performance and reduce memory consumption. Currently there are two major problems about it:
- we always allocate a buffer of the same size which is often several times bigger than actual amount of data being read from `InputStream`
- we always return of copy of `byte[]` underlying in `ByteArrayOutputStream`
Using `InputStream.available()` we can presize the buffer in vast majority of cases and even when the whole data is not read within one iteration (for large `InputStreams`) we allocate as much memory as required. Another optimization is about checking whether it was only one read from `InputStream` and in this case the buffer itself can be returned instead of calling `ByteArrayOutputStream.toByteArray()`.
I've used this benchmark available [here](https://github.com/stsypanov/spring-boot-benchmark) to check impact of the patch for start-up of simple Spring Boot application (Spring Boot sources contains repackaged fork of asm):
```java
@State(Scope.Thread)
@BenchmarkMode(Mode.SingleShotTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(jvmArgsAppend = {"-Xms2g", "-Xmx2g"})
public class SpringBootApplicationBenchmark {
private ConfigurableApplicationContext context;
@Benchmark
public Object startUp() {
return context = SpringApplication.run(BenchmarkApplication.class);
}
@TearDown(Level.Invocation)
public void close() {
context.close();
}
}
```
and got the following results:
```
original
Benchmark Mode Cnt Score Error Units
SpringBootApplicationBenchmark.startUp ss 200 718.760 ± 20.549 ms/op
SpringBootApplicationBenchmark.startUp:·gc.alloc.rate ss 200 38.895 ± 0.620 MB/sec
SpringBootApplicationBenchmark.startUp:·gc.alloc.rate.norm ss 200 49776228.720 ± 19919.815 B/op
SpringBootApplicationBenchmark.startUp:·gc.count ss 200 ≈ 0 counts
patched
Benchmark Mode Cnt Score Error Units
SpringBootApplicationBenchmark.startUp ss 200 614.820 ± 7.031 ms/op
SpringBootApplicationBenchmark.startUp:·gc.alloc.rate ss 200 41.678 ± 0.240 MB/sec
SpringBootApplicationBenchmark.startUp:·gc.alloc.rate.norm ss 200 49003403.920 ± 21786.877 B/op
SpringBootApplicationBenchmark.startUp:·gc.count ss 200 ≈ 0 counts
```Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/315Remove redundant '& 0xFF' from int-to-byte cast2021-03-13T10:39:02ZСергей ЦыпановRemove redundant '& 0xFF' from int-to-byte castWhen we do
```java
byte b1 = (byte) (value & 0xFF);
```
we keep from int only 1 lower byte and exactly the same can be achieved with plain cast. See the test below:
```java
public class Main {
public static void main(String[] args) thr...When we do
```java
byte b1 = (byte) (value & 0xFF);
```
we keep from int only 1 lower byte and exactly the same can be achieved with plain cast. See the test below:
```java
public class Main {
public static void main(String[] args) throws Exception {
IntStream.range(Integer.MIN_VALUE, Integer.MAX_VALUE).forEach(value -> {
byte b1 = (byte) (value & 0xFF);
byte b2 = (byte) value;
if (b1 != b2) {
throw new RuntimeException("" + value);
}
});
}
```Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/316Fix the formatting of reference array types in stack map frame outputs.2021-05-01T07:06:19ZEric BrunetonFix the formatting of reference array types in stack map frame outputs.Closes #317942Closes #317942Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/317Commit the change to SonarQube as a specific user2021-05-17T08:15:58ZMartin HamantCommit the change to SonarQube as a specific userHi @ebruneton,
This should now upload to SonarQube as a specific user rather than anonymous user.Hi @ebruneton,
This should now upload to SonarQube as a specific user rather than anonymous user.Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/318Update JaCoCo to version 0.8.72021-05-13T12:36:23ZEvgeny MandrikovUpdate JaCoCo to version 0.8.7It uses ASM 9.1 and provides experimental support for Java 17.
Full changelog - https://www.jacoco.org/jacoco/trunk/doc/changes.htmlIt uses ASM 9.1 and provides experimental support for Java 17.
Full changelog - https://www.jacoco.org/jacoco/trunk/doc/changes.htmlhttps://gitlab.ow2.org/asm/asm/-/merge_requests/319Fix the Javadoc of LdcInsnNode.2021-06-06T07:03:25ZEric BrunetonFix the Javadoc of LdcInsnNode.Closes #317945.Closes #317945.Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/320Resolve "CheckClassAdapter visit method does not allow a private or protected...2021-06-06T07:07:27ZEric BrunetonResolve "CheckClassAdapter visit method does not allow a private or protected inner class"Closes #317943.Closes #317943.Remi ForaxRemi Foraxhttps://gitlab.ow2.org/asm/asm/-/merge_requests/321Fix a broken Javadoc tag in ClassWriter2021-05-28T11:09:39ZJohnny LimFix a broken Javadoc tag in ClassWriterThis PR fixes a broken Javadoc tag in `ClassWriter`.This PR fixes a broken Javadoc tag in `ClassWriter`.https://gitlab.ow2.org/asm/asm/-/merge_requests/322a method with access flags ACC_ABSTRACT and ACC_STRICT is illegal if version ...2021-06-20T09:36:16ZRemi Foraxa method with access flags ACC_ABSTRACT and ACC_STRICT is illegal if version less than V17CheckClassAdapter currently does not check if that a method access_flags with ACC_ABSTRACT and ACC_STRICT is illegal.
Furthermore, the JVM spec of Java 17 now ignores ACC_STRICT thus ACC_ABSTRACT | ACC_STRICT becomes a valid combination ...CheckClassAdapter currently does not check if that a method access_flags with ACC_ABSTRACT and ACC_STRICT is illegal.
Furthermore, the JVM spec of Java 17 now ignores ACC_STRICT thus ACC_ABSTRACT | ACC_STRICT becomes a valid combination for classfile version >= V17Eric BrunetonEric Brunetonhttps://gitlab.ow2.org/asm/asm/-/merge_requests/323add support of Java 182021-06-12T11:41:58ZRemi Foraxadd support of Java 18No classfile format change are currently schedule for Java 18,
the only change is to add a new version V18.
There are numerous changes/fixes scheduled for Java 18
https://openjdk.java.net/jeps/8267650
but none of them directly concern A...No classfile format change are currently schedule for Java 18,
the only change is to add a new version V18.
There are numerous changes/fixes scheduled for Java 18
https://openjdk.java.net/jeps/8267650
but none of them directly concern ASM (perhaps apart re-saying that ACC_SUPER and ACC_STRICT are dead flags)Eric BrunetonEric Bruneton