v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
ephemeron-remembered-set.h
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#ifndef V8_HEAP_EPHEMERON_REMEMBERED_SET_H_
6#define V8_HEAP_EPHEMERON_REMEMBERED_SET_H_
7
8#include <unordered_map>
9#include <unordered_set>
10
14
15namespace v8::internal {
16
17// Stores ephemeron entries where the EphemeronHashTable is in old-space,
18// and the key of the entry is in new-space. Such keys do not appear in the
19// usual OLD_TO_NEW remembered set. The remembered set is used to avoid
20// strongifying keys in such hash tables in young generation garbage
21// collections.
23 public:
24 static constexpr int kEphemeronTableListSegmentSize = 128;
27
28 using IndicesSet = std::unordered_set<int>;
29 using TableMap = std::unordered_map<Tagged<EphemeronHashTable>, IndicesSet,
31
33 Address key_slot);
35 IndicesSet indices);
36
37 TableMap* tables() { return &tables_; }
38
39 private:
42};
43
44} // namespace v8::internal
45
46#endif // V8_HEAP_EPHEMERON_REMEMBERED_SET_H_
std::unordered_map< Tagged< EphemeronHashTable >, IndicesSet, Object::Hasher > TableMap
void RecordEphemeronKeyWrite(Tagged< EphemeronHashTable > table, Address key_slot)
void RecordEphemeronKeyWrites(Tagged< EphemeronHashTable > table, IndicesSet indices)