v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
trusted-object-inl.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_OBJECTS_TRUSTED_OBJECT_INL_H_
6#define V8_OBJECTS_TRUSTED_OBJECT_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
13#include "src/sandbox/sandbox.h"
14
15// Has to be the last include (doesn't have include guards):
17
18namespace v8 {
19namespace internal {
20
22
23Tagged<TrustedObject> TrustedObject::ReadProtectedPointerField(
24 int offset) const {
26 *this, offset);
27}
28
35
41
48
53
59
64
69
74
79
80#ifdef VERIFY_HEAP
81void TrustedObject::VerifyProtectedPointerField(Isolate* isolate, int offset) {
82 Object::VerifyPointer(isolate, ReadProtectedPointerField(offset));
83}
84#endif
85
86OBJECT_CONSTRUCTORS_IMPL(ExposedTrustedObject, TrustedObject)
87
88void ExposedTrustedObject::init_self_indirect_pointer(Isolate* isolate) {
89#ifdef V8_ENABLE_SANDBOX
90 InitSelfIndirectPointerField(kSelfIndirectPointerOffset, isolate,
91 isolate->trusted_pointer_publishing_scope());
92#endif
93}
94
96#ifdef V8_ENABLE_SANDBOX
97 // Background threads using LocalIsolates don't use
98 // TrustedPointerPublishingScopes.
99 InitSelfIndirectPointerField(kSelfIndirectPointerOffset, isolate, nullptr);
100#endif
101}
102
104 const {
105#ifdef V8_ENABLE_SANDBOX
106 return Relaxed_ReadField<IndirectPointerHandle>(kSelfIndirectPointerOffset);
107#else
108 UNREACHABLE();
109#endif
110}
111
112} // namespace internal
113} // namespace v8
114
116
117#endif // V8_OBJECTS_TRUSTED_OBJECT_INL_H_
IndirectPointerHandle self_indirect_pointer_handle() const
void init_self_indirect_pointer(Isolate *isolate)
T Relaxed_ReadField(size_t offset) const
Address field_address(size_t offset) const
static constexpr Tagged< Smi > zero()
Definition smi.h:99
static void Release_Store(Tagged< HeapObject > host, PtrType value)
static PtrType load(Tagged< HeapObject > host, int offset=0)
static void store(Tagged< HeapObject > host, PtrType value)
static PtrType Acquire_Load(Tagged< HeapObject > host, int offset=0)
void ClearProtectedPointerField(int offset)
ProtectedPointerSlot RawProtectedPointerField(int byte_offset) const
void WriteProtectedPointerField(int offset, Tagged< TrustedObject > value)
bool IsProtectedPointerFieldEmpty(int offset) const
Tagged< TrustedObject > ReadProtectedPointerField(int offset) const
ProtectedMaybeObjectSlot RawProtectedMaybeObjectField(int byte_offset) const
int32_t offset
SlotTraits::TProtectedMaybeObjectSlot ProtectedMaybeObjectSlot
Definition globals.h:1274
SlotTraits::TProtectedPointerSlot ProtectedPointerSlot
Definition globals.h:1272
uint32_t IndirectPointerHandle
V8_INLINE void InitSelfIndirectPointerField(Address field_address, IsolateForSandbox isolate, Tagged< HeapObject > host, IndirectPointerTag tag, TrustedPointerPublishingScope *opt_publishing_scope)
#define OBJECT_CONSTRUCTORS_IMPL(Type, Super)