For each MetadataSpec, mmtk-core has assumptions about how many bits it should have. However, the spec is defined by the binding, and they can use any number of bits. Incorrect number of bits may cause MMTk to fail obscurely. We need to fix this. We can do either of the two:
Preventing users creating an arbitrary metadata spec. For example, we do not expose public constructor for metadata specs, and only provides functions for specific metadata specs, e.g. something like new_forwarding_pointer_spec() etc, and we fill the number of bits in mmtk-core.
Have assertions to check if the spec is valid. This could be a compile-time check.
We also should make the assumption and the requirement for each spec very clear in the ObjectModel so binding developers know what they need to provide.
We now use a specific type for each kind of metadata in ObjectModel, which predefines the number of bits and the region size. This issue can be closed.
For each
MetadataSpec
, mmtk-core has assumptions about how many bits it should have. However, the spec is defined by the binding, and they can use any number of bits. Incorrect number of bits may cause MMTk to fail obscurely. We need to fix this. We can do either of the two:new_forwarding_pointer_spec()
etc, and we fill the number of bits in mmtk-core.We also should make the assumption and the requirement for each spec very clear in the
ObjectModel
so binding developers know what they need to provide.