mmtk-core
mmtk-core copied to clipboard
Merge SFT with Space
trait SFT
(Space Function Table) was created so that we can use it as trait objects, as at that time, Space<VM, PR>
could not be used as trait objects. To solve this, SFT
was introduced and some of functions in Space
were moved to SFT
.
https://github.com/mmtk/mmtk-core/pull/108 removed type parameters of Space<VM>
, and makes it possible to merge what is in SFT
back to Space
. We should think about whether we should merge SFT
back with Space
.
Pros:
- Less traits.
- One
Space
trait, no confusion.
Cons:
- As we plan to provide a more efficient mechanism to implement SFT (https://github.com/mmtk/mmtk-core/issues/55), the merging will make it unclear what would be in space function table.
A related type is SpaceDescriptor
. Similar to SFT which maps object addresses to dynamically dispatched Space
instances, a SpaceDescriptor
maps object addresses to some selected space metadata. They actually serve similar purposes.
Related links:
- https://github.com/mmtk/mmtk-core/issues/984 This issue mentioned the space indices in
SpaceDescriptor
andDenseChunkMap
(an implementation of SFTMap). - https://github.com/mmtk/mmtk-core/pull/952 An attempt to remove
SpaceDescriptor
, but was cancelled because we still thinkSpaceDescriptor
is useful. - https://mmtk.zulipchat.com/#narrow/stream/262673-mmtk-core/topic/descriptor_map Further discussion.