v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
cpp-marking-state.h
Go to the documentation of this file.
1// Copyright 2021 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_JS_CPP_MARKING_STATE_H_
6#define V8_HEAP_CPPGC_JS_CPP_MARKING_STATE_H_
7
8#include <memory>
9
14
15namespace v8 {
16namespace internal {
17
18class JSObject;
19class EmbedderDataSlot;
20
21class CppMarkingState final {
22 public:
24 cppgc::internal::MarkingStateBase& main_thread_marking_state)
25 : owned_marking_state_(nullptr),
26 marking_state_(main_thread_marking_state) {}
27
28 explicit CppMarkingState(std::unique_ptr<cppgc::internal::MarkingStateBase>
29 concurrent_marking_state)
30 : owned_marking_state_(std::move(concurrent_marking_state)),
34
36
37 inline void MarkAndPush(void* instance);
38
39 bool IsLocalEmpty() const {
40 return marking_state_.marking_worklist().IsLocalEmpty();
41 }
42
43 private:
44 std::unique_ptr<cppgc::internal::MarkingStateBase> owned_marking_state_;
46};
47
48} // namespace internal
49} // namespace v8
50
51#endif // V8_HEAP_CPPGC_JS_CPP_MARKING_STATE_H_
virtual V8_EXPORT_PRIVATE void Publish()
MarkingWorklists::MarkingWorklist::Local & marking_worklist()
CppMarkingState & operator=(const CppMarkingState &)=delete
std::unique_ptr< cppgc::internal::MarkingStateBase > owned_marking_state_
cppgc::internal::MarkingStateBase & marking_state_
CppMarkingState(std::unique_ptr< cppgc::internal::MarkingStateBase > concurrent_marking_state)
CppMarkingState(cppgc::internal::MarkingStateBase &main_thread_marking_state)
CppMarkingState(const CppMarkingState &)=delete
STL namespace.