chromium/v8/src/sandbox/isolate-inl.h

// Copyright 2023 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_SANDBOX_ISOLATE_INL_H_
#define V8_SANDBOX_ISOLATE_INL_H_

#include "src/execution/isolate.h"
#include "src/heap/heap-write-barrier-inl.h"

namespace v8 {
namespace internal {

template <typename IsolateT>
IsolateForSandbox::IsolateForSandbox(IsolateT* isolate)
#ifdef V8_ENABLE_SANDBOX
    : isolate_(isolate->ForSandbox()) {}
#else
{
}
#endif

#ifdef V8_ENABLE_SANDBOX
ExternalPointerTable& IsolateForSandbox::GetExternalPointerTableFor(
    ExternalPointerTag tag) {}

ExternalPointerTable::Space* IsolateForSandbox::GetExternalPointerTableSpaceFor(
    ExternalPointerTag tag, Address host) {}

ExternalBufferTable& IsolateForSandbox::GetExternalBufferTableFor(
    ExternalBufferTag tag) {}

ExternalBufferTable::Space* IsolateForSandbox::GetExternalBufferTableSpaceFor(
    ExternalBufferTag tag, Address host) {}

CodePointerTable::Space* IsolateForSandbox::GetCodePointerTableSpaceFor(
    Address owning_slot) {}

TrustedPointerTable& IsolateForSandbox::GetTrustedPointerTable() {}

TrustedPointerTable::Space* IsolateForSandbox::GetTrustedPointerTableSpace() {}

#endif  // V8_ENABLE_SANDBOX

#ifdef V8_ENABLE_LEAPTIERING
JSDispatchTable::Space* IsolateForSandbox::GetJSDispatchTableSpaceFor(
    Address owning_slot) {
  DCHECK(!ReadOnlyHeap::Contains(owning_slot));
  return isolate_->heap()->js_dispatch_table_space();
}
#endif  // V8_ENABLE_LEAPTIERING

template <typename IsolateT>
IsolateForPointerCompression::IsolateForPointerCompression(IsolateT* isolate)
#ifdef V8_COMPRESS_POINTERS
    : isolate_(isolate->ForSandbox()) {}
#else
{
}
#endif

#ifdef V8_COMPRESS_POINTERS

ExternalPointerTable& IsolateForPointerCompression::GetExternalPointerTableFor(
    ExternalPointerTag tag) {}

ExternalPointerTable::Space*
IsolateForPointerCompression::GetExternalPointerTableSpaceFor(
    ExternalPointerTag tag, Address host) {}

CppHeapPointerTable& IsolateForPointerCompression::GetCppHeapPointerTable() {}

CppHeapPointerTable::Space*
IsolateForPointerCompression::GetCppHeapPointerTableSpace() {}

#endif  // V8_COMPRESS_POINTERS

}  // namespace internal
}  // namespace v8

#endif  // V8_SANDBOX_ISOLATE_INL_H_