summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap/cppgc-js/cpp-heap.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2020-10-15 20:17:08 +0200
committerMichaël Zasso <targos@protonmail.com>2020-10-18 20:16:47 +0200
commita1d639ba5de4ff34e34fb575fbb6cc1d41ec3cce (patch)
treeabc7d41c12f1495b1208fa4449cb2508c92c5e85 /deps/v8/src/heap/cppgc-js/cpp-heap.h
parent089d654dd85f8e548597329f60a41d6029260caa (diff)
downloadnode-new-a1d639ba5de4ff34e34fb575fbb6cc1d41ec3cce.tar.gz
deps: update V8 to 8.6.395
PR-URL: https://github.com/nodejs/node/pull/35415 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/heap/cppgc-js/cpp-heap.h')
-rw-r--r--deps/v8/src/heap/cppgc-js/cpp-heap.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/deps/v8/src/heap/cppgc-js/cpp-heap.h b/deps/v8/src/heap/cppgc-js/cpp-heap.h
new file mode 100644
index 0000000000..0105934ac1
--- /dev/null
+++ b/deps/v8/src/heap/cppgc-js/cpp-heap.h
@@ -0,0 +1,43 @@
+// Copyright 2020 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_HEAP_CPPGC_JS_CPP_HEAP_H_
+#define V8_HEAP_CPPGC_JS_CPP_HEAP_H_
+
+#include "include/v8.h"
+#include "src/base/macros.h"
+#include "src/heap/cppgc/heap-base.h"
+
+namespace v8 {
+
+class Isolate;
+
+namespace internal {
+
+// A C++ heap implementation used with V8 to implement unified heap.
+class V8_EXPORT_PRIVATE CppHeap final : public cppgc::internal::HeapBase,
+ public v8::EmbedderHeapTracer {
+ public:
+ CppHeap(v8::Isolate* isolate, size_t custom_spaces);
+
+ HeapBase& AsBase() { return *this; }
+ const HeapBase& AsBase() const { return *this; }
+
+ void RegisterV8References(
+ const std::vector<std::pair<void*, void*> >& embedder_fields) final;
+ void TracePrologue(TraceFlags flags) final;
+ bool AdvanceTracing(double deadline_in_ms) final;
+ bool IsTracingDone() final;
+ void TraceEpilogue(TraceSummary* trace_summary) final;
+ void EnterFinalPause(EmbedderStackState stack_state) final;
+
+ private:
+ Isolate& isolate_;
+ bool marking_done_ = false;
+};
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_HEAP_CPPGC_JS_CPP_HEAP_H_