`is_live` is buggy for generational plans
For nursery GCs in generational plans, objects that are not in the nursery space are not traced (e.g. nonmoving space, immortal space, mature space, etc). Thus MMTk does not know whether it is live or not. However, MMTk should conservatively return true for those objects, as they may be alive.
Currently most spaces return is_live by checking the object is marked or not, and ignore the fact that it is a nursery GC, those objects will not be traced and the mark bit does not tell whether the object is alive or not.
The other option is to return Option<bool> for is_live. When we don't know the liveness, we return None instead. However, in either case, is_live is not only decided by the policy, but also decided by the plan (e.g. nursery GC or mature GC).
Returning true is correct I think. We treat any mature space object as live in nursery GCs.
We had some prior discussion about is_live and is_reachable. Those are not 100% the same as this issue, but some points, such as the meaning of "live", are still relevant.
- https://github.com/mmtk/mmtk-core/issues/1275
- https://github.com/mmtk/mmtk-core/issues/1271