Implement inline caches for property access
Add polymorphic inline caches (ICs) to GetPropertyByName and SetPropertyByName
bytecode operations. Each property-access site caches up to 4 (shape, slot_index)
pairs for O(1) fast-path lookups, with megamorphic fallback when more shapes are
seen.
Key changes:
- Define InlineCache with Uninitialized/Monomorphic/Polymorphic/Megamorphic states
- Add Vec<InlineCache> to Function, allocated by the compiler per call site
- Extend GetPropertyByName/SetPropertyByName opcodes with a u16 IC index operand
- VM fast path: on IC hit, bypass shape table lookup and read/write slots directly
- Only own-property hits on shaped objects are cached (not prototype chain)
- IC updates on slow-path misses populate the cache for subsequent iterations
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>