Although gentag and settag may be sufficient for malloc, heaps that perform iteration (for example, sweeping) need a gettag to create valid object pointers. Otherwise the heap would need to redudantly store the tags.
HeapPage::VisitObjects(ObjectVisitor* visitor) {
const uintptr_t start = this->object_start();
const uintptr_t end = this->object_end();
uintptr_t scan = start;
while (scan < end) {
HeapObjectPtr obj = static_cast<HeapObjectPtr>(scan | gettag(scan));
visitor->VisitObject(obj);
scan += obj->HeapSize();
}
}
Note that aarch64 provides ldg.
Although gentag and settag may be sufficient for malloc, heaps that perform iteration (for example, sweeping) need a gettag to create valid object pointers. Otherwise the heap would need to redudantly store the tags.
Note that aarch64 provides ldg.