v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
garbage-collector.h
Go to the documentation of this file.
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_GARBAGE_COLLECTOR_H_
6
#define V8_HEAP_CPPGC_GARBAGE_COLLECTOR_H_
7
8
#include <optional>
9
10
#include "
include/cppgc/common.h
"
11
#include "
src/heap/cppgc/heap-config.h
"
12
13
namespace
cppgc
{
14
namespace
internal
{
15
16
// GC interface that allows abstraction over the actual GC invocation. This is
17
// needed to mock/fake GC for testing.
18
class
GarbageCollector
{
19
public
:
20
// Executes a garbage collection specified in config.
21
virtual
void
CollectGarbage
(
GCConfig
) = 0;
22
virtual
void
StartIncrementalGarbageCollection
(
GCConfig
) = 0;
23
24
// The current epoch that the GC maintains. The epoch is increased on every
25
// GC invocation.
26
virtual
size_t
epoch
()
const
= 0;
27
28
// Returns if the stack state is overridden.
29
virtual
std::optional<EmbedderStackState>
overridden_stack_state
()
const
= 0;
30
31
// These virtual methods are also present in class HeapBase.
32
virtual
void
set_override_stack_state
(
EmbedderStackState
state) = 0;
33
virtual
void
clear_overridden_stack_state
() = 0;
34
35
#ifdef V8_ENABLE_ALLOCATION_TIMEOUT
36
virtual
std::optional<int> UpdateAllocationTimeout() = 0;
37
#endif
// V8_ENABLE_ALLOCATION_TIMEOUT
38
};
39
40
}
// namespace internal
41
}
// namespace cppgc
42
43
#endif
// V8_HEAP_CPPGC_GARBAGE_COLLECTOR_H_
cppgc::internal::GarbageCollector
Definition
garbage-collector.h:18
cppgc::internal::GarbageCollector::StartIncrementalGarbageCollection
virtual void StartIncrementalGarbageCollection(GCConfig)=0
cppgc::internal::GarbageCollector::clear_overridden_stack_state
virtual void clear_overridden_stack_state()=0
cppgc::internal::GarbageCollector::overridden_stack_state
virtual std::optional< EmbedderStackState > overridden_stack_state() const =0
cppgc::internal::GarbageCollector::epoch
virtual size_t epoch() const =0
cppgc::internal::GarbageCollector::set_override_stack_state
virtual void set_override_stack_state(EmbedderStackState state)=0
cppgc::internal::GarbageCollector::CollectGarbage
virtual void CollectGarbage(GCConfig)=0
heap-config.h
common.h
cppgc
Definition
cross-heap-remembered-set.h:14
cppgc::EmbedderStackState
EmbedderStackState
Definition
common.h:15
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
cppgc::internal::GCConfig
Definition
heap-config.h:58
src
heap
cppgc
garbage-collector.h
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0