Flutter Engine
The Flutter Engine
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 5706 of file object.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kSizePos 
kSizeSize 
kFlagsPos 
kFlagsSize 

Definition at line 5708 of file object.h.

5708 {
5709 kSizePos = 0,
5710 kSizeSize = 30,
5713 };
constexpr intptr_t kBitsPerInt32
Definition: globals.h:466

◆ anonymous enum

anonymous enum

Definition at line 5719 of file object.h.

5719 {
5720#define DEFINE_INSTRUCTIONS_FLAG(Name) k##Name##Index,
5722#undef DEFINE_INSTRUCTIONS_FLAG
5723 };
#define DEFINE_INSTRUCTIONS_FLAG(Name)
Definition: object.h:5720
#define INSTRUCTIONS_FLAGS_LIST(V)
Definition: object.h:5715

Member Function Documentation

◆ EntryPoint() [1/2]

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

Definition at line 5747 of file object.h.

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

◆ EntryPoint() [2/2]

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

Definition at line 5797 of file object.h.

5797 {
5798 uword entry = PayloadStart(instr);
5799 if (HasMonomorphicEntry(instr)) {
5800 entry += !FLAG_precompiled_mode ? kPolymorphicEntryOffsetJIT
5801 : kPolymorphicEntryOffsetAOT;
5802 }
5803 return entry;
5804 }
uword PayloadStart() const
Definition: object.h:5745
uintptr_t uword
Definition: globals.h:501

◆ Equals() [1/2]

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

Definition at line 5854 of file object.h.

5854 {
5855 return Equals(ptr(), other.ptr());
5856 }
bool Equals(const Instructions &other) const
Definition: object.h:5854

◆ Equals() [2/2]

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

Definition at line 5858 of file object.h.

5858 {
5859 // This method should only be called on non-null Instructions objects.
5860 ASSERT_EQUAL(a->GetClassId(), kInstructionsCid);
5861 ASSERT_EQUAL(b->GetClassId(), kInstructionsCid);
5862 // Don't include the object header tags wholesale in the comparison,
5863 // because the GC tags may differ in JIT mode. In fact, we can skip checking
5864 // the object header entirely, as we're guaranteed that the cids match,
5865 // because there are no subclasses for the Instructions class, and the sizes
5866 // should match if the content size encoded in size_and_flags_ matches.
5867 if (a->untag()->size_and_flags_ != b->untag()->size_and_flags_) {
5868 return false;
5869 }
5870 NoSafepointScope no_safepoint;
5871 return memcmp(a->untag()->data(), b->untag()->data(), Size(a)) == 0;
5872 }
#define ASSERT_EQUAL(expected, actual)
Definition: assert.h:309
intptr_t Size() const
Definition: object.h:5740
static bool b
struct MyStruct a[10]

◆ FromPayloadStart()

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

Definition at line 5846 of file object.h.

5846 {
5847#if defined(DART_PRECOMPILED_RUNTIME)
5848 UNREACHABLE();
5849#endif
5850 return static_cast<InstructionsPtr>(payload_start - HeaderSize() +
5852 }
#define UNREACHABLE()
Definition: assert.h:248
static intptr_t HeaderSize()
Definition: object.h:5825
@ kHeapObjectTag

◆ Hash() [1/2]

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

Definition at line 5874 of file object.h.

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

◆ Hash() [2/2]

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

Definition at line 5876 of file object.h.

5876 {
5877 return HashBytes(reinterpret_cast<const uint8_t*>(PayloadStart(instr)),
5878 Size(instr));
5879 }
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 5825 of file object.h.

5825 {
5826#if defined(DART_PRECOMPILED_RUNTIME)
5827 UNREACHABLE();
5828#endif
5829 return Utils::RoundUp(sizeof(UntaggedInstructions),
5831 }
static constexpr intptr_t kNonBarePayloadAlignment
Definition: object.h:5819
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
Definition: utils.h:120

◆ InstanceSize() [1/2]

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

Definition at line 5833 of file object.h.

5833 {
5834 ASSERT_EQUAL(sizeof(UntaggedInstructions),
5835 OFFSET_OF_RETURNED_VALUE(UntaggedInstructions, data));
5836 return 0;
5837 }
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 5839 of file object.h.

5839 {
5840#if defined(DART_PRECOMPILED_RUNTIME)
5841 UNREACHABLE();
5842#endif
5844 }
static constexpr intptr_t RoundedAllocationSize(intptr_t size)
Definition: object.h:758
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ MonomorphicEntryPoint() [1/2]

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

Definition at line 5746 of file object.h.

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

◆ MonomorphicEntryPoint() [2/2]

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

Definition at line 5788 of file object.h.

5788 {
5789 uword entry = PayloadStart(instr);
5790 if (HasMonomorphicEntry(instr)) {
5791 entry += !FLAG_precompiled_mode ? kMonomorphicEntryOffsetJIT
5792 : kMonomorphicEntryOffsetAOT;
5793 }
5794 return entry;
5795 }

◆ PayloadStart() [1/2]

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

Definition at line 5745 of file object.h.

5745{ return PayloadStart(ptr()); }

◆ PayloadStart() [2/2]

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

Definition at line 5748 of file object.h.

5748 {
5749 return reinterpret_cast<uword>(instr->untag()) + HeaderSize();
5750 }

◆ set_stats()

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

Definition at line 15486 of file object.cc.

15486 {
15487#if defined(DART_PRECOMPILER)
15489#endif
15490}
void SetPeer(ObjectPtr raw_obj, void *peer)
Definition: heap.h:164
CodeStatistics * stats() const
Definition: object.cc:15477
static Thread * Current()
Definition: thread.h:362
Heap * heap() const
Definition: thread.cc:943

◆ Size() [1/2]

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

Definition at line 5740 of file object.h.

5740{ return SizeBits::decode(untag()->size_and_flags_); }
static constexpr uint32_t decode(uint32_t value)
Definition: bitfield.h:171
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)
Definition: raw_object.cc:558

◆ Size() [2/2]

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

Definition at line 5741 of file object.h.

5741 {
5742 return SizeBits::decode(instr->untag()->size_and_flags_);
5743 }

◆ stats()

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

Definition at line 15477 of file object.cc.

15477 {
15478#if defined(DART_PRECOMPILER)
15479 return reinterpret_cast<CodeStatistics*>(
15480 Thread::Current()->heap()->GetPeer(ptr()));
15481#else
15482 return nullptr;
15483#endif
15484}
void * GetPeer(ObjectPtr raw_obj) const
Definition: heap.h:167

Friends And Related Function Documentation

◆ AssemblyImageWriter

friend class AssemblyImageWriter
friend

Definition at line 5914 of file object.h.

◆ BlobImageWriter

friend class BlobImageWriter
friend

Definition at line 5915 of file object.h.

◆ Class

friend class Class
friend

Definition at line 5912 of file object.h.

◆ Code

friend class Code
friend

Definition at line 5913 of file object.h.

◆ ImageWriter

friend class ImageWriter
friend

Definition at line 5916 of file object.h.

◆ RelocatorTestHelper

friend struct RelocatorTestHelper
friend

Definition at line 5885 of file object.h.

Member Data Documentation

◆ kBarePayloadAlignment

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

Definition at line 5815 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 5806 of file object.h.

◆ kNonBarePayloadAlignment

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

Definition at line 5819 of file object.h.


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