Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
dart::Instructions Class Reference

#include <object.h>

Inheritance diagram for dart::Instructions:
dart::Object

Classes

class  SizeBits
 

Public Types

enum  { kSizePos = 0 , kSizeSize = 30 , kFlagsPos = kSizePos + kSizeSize , kFlagsSize = kBitsPerInt32 - kSizeSize }
 
enum  
 
- Public Types inherited from dart::Object
enum  NameVisibility { kInternalName = 0 , kScrubbedName , kUserVisibleName }
 
enum class  NameDisambiguation { kYes , kNo }
 
using UntaggedObjectType = UntaggedObject
 
using ObjectPtrType = ObjectPtr
 

Public Member Functions

intptr_t Size () const
 
uword PayloadStart () const
 
uword MonomorphicEntryPoint () const
 
uword EntryPoint () const
 
bool Equals (const Instructions &other) const
 
uint32_t Hash () const
 
CodeStatisticsstats () const
 
void set_stats (CodeStatistics *stats) const
 
- Public Member Functions inherited from dart::Object
virtual ~Object ()
 
ObjectPtr ptr () const
 
void operator= (ObjectPtr value)
 
bool IsCanonical () const
 
void SetCanonical () const
 
void ClearCanonical () const
 
bool IsImmutable () const
 
void SetImmutable () const
 
void ClearImmutable () const
 
intptr_t GetClassId () const
 
ClassPtr clazz () const
 
 CLASS_LIST_FOR_HANDLES (DEFINE_CLASS_TESTER)
 
bool IsNull () const
 
virtual const char * ToCString () const
 
void PrintJSON (JSONStream *stream, bool ref=true) const
 
virtual void PrintJSONImpl (JSONStream *stream, bool ref) const
 
void PrintImplementationFields (JSONStream *stream) const
 
virtual void PrintImplementationFieldsImpl (const JSONArray &jsarr_fields) const
 
virtual const char * JSONType () const
 
virtual StringPtr DictionaryName () const
 
bool IsNew () const
 
bool IsOld () const
 
bool InVMIsolateHeap () const
 
void Print () const
 

Static Public Member Functions

static intptr_t Size (const InstructionsPtr instr)
 
static uword PayloadStart (const InstructionsPtr instr)
 
static uword MonomorphicEntryPoint (const InstructionsPtr instr)
 
static uword EntryPoint (const InstructionsPtr instr)
 
static intptr_t HeaderSize ()
 
static intptr_t InstanceSize ()
 
static intptr_t InstanceSize (intptr_t size)
 
static InstructionsPtr FromPayloadStart (uword payload_start)
 
static bool Equals (InstructionsPtr a, InstructionsPtr b)
 
static uint32_t Hash (const InstructionsPtr instr)
 
- Static Public Member Functions inherited from dart::Object
static ObjectPtr RawCast (ObjectPtr obj)
 
static constexpr bool ContainsCompressedPointers ()
 
static intptr_t tags_offset ()
 
static ObjectHandle ()
 
static ObjectHandle (Zone *zone)
 
static ObjectHandle (ObjectPtr ptr)
 
static ObjectHandle (Zone *zone, ObjectPtr ptr)
 
static ObjectZoneHandle ()
 
static ObjectZoneHandle (Zone *zone)
 
static ObjectZoneHandle (ObjectPtr ptr)
 
static ObjectZoneHandle (Zone *zone, ObjectPtr ptr)
 
static ObjectReadOnlyHandle ()
 
static ObjectPtr null ()
 
static void set_vm_isolate_snapshot_object_table (const Array &table)
 
static ClassPtr class_class ()
 
static ClassPtr dynamic_class ()
 
static ClassPtr void_class ()
 
static ClassPtr type_parameters_class ()
 
static ClassPtr type_arguments_class ()
 
static ClassPtr patch_class_class ()
 
static ClassPtr function_class ()
 
static ClassPtr closure_data_class ()
 
static ClassPtr ffi_trampoline_data_class ()
 
static ClassPtr field_class ()
 
static ClassPtr script_class ()
 
static ClassPtr library_class ()
 
static ClassPtr namespace_class ()
 
static ClassPtr kernel_program_info_class ()
 
static ClassPtr code_class ()
 
static ClassPtr instructions_class ()
 
static ClassPtr instructions_section_class ()
 
static ClassPtr instructions_table_class ()
 
static ClassPtr object_pool_class ()
 
static ClassPtr pc_descriptors_class ()
 
static ClassPtr code_source_map_class ()
 
static ClassPtr compressed_stackmaps_class ()
 
static ClassPtr var_descriptors_class ()
 
static ClassPtr exception_handlers_class ()
 
static ClassPtr context_class ()
 
static ClassPtr context_scope_class ()
 
static ClassPtr sentinel_class ()
 
static ClassPtr api_error_class ()
 
static ClassPtr language_error_class ()
 
static ClassPtr unhandled_exception_class ()
 
static ClassPtr unwind_error_class ()
 
static ClassPtr singletargetcache_class ()
 
static ClassPtr unlinkedcall_class ()
 
static ClassPtr monomorphicsmiablecall_class ()
 
static ClassPtr icdata_class ()
 
static ClassPtr megamorphic_cache_class ()
 
static ClassPtr subtypetestcache_class ()
 
static ClassPtr loadingunit_class ()
 
static ClassPtr weak_serialization_reference_class ()
 
static ClassPtr weak_array_class ()
 
static void InitNullAndBool (IsolateGroup *isolate_group)
 
static void Init (IsolateGroup *isolate_group)
 
static void InitVtables ()
 
static void FinishInit (IsolateGroup *isolate_group)
 
static void FinalizeVMIsolate (IsolateGroup *isolate_group)
 
static void FinalizeReadOnlyObject (ObjectPtr object)
 
static void Cleanup ()
 
static ErrorPtr Init (IsolateGroup *isolate_group, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
 
static void MakeUnusedSpaceTraversable (const Object &obj, intptr_t original_size, intptr_t used_size)
 
static intptr_t InstanceSize ()
 
template<class FakeObject >
static void VerifyBuiltinVtable (intptr_t cid)
 
static void VerifyBuiltinVtables ()
 
static bool ShouldHaveImmutabilityBitSet (classid_t class_id)
 

Static Public Attributes

static constexpr intptr_t kMaxElements
 
static constexpr intptr_t kBarePayloadAlignment = 4
 
static constexpr intptr_t kNonBarePayloadAlignment = kWordSize
 
- Static Public Attributes inherited from dart::Object
static constexpr intptr_t kHashBits = 30
 
static const ClassId kClassId = kObjectCid
 

Friends

struct RelocatorTestHelper
 
class Class
 
class Code
 
class AssemblyImageWriter
 
class BlobImageWriter
 
class ImageWriter
 

Additional Inherited Members

- Protected Member Functions inherited from dart::Object
 Object ()
 
uword raw_value () const
 
void setPtr (ObjectPtr value, intptr_t default_cid)
 
void CheckHandle () const
 
cpp_vtable vtable () const
 
void set_vtable (cpp_vtable value)
 
bool Contains (uword addr) const
 
template<typename type , std::memory_order order = std::memory_order_relaxed>
type LoadPointer (type const *addr) const
 
template<typename type , std::memory_order order = std::memory_order_relaxed>
void StorePointer (type const *addr, type value) const
 
template<typename type , typename compressed_type , std::memory_order order = std::memory_order_relaxed>
void StoreCompressedPointer (compressed_type const *addr, type value) const
 
template<typename type >
void StorePointerUnaligned (type const *addr, type value, Thread *thread) const
 
void StoreSmi (SmiPtr const *addr, SmiPtr value) const
 
template<typename FieldType >
void StoreSimd128 (const FieldType *addr, simd128_value_t value) const
 
template<typename FieldType >
FieldType LoadNonPointer (const FieldType *addr) const
 
template<typename FieldType , std::memory_order order>
FieldType LoadNonPointer (const FieldType *addr) const
 
template<typename FieldType , typename ValueType >
void StoreNonPointer (const FieldType *addr, ValueType value) const
 
template<typename FieldType , typename ValueType , std::memory_order order>
void StoreNonPointer (const FieldType *addr, ValueType value) const
 
template<typename FieldType >
FieldType * UnsafeMutableNonPointer (const FieldType *addr) const
 
 CLASS_LIST (STORE_NON_POINTER_ILLEGAL_TYPE)
 
void UnimplementedMethod () const
 
void AddCommonObjectProperties (JSONObject *jsobj, const char *protocol_type, bool ref) const
 
- Static Protected Member Functions inherited from dart::Object
static DART_NOINLINE ObjectHandleImpl (Zone *zone, ObjectPtr ptr, intptr_t default_cid)
 
static DART_NOINLINE ObjectZoneHandleImpl (Zone *zone, ObjectPtr ptr, intptr_t default_cid)
 
static DART_NOINLINE ObjectReadOnlyHandleImpl (intptr_t cid)
 
static ObjectPtr Allocate (intptr_t cls_id, intptr_t size, Heap::Space space, bool compressed, uword ptr_field_start_offset, uword ptr_field_end_offset)
 
template<typename T >
static DART_FORCE_INLINE T::ObjectPtrType Allocate (Heap::Space space)
 
template<typename T >
static DART_FORCE_INLINE T::ObjectPtrType Allocate (Heap::Space space, intptr_t elements)
 
template<typename T >
static DART_FORCE_INLINE T::ObjectPtrType AllocateVariant (intptr_t class_id, Heap::Space space)
 
template<typename T >
static DART_FORCE_INLINE T::ObjectPtrType AllocateVariant (intptr_t class_id, Heap::Space space, intptr_t elements)
 
static constexpr intptr_t RoundedAllocationSize (intptr_t size)
 
static ObjectPtr Clone (const Object &orig, Heap::Space space, bool load_with_relaxed_atomics=false)
 
template<typename T >
static DART_FORCE_INLINE uword from_offset ()
 
template<typename T >
static DART_FORCE_INLINE uword to_offset (intptr_t length=0)
 
- Protected Attributes inherited from dart::Object
ObjectPtr ptr_
 

Detailed Description

Definition at line 5677 of file object.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kSizePos 
kSizeSize 
kFlagsPos 
kFlagsSize 

Definition at line 5679 of file object.h.

5679 {
5680 kSizePos = 0,
5681 kSizeSize = 30,
5684 };
constexpr intptr_t kBitsPerInt32
Definition globals.h:466

◆ anonymous enum

anonymous enum

Definition at line 5690 of file object.h.

5690 {
5691#define DEFINE_INSTRUCTIONS_FLAG(Name) k##Name##Index,
5693#undef DEFINE_INSTRUCTIONS_FLAG
5694 };
#define DEFINE_INSTRUCTIONS_FLAG(Name)
Definition object.h:5691
#define INSTRUCTIONS_FLAGS_LIST(V)
Definition object.h:5686

Member Function Documentation

◆ EntryPoint() [1/2]

uword dart::Instructions::EntryPoint ( ) const
inline

Definition at line 5718 of file object.h.

5718{ return EntryPoint(ptr()); }
uword EntryPoint() const
Definition object.h:5718
ObjectPtr ptr() const
Definition object.h:332

◆ EntryPoint() [2/2]

static uword dart::Instructions::EntryPoint ( const InstructionsPtr  instr)
inlinestatic

Definition at line 5768 of file object.h.

5768 {
5769 uword entry = PayloadStart(instr);
5770 if (HasMonomorphicEntry(instr)) {
5771 entry += !FLAG_precompiled_mode ? kPolymorphicEntryOffsetJIT
5772 : kPolymorphicEntryOffsetAOT;
5773 }
5774 return entry;
5775 }
uword PayloadStart() const
Definition object.h:5716
uintptr_t uword
Definition globals.h:501

◆ Equals() [1/2]

bool dart::Instructions::Equals ( const Instructions other) const
inline

Definition at line 5825 of file object.h.

5825 {
5826 return Equals(ptr(), other.ptr());
5827 }
bool Equals(const Instructions &other) const
Definition object.h:5825

◆ Equals() [2/2]

static bool dart::Instructions::Equals ( InstructionsPtr  a,
InstructionsPtr  b 
)
inlinestatic

Definition at line 5829 of file object.h.

5829 {
5830 // This method should only be called on non-null Instructions objects.
5831 ASSERT_EQUAL(a->GetClassId(), kInstructionsCid);
5832 ASSERT_EQUAL(b->GetClassId(), kInstructionsCid);
5833 // Don't include the object header tags wholesale in the comparison,
5834 // because the GC tags may differ in JIT mode. In fact, we can skip checking
5835 // the object header entirely, as we're guaranteed that the cids match,
5836 // because there are no subclasses for the Instructions class, and the sizes
5837 // should match if the content size encoded in size_and_flags_ matches.
5838 if (a->untag()->size_and_flags_ != b->untag()->size_and_flags_) {
5839 return false;
5840 }
5841 NoSafepointScope no_safepoint;
5842 return memcmp(a->untag()->data(), b->untag()->data(), Size(a)) == 0;
5843 }
#define ASSERT_EQUAL(expected, actual)
Definition assert.h:309
intptr_t Size() const
Definition object.h:5711
static bool b
struct MyStruct a[10]

◆ FromPayloadStart()

static InstructionsPtr dart::Instructions::FromPayloadStart ( uword  payload_start)
inlinestatic

Definition at line 5817 of file object.h.

5817 {
5818#if defined(DART_PRECOMPILED_RUNTIME)
5819 UNREACHABLE();
5820#endif
5821 return static_cast<InstructionsPtr>(payload_start - HeaderSize() +
5823 }
#define UNREACHABLE()
Definition assert.h:248
static intptr_t HeaderSize()
Definition object.h:5796
@ kHeapObjectTag

◆ Hash() [1/2]

uint32_t dart::Instructions::Hash ( ) const
inline

Definition at line 5845 of file object.h.

5845{ return Hash(ptr()); }
uint32_t Hash() const
Definition object.h:5845

◆ Hash() [2/2]

static uint32_t dart::Instructions::Hash ( const InstructionsPtr  instr)
inlinestatic

Definition at line 5847 of file object.h.

5847 {
5848 return HashBytes(reinterpret_cast<const uint8_t*>(PayloadStart(instr)),
5849 Size(instr));
5850 }
uint32_t HashBytes(const uint8_t *bytes, intptr_t size)
Definition hash.h:31

◆ HeaderSize()

static intptr_t dart::Instructions::HeaderSize ( )
inlinestatic

Definition at line 5796 of file object.h.

5796 {
5797#if defined(DART_PRECOMPILED_RUNTIME)
5798 UNREACHABLE();
5799#endif
5800 return Utils::RoundUp(sizeof(UntaggedInstructions),
5802 }
static constexpr intptr_t kNonBarePayloadAlignment
Definition object.h:5790
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
Definition utils.h:105

◆ InstanceSize() [1/2]

static intptr_t dart::Instructions::InstanceSize ( )
inlinestatic

Definition at line 5804 of file object.h.

5804 {
5805 ASSERT_EQUAL(sizeof(UntaggedInstructions),
5806 OFFSET_OF_RETURNED_VALUE(UntaggedInstructions, data));
5807 return 0;
5808 }
static int8_t data[kExtLength]
#define OFFSET_OF_RETURNED_VALUE(type, accessor)
Definition globals.h:143

◆ InstanceSize() [2/2]

static intptr_t dart::Instructions::InstanceSize ( intptr_t  size)
inlinestatic

Definition at line 5810 of file object.h.

5810 {
5811#if defined(DART_PRECOMPILED_RUNTIME)
5812 UNREACHABLE();
5813#endif
5814 return RoundedAllocationSize(HeaderSize() + size);
5815 }
static constexpr intptr_t RoundedAllocationSize(intptr_t size)
Definition object.h:758

◆ MonomorphicEntryPoint() [1/2]

uword dart::Instructions::MonomorphicEntryPoint ( ) const
inline

Definition at line 5717 of file object.h.

5717{ return MonomorphicEntryPoint(ptr()); }
uword MonomorphicEntryPoint() const
Definition object.h:5717

◆ MonomorphicEntryPoint() [2/2]

static uword dart::Instructions::MonomorphicEntryPoint ( const InstructionsPtr  instr)
inlinestatic

Definition at line 5759 of file object.h.

5759 {
5760 uword entry = PayloadStart(instr);
5761 if (HasMonomorphicEntry(instr)) {
5762 entry += !FLAG_precompiled_mode ? kMonomorphicEntryOffsetJIT
5763 : kMonomorphicEntryOffsetAOT;
5764 }
5765 return entry;
5766 }

◆ PayloadStart() [1/2]

uword dart::Instructions::PayloadStart ( ) const
inline

Definition at line 5716 of file object.h.

5716{ return PayloadStart(ptr()); }

◆ PayloadStart() [2/2]

static uword dart::Instructions::PayloadStart ( const InstructionsPtr  instr)
inlinestatic

Definition at line 5719 of file object.h.

5719 {
5720 return reinterpret_cast<uword>(instr->untag()) + HeaderSize();
5721 }

◆ set_stats()

void dart::Instructions::set_stats ( CodeStatistics stats) const

Definition at line 15533 of file object.cc.

15533 {
15534#if defined(DART_PRECOMPILER)
15536#endif
15537}
void SetPeer(ObjectPtr raw_obj, void *peer)
Definition heap.h:164
CodeStatistics * stats() const
Definition object.cc:15524
static Thread * Current()
Definition thread.h:361
Heap * heap() const
Definition thread.cc:876

◆ Size() [1/2]

intptr_t dart::Instructions::Size ( ) const
inline

Definition at line 5711 of file object.h.

5711{ return SizeBits::decode(untag()->size_and_flags_); }
static constexpr uint32_t decode(uint32_t value)
Definition bitfield.h:173
raw_obj untag() -> num_entries()) VARIABLE_COMPRESSED_VISITOR(Array, Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(TypedData, TypedData::ElementSizeInBytes(raw_obj->GetClassId()) *Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(Record, RecordShape(raw_obj->untag() ->shape()).num_fields()) VARIABLE_NULL_VISITOR(CompressedStackMaps, CompressedStackMaps::PayloadSizeOf(raw_obj)) VARIABLE_NULL_VISITOR(OneByteString, Smi::Value(raw_obj->untag() ->length())) VARIABLE_NULL_VISITOR(TwoByteString, Smi::Value(raw_obj->untag() ->length())) intptr_t UntaggedField::VisitFieldPointers(FieldPtr raw_obj, ObjectPointerVisitor *visitor)

◆ Size() [2/2]

static intptr_t dart::Instructions::Size ( const InstructionsPtr  instr)
inlinestatic

Definition at line 5712 of file object.h.

5712 {
5713 return SizeBits::decode(instr->untag()->size_and_flags_);
5714 }

◆ stats()

CodeStatistics * dart::Instructions::stats ( ) const

Definition at line 15524 of file object.cc.

15524 {
15525#if defined(DART_PRECOMPILER)
15526 return reinterpret_cast<CodeStatistics*>(
15527 Thread::Current()->heap()->GetPeer(ptr()));
15528#else
15529 return nullptr;
15530#endif
15531}
void * GetPeer(ObjectPtr raw_obj) const
Definition heap.h:167

Friends And Related Symbol Documentation

◆ AssemblyImageWriter

friend class AssemblyImageWriter
friend

Definition at line 5885 of file object.h.

◆ BlobImageWriter

friend class BlobImageWriter
friend

Definition at line 5886 of file object.h.

◆ Class

friend class Class
friend

Definition at line 5883 of file object.h.

◆ Code

friend class Code
friend

Definition at line 5884 of file object.h.

◆ ImageWriter

friend class ImageWriter
friend

Definition at line 5887 of file object.h.

◆ RelocatorTestHelper

friend struct RelocatorTestHelper
friend

Definition at line 5856 of file object.h.

Member Data Documentation

◆ kBarePayloadAlignment

constexpr intptr_t dart::Instructions::kBarePayloadAlignment = 4
staticconstexpr

Definition at line 5786 of file object.h.

◆ kMaxElements

constexpr intptr_t dart::Instructions::kMaxElements
staticconstexpr
Initial value:
=
(kMaxInt32 - (sizeof(UntaggedInstructions) + sizeof(UntaggedObject) +
static constexpr intptr_t kObjectStartAlignment
constexpr int32_t kMaxInt32
Definition globals.h:483

Definition at line 5777 of file object.h.

◆ kNonBarePayloadAlignment

constexpr intptr_t dart::Instructions::kNonBarePayloadAlignment = kWordSize
staticconstexpr

Definition at line 5790 of file object.h.


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