Add classfile-api module: java.lang.classfile (JEP 484) parse, generate, transform with timing instrumentation, ASM 9.11.1 comparison, version limits, JDK 24/25/26 API diff

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
This commit is contained in:
2026-10-29 04:14:57 +00:00
co-authored by Claude Sonnet 5.5
parent eca73ad544
commit 41101bea40
37 changed files with 1763 additions and 0 deletions
+106
View File
@@ -0,0 +1,106 @@
$ javap -c -p -v demo.Generated (the class GenerateDemo wrote; 25.0.5+8-LTS)
public class demo.Generated
minor version: 0
major version: 69
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #2 // demo/Generated
super_class: #6 // java/lang/Object
interfaces: 0, fields: 0, methods: 5, attributes: 0
Constant pool:
#1 = Utf8 demo/Generated
#2 = Class #1 // demo/Generated
#3 = Utf8 <init>
#4 = Utf8 ()V
#5 = Utf8 java/lang/Object
#6 = Class #5 // java/lang/Object
#7 = NameAndType #3:#4 // "<init>":()V
#8 = Methodref #6.#7 // java/lang/Object."<init>":()V
#9 = Utf8 add
#10 = Utf8 (II)I
#11 = Utf8 hello
#12 = Utf8 ()Ljava/lang/String;
#13 = Utf8 Hello from generated bytecode
#14 = String #13 // Hello from generated bytecode
#15 = Utf8 sumTo
#16 = Utf8 (I)J
#17 = Utf8 classify
#18 = Utf8 (I)Ljava/lang/String;
#19 = Utf8 negative
#20 = String #19 // negative
#21 = Utf8 non-negative
#22 = String #21 // non-negative
#23 = Utf8 Code
#24 = Utf8 StackMapTable
#25 = Utf8 java/lang/String
#26 = Class #25 // java/lang/String
{
public demo.Generated();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #8 // Method java/lang/Object."<init>":()V
4: return
public static int add(int, int);
descriptor: (II)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=2, args_size=2
0: iload_0
1: iload_1
2: iadd
3: ireturn
public static java.lang.String hello();
descriptor: ()Ljava/lang/String;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc #14 // String Hello from generated bytecode
2: areturn
public static long sumTo(int);
descriptor: (I)J
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=1
0: lconst_0
1: lstore_1
2: iconst_1
3: istore_3
4: iload_3
5: iload_0
6: if_icmpgt 20
9: lload_1
10: iload_3
11: i2l
12: ladd
13: lstore_1
14: iinc 3, 1
17: goto 4
20: lload_1
21: lreturn
StackMapTable: number_of_entries = 2
frame_type = 253 /* append */
offset_delta = 4
locals = [ long, int ]
frame_type = 15 /* same */
public static java.lang.String classify(int);
descriptor: (I)Ljava/lang/String;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=1, args_size=1
0: iload_0
1: ifge 9
4: ldc #20 // String negative
6: goto 11
9: ldc #22 // String non-negative
11: areturn
StackMapTable: number_of_entries = 2
frame_type = 9 /* same */
frame_type = 65 /* same_locals_1_stack_item */
stack = [ class java/lang/String ]
}