Skip to content

New object-scanning API for barriers #1375

@wks

Description

@wks

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:

  1. It takes a parameter tls: VMMutatorThread instead.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions