Implementing Efficient Indirections
Résumé
We study and compare three different implementations of indirections: pointers, descriptors and maillons. Pointers are efficient but inflexible: the target object is accessible without protection and cannot be moved easily. An indirection through an object descriptor facilitates in particular object faulting, copying garbage collection, migration, locking and late binding. Unfortunately the cost to applications is high, because every access must test attributes of the descriptor. We propose an alternative implementation, called maillons, where the descriptor directly contains the dereference code and no test is necessary on the common path. In contract with descriptors, an action is attached to the maillon itself and not to the calling code. We have implemented different kinds of maillons, and measured them in micro- and macro-benchmarks. The micro-benchmarks indicate that a maillon is dereferenced in twice the time of the equivalent pointer. The macro-benchmarks indicate that, the impact on the application times is acceptable