• Omer Katz's avatar
    cppgc: Initial incremental marking implementation. · 132727fd
    Omer Katz authored
    This CL adds a basic implementation of incremental marking for standalone GC.
    Followup CLs include:
    * Use bytes instead of time as deadline
    * Port incremental marking schedule from blink
    * Mark on allocation
    * Guarantees for progres/termination for standalone GC
    * etc...
    
    Calling StartIncrementalGarbageCollection triggers StartMarking which
    schedules incremental marking as non-nestable tasks.
    For unified heap, marking will continue running until it runs out of
    work but it won't finalize independently.
    For standalone, when incremental runs out of work it will schedule a new
    task in which it will finalize marking and trigger the rest of the GC.
    Users of standalone can also force finalization before incremental
    marking as finished using FinalizeIncrementalGarbageCollectionIfRunning.
    Calling CollectGarbage would also finalize an on-going incremental GC
    if one exists. Otherwise it will trigger an atomic GC.
    
    See the following doc for explanation of the various methods:
    https://docs.google.com/document/d/1ZhJY2fOoD8sH53ZxMh2927Zl8sXqA7azJgcQTWx-YKs/edit?usp=sharing
    
    Bug: chromium:1056170
    Change-Id: I75ead414eb9da9f8b7f71c4638b9830fce7708ca
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2298009
    Commit-Queue: Omer Katz <omerkatz@chromium.org>
    Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
    Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#69480}
    132727fd
cpp-heap.cc 5.66 KB