Zef interpreter after Optimization #6: Object Model and Inline Caches
This is a huge change to the Zef interpreter:
-
Objects and dynamic scopes are no longer hashtables. Instead, they are tightly packes contiguous objects. Objects use the
Objecttype and dynamic scopes use theStoragetype.Objectis a subtype ofStorage. -
All objects have a
ClassObjectthat describes them, and theClassObjectis where the hashtables are. All dynamic scopes have aContextthat describes them, and theContextis where the hashtables are. Hence, we donβt have to create hashtables every time we create scopes and objects, but the hashtables are still there. -
The common case of object or scope lookup is via an inline cache - code that has been specialized based on whatever lookup path succeeded the first time that particular access was attempted.
constructcache.his where the construction of inline caches happens.
This is a 4.5x speed-up.