v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
cross-heap-remembered-set.cc
Go to the documentation of this file.
1// Copyright 2022 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
6
7#include "src/api/api-inl.h"
10
11namespace v8::internal {
12
14 Isolate& isolate, Tagged<JSObject> host_obj, void* cppgc_object) {
15 DCHECK_NOT_NULL(cppgc_object);
16 // Any in-cage pointer must point to a vaild, not freed cppgc object.
17 auto* page =
19 // TODO(v8:13475): Better filter with on-cage check.
20 if (!page) return;
21 auto& value_hoh = page->ObjectHeaderFromInnerAddress(cppgc_object);
22 if (!value_hoh.IsYoung()) return;
24 isolate.global_handles()->Create(host_obj));
25}
26
29 isolate.global_handles()->Destroy(h.location());
30 }
33}
34
35} // namespace v8::internal
static BasePage * FromInnerAddress(const HeapBase *, void *)
Definition heap-page.cc:40
void RememberReferenceIfNeeded(Isolate &isolate, Tagged< JSObject > host_obj, void *cppgc_object)
std::vector< IndirectHandle< JSObject > > remembered_v8_to_cppgc_references_
#define DCHECK_NOT_NULL(val)
Definition logging.h:492