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

#include <object.h>

Inheritance diagram for dart::PcDescriptors:
dart::Object

Classes

class  Iterator
 

Public Member Functions

void Verify (const Function &function) const
 
void PrintToJSONObject (JSONObject *jsobj, bool ref) const
 
intptr_t Length () const
 
bool Equals (const PcDescriptors &other) const
 
void WriteToBuffer (BaseTextBuffer *buffer, uword base) 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 HeaderSize ()
 
static intptr_t UnroundedSize (PcDescriptorsPtr desc)
 
static intptr_t UnroundedSize (intptr_t len)
 
static intptr_t InstanceSize ()
 
static intptr_t InstanceSize (intptr_t len)
 
static PcDescriptorsPtr New (const void *delta_encoded_data, intptr_t size)
 
static void PrintHeaderString ()
 
- 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 kBytesPerElement = 1
 
static constexpr intptr_t kMaxElements = kMaxInt32 / kBytesPerElement
 
- Static Public Attributes inherited from dart::Object
static constexpr intptr_t kHashBits = 30
 
static const ClassId kClassId = kObjectCid
 

Friends

class Class
 
class Object
 

Additional Inherited Members

- Public Types inherited from dart::Object
enum  NameVisibility { kInternalName = 0 , kScrubbedName , kUserVisibleName }
 
enum class  NameDisambiguation { kYes , kNo }
 
using UntaggedObjectType = UntaggedObject
 
using ObjectPtrType = ObjectPtr
 
- 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 6050 of file object.h.

Member Function Documentation

◆ Equals()

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

Definition at line 6167 of file object.h.

6167 {
6168 if (Length() != other.Length()) {
6169 return false;
6170 }
6171 NoSafepointScope no_safepoint;
6172 return memcmp(untag()->data(), other.untag()->data(), Length()) == 0;
6173 }
intptr_t Length() const
Definition object.cc:15826
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)
static int8_t data[kExtLength]

◆ HeaderSize()

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

Definition at line 6055 of file object.h.

6055{ return sizeof(UntaggedPcDescriptors); }

◆ InstanceSize() [1/2]

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

Definition at line 6060 of file object.h.

6060 {
6061 ASSERT_EQUAL(sizeof(UntaggedPcDescriptors),
6062 OFFSET_OF_RETURNED_VALUE(UntaggedPcDescriptors, data));
6063 return 0;
6064 }
#define ASSERT_EQUAL(expected, actual)
Definition assert.h:309
#define OFFSET_OF_RETURNED_VALUE(type, accessor)
Definition globals.h:143

◆ InstanceSize() [2/2]

static intptr_t dart::PcDescriptors::InstanceSize ( intptr_t  len)
inlinestatic

Definition at line 6065 of file object.h.

6065 {
6066 ASSERT(0 <= len && len <= kMaxElements);
6068 }
static constexpr intptr_t RoundedAllocationSize(intptr_t size)
Definition object.h:758
static constexpr intptr_t kMaxElements
Definition object.h:6053
static intptr_t UnroundedSize(PcDescriptorsPtr desc)
Definition object.h:6056
#define ASSERT(E)

◆ Length()

intptr_t dart::PcDescriptors::Length ( ) const

Definition at line 15826 of file object.cc.

15826 {
15827 return untag()->length_;
15828}

◆ New()

PcDescriptorsPtr dart::PcDescriptors::New ( const void *  delta_encoded_data,
intptr_t  size 
)
static

Definition at line 15841 of file object.cc.

15842 {
15844 Thread* thread = Thread::Current();
15845 PcDescriptors& result = PcDescriptors::Handle(thread->zone());
15846 {
15847 auto raw = Object::Allocate<PcDescriptors>(Heap::kOld, size);
15848 NoSafepointScope no_safepoint;
15849 result = raw;
15850 result.SetLength(size);
15851 }
15852 result.CopyData(delta_encoded_data, size);
15853 return result.ptr();
15854}
@ kOld
Definition heap.h:39
static ClassPtr pc_descriptors_class()
Definition object.h:540
static ObjectPtr null()
Definition object.h:433
static Object & Handle()
Definition object.h:407
friend class Thread
Definition object.h:1025
static Thread * Current()
Definition thread.h:361
GAsyncResult * result

◆ PrintHeaderString()

static void dart::PcDescriptors::PrintHeaderString ( )
static

◆ PrintToJSONObject()

void dart::PcDescriptors::PrintToJSONObject ( JSONObject jsobj,
bool  ref 
) const

Definition at line 848 of file object_service.cc.

848 {
849 AddCommonObjectProperties(jsobj, "Object", ref);
850 // TODO(johnmccutchan): Generate a stable id. PcDescriptors hang off a Code
851 // object but do not have a back reference to generate an ID.
852 jsobj->AddServiceId(*this);
853 if (ref) {
854 return;
855 }
856 JSONArray members(jsobj, "members");
857 Iterator iter(*this, UntaggedPcDescriptors::kAnyKind);
858 while (iter.MoveNext()) {
859 JSONObject descriptor(&members);
860 descriptor.AddPropertyF("pcOffset", "%" Px "", iter.PcOffset());
861 descriptor.AddProperty("kind", KindAsStr(iter.Kind()));
862 descriptor.AddProperty("deoptId", iter.DeoptId());
863 // TODO(turnidge): Use AddLocation instead.
864 descriptor.AddProperty("tokenPos", iter.TokenPos());
865 descriptor.AddProperty("tryIndex", iter.TryIndex());
866 }
867}
void AddCommonObjectProperties(JSONObject *jsobj, const char *protocol_type, bool ref) const
#define Px
Definition globals.h:410

◆ UnroundedSize() [1/2]

static intptr_t dart::PcDescriptors::UnroundedSize ( intptr_t  len)
inlinestatic

Definition at line 6059 of file object.h.

6059{ return HeaderSize() + len; }
static intptr_t HeaderSize()
Definition object.h:6055

◆ UnroundedSize() [2/2]

static intptr_t dart::PcDescriptors::UnroundedSize ( PcDescriptorsPtr  desc)
inlinestatic

Definition at line 6056 of file object.h.

6056 {
6057 return UnroundedSize(desc->untag()->length_);
6058 }

◆ Verify()

void dart::PcDescriptors::Verify ( const Function function) const

Definition at line 15927 of file object.cc.

15927 {
15928#if defined(DEBUG)
15929 // Only check ids for unoptimized code that is optimizable.
15930 if (!function.IsOptimizable()) {
15931 return;
15932 }
15933 intptr_t max_deopt_id = 0;
15934 Iterator max_iter(
15935 *this, UntaggedPcDescriptors::kDeopt | UntaggedPcDescriptors::kIcCall);
15936 while (max_iter.MoveNext()) {
15937 if (max_iter.DeoptId() > max_deopt_id) {
15938 max_deopt_id = max_iter.DeoptId();
15939 }
15940 }
15941
15942 Zone* zone = Thread::Current()->zone();
15943 BitVector* deopt_ids = new (zone) BitVector(zone, max_deopt_id + 1);
15944 BitVector* iccall_ids = new (zone) BitVector(zone, max_deopt_id + 1);
15945 Iterator iter(*this,
15946 UntaggedPcDescriptors::kDeopt | UntaggedPcDescriptors::kIcCall);
15947 while (iter.MoveNext()) {
15948 // 'deopt_id' is set for kDeopt and kIcCall and must be unique for one kind.
15949 if (DeoptId::IsDeoptAfter(iter.DeoptId())) {
15950 // TODO(vegorov): some instructions contain multiple calls and have
15951 // multiple "after" targets recorded. Right now it is benign but might
15952 // lead to issues in the future. Fix that and enable verification.
15953 continue;
15954 }
15955 if (iter.Kind() == UntaggedPcDescriptors::kDeopt) {
15956 ASSERT(!deopt_ids->Contains(iter.DeoptId()));
15957 deopt_ids->Add(iter.DeoptId());
15958 } else {
15959 ASSERT(!iccall_ids->Contains(iter.DeoptId()));
15960 iccall_ids->Add(iter.DeoptId());
15961 }
15962 }
15963#endif // DEBUG
15964}
static bool IsDeoptAfter(intptr_t deopt_id)
Definition deopt_id.h:40
Zone * zone() const
Dart_NativeFunction function
Definition fuchsia.cc:51

◆ WriteToBuffer()

void dart::PcDescriptors::WriteToBuffer ( BaseTextBuffer buffer,
uword  base 
) const

Definition at line 15895 of file object.cc.

15895 {
15896 // 4 bits per hex digit.
15897 const int addr_width = kBitsPerWord / 4;
15898 // "*" in a printf format specifier tells it to read the field width from
15899 // the printf argument list.
15900 buffer->Printf(
15901 "%-*s kind deopt-id tok-ix try-ix yield-idx\n",
15902 addr_width, "pc");
15903 Iterator iter(*this, UntaggedPcDescriptors::kAnyKind);
15904 while (iter.MoveNext()) {
15905 buffer->Printf("%#-*" Px " %-13s % 8" Pd " %-10s % 8" Pd " % 8" Pd
15906 "\n",
15907 addr_width, base + iter.PcOffset(), KindAsStr(iter.Kind()),
15908 iter.DeoptId(), iter.TokenPos().ToCString(), iter.TryIndex(),
15909 iter.YieldIndex());
15910 }
15911}
static const uint8_t buffer[]
constexpr intptr_t kBitsPerWord
Definition globals.h:514
#define Pd
Definition globals.h:408

Friends And Related Symbol Documentation

◆ Class

friend class Class
friend

Definition at line 6188 of file object.h.

◆ Object

friend class Object
friend

Definition at line 6189 of file object.h.

Member Data Documentation

◆ kBytesPerElement

constexpr intptr_t dart::PcDescriptors::kBytesPerElement = 1
staticconstexpr

Definition at line 6052 of file object.h.

◆ kMaxElements

constexpr intptr_t dart::PcDescriptors::kMaxElements = kMaxInt32 / kBytesPerElement
staticconstexpr

Definition at line 6053 of file object.h.


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