Revisiting Dynamic Dispatch for Modern Architectures
summary
Proposes a flat dispatch hash table per class that stores compiled code pointers for every selector actually sent to that class, compiling a found method for the target class on first miss so future dispatches go direct. Collisions go to a lightweight disambiguator and tables grow by rehashing; updates use compare-and-swap so no global locks on multicore. Trades memory for speed, aims for performance near static vtable dispatch while enabling aggressive inlining and larger compilation units for better optimization.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:13Why revisit now
- 2:40Inline caching challenges
- 3:23Smalltalk message dispatch
- 5:33Control structure optimizations
- 8:08Global and inline caching
- 9:14Java vs Smalltalk dispatch
- 11:04Flat dispatch for Smalltalk
- 13:09On-demand method compiling
- 14:57Hash collision handling
- 15:42Aggressive inlining
- 17:06Code generation in Zag Smalltalk
- 17:47Conclusions and future
- 18:33Q&A
related talks
16mContextual Dispatch for Function Specialization
29mPredicate Dispatch
27mDynamic Dispatch and Type Inference in Fortress
50mA new general dispatch mechanism to speed up various slow Raku constructs
09mDynamic Dispatch of Context-Sensitive Optimizations
01h 21mNon-local compiler transformations in the presence of dynamic dispatch
01h 07mDynamic Polymorphism With Code Injection and Metaclasses
26mAn Analysis of Compiled Code Reusability in Dynamic Compilation
