v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
shared-object-conveyor-handles.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
8
9namespace v8 {
10namespace internal {
11
12// TODO(v8:12547): Currently the shared isolate owns all the conveyors. Change
13// the owner to the main isolate once the shared isolate is removed.
15 : persistent_handles_(
16 isolate->shared_space_isolate()->NewPersistentHandles()) {}
17
19 Tagged<HeapObject> shared_object) {
20 DCHECK(IsShared(shared_object));
21 uint32_t id = static_cast<uint32_t>(shared_objects_.size());
22 shared_objects_.push_back(persistent_handles_->NewHandle(shared_object));
23 return id;
24}
25
26} // namespace internal
27} // namespace v8
uint32_t Persist(Tagged< HeapObject > shared_object)
std::vector< Handle< HeapObject > > shared_objects_
std::unique_ptr< PersistentHandles > persistent_handles_
bool IsShared(Tagged< Object > obj)
#define DCHECK(condition)
Definition logging.h:482