-
Notifications
You must be signed in to change notification settings - Fork 78
Description
In GitLab by @steveblackburn on Jan 22, 2020, 02:35
The hot path of the GC will be conditioned on the space that a given object is in. For example, if tracing an object, the behavior will vary depending on what space the referent is in.
One idea is to have something like a dynamic dispatch table for each space. More specifically, the dispatch table would be duplicated, so that the function pointer would be discovered by simple bit shifting and arithmetic on the object pointer. If, for example, regions were allocated at 64KB granularity (ie all pages within that region map to the same space), then for each 64KB space, there would be a 'space dispatch table'.
The simple alternative is to look up the space (eg #51), and then have a switch statement that does different semantics according to which space identifier got returned. It is not clear which will perform better or which is cleaner.