Fix reference-type obj handling in generational CC

Reference-type objects in old generation with referent in young
generation are not handled correctly. During card-table scan, we only
visit such objects, which does not process the referent. Also, we don't
set the read-barrier state to gray. Eventually, if the mutator calls
GetReferent() on such objects (after done_scanning_ is set to true),
then the read barrier will not be called, breaking the to-space
invariant.

Test: art/tests/testrunner/testrunner.py --target
Bug: 120792243
Change-Id: I53e8f0bc99ef99eb6e0ea7d743a6185d37d7ff8c
2 files changed