• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_HEAP_CPPGC_COMPACTION_WORKLISTS_H_
6 #define V8_HEAP_CPPGC_COMPACTION_WORKLISTS_H_
7 
8 #include <unordered_set>
9 
10 #include "src/heap/base/worklist.h"
11 
12 namespace cppgc {
13 namespace internal {
14 
15 class CompactionWorklists final {
16  public:
17   CompactionWorklists() = default;
18 
19   CompactionWorklists(const CompactionWorklists&) = delete;
20   CompactionWorklists& operator=(const CompactionWorklists&) = delete;
21 
22   using MovableReference = const void*;
23 
24   using MovableReferencesWorklist =
25       heap::base::Worklist<MovableReference*, 256 /* local entries */>;
26 
movable_slots_worklist()27   MovableReferencesWorklist* movable_slots_worklist() {
28     return &movable_slots_worklist_;
29   }
30 
31   void ClearForTesting();
32 
33  private:
34   MovableReferencesWorklist movable_slots_worklist_;
35 };
36 
37 }  // namespace internal
38 }  // namespace cppgc
39 
40 #endif  // V8_HEAP_CPPGC_COMPACTION_WORKLISTS_H_
41