5#ifndef V8_SANDBOX_ISOLATE_INL_H_
6#define V8_SANDBOX_ISOLATE_INL_H_
19#ifdef V8_ENABLE_SANDBOX
21ExternalPointerTable& IsolateForSandbox::GetExternalPointerTableFor(
24 return isolate.GetExternalPointerTableFor(tag_range);
27ExternalPointerTable::Space* IsolateForSandbox::GetExternalPointerTableSpaceFor(
30 return isolate.GetExternalPointerTableSpaceFor(tag_range, host);
33CodePointerTable::Space* IsolateForSandbox::GetCodePointerTableSpaceFor(
36 ?
isolate_->read_only_heap()->code_pointer_space()
37 :
isolate_->heap()->code_pointer_space();
40TrustedPointerTable& IsolateForSandbox::GetTrustedPointerTableFor(
43 ?
isolate_->shared_trusted_pointer_table()
47TrustedPointerTable::Space* IsolateForSandbox::GetTrustedPointerTableSpaceFor(
50 ?
isolate_->shared_trusted_pointer_space()
51 :
isolate_->heap()->trusted_pointer_space();
60bool IsolateForSandbox::SharesPointerTablesWith(IsolateForSandbox other)
const {
61 return &
isolate_->shared_trusted_pointer_table() ==
62 &other.isolate_->shared_trusted_pointer_table() &&
63 &
isolate_->shared_external_pointer_table() ==
64 &other.isolate_->shared_external_pointer_table() &&
65 isolate_->shared_external_pointer_space() ==
66 other.isolate_->shared_external_pointer_space();
85 CHECK(IsString(
object));
86 CHECK(isolate->is_shared_space_isolate());
87 allow_isolate_sharing =
true;
89 if (allow_isolate_sharing) {
91 DCHECK(IsolateForSandbox{isolate}.SharesPointerTablesWith(
106#ifdef V8_COMPRESS_POINTERS
108ExternalPointerTable& IsolateForPointerCompression::GetExternalPointerTableFor(
110 DCHECK(!tag_range.IsEmpty());
112 ?
isolate_->shared_external_pointer_table()
113 :
isolate_->external_pointer_table();
116ExternalPointerTable::Space*
117IsolateForPointerCompression::GetExternalPointerTableSpaceFor(
119 DCHECK(!tag_range.IsEmpty());
123 return isolate_->shared_external_pointer_space();
128 return isolate_->heap()->read_only_external_pointer_space();
132 return isolate_->heap()->young_external_pointer_space();
135 return isolate_->heap()->old_external_pointer_space();
138CppHeapPointerTable& IsolateForPointerCompression::GetCppHeapPointerTable() {
139 return isolate_->cpp_heap_pointer_table();
142CppHeapPointerTable::Space*
143IsolateForPointerCompression::GetCppHeapPointerTableSpace() {
144 return isolate_->heap()->cpp_heap_pointer_space();
static Isolate * TryGetCurrent()
static V8_INLINE bool InYoungGeneration(Tagged< Object > object)
static V8_INLINE bool InWritableSharedSpace(Tagged< HeapObject > object)
static Tagged< HeapObject > FromAddress(Address address)
static V8_INLINE Isolate * Current()
static Isolate * FromHeap(const Heap *heap)
static V8_INLINE MemoryChunk * FromHeapObject(Tagged< HeapObject > object)
static V8_EXPORT_PRIVATE bool Contains(Address address)
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
static V8_INLINE constexpr bool IsSharedExternalPointerType(ExternalPointerTagRange tag_range)
V8_INLINE IsolateForSandbox GetCurrentIsolateForSandbox()
kInterpreterTrampolineOffset Tagged< HeapObject >
TagRange< ExternalPointerTag > ExternalPointerTagRange
V8_INLINE IsolateForSandbox GetIsolateForSandbox(Tagged< HeapObject >)
static V8_INLINE constexpr bool IsMaybeReadOnlyExternalPointerType(ExternalPointerTagRange tag_range)
V8_EXPORT_PRIVATE FlagValues v8_flags
uint32_t ExternalPointerHandle
static V8_INLINE constexpr bool IsSharedTrustedPointerType(IndirectPointerTag tag)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define V8_UNLIKELY(condition)