Skip to content

Add visit_slice to EdgeVisitor #986

@wks

Description

@wks

It is stupid to enqueue the address of each and every element of an array into a ProcessEdgesWork. We can enqueue slices directly.

For example, when scanning an Object[], instead of enqueuing &object[0], &object[1], &object[2], ..., &object[object.length - 1], we can enqueue one single OpenJDKEdgeRange { range: &object[0]..&object[object.length - 1] }. That saves both space and time.

But we need to take into account the effect of prefetching as well as eager edge loading (See: #584). If we decide that it is better to load edges eagerly when scanning the object, we may want to enqueue the edge address together with the value it holds. If that's the case, there will be no space advantage to enqueue slices because we need to enqueue values, too. But there may be a temporal advantage. If we know that consecutive edges in a ProcessEdgesWork work packet are loaded sequentially from an array, we may take advantage of it and do prefetching more efficiently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-highPriority: High. A high-priority issue should be fixed as soon as possible.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions