5#ifndef V8_OBJECTS_INSTRUCTION_STREAM_INL_H_
6#define V8_OBJECTS_INSTRUCTION_STREAM_INL_H_
27uint32_t InstructionStream::body_size()
const {
34#if V8_EMBEDDED_CONSTANT_POOL_BOOL
54 writable_allocation.
WriteHeaderSlot<uint32_t, kBodySizeOffset>(body_size);
69 kRelocationInfoOffset>(
85 SLOW_DCHECK(!WriteBarrier::IsRequired(istream, map));
126 std::optional<WriteBarrierPromise> promise;
130 DCHECK_EQ(reloc_info->length(), desc.reloc_size);
131 CopyBytes(reloc_info->begin(), desc.buffer + desc.reloc_offset,
132 static_cast<size_t>(desc.reloc_size));
143 static_cast<size_t>(desc.instr_size));
146 static_cast<size_t>(desc.unwinding_info_size));
147 DCHECK_EQ(desc.body_size(), desc.instr_size + desc.unwinding_info_size);
149 code->instruction_size() + code->metadata_size());
152 code->constant_pool(), no_gc));
191 if (maybe_code ==
Smi::zero())
return false;
199 if (maybe_code ==
Smi::zero())
return false;
265#ifdef V8_COMPRESS_POINTERS
#define SLOW_DCHECK(condition)
Tagged< Object > Acquire_Load() const
static V8_INLINE bool InYoungGeneration(Tagged< Object > object)
static V8_INLINE bool InTrustedSpace(Tagged< HeapObject > object)
static constexpr int kHeaderSize
static Tagged< HeapObject > FromAddress(Address address)
Address field_address(size_t offset) const
static constexpr int kMapOffset
T ReadField(size_t offset) const
Tagged< Object > raw_code(AcquireLoadTag tag) const
static PtrComprCageBase main_cage_base()
static NEVER_READ_ONLY_SPACE constexpr bool kOnHeapBodyIsContiguous
uint8_t * relocation_start() const
uint8_t * relocation_end() const
void RelocateFromDescWriteBarriers(Heap *heap, const CodeDesc &desc, Address constant_pool, WriteBarrierPromise &promise, const DisallowGarbageCollection &no_gc)
bool TryGetCode(Tagged< Code > *code_out, AcquireLoadTag tag) const
Address constant_pool() const
static constexpr int TrailingPaddingSizeFor(uint32_t body_size)
static Tagged< InstructionStream > FromTargetAddress(Address address)
Address instruction_start() const
bool TryGetCodeUnchecked(Tagged< Code > *code_out, AcquireLoadTag tag) const
static Tagged< InstructionStream > FromEntryAddress(Address location_of_address)
V8_INLINE void Finalize(Tagged< Code > code, Tagged< TrustedByteArray > reloc_info, CodeDesc desc, Heap *heap)
V8_INLINE bool IsFullyInitialized()
int relocation_size() const
WriteBarrierPromise RelocateFromDesc(WritableJitAllocation &jit_allocation, Heap *heap, const CodeDesc &desc, Address constant_pool, const DisallowGarbageCollection &no_gc)
static constexpr int SizeFor(int body_size)
Tagged< Code > code(AcquireLoadTag tag) const
Tagged< TrustedByteArray > relocation_info() const
Tagged< TrustedByteArray > unchecked_relocation_info() const
static V8_INLINE Tagged< InstructionStream > Initialize(Tagged< HeapObject > self, Tagged< Map > map, uint32_t body_size, int constant_pool_offset, Tagged< TrustedByteArray > reloc_info)
static const uint8_t * CurrentEmbeddedBlobCode()
static uint32_t CurrentEmbeddedBlobCodeSize()
static constexpr Tagged< Smi > zero()
constexpr bool IsSmi() const
static WritableJitAllocation RegisterInstructionStreamAllocation(Address addr, size_t size, bool enforce_write_api=false)
static WritableJitAllocation LookupJitAllocation(Address addr, size_t size, JitAllocationType type, bool enforce_write_api=false)
ProtectedPointerSlot RawProtectedPointerField(int byte_offset) const
Tagged< TrustedObject > ReadProtectedPointerField(int offset) const
static constexpr int kHeaderSize
V8_CONST static V8_INLINE Address base()
V8_INLINE void CopyCode(size_t dst_offset, const uint8_t *src, size_t num_bytes)
V8_INLINE void WriteHeaderSlot(T value)
V8_INLINE void ClearBytes(size_t offset, size_t len)
V8_INLINE void WriteProtectedPointerHeaderSlot(Tagged< T > value, ReleaseStoreTag)
V8_INLINE void CopyData(size_t dst_offset, const uint8_t *src, size_t num_bytes)
#define V8_EMBEDDED_CONSTANT_POOL_BOOL
void CopyBytes(T *dst, const T *src, size_t num_bytes)
Handle< To > UncheckedCast(Handle< From > value)
static constexpr Address kNullAddress
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
static constexpr ReleaseStoreTag kReleaseStore
static constexpr RelaxedStoreTag kRelaxedStore
static constexpr AcquireLoadTag kAcquireLoad
#define OBJECT_CONSTRUCTORS_IMPL(Type, Super)
#define CONDITIONAL_PROTECTED_POINTER_WRITE_BARRIER(object, offset, value, mode)
#define NEVER_READ_ONLY_SPACE_IMPL(Type)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)