Commit 62c869b
committed
feat: Implement Monomorphic Inline Cache (MIC) for message sends
Add one-slot inline cache to MessageNode for fast method dispatch:
- cachedClass: stores the last receiver class seen
- cachedMethod: stores the method for that class
- callCount: tracks call site usage (for future PIC)
Update WorkFrame to include msgNode reference for wfSendMessage.
Update VM to check cache before full method lookup:
- Cache hit: use cached method directly (bypass lookupMethod)
- Cache miss: do full lookup and update cache
The MIC is populated when message sends are evaluated from
MessageNode (nkMessage). Continuation-based sends don't
have cache access yet (msgNode is nil).
Note: Performance impact needs evaluation - may need tuning.1 parent f995b1a commit 62c869b
5 files changed
Lines changed: 1784 additions & 1477 deletions
File tree
- lib/harding/gui
- Gtk4
- Ide
- src/harding
- codegen
- interpreter
0 commit comments