#ifndef V8_OBJECTS_FOREIGN_H_
#define V8_OBJECTS_FOREIGN_H_
#include "src/objects/heap-object.h"
#include "src/objects/objects-body-descriptors.h"
#include "src/objects/object-macros.h"
namespace v8::internal {
#include "torque-generated/src/objects/foreign-tq.inc"
class Foreign : public TorqueGeneratedForeign<Foreign, HeapObject> {
public:
template <ExternalPointerTag tag>
inline Address foreign_address(IsolateForSandbox isolate) const;
template <ExternalPointerTag tag>
inline Address foreign_address() const;
template <ExternalPointerTag tag>
inline void set_foreign_address(IsolateForSandbox isolate,
const Address value);
template <ExternalPointerTag tag>
inline void init_foreign_address(IsolateForSandbox isolate,
const Address initial_value);
inline Address foreign_address_unchecked(IsolateForSandbox isolate) const;
inline Address foreign_address_unchecked() const;
inline ExternalPointerTag GetTag() const;
DECL_PRINTER(Foreign)
#ifdef V8_COMPRESS_POINTERS
static_assert(IsAligned(kForeignAddressOffset, kTaggedSize));
#else
static_assert(IsAligned(kForeignAddressOffset, kExternalPointerSlotSize));
#endif
using BodyDescriptor = StackedBodyDescriptor<
FixedBodyDescriptorFor<Foreign>,
WithExternalPointer<kForeignAddressOffset,
kAnyForeignExternalPointerTagRange>>;
private:
TQ_OBJECT_CONSTRUCTORS(Foreign)
};
class TrustedForeign
: public TorqueGeneratedTrustedForeign<TrustedForeign, TrustedObject> {
public:
DECL_PRINTER(TrustedForeign)
using BodyDescriptor = FixedBodyDescriptorFor<TrustedForeign>;
private:
TQ_OBJECT_CONSTRUCTORS(TrustedForeign)
};
}
#include "src/objects/object-macros-undef.h"
#endif