zigself
zigself copied to clipboard
runtime: Add a basic monomorphic cache implementation
Tasks:
- [x] Allocate an inline cache inside
ExecutableMap - [x] Put receiver map-method object pairs inside the inline cache
- [ ] Query the inline cache during method lookup and use it first
- [ ] Invalidate the inline cache when the dependent method changes
- [ ] Make the inline cache weak, so that references can be dropped when they are no longer referenced by anything else
Optional tasks:
- [ ] Implement quickening (https://bernsteinbear.com/blog/inline-caching-quickening/)
Questions to answer:
- [ ] Who owns the inline cache?
- [ ] Should the inline cache be an
ArrayObjector should it be given its own dedicated object type? - [ ] Should global objects' inline caches be affected by actor-owned methods?
- [ ] Should actors' inline caches be affected by actor-owned methods?
- [ ] Implications of inline caching from a concurrency standpoint