Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
dart::Field Class Reference

#include <object.h>

Inheritance diagram for dart::Field:
dart::Object

Public Types

enum  { kUnknownLengthOffset = -1 , kUnknownFixedLength = -1 , kNoFixedLength = -2 }
 
- 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

FieldPtr Original () const
 
void SetOriginal (const Field &value) const
 
bool IsOriginal () const
 
FieldPtr CloneFromOriginal () const
 
StringPtr name () const
 
StringPtr UserVisibleName () const
 
const char * UserVisibleNameCString () const
 
virtual StringPtr DictionaryName () const
 
uint16_t kind_bits () const
 
bool is_static () const
 
bool is_instance () const
 
bool is_final () const
 
bool is_const () const
 
bool is_late () const
 
bool is_extension_member () const
 
bool is_extension_type_member () const
 
bool needs_load_guard () const
 
bool is_reflectable () const
 
void set_is_reflectable (bool value) const
 
bool initializer_changed_after_initialization () const
 
void set_initializer_changed_after_initialization (bool value) const
 
bool has_pragma () const
 
void set_has_pragma (bool value) const
 
bool is_covariant () const
 
void set_is_covariant (bool value) const
 
bool is_generic_covariant_impl () const
 
void set_is_generic_covariant_impl (bool value) const
 
void set_is_shared (bool value) const
 
bool is_shared () const
 
intptr_t kernel_offset () const
 
void set_kernel_offset (intptr_t value) const
 
void InheritKernelOffsetFrom (const Field &src) const
 
TypedDataViewPtr KernelLibrary () const
 
intptr_t KernelLibraryOffset () const
 
intptr_t KernelLibraryIndex () const
 
void SetOffset (intptr_t host_offset_in_bytes, intptr_t target_offset_in_bytes) const
 
intptr_t HostOffset () const
 
intptr_t TargetOffset () const
 
ObjectPtr StaticConstFieldValue () const
 
void SetStaticConstFieldValue (const Instance &value, bool assert_initializing_store=true) const
 
ObjectPtr StaticValue () const
 
void SetStaticValue (const Object &value) const
 
intptr_t field_id () const
 
void set_field_id (intptr_t field_id) const
 
void set_field_id_unsafe (intptr_t field_id) const
 
ClassPtr Owner () const
 
ScriptPtr Script () const
 
KernelProgramInfoPtr KernelProgramInfo () const
 
ObjectPtr RawOwner () const
 
uint32_t Hash () const
 
AbstractTypePtr type () const
 
void SetFieldType (const AbstractType &value) const
 
void SetFieldTypeSafe (const AbstractType &value) const
 
DART_WARN_UNUSED_RESULT ErrorPtr VerifyEntryPoint (EntryPointPragma kind) const
 
FieldPtr Clone (const Field &original) const
 
TokenPosition token_pos () const
 
TokenPosition end_token_pos () const
 
int32_t SourceFingerprint () const
 
StringPtr InitializingExpression () const
 
bool has_nontrivial_initializer () const
 
void set_has_nontrivial_initializer_unsafe (bool has_nontrivial_initializer) const
 
void set_has_nontrivial_initializer (bool has_nontrivial_initializer) const
 
bool has_initializer () const
 
void set_has_initializer_unsafe (bool has_initializer) const
 
void set_has_initializer (bool has_initializer) const
 
bool has_trivial_initializer () const
 
StaticTypeExactnessState static_type_exactness_state () const
 
void set_static_type_exactness_state (StaticTypeExactnessState state) const
 
void set_static_type_exactness_state_unsafe (StaticTypeExactnessState state) const
 
intptr_t guarded_cid () const
 
void set_guarded_cid (intptr_t cid) const
 
void set_guarded_cid_unsafe (intptr_t cid) const
 
intptr_t guarded_list_length () const
 
void set_guarded_list_length_unsafe (intptr_t list_length) const
 
void set_guarded_list_length (intptr_t list_length) const
 
intptr_t guarded_list_length_in_object_offset () const
 
void set_guarded_list_length_in_object_offset_unsafe (intptr_t offset) const
 
void set_guarded_list_length_in_object_offset (intptr_t offset) const
 
bool needs_length_check () const
 
bool NeedsSetter () const
 
bool NeedsGetter () const
 
bool NeedsInitializationCheckOnLoad () const
 
const char * GuardedPropertiesAsCString () const
 
bool is_unboxed () const
 
void set_is_unboxed_unsafe (bool b) const
 
void set_is_unboxed (bool b) const
 
void set_is_late (bool value) const
 
void set_is_extension_member (bool value) const
 
void set_is_extension_type_member (bool value) const
 
void set_needs_load_guard (bool value) const
 
bool is_nullable () const
 
void set_is_nullable (bool val) const
 
bool is_nullable_unsafe () const
 
void set_is_nullable_unsafe (bool val) const
 
void RecordStore (const Object &value) const
 
void InitializeGuardedListLengthInObjectOffset (bool unsafe=false) const
 
WeakArrayPtr dependent_code () const
 
void set_dependent_code (const WeakArray &array) const
 
void RegisterDependentCode (const Code &code) const
 
void DeoptimizeDependentCode (bool are_mutators_stopped=false) const
 
bool IsConsistentWith (const Field &field) const
 
bool IsUninitialized () const
 
DART_WARN_UNUSED_RESULT ErrorPtr InitializeInstance (const Instance &instance) const
 
DART_WARN_UNUSED_RESULT ErrorPtr InitializeStatic () const
 
DART_WARN_UNUSED_RESULT ObjectPtr EvaluateInitializer () const
 
FunctionPtr EnsureInitializerFunction () const
 
FunctionPtr InitializerFunction () const
 
void SetInitializerFunction (const Function &initializer) const
 
bool HasInitializerFunction () const
 
InstancePtr GetterClosure () const
 
InstancePtr SetterClosure () const
 
InstancePtr AccessorClosure (bool make_setter) 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 host_offset_or_field_id_offset ()
 
static intptr_t TargetOffsetOf (FieldPtr field)
 
static intptr_t InstanceSize ()
 
static FieldPtr New (const String &name, bool is_static, bool is_final, bool is_const, bool is_reflectable, bool is_late, const Object &owner, const AbstractType &type, TokenPosition token_pos, TokenPosition end_token_pos)
 
static FieldPtr NewTopLevel (const String &name, bool is_final, bool is_const, bool is_late, const Object &owner, TokenPosition token_pos, TokenPosition end_token_pos)
 
static intptr_t kind_bits_offset ()
 
static intptr_t static_type_exactness_state_offset ()
 
static intptr_t guarded_cid_offset ()
 
static intptr_t guarded_list_length_offset ()
 
static intptr_t guarded_list_length_in_object_offset_offset ()
 
static intptr_t is_nullable_offset ()
 
static intptr_t initializer_function_offset ()
 
static StringPtr GetterName (const String &field_name)
 
static StringPtr GetterSymbol (const String &field_name)
 
static StringPtr LookupGetterSymbol (const String &field_name)
 
static StringPtr SetterName (const String &field_name)
 
static StringPtr SetterSymbol (const String &field_name)
 
static StringPtr LookupSetterSymbol (const String &field_name)
 
static StringPtr NameFromGetter (const String &getter_name)
 
static StringPtr NameFromSetter (const String &setter_name)
 
static StringPtr NameFromInit (const String &init_name)
 
static bool IsGetterName (const String &function_name)
 
static bool IsSetterName (const String &function_name)
 
static bool IsInitName (const String &function_name)
 
- 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)
 

Friends

class StoreFieldInstr
 
class Class
 
class UntaggedField
 
class FieldSerializationCluster
 
class FieldDeserializationCluster
 

Additional Inherited Members

- Static Public Attributes inherited from dart::Object
static constexpr intptr_t kHashBits = 30
 
static const ClassId kClassId = kObjectCid
 
- 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 4407 of file object.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kUnknownLengthOffset 
kUnknownFixedLength 
kNoFixedLength 

Definition at line 4726 of file object.h.

4726 {
4729 kNoFixedLength = -2,
4730 };
@ kUnknownFixedLength
Definition: object.h:4728
@ kUnknownLengthOffset
Definition: object.h:4727
@ kNoFixedLength
Definition: object.h:4729

Member Function Documentation

◆ AccessorClosure()

InstancePtr dart::Field::AccessorClosure ( bool  make_setter) const

Definition at line 12178 of file object.cc.

12178 {
12179 Thread* thread = Thread::Current();
12180 Zone* zone = thread->zone();
12181 ASSERT(is_static());
12182 const Class& field_owner = Class::Handle(zone, Owner());
12183
12184 String& closure_name = String::Handle(zone, this->name());
12185 closure_name = Symbols::FromConcat(thread, Symbols::HashMark(), closure_name);
12186 if (make_setter) {
12187 closure_name =
12188 Symbols::FromConcat(thread, Symbols::HashMark(), closure_name);
12189 }
12190
12191 Field& closure_field = Field::Handle(zone);
12192 closure_field = field_owner.LookupStaticField(closure_name);
12193 if (!closure_field.IsNull()) {
12194 ASSERT(closure_field.is_static());
12195 const Instance& closure =
12196 Instance::Handle(zone, Instance::RawCast(closure_field.StaticValue()));
12197 ASSERT(!closure.IsNull());
12198 ASSERT(closure.IsClosure());
12199 return closure.ptr();
12200 }
12201
12202 UNREACHABLE();
12203 return Instance::null();
12204}
#define UNREACHABLE()
Definition: assert.h:248
ClassPtr Owner() const
Definition: object.cc:11860
bool is_static() const
Definition: object.h:4440
StringPtr name() const
Definition: object.h:4430
friend class Class
Definition: object.h:4924
static ObjectPtr null()
Definition: object.h:433
static Object & Handle()
Definition: object.h:407
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
friend class Thread
Definition: object.h:1025
static const String & HashMark()
Definition: symbols.h:672
static StringPtr FromConcat(Thread *thread, const String &str1, const String &str2)
Definition: symbols.cc:235
static Thread * Current()
Definition: thread.h:362
#define ASSERT(E)
std::function< void()> closure
Definition: closure.h:14

◆ Clone()

FieldPtr dart::Field::Clone ( const Field original) const

Definition at line 12054 of file object.cc.

12054 {
12055 if (original.IsNull()) {
12056 return Field::null();
12057 }
12058 ASSERT(original.IsOriginal());
12059 Field& clone = Field::Handle();
12060 // Using relaxed loading is fine because concurrent fields changes are all
12061 // guarded, will be reconciled during optimized code installation.
12062 clone ^= Object::Clone(*this, Heap::kOld, /*load_with_relaxed_atomics=*/true);
12063 clone.SetOriginal(original);
12064 clone.InheritKernelOffsetFrom(original);
12065 return clone.ptr();
12066}
@ kOld
Definition: heap.h:39
static ObjectPtr Clone(const Object &orig, Heap::Space space, bool load_with_relaxed_atomics=false)
Definition: object.cc:2899

◆ CloneFromOriginal()

FieldPtr dart::Field::CloneFromOriginal ( ) const

Definition at line 11735 of file object.cc.

11735 {
11736 return this->Clone(*this);
11737}
FieldPtr Clone(const Field &original) const
Definition: object.cc:12054

◆ DeoptimizeDependentCode()

void dart::Field::DeoptimizeDependentCode ( bool  are_mutators_stopped = false) const

Definition at line 12268 of file object.cc.

12268 {
12270 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
12271 ASSERT(IsOriginal());
12272 FieldDependentArray a(*this);
12273 if (FLAG_trace_deoptimization && a.HasCodes()) {
12274 THR_Print("Deopt for field guard (field %s)\n", ToCString());
12275 }
12276 a.DisableCode(are_mutators_stopped);
12277}
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
bool IsOriginal() const
Definition: object.h:4418
static IsolateGroup * Current()
Definition: isolate.h:539
virtual const char * ToCString() const
Definition: object.h:366
#define THR_Print(format,...)
Definition: log.h:20
struct MyStruct a[10]

◆ dependent_code()

WeakArrayPtr dart::Field::dependent_code ( ) const

Definition at line 12214 of file object.cc.

12214 {
12216 IsolateGroup::Current()->program_lock()->IsCurrentThreadReader());
12217 return untag()->dependent_code();
12218}
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

◆ DictionaryName()

virtual StringPtr dart::Field::DictionaryName ( ) const
inlinevirtual

Reimplemented from dart::Object.

Definition at line 4433 of file object.h.

4433{ return name(); }

◆ end_token_pos()

TokenPosition dart::Field::end_token_pos ( ) const
inline

Definition at line 4590 of file object.h.

4590{ return untag()->end_token_pos_; }

◆ EnsureInitializerFunction()

FunctionPtr dart::Field::EnsureInitializerFunction ( ) const

Definition at line 12297 of file object.cc.

12297 {
12299 ASSERT(IsOriginal());
12300 Thread* thread = Thread::Current();
12301 Zone* zone = thread->zone();
12303 if (initializer.IsNull()) {
12304#if defined(DART_PRECOMPILED_RUNTIME)
12305 UNREACHABLE();
12306#else
12307 SafepointMutexLocker ml(
12308 thread->isolate_group()->initializer_functions_mutex());
12309 // Double check after grabbing the lock.
12311 if (initializer.IsNull()) {
12313 }
12314#endif
12315 }
12316 return initializer.ptr();
12317}
static struct Initializer initializer
FunctionPtr InitializerFunction() const
Definition: object.h:4804
bool has_nontrivial_initializer() const
Definition: object.h:4596
FunctionPtr CreateFieldInitializerFunction(Thread *thread, Zone *zone, const Field &field)

◆ EvaluateInitializer()

ObjectPtr dart::Field::EvaluateInitializer ( ) const

Definition at line 12465 of file object.cc.

12465 {
12466 ASSERT(Thread::Current()->IsDartMutatorThread());
12467
12468#if !defined(DART_PRECOMPILED_RUNTIME)
12469 if (is_static() && is_const()) {
12471 }
12472#endif // !defined(DART_PRECOMPILED_RUNTIME)
12473
12475 return DartEntry::InvokeFunction(initializer, Object::empty_array());
12476}
static ObjectPtr InvokeFunction(const Function &function, const Array &arguments)
Definition: dart_entry.cc:31
FunctionPtr EnsureInitializerFunction() const
Definition: object.cc:12297
bool is_const() const
Definition: object.h:4443
ObjectPtr EvaluateStaticConstFieldInitializer(const Field &field)
Definition: kernel.cc:381

◆ field_id()

intptr_t dart::Field::field_id ( ) const
inline

Definition at line 13284 of file object.h.

13284 {
13285 return Smi::Value(untag()->host_offset_or_field_id());
13286}
intptr_t Value() const
Definition: object.h:9990

◆ GetterClosure()

InstancePtr dart::Field::GetterClosure ( ) const

Definition at line 12206 of file object.cc.

12206 {
12207 return AccessorClosure(false);
12208}
InstancePtr AccessorClosure(bool make_setter) const
Definition: object.cc:12178

◆ GetterName()

StringPtr dart::Field::GetterName ( const String field_name)
static

Definition at line 11792 of file object.cc.

11792 {
11793 return String::Concat(Symbols::GetterPrefix(), field_name);
11794}
static StringPtr Concat(const String &str1, const String &str2, Heap::Space space=Heap::kNew)
Definition: object.cc:24037

◆ GetterSymbol()

StringPtr dart::Field::GetterSymbol ( const String field_name)
static

Definition at line 11796 of file object.cc.

11796 {
11797 return Symbols::FromGet(Thread::Current(), field_name);
11798}
static StringPtr FromGet(Thread *thread, const String &str)
Definition: symbols.cc:247

◆ guarded_cid()

intptr_t dart::Field::guarded_cid ( ) const

Definition at line 11749 of file object.cc.

11749 {
11750#if defined(DEBUG)
11751 // This assertion ensures that the cid seen by the background compiler is
11752 // consistent. So the assertion passes if the field is a clone. It also
11753 // passes if the field is static, because we don't use field guards on
11754 // static fields. It also passes if we're compiling unoptimized
11755 // code (in which case the caller might get different answers if it obtains
11756 // the guarded cid multiple times).
11757 Thread* thread = Thread::Current();
11758#if defined(DART_PRECOMPILED_RUNTIME)
11759 ASSERT(!thread->IsInsideCompiler() || is_static());
11760#else
11761 ASSERT(!thread->IsInsideCompiler() ||
11763 is_static());
11764#endif
11765#endif
11766 return LoadNonPointer<ClassIdTagType, std::memory_order_relaxed>(
11767 &untag()->guarded_cid_);
11768}
static CompilerState & Current()

◆ guarded_cid_offset()

static intptr_t dart::Field::guarded_cid_offset ( )
inlinestatic

Definition at line 4669 of file object.h.

4669 {
4670 return OFFSET_OF(UntaggedField, guarded_cid_);
4671 }
friend class UntaggedField
Definition: object.h:4925
#define OFFSET_OF(type, field)
Definition: globals.h:138

◆ guarded_list_length()

intptr_t dart::Field::guarded_list_length ( ) const

Definition at line 12101 of file object.cc.

12101 {
12103}
intptr_t guarded_list_length() const
Definition: object.cc:12101

◆ guarded_list_length_in_object_offset()

intptr_t dart::Field::guarded_list_length_in_object_offset ( ) const

Definition at line 12110 of file object.cc.

12110 {
12111 return untag()->guarded_list_length_in_object_offset_ + kHeapObjectTag;
12112}
@ kHeapObjectTag

◆ guarded_list_length_in_object_offset_offset()

static intptr_t dart::Field::guarded_list_length_in_object_offset_offset ( )
inlinestatic

Definition at line 4693 of file object.h.

4693 {
4694 return OFFSET_OF(UntaggedField, guarded_list_length_in_object_offset_);
4695 }

◆ guarded_list_length_offset()

static intptr_t dart::Field::guarded_list_length_offset ( )
inlinestatic

Definition at line 4683 of file object.h.

4683 {
4684 return OFFSET_OF(UntaggedField, guarded_list_length_);
4685 }

◆ GuardedPropertiesAsCString()

const char * dart::Field::GuardedPropertiesAsCString ( ) const

Definition at line 12504 of file object.cc.

12504 {
12505 if (guarded_cid() == kIllegalCid) {
12506 return "<?>";
12507 } else if (guarded_cid() == kDynamicCid) {
12508 ASSERT(!static_type_exactness_state().IsExactOrUninitialized());
12509 return "<*>";
12510 }
12511
12512 Zone* zone = Thread::Current()->zone();
12513
12514 const char* exactness = "";
12515 if (static_type_exactness_state().IsTracking()) {
12516 exactness =
12518 }
12519
12520 const Class& cls =
12521 Class::Handle(IsolateGroup::Current()->class_table()->At(guarded_cid()));
12522 const char* class_name = String::Handle(cls.Name()).ToCString();
12523
12527 return zone->PrintToString("<%s [*]%s>", class_name, exactness);
12528 } else {
12529 return zone->PrintToString(
12530 "<%s [%" Pd " @%" Pd "]%s>", class_name, guarded_list_length(),
12532 }
12533 }
12534
12535 return zone->PrintToString("<%s %s%s>",
12536 is_nullable() ? "nullable" : "not-nullable",
12537 class_name, exactness);
12538}
bool is_final() const
Definition: object.h:4442
bool is_nullable() const
Definition: object.cc:11770
StaticTypeExactnessState static_type_exactness_state() const
Definition: object.h:4633
intptr_t guarded_list_length_in_object_offset() const
Definition: object.cc:12110
intptr_t guarded_cid() const
Definition: object.cc:11749
Zone * zone() const
Definition: thread_state.h:37
char * PrintToString(const char *format,...) PRINTF_ATTRIBUTE(2
Definition: zone.cc:313
const char *const class_name
@ kIllegalCid
Definition: class_id.h:214
@ kDynamicCid
Definition: class_id.h:253
bool IsBuiltinListClassId(intptr_t index)
Definition: class_id.h:364
#define Pd
Definition: globals.h:408

◆ has_initializer()

bool dart::Field::has_initializer ( ) const
inline

Definition at line 4613 of file object.h.

4613 {
4615 }
uint16_t kind_bits() const
Definition: object.h:4435
static DecodeResult decode(std::string path)
Definition: png_codec.cpp:124

◆ has_nontrivial_initializer()

bool dart::Field::has_nontrivial_initializer ( ) const
inline

Definition at line 4596 of file object.h.

4596 {
4598 }

◆ has_pragma()

bool dart::Field::has_pragma ( ) const
inline

Definition at line 4470 of file object.h.

4470{ return HasPragmaBit::decode(kind_bits()); }

◆ has_trivial_initializer()

bool dart::Field::has_trivial_initializer ( ) const
inline

Definition at line 4629 of file object.h.

4629 {
4631 }
bool has_initializer() const
Definition: object.h:4613

◆ Hash()

uint32_t dart::Field::Hash ( ) const

Definition at line 11894 of file object.cc.

11894 {
11895 return String::HashRawSymbol(name());
11896}
static uword HashRawSymbol(const StringPtr symbol)
Definition: object.h:10247

◆ HasInitializerFunction()

bool dart::Field::HasInitializerFunction ( ) const

Definition at line 12335 of file object.cc.

12335 {
12336 return untag()->initializer_function() != Function::null();
12337}

◆ host_offset_or_field_id_offset()

static intptr_t dart::Field::host_offset_or_field_id_offset ( )
inlinestatic

Definition at line 4523 of file object.h.

4523 {
4524 return OFFSET_OF(UntaggedField, host_offset_or_field_id_);
4525 }

◆ HostOffset()

intptr_t dart::Field::HostOffset ( ) const
inline

Definition at line 13241 of file object.h.

13241 {
13242 ASSERT(is_instance()); // Valid only for dart instance fields.
13243 return (Smi::Value(untag()->host_offset_or_field_id()) * kCompressedWordSize);
13244}
bool is_instance() const
Definition: object.h:4441
static constexpr intptr_t kCompressedWordSize
Definition: globals.h:42

◆ InheritKernelOffsetFrom()

void dart::Field::InheritKernelOffsetFrom ( const Field src) const

Definition at line 11898 of file object.cc.

11898 {
11899#if defined(DART_PRECOMPILED_RUNTIME)
11900 UNREACHABLE();
11901#else
11902 StoreNonPointer(&untag()->kernel_offset_, src.untag()->kernel_offset_);
11903#endif
11904}
void StoreNonPointer(const FieldType *addr, ValueType value) const
Definition: object.h:819

◆ InitializeGuardedListLengthInObjectOffset()

void dart::Field::InitializeGuardedListLengthInObjectOffset ( bool  unsafe = false) const

Definition at line 12540 of file object.cc.

12540 {
12543 ASSERT(IsOriginal());
12544 if (needs_length_check() &&
12546 const intptr_t offset = GetListLengthOffset(guarded_cid());
12547 (this->*setter)(offset);
12549 } else {
12550 (this->*setter)(Field::kUnknownLengthOffset);
12551 }
12552}
bool needs_length_check() const
Definition: object.h:4697
void set_guarded_list_length_in_object_offset_unsafe(intptr_t offset) const
Definition: object.cc:12114
void set_guarded_list_length_in_object_offset(intptr_t offset) const
Definition: object.h:4688
static intptr_t GetListLengthOffset(intptr_t cid)
Definition: object.cc:12490
SeparatedVector2 offset

◆ InitializeInstance()

ErrorPtr dart::Field::InitializeInstance ( const Instance instance) const

Definition at line 12339 of file object.cc.

12339 {
12340 ASSERT(IsOriginal());
12342 ASSERT(instance.GetField(*this) == Object::sentinel().ptr());
12344
12347 const Array& args = Array::Handle(Array::New(1));
12348 args.SetAt(0, instance);
12350 if (!value.IsNull() && value.IsError()) {
12351 return Error::Cast(value).ptr();
12352 }
12353 } else {
12354 if (is_late() && !has_initializer()) {
12356 UNREACHABLE();
12357 }
12358#if defined(DART_PRECOMPILED_RUNTIME)
12359 UNREACHABLE();
12360#else
12361 // Our trivial initializer is `null`. Any non-`null` initializer is
12362 // non-trivial (see `KernelLoader::CheckForInitializer()`).
12363 value = Object::null();
12364#endif
12365 }
12366 ASSERT(value.IsNull() || value.IsInstance());
12367 if (is_late() && is_final() &&
12368 (instance.GetField(*this) != Object::sentinel().ptr())) {
12370 String::Handle(name()));
12371 UNREACHABLE();
12372 }
12373 instance.SetField(*this, value);
12374 return Error::null();
12375}
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
Definition: object.h:10959
static DART_NORETURN void ThrowLateFieldAssignedDuringInitialization(const String &name)
Definition: exceptions.cc:1124
static DART_NORETURN void ThrowLateFieldNotInitialized(const String &name)
Definition: exceptions.cc:1118
bool is_late() const
Definition: object.h:4444
VkInstance instance
Definition: main.cc:48
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint8_t value

◆ initializer_changed_after_initialization()

bool dart::Field::initializer_changed_after_initialization ( ) const
inline

Definition at line 4461 of file object.h.

◆ initializer_function_offset()

static intptr_t dart::Field::initializer_function_offset ( )
inlinestatic

Definition at line 4809 of file object.h.

4809 {
4810 return OFFSET_OF(UntaggedField, initializer_function_);
4811 }

◆ InitializerFunction()

FunctionPtr dart::Field::InitializerFunction ( ) const
inline

Definition at line 4804 of file object.h.

4804 {
4805 return untag()->initializer_function<std::memory_order_acquire>();
4806 }

◆ InitializeStatic()

ErrorPtr dart::Field::InitializeStatic ( ) const

Definition at line 12377 of file object.cc.

12377 {
12378 ASSERT(IsOriginal());
12379 ASSERT(is_static());
12380 if (StaticValue() == Object::sentinel().ptr()) {
12381 auto& value = Object::Handle();
12382 if (is_late()) {
12383 if (!has_initializer()) {
12385 UNREACHABLE();
12386 }
12388 if (value.IsError()) {
12389 return Error::Cast(value).ptr();
12390 }
12391 if (is_final() && (StaticValue() != Object::sentinel().ptr())) {
12393 String::Handle(name()));
12394 UNREACHABLE();
12395 }
12396 } else {
12397 SetStaticValue(Object::transition_sentinel());
12399 if (value.IsError()) {
12400 SetStaticValue(Object::null_instance());
12401 return Error::Cast(value).ptr();
12402 }
12403 }
12404 ASSERT(value.IsNull() || value.IsInstance());
12405 SetStaticValue(value.IsNull() ? Instance::null_instance()
12406 : Instance::Cast(value));
12407 return Error::null();
12408 } else if (StaticValue() == Object::transition_sentinel().ptr()) {
12409 ASSERT(!is_late());
12410 const Array& ctor_args = Array::Handle(Array::New(1));
12411 const String& field_name = String::Handle(name());
12412 ctor_args.SetAt(0, field_name);
12414 UNREACHABLE();
12415 }
12416 return Error::null();
12417}
static DART_NORETURN void ThrowByType(ExceptionType type, const Array &arguments)
Definition: exceptions.cc:1052
@ kCyclicInitializationError
Definition: exceptions.h:70
DART_WARN_UNUSED_RESULT ObjectPtr EvaluateInitializer() const
Definition: object.cc:12465
ObjectPtr StaticValue() const
Definition: object.h:13279
void SetStaticValue(const Object &value) const
Definition: object.cc:12770
ObjectPtr ptr() const
Definition: object.h:332

◆ InitializingExpression()

StringPtr dart::Field::InitializingExpression ( ) const

Definition at line 12077 of file object.cc.

12077 {
12078 UNREACHABLE();
12079 return String::null();
12080}

◆ InstanceSize()

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

Definition at line 4558 of file object.h.

4558 {
4559 return RoundedAllocationSize(sizeof(UntaggedField));
4560 }
static constexpr intptr_t RoundedAllocationSize(intptr_t size)
Definition: object.h:758

◆ is_const()

bool dart::Field::is_const ( ) const
inline

Definition at line 4443 of file object.h.

4443{ return ConstBit::decode(kind_bits()); }

◆ is_covariant()

bool dart::Field::is_covariant ( ) const
inline

Definition at line 4476 of file object.h.

4476{ return CovariantBit::decode(kind_bits()); }

◆ is_extension_member()

bool dart::Field::is_extension_member ( ) const
inline

Definition at line 4445 of file object.h.

4445 {
4447 }

◆ is_extension_type_member()

bool dart::Field::is_extension_type_member ( ) const
inline

Definition at line 4448 of file object.h.

4448 {
4450 }

◆ is_final()

bool dart::Field::is_final ( ) const
inline

Definition at line 4442 of file object.h.

4442{ return FinalBit::decode(kind_bits()); }

◆ is_generic_covariant_impl()

bool dart::Field::is_generic_covariant_impl ( ) const
inline

Definition at line 4482 of file object.h.

4482 {
4484 }

◆ is_instance()

bool dart::Field::is_instance ( ) const
inline

Definition at line 4441 of file object.h.

4441{ return !is_static(); }

◆ is_late()

bool dart::Field::is_late ( ) const
inline

Definition at line 4444 of file object.h.

4444{ return IsLateBit::decode(kind_bits()); }

◆ is_nullable()

bool dart::Field::is_nullable ( ) const

Definition at line 11770 of file object.cc.

11770 {
11771#if defined(DEBUG)
11772 // Same assert as guarded_cid(), because is_nullable() also needs to be
11773 // consistent for the background compiler.
11774 Thread* thread = Thread::Current();
11775#if defined(DART_PRECOMPILED_RUNTIME)
11776 ASSERT(!thread->IsInsideCompiler() || is_static());
11777#else
11778 ASSERT(!thread->IsInsideCompiler() ||
11780 is_static());
11781#endif
11782#endif
11783 return is_nullable_unsafe();
11784}
bool is_nullable_unsafe() const
Definition: object.h:4758

◆ is_nullable_offset()

static intptr_t dart::Field::is_nullable_offset ( )
inlinestatic

Definition at line 4766 of file object.h.

4766 {
4767 return OFFSET_OF(UntaggedField, is_nullable_);
4768 }

◆ is_nullable_unsafe()

bool dart::Field::is_nullable_unsafe ( ) const
inline

Definition at line 4758 of file object.h.

4758 {
4759 return LoadNonPointer<ClassIdTagType, std::memory_order_relaxed>(
4760 &untag()->is_nullable_) == kNullCid;
4761 }
@ kNullCid
Definition: class_id.h:252

◆ is_reflectable()

bool dart::Field::is_reflectable ( ) const
inline

Definition at line 4454 of file object.h.

4454{ return ReflectableBit::decode(kind_bits()); }

◆ is_shared()

bool dart::Field::is_shared ( ) const
inline

Definition at line 4493 of file object.h.

4493{ return SharedBit::decode(kind_bits()); }

◆ is_static()

bool dart::Field::is_static ( ) const
inline

Definition at line 4440 of file object.h.

4440{ return StaticBit::decode(kind_bits()); }

◆ is_unboxed()

bool dart::Field::is_unboxed ( ) const
inline

Definition at line 4712 of file object.h.

4712{ return UnboxedBit::decode(kind_bits()); }

◆ IsConsistentWith()

bool dart::Field::IsConsistentWith ( const Field field) const

Definition at line 12279 of file object.cc.

12279 {
12280 return (untag()->guarded_cid_ == other.untag()->guarded_cid_) &&
12281 (untag()->is_nullable_ == other.untag()->is_nullable_) &&
12282 (untag()->guarded_list_length() ==
12283 other.untag()->guarded_list_length()) &&
12284 (is_unboxed() == other.is_unboxed()) &&
12286 other.static_type_exactness_state().Encode());
12287}
bool is_unboxed() const
Definition: object.h:4712

◆ IsGetterName()

bool dart::Field::IsGetterName ( const String function_name)
static

Definition at line 11831 of file object.cc.

11831 {
11832 return function_name.StartsWith(Symbols::GetterPrefix());
11833}
const char *const function_name

◆ IsInitName()

bool dart::Field::IsInitName ( const String function_name)
static

Definition at line 11839 of file object.cc.

11839 {
11840 return function_name.StartsWith(Symbols::InitPrefix());
11841}

◆ IsOriginal()

bool dart::Field::IsOriginal ( ) const
inline

Definition at line 4418 of file object.h.

4418 {
4419 if (IsNull()) {
4420 return true;
4421 }
4422 NoSafepointScope no_safepoint;
4423 return !untag()->owner()->IsField();
4424 }
bool IsNull() const
Definition: object.h:363

◆ IsSetterName()

bool dart::Field::IsSetterName ( const String function_name)
static

Definition at line 11835 of file object.cc.

11835 {
11836 return function_name.StartsWith(Symbols::SetterPrefix());
11837}

◆ IsUninitialized()

bool dart::Field::IsUninitialized ( ) const

Definition at line 12289 of file object.cc.

12289 {
12290 Thread* thread = Thread::Current();
12291 const FieldTable* field_table = thread->isolate()->field_table();
12292 const ObjectPtr raw_value = field_table->At(field_id());
12293 ASSERT(raw_value != Object::transition_sentinel().ptr());
12294 return raw_value == Object::sentinel().ptr();
12295}
intptr_t field_id() const
Definition: object.h:13284
uword raw_value() const
Definition: object.h:670

◆ kernel_offset()

intptr_t dart::Field::kernel_offset ( ) const
inline

Definition at line 4495 of file object.h.

4495 {
4496#if defined(DART_PRECOMPILED_RUNTIME)
4497 return 0;
4498#else
4499 return untag()->kernel_offset_;
4500#endif
4501 }

◆ KernelLibrary()

TypedDataViewPtr dart::Field::KernelLibrary ( ) const

Definition at line 11907 of file object.cc.

11907 {
11909 return info.KernelLibrary(KernelLibraryIndex());
11910}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
intptr_t KernelLibraryIndex() const
Definition: object.cc:11919
KernelProgramInfoPtr KernelProgramInfo() const
Definition: object.cc:11885

◆ KernelLibraryIndex()

intptr_t dart::Field::KernelLibraryIndex ( ) const

Definition at line 11919 of file object.cc.

11919 {
11920 const Object& obj = Object::Handle(untag()->owner());
11921 // During background JIT compilation field objects are copied
11922 // and copy points to the original field via the owner field.
11923 if (obj.IsField()) {
11924 return Field::Cast(obj).KernelLibraryIndex();
11925 } else if (obj.IsClass()) {
11926 const auto& lib = Library::Handle(Class::Cast(obj).library());
11927 return lib.kernel_library_index();
11928 }
11929 ASSERT(obj.IsPatchClass());
11930 return PatchClass::Cast(obj).kernel_library_index();
11931}

◆ KernelLibraryOffset()

intptr_t dart::Field::KernelLibraryOffset ( ) const

Definition at line 11912 of file object.cc.

11912 {
11913 const intptr_t kernel_library_index = KernelLibraryIndex();
11914 if (kernel_library_index == -1) return 0;
11916 return info.KernelLibraryStartOffset(kernel_library_index);
11917}

◆ KernelProgramInfo()

KernelProgramInfoPtr dart::Field::KernelProgramInfo ( ) const

Definition at line 11885 of file object.cc.

11885 {
11886 const auto& owner = Object::Handle(RawOwner());
11887 if (owner.IsClass()) {
11888 return Class::Cast(owner).KernelProgramInfo();
11889 }
11890 return PatchClass::Cast(owner).kernel_program_info();
11891}
ObjectPtr RawOwner() const
Definition: object.cc:11849

◆ kind_bits()

uint16_t dart::Field::kind_bits ( ) const
inline

Definition at line 4435 of file object.h.

4435 {
4436 return LoadNonPointer<uint16_t, std::memory_order_acquire>(
4437 &untag()->kind_bits_);
4438 }

◆ kind_bits_offset()

static intptr_t dart::Field::kind_bits_offset ( )
inlinestatic

Definition at line 4585 of file object.h.

4585 {
4586 return OFFSET_OF(UntaggedField, kind_bits_);
4587 }

◆ LookupGetterSymbol()

StringPtr dart::Field::LookupGetterSymbol ( const String field_name)
static

Definition at line 11800 of file object.cc.

11800 {
11801 return Symbols::LookupFromGet(Thread::Current(), field_name);
11802}
static StringPtr LookupFromGet(Thread *thread, const String &str)
Definition: symbols.cc:424

◆ LookupSetterSymbol()

StringPtr dart::Field::LookupSetterSymbol ( const String field_name)
static

Definition at line 11812 of file object.cc.

11812 {
11813 return Symbols::LookupFromSet(Thread::Current(), field_name);
11814}
static StringPtr LookupFromSet(Thread *thread, const String &str)
Definition: symbols.cc:428

◆ name()

StringPtr dart::Field::name ( ) const
inline

Definition at line 4430 of file object.h.

4430{ return untag()->name(); }

◆ NameFromGetter()

StringPtr dart::Field::NameFromGetter ( const String getter_name)
static

Definition at line 11816 of file object.cc.

11816 {
11817 return Symbols::New(Thread::Current(), getter_name, kGetterPrefixLength,
11818 getter_name.Length() - kGetterPrefixLength);
11819}
static StringPtr New(Thread *thread, const char *cstr)
Definition: symbols.h:723
static const intptr_t kGetterPrefixLength
Definition: object.cc:116

◆ NameFromInit()

StringPtr dart::Field::NameFromInit ( const String init_name)
static

Definition at line 11826 of file object.cc.

11826 {
11827 return Symbols::New(Thread::Current(), init_name, kInitPrefixLength,
11828 init_name.Length() - kInitPrefixLength);
11829}
static const intptr_t kInitPrefixLength
Definition: object.cc:120

◆ NameFromSetter()

StringPtr dart::Field::NameFromSetter ( const String setter_name)
static

Definition at line 11821 of file object.cc.

11821 {
11822 return Symbols::New(Thread::Current(), setter_name, kSetterPrefixLength,
11823 setter_name.Length() - kSetterPrefixLength);
11824}
static const intptr_t kSetterPrefixLength
Definition: object.cc:118

◆ needs_length_check()

bool dart::Field::needs_length_check ( ) const
inline

Definition at line 4697 of file object.h.

4697 {
4699 ASSERT(!r || is_final());
4700 return r;
4701 }

◆ needs_load_guard()

bool dart::Field::needs_load_guard ( ) const
inline

Definition at line 4451 of file object.h.

4451 {
4453 }

◆ NeedsGetter()

bool dart::Field::NeedsGetter ( ) const

Definition at line 12145 of file object.cc.

12145 {
12146 // All instance fields need a getter.
12147 if (!is_static()) return true;
12148
12149 // Static fields also need a getter if they have a non-trivial initializer,
12150 // because it needs to be initialized lazily.
12151 if (has_nontrivial_initializer()) return true;
12152
12153 // Static late fields with no initializer also need a getter, to check if it's
12154 // been initialized.
12155 return is_late() && !has_initializer();
12156}

◆ NeedsInitializationCheckOnLoad()

bool dart::Field::NeedsInitializationCheckOnLoad ( ) const
inline

Definition at line 4706 of file object.h.

4706 {
4707 return needs_load_guard() || (is_late() && !has_trivial_initializer());
4708 }
bool needs_load_guard() const
Definition: object.h:4451
bool has_trivial_initializer() const
Definition: object.h:4629

◆ NeedsSetter()

bool dart::Field::NeedsSetter ( ) const

Definition at line 12123 of file object.cc.

12123 {
12124 // According to the Dart language specification, final fields don't have
12125 // a setter, except late final fields without initializer.
12126 if (is_final()) {
12127 // Late final fields without initializer always need a setter to check
12128 // if they are already initialized.
12129 if (is_late() && !has_initializer()) {
12130 return true;
12131 }
12132 return false;
12133 }
12134
12135 // Instance non-final fields always need a setter.
12136 if (!is_static()) {
12137 return true;
12138 }
12139
12140 // Otherwise, setters for static fields can be omitted
12141 // and fields can be accessed directly.
12142 return false;
12143}

◆ New()

FieldPtr dart::Field::New ( const String name,
bool  is_static,
bool  is_final,
bool  is_const,
bool  is_reflectable,
bool  is_late,
const Object owner,
const AbstractType type,
TokenPosition  token_pos,
TokenPosition  end_token_pos 
)
static

Definition at line 12018 of file object.cc.

12027 {
12028 ASSERT(!owner.IsNull());
12029 const Field& result = Field::Handle(Field::New());
12032 result.SetFieldTypeSafe(type);
12033#if !defined(DART_PRECOMPILED_RUNTIME)
12035#endif
12036 return result.ptr();
12037}
bool is_reflectable() const
Definition: object.h:4454
AbstractTypePtr type() const
Definition: object.h:4550
TokenPosition end_token_pos() const
Definition: object.h:4590
TokenPosition token_pos() const
Definition: object.h:4589
GAsyncResult * result
void UnboxFieldIfSupported(const dart::Field &field, const dart::AbstractType &type)

◆ NewTopLevel()

FieldPtr dart::Field::NewTopLevel ( const String name,
bool  is_final,
bool  is_const,
bool  is_late,
const Object owner,
TokenPosition  token_pos,
TokenPosition  end_token_pos 
)
static

Definition at line 12039 of file object.cc.

12045 {
12046 ASSERT(!owner.IsNull());
12047 const Field& result = Field::Handle(Field::New());
12048 InitializeNew(result, name, true, /* is_static */
12049 is_final, is_const, true, /* is_reflectable */
12051 return result.ptr();
12052}

◆ Original()

FieldPtr dart::Field::Original ( ) const

Definition at line 11739 of file object.cc.

11739 {
11740 if (IsNull()) {
11741 return Field::null();
11742 }
11743 if (untag()->owner()->IsField()) {
11744 return static_cast<FieldPtr>(untag()->owner());
11745 }
11746 return this->ptr();
11747}

◆ Owner()

ClassPtr dart::Field::Owner ( ) const

Definition at line 11860 of file object.cc.

11860 {
11861 const Field& field = Field::Handle(Original());
11862 ASSERT(field.IsOriginal());
11863 const Object& obj = Object::Handle(field.untag()->owner());
11864 if (obj.IsClass()) {
11865 return Class::Cast(obj).ptr();
11866 }
11867 ASSERT(obj.IsPatchClass());
11868 return PatchClass::Cast(obj).wrapped_class();
11869}
FieldPtr Original() const
Definition: object.cc:11739

◆ RawOwner()

ObjectPtr dart::Field::RawOwner ( ) const

Definition at line 11849 of file object.cc.

11849 {
11850 if (IsOriginal()) {
11851 return untag()->owner();
11852 } else {
11853 const Field& field = Field::Handle(Original());
11854 ASSERT(field.IsOriginal());
11855 ASSERT(!Object::Handle(field.untag()->owner()).IsField());
11856 return field.untag()->owner();
11857 }
11858}

◆ RecordStore()

void dart::Field::RecordStore ( const Object value) const

Definition at line 13027 of file object.cc.

13027 {
13028 ASSERT(IsOriginal());
13029 Thread* const thread = Thread::Current();
13030 if (!thread->isolate_group()->use_field_guards()) {
13031 return;
13032 }
13033
13034 // We should never try to record a sentinel.
13035 ASSERT(value.ptr() != Object::sentinel().ptr());
13036
13037 SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock());
13038 if ((guarded_cid() == kDynamicCid) ||
13039 (is_nullable() && value.ptr() == Object::null())) {
13040 // Nothing to do: the field is not guarded or we are storing null into
13041 // a nullable field.
13042 return;
13043 }
13044
13045 if (FLAG_trace_field_guards) {
13046 THR_Print("Store %s %s <- %s\n", ToCString(), GuardedPropertiesAsCString(),
13047 value.ToCString());
13048 }
13049
13050 FieldGuardUpdater updater(this, value);
13051 if (updater.IsUpdateNeeded()) {
13052 if (FLAG_trace_field_guards) {
13054 }
13055 // Nobody else could have updated guard state since we are holding write
13056 // program lock. But we need to ensure we stop mutators as we update
13057 // guard state as we can't have optimized code running with updated fields.
13058 auto isolate_group = IsolateGroup::Current();
13059 isolate_group->RunWithStoppedMutators([&]() {
13060 updater.DoUpdate();
13061 DeoptimizeDependentCode(/*are_mutators_stopped=*/true);
13062 });
13063 }
13064}
const char * GuardedPropertiesAsCString() const
Definition: object.cc:12504
void DeoptimizeDependentCode(bool are_mutators_stopped=false) const
Definition: object.cc:12268

◆ RegisterDependentCode()

void dart::Field::RegisterDependentCode ( const Code code) const

Definition at line 12260 of file object.cc.

12260 {
12261 ASSERT(IsOriginal());
12262 DEBUG_ASSERT(IsMutatorOrAtDeoptSafepoint());
12263 ASSERT(code.is_optimized());
12264 FieldDependentArray a(*this);
12265 a.Register(code);
12266}

◆ Script()

ScriptPtr dart::Field::Script ( ) const

Definition at line 11871 of file object.cc.

11871 {
11872 // NOTE(turnidge): If you update this function, you probably want to
11873 // update Class::PatchFieldsAndFunctions() at the same time.
11874 const Field& field = Field::Handle(Original());
11875 ASSERT(field.IsOriginal());
11876 const Object& obj = Object::Handle(field.untag()->owner());
11877 if (obj.IsClass()) {
11878 return Class::Cast(obj).script();
11879 }
11880 ASSERT(obj.IsPatchClass());
11881 return PatchClass::Cast(obj).script();
11882}

◆ set_dependent_code()

void dart::Field::set_dependent_code ( const WeakArray array) const

Definition at line 12220 of file object.cc.

12220 {
12221 ASSERT(IsOriginal());
12223 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
12224 untag()->set_dependent_code(array.ptr());
12225}

◆ set_field_id()

void dart::Field::set_field_id ( intptr_t  field_id) const
inline

Definition at line 13288 of file object.h.

13288 {
13290 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
13292}
void set_field_id_unsafe(intptr_t field_id) const
Definition: object.h:13294

◆ set_field_id_unsafe()

void dart::Field::set_field_id_unsafe ( intptr_t  field_id) const
inline

Definition at line 13294 of file object.h.

13294 {
13295 ASSERT(is_static());
13296 untag()->set_host_offset_or_field_id(Smi::New(field_id));
13297}
static SmiPtr New(intptr_t value)
Definition: object.h:10006

◆ set_guarded_cid()

void dart::Field::set_guarded_cid ( intptr_t  cid) const
inline

Definition at line 4660 of file object.h.

4660 {
4662 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
4664 }
void set_guarded_cid_unsafe(intptr_t cid) const
Definition: object.h:4665
const intptr_t cid

◆ set_guarded_cid_unsafe()

void dart::Field::set_guarded_cid_unsafe ( intptr_t  cid) const
inline

Definition at line 4665 of file object.h.

4665 {
4666 StoreNonPointer<ClassIdTagType, ClassIdTagType, std::memory_order_relaxed>(
4667 &untag()->guarded_cid_, cid);
4668 }

◆ set_guarded_list_length()

void dart::Field::set_guarded_list_length ( intptr_t  list_length) const
inline

Definition at line 4678 of file object.h.

4678 {
4680 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
4681 set_guarded_list_length_unsafe(list_length);
4682 }
void set_guarded_list_length_unsafe(intptr_t list_length) const
Definition: object.cc:12105

◆ set_guarded_list_length_in_object_offset()

void dart::Field::set_guarded_list_length_in_object_offset ( intptr_t  offset) const
inline

Definition at line 4688 of file object.h.

4688 {
4690 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
4692 }

◆ set_guarded_list_length_in_object_offset_unsafe()

void dart::Field::set_guarded_list_length_in_object_offset_unsafe ( intptr_t  offset) const

Definition at line 12114 of file object.cc.

12115 {
12116 ASSERT(IsOriginal());
12117 StoreNonPointer<int8_t, int8_t, std::memory_order_relaxed>(
12118 &untag()->guarded_list_length_in_object_offset_,
12119 static_cast<int8_t>(list_length_offset - kHeapObjectTag));
12120 ASSERT(guarded_list_length_in_object_offset() == list_length_offset);
12121}

◆ set_guarded_list_length_unsafe()

void dart::Field::set_guarded_list_length_unsafe ( intptr_t  list_length) const

Definition at line 12105 of file object.cc.

12105 {
12106 ASSERT(IsOriginal());
12107 untag()->set_guarded_list_length(Smi::New(list_length));
12108}

◆ set_has_initializer()

void dart::Field::set_has_initializer ( bool  has_initializer) const
inline

Definition at line 4623 of file object.h.

4623 {
4625 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
4627 }
void set_has_initializer_unsafe(bool has_initializer) const
Definition: object.h:4617

◆ set_has_initializer_unsafe()

void dart::Field::set_has_initializer_unsafe ( bool  has_initializer) const
inline

Definition at line 4617 of file object.h.

4617 {
4618 ASSERT(IsOriginal());
4619 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4620 set_kind_bits(
4621 HasInitializerBit::update(has_initializer, untag()->kind_bits_));
4622 }

◆ set_has_nontrivial_initializer()

void dart::Field::set_has_nontrivial_initializer ( bool  has_nontrivial_initializer) const
inline

Definition at line 4607 of file object.h.

4607 {
4609 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
4611 }
void set_has_nontrivial_initializer_unsafe(bool has_nontrivial_initializer) const
Definition: object.h:4600

◆ set_has_nontrivial_initializer_unsafe()

void dart::Field::set_has_nontrivial_initializer_unsafe ( bool  has_nontrivial_initializer) const
inline

Definition at line 4600 of file object.h.

4601 {
4602 ASSERT(IsOriginal());
4603 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4604 set_kind_bits(HasNontrivialInitializerBit::update(
4605 has_nontrivial_initializer, untag()->kind_bits_));
4606 }

◆ set_has_pragma()

void dart::Field::set_has_pragma ( bool  value) const
inline

Definition at line 4471 of file object.h.

4471 {
4472 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4473 set_kind_bits(HasPragmaBit::update(value, untag()->kind_bits_));
4474 }

◆ set_initializer_changed_after_initialization()

void dart::Field::set_initializer_changed_after_initialization ( bool  value) const
inline

Definition at line 4464 of file object.h.

4464 {
4465 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4466 set_kind_bits(InitializerChangedAfterInitializationBit::update(
4467 value, untag()->kind_bits_));
4468 }

◆ set_is_covariant()

void dart::Field::set_is_covariant ( bool  value) const
inline

Definition at line 4477 of file object.h.

4477 {
4478 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4479 set_kind_bits(CovariantBit::update(value, untag()->kind_bits_));
4480 }

◆ set_is_extension_member()

void dart::Field::set_is_extension_member ( bool  value) const
inline

Definition at line 4735 of file object.h.

4735 {
4736 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4737 set_kind_bits(IsExtensionMemberBit::update(value, untag()->kind_bits_));
4738 }

◆ set_is_extension_type_member()

void dart::Field::set_is_extension_type_member ( bool  value) const
inline

Definition at line 4739 of file object.h.

4739 {
4740 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4741 set_kind_bits(IsExtensionTypeMemberBit::update(value, untag()->kind_bits_));
4742 }

◆ set_is_generic_covariant_impl()

void dart::Field::set_is_generic_covariant_impl ( bool  value) const
inline

Definition at line 4485 of file object.h.

4485 {
4486 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4487 set_kind_bits(GenericCovariantImplBit::update(value, untag()->kind_bits_));
4488 }

◆ set_is_late()

void dart::Field::set_is_late ( bool  value) const
inline

Definition at line 4731 of file object.h.

4731 {
4732 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4733 set_kind_bits(IsLateBit::update(value, untag()->kind_bits_));
4734 }

◆ set_is_nullable()

void dart::Field::set_is_nullable ( bool  val) const
inline

Definition at line 4753 of file object.h.

4753 {
4755 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
4757 }
void set_is_nullable_unsafe(bool val) const
Definition: object.h:4762

◆ set_is_nullable_unsafe()

void dart::Field::set_is_nullable_unsafe ( bool  val) const
inline

Definition at line 4762 of file object.h.

4762 {
4763 StoreNonPointer<ClassIdTagType, ClassIdTagType, std::memory_order_relaxed>(
4764 &untag()->is_nullable_, val ? kNullCid : kIllegalCid);
4765 }

◆ set_is_reflectable()

void dart::Field::set_is_reflectable ( bool  value) const
inline

Definition at line 4455 of file object.h.

4455 {
4456 ASSERT(IsOriginal());
4457 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4458 set_kind_bits(ReflectableBit::update(value, untag()->kind_bits_));
4459 }

◆ set_is_shared()

void dart::Field::set_is_shared ( bool  value) const
inline

Definition at line 4490 of file object.h.

4490 {
4491 set_kind_bits(SharedBit::update(value, untag()->kind_bits_));
4492 }

◆ set_is_unboxed()

void dart::Field::set_is_unboxed ( bool  b) const
inline

Definition at line 4720 of file object.h.

4720 {
4722 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
4724 }
void set_is_unboxed_unsafe(bool b) const
Definition: object.h:4716
static bool b

◆ set_is_unboxed_unsafe()

void dart::Field::set_is_unboxed_unsafe ( bool  b) const
inline

Definition at line 4716 of file object.h.

4716 {
4717 set_kind_bits(UnboxedBit::update(b, untag()->kind_bits_));
4718 }

◆ set_kernel_offset()

void dart::Field::set_kernel_offset ( intptr_t  value) const
inline

Definition at line 4503 of file object.h.

4503 {
4504#if defined(DART_PRECOMPILED_RUNTIME)
4505 UNREACHABLE();
4506#else
4507 ASSERT(value >= 0);
4508 StoreNonPointer(&untag()->kernel_offset_, value);
4509#endif
4510 }

◆ set_needs_load_guard()

void dart::Field::set_needs_load_guard ( bool  value) const
inline

Definition at line 4743 of file object.h.

4743 {
4744 // TODO(36097): Once concurrent access is possible ensure updates are safe.
4745 set_kind_bits(NeedsLoadGuardBit::update(value, untag()->kind_bits_));
4746 }

◆ set_static_type_exactness_state()

void dart::Field::set_static_type_exactness_state ( StaticTypeExactnessState  state) const
inline

Definition at line 4639 of file object.h.

4639 {
4641 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
4643 }
void set_static_type_exactness_state_unsafe(StaticTypeExactnessState state) const
Definition: object.h:4645
AtkStateType state

◆ set_static_type_exactness_state_unsafe()

void dart::Field::set_static_type_exactness_state_unsafe ( StaticTypeExactnessState  state) const
inline

Definition at line 4645 of file object.h.

4646 {
4647 StoreNonPointer<int8_t, int8_t, std::memory_order_relaxed>(
4648 &untag()->static_type_exactness_state_, state.Encode());
4649 }

◆ SetFieldType()

void dart::Field::SetFieldType ( const AbstractType value) const

Definition at line 11943 of file object.cc.

11943 {
11945 IsolateGroup::Current()->program_lock()->IsCurrentThreadWriter());
11947}
void SetFieldTypeSafe(const AbstractType &value) const
Definition: object.cc:11934

◆ SetFieldTypeSafe()

void dart::Field::SetFieldTypeSafe ( const AbstractType value) const

Definition at line 11934 of file object.cc.

11934 {
11935 ASSERT(IsOriginal());
11936 ASSERT(!value.IsNull());
11937 if (value.ptr() != type()) {
11938 untag()->set_type(value.ptr());
11939 }
11940}

◆ SetInitializerFunction()

void dart::Field::SetInitializerFunction ( const Function initializer) const

Definition at line 12319 of file object.cc.

12319 {
12320#if defined(DART_PRECOMPILED_RUNTIME)
12321 UNREACHABLE();
12322#else
12323 ASSERT(IsOriginal());
12325 ->initializer_functions_mutex()
12326 ->IsOwnedByCurrentThread());
12327 // We have to ensure that all stores into the initializer function object
12328 // happen before releasing the pointer to the initializer as it may be
12329 // accessed without grabbing the lock.
12330 untag()->set_initializer_function<std::memory_order_release>(
12331 initializer.ptr());
12332#endif
12333}

◆ SetOffset()

void dart::Field::SetOffset ( intptr_t  host_offset_in_bytes,
intptr_t  target_offset_in_bytes 
) const
inline

Definition at line 13263 of file object.h.

13264 {
13265 ASSERT(is_instance()); // Valid only for dart instance fields.
13267 untag()->set_host_offset_or_field_id(
13268 Smi::New(host_offset_in_bytes / kCompressedWordSize));
13269#if !defined(DART_PRECOMPILED_RUNTIME)
13272 &untag()->target_offset_,
13273 target_offset_in_bytes / compiler::target::kCompressedWordSize);
13274#else
13275 ASSERT(host_offset_in_bytes == target_offset_in_bytes);
13276#endif // !defined(DART_PRECOMPILED_RUNTIME)
13277}
static constexpr intptr_t kCompressedWordSize
Definition: runtime_api.h:286

◆ SetOriginal()

void dart::Field::SetOriginal ( const Field value) const

Definition at line 11786 of file object.cc.

11786 {
11787 ASSERT(value.IsOriginal());
11788 ASSERT(!value.IsNull());
11789 untag()->set_owner(static_cast<ObjectPtr>(value.ptr()));
11790}

◆ SetStaticConstFieldValue()

void dart::Field::SetStaticConstFieldValue ( const Instance value,
bool  assert_initializing_store = true 
) const

Definition at line 12448 of file object.cc.

12449 {
12450 ASSERT(is_static());
12451 ASSERT(!is_shared());
12452 auto thread = Thread::Current();
12453 auto initial_field_table = thread->isolate_group()->initial_field_table();
12454
12455 SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock());
12456 ASSERT(initial_field_table->At(field_id()) == Object::sentinel().ptr() ||
12457 initial_field_table->At(field_id()) == value.ptr() ||
12458 !assert_initializing_store);
12459 initial_field_table->SetAt(field_id(),
12460 value.IsNull() ? Instance::null_instance().ptr()
12461 : Instance::Cast(value).ptr(),
12462 /*concurrent_use=*/true);
12463}
bool is_shared() const
Definition: object.h:4493

◆ SetStaticValue()

void dart::Field::SetStaticValue ( const Object value) const

Definition at line 12770 of file object.cc.

12770 {
12771 ASSERT(!is_shared());
12772 auto thread = Thread::Current();
12773 ASSERT(thread->IsDartMutatorThread());
12774 ASSERT(value.IsNull() || value.IsSentinel() || value.IsInstance());
12775
12776 ASSERT(is_static()); // Valid only for static dart fields.
12777 const intptr_t id = field_id();
12778 ASSERT(id >= 0);
12779
12780 SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock());
12781 thread->isolate()->field_table()->SetAt(id, value.ptr());
12782}

◆ SetterClosure()

InstancePtr dart::Field::SetterClosure ( ) const

Definition at line 12210 of file object.cc.

12210 {
12211 return AccessorClosure(true);
12212}

◆ SetterName()

StringPtr dart::Field::SetterName ( const String field_name)
static

Definition at line 11804 of file object.cc.

11804 {
11805 return String::Concat(Symbols::SetterPrefix(), field_name);
11806}

◆ SetterSymbol()

StringPtr dart::Field::SetterSymbol ( const String field_name)
static

Definition at line 11808 of file object.cc.

11808 {
11809 return Symbols::FromSet(Thread::Current(), field_name);
11810}
static StringPtr FromSet(Thread *thread, const String &str)
Definition: symbols.cc:251

◆ SourceFingerprint()

int32_t dart::Field::SourceFingerprint ( ) const

Definition at line 12068 of file object.cc.

12068 {
12069#if !defined(DART_PRECOMPILED_RUNTIME)
12071 *this);
12072#else
12073 return 0;
12074#endif // !defined(DART_PRECOMPILED_RUNTIME)
12075}
static uint32_t CalculateFieldFingerprint(const Field &field)

◆ static_type_exactness_state()

StaticTypeExactnessState dart::Field::static_type_exactness_state ( ) const
inline

Definition at line 4633 of file object.h.

4633 {
4635 LoadNonPointer<int8_t, std::memory_order_relaxed>(
4636 &untag()->static_type_exactness_state_));
4637 }
static StaticTypeExactnessState Decode(int8_t value)

◆ static_type_exactness_state_offset()

static intptr_t dart::Field::static_type_exactness_state_offset ( )
inlinestatic

Definition at line 4651 of file object.h.

4651 {
4652 return OFFSET_OF(UntaggedField, static_type_exactness_state_);
4653 }

◆ StaticConstFieldValue()

ObjectPtr dart::Field::StaticConstFieldValue ( ) const

Definition at line 12419 of file object.cc.

12419 {
12420 ASSERT(is_static() &&
12421 (is_const() || (is_final() && has_trivial_initializer())));
12422
12423 auto thread = Thread::Current();
12424 auto zone = thread->zone();
12425 auto initial_field_table = thread->isolate_group()->initial_field_table();
12426
12427 // We can safely cache the value of the static const field in the initial
12428 // field table.
12429 ASSERT(!is_shared());
12430 auto& value = Object::Handle(
12431 zone, initial_field_table->At(field_id(), /*concurrent_use=*/true));
12432 if (value.ptr() == Object::sentinel().ptr()) {
12433 // Fields with trivial initializers get their initial value
12434 // eagerly when they are registered.
12435 ASSERT(is_const());
12439 if (!value.IsError()) {
12440 ASSERT(value.IsNull() || value.IsInstance());
12441 SetStaticConstFieldValue(value.IsNull() ? Instance::null_instance()
12442 : Instance::Cast(value));
12443 }
12444 }
12445 return value.ptr();
12446}
void SetStaticConstFieldValue(const Instance &value, bool assert_initializing_store=true) const
Definition: object.cc:12448

◆ StaticValue()

ObjectPtr dart::Field::StaticValue ( ) const
inline

Definition at line 13279 of file object.h.

13279 {
13280 ASSERT(is_static()); // Valid only for static dart fields.
13281 return Isolate::Current()->field_table()->At(field_id());
13282}
ObjectPtr At(intptr_t index, bool concurrent_use=false) const
Definition: field_table.h:62
FieldTable * field_table() const
Definition: isolate.h:1000
static Isolate * Current()
Definition: isolate.h:986

◆ TargetOffset()

intptr_t dart::Field::TargetOffset ( ) const
inline

Definition at line 13246 of file object.h.

13246 {
13247 ASSERT(is_instance()); // Valid only for dart instance fields.
13248#if !defined(DART_PRECOMPILED_RUNTIME)
13249 return (untag()->target_offset_ * compiler::target::kCompressedWordSize);
13250#else
13251 return HostOffset();
13252#endif // !defined(DART_PRECOMPILED_RUNTIME)
13253}
intptr_t HostOffset() const
Definition: object.h:13241

◆ TargetOffsetOf()

intptr_t dart::Field::TargetOffsetOf ( FieldPtr  field)
inlinestatic

Definition at line 13255 of file object.h.

13255 {
13256#if !defined(DART_PRECOMPILED_RUNTIME)
13257 return field->untag()->target_offset_;
13258#else
13259 return Smi::Value(field->untag()->host_offset_or_field_id());
13260#endif // !defined(DART_PRECOMPILED_RUNTIME)
13261}

◆ token_pos()

TokenPosition dart::Field::token_pos ( ) const
inline

Definition at line 4589 of file object.h.

4589{ return untag()->token_pos_; }

◆ type()

AbstractTypePtr dart::Field::type ( ) const
inline

Definition at line 4550 of file object.h.

4550{ return untag()->type(); }

◆ UserVisibleName()

StringPtr dart::Field::UserVisibleName ( ) const

Definition at line 12091 of file object.cc.

12091 {
12092 if (FLAG_show_internal_names) {
12093 return name();
12094 }
12095 return Symbols::New(
12099}
bool is_extension_member() const
Definition: object.h:4445
bool is_extension_type_member() const
Definition: object.h:4448
static const char * ScrubName(const String &name, bool is_extension=false)
Definition: object.cc:287

◆ UserVisibleNameCString()

const char * dart::Field::UserVisibleNameCString ( ) const

Definition at line 12082 of file object.cc.

12082 {
12083 NoSafepointScope no_safepoint;
12084 if (FLAG_show_internal_names) {
12085 return String::Handle(name()).ToCString();
12086 }
12089}

◆ VerifyEntryPoint()

ErrorPtr dart::Field::VerifyEntryPoint ( EntryPointPragma  kind) const

Definition at line 27363 of file object.cc.

27363 {
27364 if (!FLAG_verify_entry_points) return Error::null();
27365 const Class& cls = Class::Handle(Owner());
27366 const Library& lib = Library::Handle(cls.library());
27367 return dart::VerifyEntryPoint(lib, *this, *this, {pragma});
27368}
DART_WARN_UNUSED_RESULT ErrorPtr VerifyEntryPoint(const Library &lib, const Object &member, const Object &annotated, std::initializer_list< EntryPointPragma > allowed_kinds)
Definition: object.cc:27151

Friends And Related Function Documentation

◆ Class

friend class Class
friend

Definition at line 4924 of file object.h.

◆ FieldDeserializationCluster

friend class FieldDeserializationCluster
friend

Definition at line 4927 of file object.h.

◆ FieldSerializationCluster

friend class FieldSerializationCluster
friend

Definition at line 4926 of file object.h.

◆ StoreFieldInstr

friend class StoreFieldInstr
friend

Definition at line 4846 of file object.h.

◆ UntaggedField

friend class UntaggedField
friend

Definition at line 4925 of file object.h.


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