Bytecode Pattern Matching
summary
Hands-on exploration of how javac, ECJ and kotlinc transform simple source into surprising bytecode, with JaCoCo/EclEmma used to measure and then filter out compiler-generated artifacts. Concrete examples: enums produce a synthetic values array and a generated constructor/accessor bridge methods; string switches become a two-stage hashcode-and-equals sequence that can turn 3 source branches into 9 bytecode branches; try/finally and try-with-resources duplicate calls; Java 11 nestmates remove some synthetic shims. Filters are implemented in JaCoCo and improve coverage reports.
AI-written summary · about
chapters (12)
- 0:00Start
- 0:57Java Code Coverage
- 4:02Disclaimer
- 5:39Constant Pool
- 6:06Default Constructor
- 10:07Java Virtual Machine Specification
- 12:05Constructor Invocation
- 13:11Accessible Constructor
- 14:24Accessor Methods
- 15:41Bridge Methods
- 33:34Default Arguments and Kotlin
- 37:49Conclusion
related talks
46mJava, Code Coverage & Their Best Friend: Bytecode
56mJava 4..21, Kotlin, Code Coverage, bytecode: scandals, intrigues, investigations
46mKotlin, Java 4..18, Code Coverage and their best friend — bytecode: ...
35mJava Source to Byte Code Transformation - The Hidden Story!
44mJava Code Coverage Mechanics
53mWell there's your problem! Your engine's missing! A look under Java's hood
55mThe Art of Java Language Pattern Matching
46mThe Art of Java Type Patterns
