~/talk

Type Specialization of Java Generics - What If Casts Have Teeth ?

Talkat JVM Language Summit 2024 · 2024-08-05..08-07· [java]
github:forax
links:none on file
slides:none on file

Patch to javac propagates type arguments at runtime, creating an AR field per parameterized instance and inserting method-entry checks and cast checks; the experimental Diego prototype rewrites constructors and synthetic bridge methods so recompiled classes interoperate with legacy jars. Running it against a JDK build shows many failing checkcast insertions, mostly from enforcing method-entry/exit and from shared singletons (immutable empty lists, optional.empty) and tricky generic casts in stream/collection APIs, so full reification breaks substantial existing Java code.

AI-written summary · about

  1. 0:00Introduction and context
  2. 1:35The problem: generics vs value types
  3. 4:21Defining the spectrum of specialization
  4. 10:48Experimentation with Diego
  5. 14:53Prototype architecture
  6. 17:49Implementation details
  7. 21:30Adding runtime checks
  8. 24:14Handling separate compilation
  9. 27:09Inheritance and raw types
  10. 31:02Compiler modifications
  11. 33:39Results of the experiment
  12. 35:48Fixing common language issues
  13. 39:49Challenges in upgrading legacy code
  14. 42:31Conclusion and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.