A Classfile API for the JDK
summary
Claims a new standard JDK Class-File API (JEP 8280389) that parses, generates and transforms class files with a model-driven element stream core, immutability and lazy parsing. Builds a concrete API: element models + builders + composable transforms, uses java.lang.constant descriptors instead of raw strings, and optimizes with constant pool sharing to bulk-copy unchanged bytes. Results: nicer ergonomics than ASM, do-nothing transforms often faster, full-featured but pay-as-you-go parsing when you inspect or modify content.
AI-written summary · about
chapters (18)
- 0:00Intro
- 1:43Processing classfiles
- 3:04Why another classfile API?
- 6:15A classfile library for the JDK
- 8:05Design goals
- 11:17Pruning the design space
- 12:56Inspirational prototype: generation
- 21:14Finding the primitive
- 23:01Modeling the classfile
- 24:50Turning the model into an API
- 26:54How it all fits together
- 28:22Example: reading classfiles
- 29:24Shoring up builders
- 30:19Design principles and goals
- 33:32Example: Transformation
- 39:22The big trick Constant pool sharing
- 41:06Other performance tricks
- 45:39Summary
related talks
51mThe Java Class File API
44mOW2 ASM and JEP 457: Class-File API
43mDeep Dive into the .class File and Even Deeper
32mUnveiling the Hidden Layers of Java Class Files Beyond Bytecode
35mJava Source to Byte Code Transformation - The Hidden Story!
45mDeep Dive into the .class File and the Class Loader
51mRethinking Java String Concatenation
52mJava 22 and Beyond: A Roadmap of Innovations
