-
Notifications
You must be signed in to change notification settings - Fork 81
Description
As I mentioned in this Zulip conversation, the current API Scanning::scan_object is flawed because its tls: VMWorkerThread argument prevents it from being used by mutator threads. But both SATB barriers and coalescing RC barriers need to scan objects, and they are executed by mutators. Currently, the lxr branch works around this issue by passing VMWorkerThread(VMThread::UNINITIALIZED) to the VM binding, and it works because the OpenJDK binding ignores that value.
We should introduce another API function in Scanning which differs from the current scan_object and scan_object_and_trace_edges function in the following ways:
- It takes a parameter
tls: VMMutatorThreadinstead. - It only needs to visit the values of reference fields, and does not need to update those fields.
And it will be used by write barriers.
It is similar to the old JikesRVM API back in 2006 named enumeratePointers, except I think we only need to enumerate pointer values instead of pointer locations.