v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
ephemeron-remembered-set.cc
Go to the documentation of this file.
1
// Copyright 2023 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
#include "
src/heap/ephemeron-remembered-set.h
"
6
7
#include "
src/heap/heap-inl.h
"
8
#include "
src/heap/heap-layout-inl.h
"
9
10
namespace
v8::internal
{
11
12
void
EphemeronRememberedSet::RecordEphemeronKeyWrite
(
13
Tagged<EphemeronHashTable>
table,
Address
slot) {
14
DCHECK
(
HeapLayout::InYoungGeneration
(
HeapObjectSlot
(slot).ToHeapObject()));
15
int
slot_index = EphemeronHashTable::SlotToIndex(table.address(), slot);
16
InternalIndex
entry = EphemeronHashTable::IndexToEntry(slot_index);
17
base::MutexGuard
guard(&
insertion_mutex_
);
18
auto
it =
tables_
.insert({table,
IndicesSet
()});
19
it.first->second.insert(entry.
as_int
());
20
}
21
22
void
EphemeronRememberedSet::RecordEphemeronKeyWrites
(
23
Tagged<EphemeronHashTable>
table,
IndicesSet
indices) {
24
base::MutexGuard
guard(&
insertion_mutex_
);
25
auto
it =
tables_
.find(table);
26
if
(it !=
tables_
.end()) {
27
it->second.merge(std::move(indices));
28
}
else
{
29
tables_
.insert({table, std::move(indices)});
30
}
31
}
32
33
}
// namespace v8::internal
v8::base::LockGuard
Definition
mutex.h:192
v8::internal::EphemeronRememberedSet::tables_
TableMap tables_
Definition
ephemeron-remembered-set.h:41
v8::internal::EphemeronRememberedSet::RecordEphemeronKeyWrite
void RecordEphemeronKeyWrite(Tagged< EphemeronHashTable > table, Address key_slot)
Definition
ephemeron-remembered-set.cc:12
v8::internal::EphemeronRememberedSet::IndicesSet
std::unordered_set< int > IndicesSet
Definition
ephemeron-remembered-set.h:28
v8::internal::EphemeronRememberedSet::insertion_mutex_
base::Mutex insertion_mutex_
Definition
ephemeron-remembered-set.h:40
v8::internal::EphemeronRememberedSet::RecordEphemeronKeyWrites
void RecordEphemeronKeyWrites(Tagged< EphemeronHashTable > table, IndicesSet indices)
Definition
ephemeron-remembered-set.cc:22
v8::internal::HeapLayout::InYoungGeneration
static V8_INLINE bool InYoungGeneration(Tagged< Object > object)
Definition
heap-layout-inl.h:43
v8::internal::InternalIndex
Definition
internal-index.h:20
v8::internal::InternalIndex::as_int
constexpr int as_int() const
Definition
internal-index.h:42
v8::internal::Tagged
Definition
waiter-queue-node.h:21
ephemeron-remembered-set.h
heap-inl.h
heap-layout-inl.h
v8::internal
Definition
api-arguments-inl.h:20
v8::internal::Address
Address
Definition
api-callbacks-inl.h:36
v8::internal::HeapObjectSlot
SlotTraits::THeapObjectSlot HeapObjectSlot
Definition
globals.h:1253
DCHECK
#define DCHECK(condition)
Definition
logging.h:482
src
heap
ephemeron-remembered-set.cc
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0