v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::InstructionStream Class Reference

#include <instruction-stream.h>

Inheritance diagram for v8::internal::InstructionStream:
Collaboration diagram for v8::internal::InstructionStream:

Classes

class  BodyDescriptor
 
class  WriteBarrierPromise
 

Public Member Functions

Address instruction_start () const
 
Tagged< Codecode (AcquireLoadTag tag) const
 
Tagged< Objectraw_code (AcquireLoadTag tag) const
 
bool TryGetCode (Tagged< Code > *code_out, AcquireLoadTag tag) const
 
bool TryGetCodeUnchecked (Tagged< Code > *code_out, AcquireLoadTag tag) const
 
Address constant_pool () const
 
Tagged< TrustedByteArrayrelocation_info () const
 
Tagged< TrustedByteArrayunchecked_relocation_info () const
 
uint8_t * relocation_start () const
 
uint8_t * relocation_end () const
 
int relocation_size () const
 
Address body_end () const
 
int Size () const
 
void Relocate (WritableJitAllocation &jit_allocation, intptr_t delta)
 
V8_INLINE void Finalize (Tagged< Code > code, Tagged< TrustedByteArray > reloc_info, CodeDesc desc, Heap *heap)
 
V8_INLINE bool IsFullyInitialized ()
 
- Public Member Functions inherited from v8::internal::TrustedObject
Tagged< TrustedObjectReadProtectedPointerField (int offset) const
 
Tagged< TrustedObjectReadProtectedPointerField (int offset, AcquireLoadTag) const
 
void WriteProtectedPointerField (int offset, Tagged< TrustedObject > value)
 
void WriteProtectedPointerField (int offset, Tagged< TrustedObject > value, ReleaseStoreTag)
 
bool IsProtectedPointerFieldEmpty (int offset) const
 
bool IsProtectedPointerFieldEmpty (int offset, AcquireLoadTag) const
 
void ClearProtectedPointerField (int offset)
 
void ClearProtectedPointerField (int offset, ReleaseStoreTag)
 
ProtectedPointerSlot RawProtectedPointerField (int byte_offset) const
 
ProtectedMaybeObjectSlot RawProtectedMaybeObjectField (int byte_offset) const
 
 OBJECT_CONSTRUCTORS (TrustedObject, HeapObject)
 
- Public Member Functions inherited from v8::internal::HeapObject
constexpr HeapObject ()=default
 
void set_map (Isolate *isolate, Tagged< Map > value)
 
template<typename IsolateT >
void set_map_safe_transition (IsolateT *isolate, Tagged< Map > value)
 
ObjectSlot map_slot () const
 
void set_map_no_write_barrier (Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
 
void set_map_no_write_barrier (Isolate *isolate, Tagged< Map > value, ReleaseStoreTag)
 
void set_map_safe_transition_no_write_barrier (Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
 
void set_map_safe_transition_no_write_barrier (Isolate *isolate, Tagged< Map > value, ReleaseStoreTag)
 
template<typename IsolateT >
void set_map (IsolateT *isolate, Tagged< Map > value, ReleaseStoreTag)
 
template<typename IsolateT >
void set_map_safe_transition (IsolateT *isolate, Tagged< Map > value, ReleaseStoreTag)
 
bool release_compare_and_swap_map_word_forwarded (MapWord old_map_word, Tagged< HeapObject > new_target_object)
 
bool relaxed_compare_and_swap_map_word_forwarded (MapWord old_map_word, Tagged< HeapObject > new_target_object)
 
template<typename IsolateT >
void set_map_after_allocation (IsolateT *isolate, Tagged< Map > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
void set_map_word (Tagged< Map > map, RelaxedStoreTag)
 
void set_map_word_forwarded (Tagged< HeapObject > target_object, RelaxedStoreTag)
 
void set_map_word (Tagged< Map > map, ReleaseStoreTag)
 
void set_map_word_forwarded (Tagged< HeapObject > target_object, ReleaseStoreTag)
 
ReadOnlyRoots EarlyGetReadOnlyRoots () const
 
Address address () const
 
V8_EXPORT_PRIVATE int SizeFromMap (Tagged< Map > map) const
 
template<class T >
requires (std::is_arithmetic_v<T> || std::is_enum_v<T> || std::is_pointer_v<T>)
T ReadField (size_t offset) const
 
template<class T >
requires (std::is_arithmetic_v<T> || std::is_enum_v<T> || std::is_pointer_v<T>)
void WriteField (size_t offset, T value) const
 
template<class T >
requires ((std::is_arithmetic_v<T> || std::is_enum_v<T>) && !std::is_floating_point_v<T>)
T Relaxed_ReadField (size_t offset) const
 
template<class T >
requires ((std::is_arithmetic_v<T> || std::is_enum_v<T>) && !std::is_floating_point_v<T>)
void Relaxed_WriteField (size_t offset, T value)
 
template<class T >
requires ((std::is_arithmetic_v<T> || std::is_enum_v<T>) && !std::is_floating_point_v<T>)
T Acquire_ReadField (size_t offset) const
 
Address ReadSandboxedPointerField (size_t offset, PtrComprCageBase cage_base) const
 
void WriteSandboxedPointerField (size_t offset, PtrComprCageBase cage_base, Address value)
 
void WriteSandboxedPointerField (size_t offset, Isolate *isolate, Address value)
 
size_t ReadBoundedSizeField (size_t offset) const
 
void WriteBoundedSizeField (size_t offset, size_t value)
 
template<ExternalPointerTag tag>
void InitExternalPointerField (size_t offset, IsolateForSandbox isolate, Address value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
template<ExternalPointerTagRange tag_range>
Address ReadExternalPointerField (size_t offset, IsolateForSandbox isolate) const
 
template<CppHeapPointerTag lower_bound, CppHeapPointerTag upper_bound>
Address ReadCppHeapPointerField (size_t offset, IsolateForPointerCompression isolate) const
 
Address ReadCppHeapPointerField (size_t offset, IsolateForPointerCompression isolate, CppHeapPointerTagRange tag_range) const
 
template<ExternalPointerTag tag>
void WriteExternalPointerField (size_t offset, IsolateForSandbox isolate, Address value)
 
void SetupLazilyInitializedExternalPointerField (size_t offset)
 
bool IsLazilyInitializedExternalPointerFieldInitialized (size_t offset) const
 
template<ExternalPointerTag tag>
void WriteLazilyInitializedExternalPointerField (size_t offset, IsolateForSandbox isolate, Address value)
 
void SetupLazilyInitializedCppHeapPointerField (size_t offset)
 
template<CppHeapPointerTag tag>
void WriteLazilyInitializedCppHeapPointerField (size_t offset, IsolateForPointerCompression isolate, Address value)
 
void WriteLazilyInitializedCppHeapPointerField (size_t offset, IsolateForPointerCompression isolate, Address value, CppHeapPointerTag tag)
 
template<IndirectPointerTag tag>
Tagged< ExposedTrustedObjectReadTrustedPointerField (size_t offset, IsolateForSandbox isolate) const
 
template<IndirectPointerTag tag>
Tagged< ExposedTrustedObjectReadTrustedPointerField (size_t offset, IsolateForSandbox isolate, AcquireLoadTag) const
 
template<IndirectPointerTag tag>
Tagged< ObjectReadMaybeEmptyTrustedPointerField (size_t offset, IsolateForSandbox isolate, AcquireLoadTag) const
 
template<IndirectPointerTag tag>
void WriteTrustedPointerField (size_t offset, Tagged< ExposedTrustedObject > value)
 
bool IsTrustedPointerFieldEmpty (size_t offset) const
 
bool IsTrustedPointerFieldUnpublished (size_t offset, IndirectPointerTag tag, IsolateForSandbox isolate) const
 
void ClearTrustedPointerField (size_t offest)
 
void ClearTrustedPointerField (size_t offest, ReleaseStoreTag)
 
Tagged< CodeReadCodePointerField (size_t offset, IsolateForSandbox isolate) const
 
void WriteCodePointerField (size_t offset, Tagged< Code > value)
 
bool IsCodePointerFieldEmpty (size_t offset) const
 
void ClearCodePointerField (size_t offest)
 
Address ReadCodeEntrypointViaCodePointerField (size_t offset, CodeEntrypointTag tag) const
 
void WriteCodeEntrypointViaCodePointerField (size_t offset, Address value, CodeEntrypointTag tag)
 
ObjectSlot RawField (int byte_offset) const
 
MaybeObjectSlot RawMaybeWeakField (int byte_offset) const
 
InstructionStreamSlot RawInstructionStreamField (int byte_offset) const
 
ExternalPointerSlot RawExternalPointerField (int byte_offset, ExternalPointerTagRange tag_range) const
 
CppHeapPointerSlot RawCppHeapPointerField (int byte_offset) const
 
IndirectPointerSlot RawIndirectPointerField (int byte_offset, IndirectPointerTag tag) const
 
WriteBarrierMode GetWriteBarrierMode (const DisallowGarbageCollection &promise)
 
void HeapObjectShortPrint (std::ostream &os)
 
void Print ()
 
bool CheckRequiredAlignment (PtrComprCageBase cage_base) const
 
bool NeedsRehashing (InstanceType instance_type) const
 
bool NeedsRehashing (PtrComprCageBase cage_base) const
 
bool CanBeRehashed (PtrComprCageBase cage_base) const
 
template<typename IsolateT >
void RehashBasedOnMap (IsolateT *isolate)
 
Address GetFieldAddress (int field_offset) const
 
HeapObjectoperator-> ()
 
const HeapObjectoperator-> () const
 
template<HeapObject::EmitWriteBarrier emit_write_barrier, typename MemoryOrder , typename IsolateT >
void set_map (IsolateT *isolate, Tagged< Map > value, MemoryOrder order, VerificationMode mode)
 
- Public Member Functions inherited from v8::internal::TaggedImpl< HeapObjectReferenceType::STRONG, Address >
V8_INLINE constexpr TaggedImpl ()
 
V8_INLINE constexpr TaggedImpl (Address ptr)
 
 operator bool () const=delete
 
constexpr bool operator== (TaggedImpl< kOtherRefType, U > other) const
 
constexpr bool operator!= (TaggedImpl< kOtherRefType, U > other) const
 
constexpr bool SafeEquals (TaggedImpl< kOtherRefType, Address > other) const
 
constexpr bool operator< (TaggedImpl other) const
 
V8_INLINE constexpr Address ptr () const
 
constexpr bool IsObject () const
 
constexpr bool IsSmi () const
 
bool ToSmi (Tagged< Smi > *value) const
 
Tagged< SmiToSmi () const
 
constexpr bool IsHeapObject () const
 
constexpr bool IsCleared () const
 
constexpr bool IsStrongOrWeak () const
 
constexpr bool IsStrong () const
 
constexpr bool IsStrongOrSmi () const
 
constexpr bool IsWeak () const
 
constexpr bool IsWeakOrCleared () const
 
bool GetHeapObjectIfStrong (Tagged< HeapObject > *result) const
 
bool GetHeapObjectIfStrong (Isolate *isolate, Tagged< HeapObject > *result) const
 
Tagged< HeapObjectGetHeapObjectAssumeStrong () const
 
Tagged< HeapObjectGetHeapObjectAssumeStrong (Isolate *isolate) const
 
bool GetHeapObjectIfWeak (Tagged< HeapObject > *result) const
 
bool GetHeapObjectIfWeak (Isolate *isolate, Tagged< HeapObject > *result) const
 
Tagged< HeapObjectGetHeapObjectAssumeWeak () const
 
Tagged< HeapObjectGetHeapObjectAssumeWeak (Isolate *isolate) const
 
bool GetHeapObject (Tagged< HeapObject > *result) const
 
bool GetHeapObject (Isolate *isolate, Tagged< HeapObject > *result) const
 
bool GetHeapObject (Tagged< HeapObject > *result, HeapObjectReferenceType *reference_type) const
 
bool GetHeapObject (Isolate *isolate, Tagged< HeapObject > *result, HeapObjectReferenceType *reference_type) const
 
Tagged< HeapObjectGetHeapObject () const
 
Tagged< HeapObjectGetHeapObject (Isolate *isolate) const
 
Tagged< ObjectGetHeapObjectOrSmi () const
 
Tagged< ObjectGetHeapObjectOrSmi (Isolate *isolate) const
 
Tagged< Tcast () const
 

Static Public Member Functions

static constexpr int TrailingPaddingSizeFor (uint32_t body_size)
 
static constexpr int SizeFor (int body_size)
 
static Tagged< InstructionStreamFromTargetAddress (Address address)
 
static Tagged< InstructionStreamFromEntryAddress (Address location_of_address)
 
static V8_INLINE Tagged< InstructionStreamInitialize (Tagged< HeapObject > self, Tagged< Map > map, uint32_t body_size, int constant_pool_offset, Tagged< TrustedByteArray > reloc_info)
 
- Static Public Member Functions inherited from v8::internal::HeapObject
static void SetFillerMap (const WritableFreeSpace &writable_page, Tagged< Map > value)
 
static Tagged< HeapObjectFromAddress (Address address)
 
template<typename CompareAndSwapImpl >
static Tagged< ObjectSeqCst_CompareAndSwapField (Tagged< Object > expected_value, Tagged< Object > new_value, CompareAndSwapImpl compare_and_swap_impl)
 
template<typename ObjectType >
static JSDispatchHandle AllocateAndInstallJSDispatchHandle (ObjectType host, size_t offset, Isolate *isolate, uint16_t parameter_count, DirectHandle< Code > code, WriteBarrierMode mode=WriteBarrierMode::UPDATE_WRITE_BARRIER)
 
static void Print (Tagged< Object > obj)
 
static void Print (Tagged< Object > obj, std::ostream &os)
 
static AllocationAlignment RequiredAlignment (Tagged< Map > map)
 

Static Public Attributes

static NEVER_READ_ONLY_SPACE constexpr bool kOnHeapBodyIsContiguous = true
 
static constexpr bool kOffHeapBodyIsContiguous = false
 
static constexpr bool kBodyIsContiguous
 
static constexpr int kMetadataAlignment = kIntSize
 
static constexpr int kCodeAlignmentMinusCodeHeader
 
- Static Public Attributes inherited from v8::internal::TrustedObject
static constexpr int kHeaderSize = HeapObject::kHeaderSize
 
- Static Public Attributes inherited from v8::internal::HeapObject
static constexpr int kMapOffset = offsetof(HeapObjectLayout, map_)
 
static constexpr int kHeaderSize = sizeof(HeapObjectLayout)
 
- Static Public Attributes inherited from v8::internal::TaggedImpl< HeapObjectReferenceType::STRONG, Address >
static const bool kIsFull
 
static const bool kCanBeWeak
 

Private Member Functions

WriteBarrierPromise RelocateFromDesc (WritableJitAllocation &jit_allocation, Heap *heap, const CodeDesc &desc, Address constant_pool, const DisallowGarbageCollection &no_gc)
 
void RelocateFromDescWriteBarriers (Heap *heap, const CodeDesc &desc, Address constant_pool, WriteBarrierPromise &promise, const DisallowGarbageCollection &no_gc)
 
 OBJECT_CONSTRUCTORS (InstructionStream, TrustedObject)
 

Static Private Member Functions

static PtrComprCageBase main_cage_base ()
 

Friends

class Factory
 

Additional Inherited Members

- Public Types inherited from v8::internal::HeapObject
using MapField = TaggedField<MapWord, HeapObject::kMapOffset>
 
- Protected Member Functions inherited from v8::internal::HeapObject
V8_INLINE constexpr HeapObject (Address ptr, HeapObject::SkipTypeCheckTag)
 
 HeapObject (Address ptr)
 
Address field_address (size_t offset) const
 
- Protected Member Functions inherited from v8::internal::TaggedImpl< HeapObjectReferenceType::STRONG, Address >
Addressptr_location ()
 
const Addressptr_location () const
 
- Static Protected Member Functions inherited from v8::internal::HeapObject
template<typename T >
static bool IsSmi (T obj)
 
template<typename T >
static bool IsHeapObject (T obj)
 

Detailed Description

Definition at line 34 of file instruction-stream.h.

Member Function Documentation

◆ body_end()

Address v8::internal::InstructionStream::body_end ( ) const
inline

Definition at line 172 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ code()

Tagged< Code > v8::internal::InstructionStream::code ( AcquireLoadTag tag) const
inline

Definition at line 184 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ constant_pool()

Address v8::internal::InstructionStream::constant_pool ( ) const
inline

Definition at line 39 of file instruction-stream-inl.h.

Here is the caller graph for this function:

◆ Finalize()

void v8::internal::InstructionStream::Finalize ( Tagged< Code > code,
Tagged< TrustedByteArray > reloc_info,
CodeDesc desc,
Heap * heap )

Definition at line 122 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ FromEntryAddress()

Tagged< InstructionStream > v8::internal::InstructionStream::FromEntryAddress ( Address location_of_address)
inlinestatic

Definition at line 253 of file instruction-stream-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromTargetAddress()

Tagged< InstructionStream > v8::internal::InstructionStream::FromTargetAddress ( Address address)
inlinestatic

Definition at line 234 of file instruction-stream-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

Tagged< InstructionStream > v8::internal::InstructionStream::Initialize ( Tagged< HeapObject > self,
Tagged< Map > map,
uint32_t body_size,
int constant_pool_offset,
Tagged< TrustedByteArray > reloc_info )
static

Definition at line 43 of file instruction-stream-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ instruction_start()

Address v8::internal::InstructionStream::instruction_start ( ) const
inline

Definition at line 209 of file instruction-stream-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsFullyInitialized()

bool v8::internal::InstructionStream::IsFullyInitialized ( )

Definition at line 168 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ main_cage_base()

PtrComprCageBase v8::internal::InstructionStream::main_cage_base ( )
inlinestaticprivate

Definition at line 264 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ OBJECT_CONSTRUCTORS()

v8::internal::InstructionStream::OBJECT_CONSTRUCTORS ( InstructionStream ,
TrustedObject  )
private

◆ raw_code()

Tagged< Object > v8::internal::InstructionStream::raw_code ( AcquireLoadTag tag) const
inline

Definition at line 177 of file instruction-stream-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Relocate()

void v8::internal::InstructionStream::Relocate ( WritableJitAllocation & jit_allocation,
intptr_t delta )

Definition at line 17 of file instruction-stream.cc.

Here is the call graph for this function:

◆ RelocateFromDesc()

InstructionStream::WriteBarrierPromise v8::internal::InstructionStream::RelocateFromDesc ( WritableJitAllocation & jit_allocation,
Heap * heap,
const CodeDesc & desc,
Address constant_pool,
const DisallowGarbageCollection & no_gc )
private

Definition at line 34 of file instruction-stream.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RelocateFromDescWriteBarriers()

void v8::internal::InstructionStream::RelocateFromDescWriteBarriers ( Heap * heap,
const CodeDesc & desc,
Address constant_pool,
WriteBarrierPromise & promise,
const DisallowGarbageCollection & no_gc )
private

Definition at line 95 of file instruction-stream.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ relocation_end()

uint8_t * v8::internal::InstructionStream::relocation_end ( ) const
inline

Definition at line 223 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ relocation_info()

Tagged< TrustedByteArray > v8::internal::InstructionStream::relocation_info ( ) const
inline

Definition at line 204 of file instruction-stream-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ relocation_size()

int v8::internal::InstructionStream::relocation_size ( ) const
inline

Definition at line 227 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ relocation_start()

uint8_t * v8::internal::InstructionStream::relocation_start ( ) const
inline

Definition at line 219 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ Size()

int v8::internal::InstructionStream::Size ( ) const
inline

Definition at line 231 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ SizeFor()

static constexpr int v8::internal::InstructionStream::SizeFor ( int body_size)
inlinestaticconstexpr

Definition at line 104 of file instruction-stream.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TrailingPaddingSizeFor()

static constexpr int v8::internal::InstructionStream::TrailingPaddingSizeFor ( uint32_t body_size)
inlinestaticconstexpr

Definition at line 100 of file instruction-stream.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryGetCode()

bool v8::internal::InstructionStream::TryGetCode ( Tagged< Code > * code_out,
AcquireLoadTag tag ) const
inline

Definition at line 188 of file instruction-stream-inl.h.

Here is the call graph for this function:

◆ TryGetCodeUnchecked()

bool v8::internal::InstructionStream::TryGetCodeUnchecked ( Tagged< Code > * code_out,
AcquireLoadTag tag ) const
inline

Definition at line 196 of file instruction-stream-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unchecked_relocation_info()

Tagged< TrustedByteArray > v8::internal::InstructionStream::unchecked_relocation_info ( ) const
inline

Definition at line 213 of file instruction-stream-inl.h.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ Factory

friend class Factory
friend

Definition at line 154 of file instruction-stream.h.

Member Data Documentation

◆ kBodyIsContiguous

bool v8::internal::InstructionStream::kBodyIsContiguous
staticconstexpr
Initial value:
=
static NEVER_READ_ONLY_SPACE constexpr bool kOnHeapBodyIsContiguous
static constexpr bool kOffHeapBodyIsContiguous

Definition at line 65 of file instruction-stream.h.

◆ kCodeAlignmentMinusCodeHeader

int v8::internal::InstructionStream::kCodeAlignmentMinusCodeHeader
staticconstexpr
Initial value:
=
static constexpr int kHeaderSize
constexpr intptr_t kCodeAlignment
Definition globals.h:964

Definition at line 148 of file instruction-stream.h.

◆ kMetadataAlignment

int v8::internal::InstructionStream::kMetadataAlignment = kIntSize
staticconstexpr

Definition at line 71 of file instruction-stream.h.

◆ kOffHeapBodyIsContiguous

bool v8::internal::InstructionStream::kOffHeapBodyIsContiguous = false
staticconstexpr

Definition at line 64 of file instruction-stream.h.

◆ kOnHeapBodyIsContiguous

NEVER_READ_ONLY_SPACE constexpr bool v8::internal::InstructionStream::kOnHeapBodyIsContiguous = true
staticconstexpr

Definition at line 63 of file instruction-stream.h.


The documentation for this class was generated from the following files: