summaryrefslogtreecommitdiff
path: root/deps/v8/include/cppgc/internal
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/include/cppgc/internal')
-rw-r--r--deps/v8/include/cppgc/internal/prefinalizer-handler.h30
-rw-r--r--deps/v8/include/cppgc/internal/write-barrier.h54
2 files changed, 23 insertions, 61 deletions
diff --git a/deps/v8/include/cppgc/internal/prefinalizer-handler.h b/deps/v8/include/cppgc/internal/prefinalizer-handler.h
deleted file mode 100644
index 64b07ec911..0000000000
--- a/deps/v8/include/cppgc/internal/prefinalizer-handler.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// 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 INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_
-#define INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_
-
-#include "cppgc/heap.h"
-#include "cppgc/liveness-broker.h"
-
-namespace cppgc {
-namespace internal {
-
-class V8_EXPORT PreFinalizerRegistrationDispatcher final {
- public:
- using PreFinalizerCallback = bool (*)(const LivenessBroker&, void*);
- struct PreFinalizer {
- void* object;
- PreFinalizerCallback callback;
-
- bool operator==(const PreFinalizer& other) const;
- };
-
- static void RegisterPrefinalizer(PreFinalizer pre_finalizer);
-};
-
-} // namespace internal
-} // namespace cppgc
-
-#endif // INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_
diff --git a/deps/v8/include/cppgc/internal/write-barrier.h b/deps/v8/include/cppgc/internal/write-barrier.h
index 67f039c658..cdb7ec6f9e 100644
--- a/deps/v8/include/cppgc/internal/write-barrier.h
+++ b/deps/v8/include/cppgc/internal/write-barrier.h
@@ -70,10 +70,6 @@ class V8_EXPORT WriteBarrier final {
// Returns the required write barrier for a given `value`.
static V8_INLINE Type GetWriteBarrierType(const void* value, Params& params);
- template <typename HeapHandleCallback>
- static V8_INLINE Type GetWriteBarrierTypeForExternallyReferencedObject(
- const void* value, Params& params, HeapHandleCallback callback);
-
static V8_INLINE void DijkstraMarkingBarrier(const Params& params,
const void* object);
static V8_INLINE void DijkstraMarkingBarrierRange(
@@ -84,9 +80,13 @@ class V8_EXPORT WriteBarrier final {
#if defined(CPPGC_YOUNG_GENERATION)
static V8_INLINE void GenerationalBarrier(const Params& params,
const void* slot);
-#else // !CPPGC_YOUNG_GENERATION
+ static V8_INLINE void GenerationalBarrierForSourceObject(
+ const Params& params, const void* inner_pointer);
+#else // !CPPGC_YOUNG_GENERATION
static V8_INLINE void GenerationalBarrier(const Params& params,
const void* slot) {}
+ static V8_INLINE void GenerationalBarrierForSourceObject(
+ const Params& params, const void* inner_pointer) {}
#endif // CPPGC_YOUNG_GENERATION
#if V8_ENABLE_CHECKS
@@ -124,8 +124,10 @@ class V8_EXPORT WriteBarrier final {
#if defined(CPPGC_YOUNG_GENERATION)
static CagedHeapLocalData& GetLocalData(HeapHandle&);
static void GenerationalBarrierSlow(const CagedHeapLocalData& local_data,
- const AgeTable& ageTable,
+ const AgeTable& age_table,
const void* slot, uintptr_t value_offset);
+ static void GenerationalBarrierForSourceObjectSlow(
+ const CagedHeapLocalData& local_data, const void* object);
#endif // CPPGC_YOUNG_GENERATION
static AtomicEntryFlag incremental_or_concurrent_marking_flag_;
@@ -157,13 +159,6 @@ class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final {
return GetNoSlot(value, params, callback);
}
- template <typename HeapHandleCallback>
- static V8_INLINE WriteBarrier::Type GetForExternallyReferenced(
- const void* value, WriteBarrier::Params& params,
- HeapHandleCallback callback) {
- return GetNoSlot(value, params, callback);
- }
-
private:
WriteBarrierTypeForCagedHeapPolicy() = delete;
@@ -292,15 +287,6 @@ class V8_EXPORT WriteBarrierTypeForNonCagedHeapPolicy final {
callback);
}
- template <typename HeapHandleCallback>
- static V8_INLINE WriteBarrier::Type GetForExternallyReferenced(
- const void* value, WriteBarrier::Params& params,
- HeapHandleCallback callback) {
- // The slot will never be used in `Get()` below.
- return Get<WriteBarrier::ValueMode::kValuePresent>(nullptr, value, params,
- callback);
- }
-
private:
template <WriteBarrier::ValueMode value_mode>
struct ValueModeDispatch;
@@ -376,15 +362,6 @@ WriteBarrier::Type WriteBarrier::GetWriteBarrierType(
}
// static
-template <typename HeapHandleCallback>
-WriteBarrier::Type
-WriteBarrier::GetWriteBarrierTypeForExternallyReferencedObject(
- const void* value, Params& params, HeapHandleCallback callback) {
- return WriteBarrierTypePolicy::GetForExternallyReferenced(value, params,
- callback);
-}
-
-// static
void WriteBarrier::DijkstraMarkingBarrier(const Params& params,
const void* object) {
CheckParams(Type::kMarking, params);
@@ -433,6 +410,21 @@ void WriteBarrier::GenerationalBarrier(const Params& params, const void* slot) {
GenerationalBarrierSlow(local_data, age_table, slot, params.value_offset);
}
+// static
+void WriteBarrier::GenerationalBarrierForSourceObject(
+ const Params& params, const void* inner_pointer) {
+ CheckParams(Type::kGenerational, params);
+
+ const CagedHeapLocalData& local_data = params.caged_heap();
+ const AgeTable& age_table = local_data.age_table;
+
+ // Assume that if the first element is in young generation, the whole range is
+ // in young generation.
+ if (V8_LIKELY(age_table[params.slot_offset] == AgeTable::Age::kYoung)) return;
+
+ GenerationalBarrierForSourceObjectSlow(local_data, inner_pointer);
+}
+
#endif // !CPPGC_YOUNG_GENERATION
} // namespace internal