Files
sdk/runtime/vm/heap/incremental_compactor.h
Ryan Macnak 6694cae4d7 [vm, gc] Incremental compaction, take 3.
- Use atomics to mark remembered cards in the write barrier stub.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52513
Bug: https://github.com/dart-lang/sdk/issues/55754
Change-Id: I1f78c6b680a6ae9170613ba328a244335a6343e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368480
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-30 21:01:39 +00:00

41 lines
1.4 KiB
C++

// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef RUNTIME_VM_HEAP_INCREMENTAL_COMPACTOR_H_
#define RUNTIME_VM_HEAP_INCREMENTAL_COMPACTOR_H_
#include "vm/allocation.h"
namespace dart {
// Forward declarations.
class PageSpace;
class ObjectVisitor;
class IncrementalForwardingVisitor;
// An evacuating compactor that is incremental in the sense that building the
// remembered set is interleaved with the mutator. The evacuation and forwarding
// is not interleaved with the mutator, which would require a read barrier.
class GCIncrementalCompactor : public AllStatic {
public:
static void Prologue(PageSpace* old_space);
static bool Epilogue(PageSpace* old_space);
static void Abort(PageSpace* old_space);
private:
static bool SelectEvacuationCandidates(PageSpace* old_space);
static void CheckFreeLists(PageSpace* old_space);
static bool HasEvacuationCandidates(PageSpace* old_space);
static void CheckPreEvacuate(PageSpace* old_space);
static void Evacuate(PageSpace* old_space);
static void CheckPostEvacuate(PageSpace* old_space);
static void FreeEvacuatedPages(PageSpace* old_space);
static void VerifyAfterIncrementalCompaction(PageSpace* old_space);
};
} // namespace dart
#endif // RUNTIME_VM_HEAP_INCREMENTAL_COMPACTOR_H_