mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
An instance of a compiled class reaches untyped code as a capsule, which a property site sent to its helper on every read: the helper normalizes the capsule, tests each class's key in turn, and loads the field. A read site now emits the helper's plain field branches inline. A capsule whose key pointer is one of those classes' keys loads the field from its instance and shares the inline hits' conversion. A branch is emitted only when its field holds a plain dyn cell and every subclass the helper's normalization can rebox the key to reads the same field from the same slot. Getters, bag properties, unset fields and other capsules keep the helper.