5#ifndef RUNTIME_VM_OBJECT_H_
6#define RUNTIME_VM_OBJECT_H_
8#if defined(SHOULD_NOT_INCLUDE_RUNTIME)
9#error "Should not include runtime"
54#define DEFINE_FORWARD_DECLARATION(clazz) class clazz;
56#undef DEFINE_FORWARD_DECLARATION
58class ArgumentsDescriptor;
62class DisassemblyFormatter;
63class FinalizablePersistentHandle;
64class FlowGraphCompiler;
67class CallSiteResetter;
69class IsolateGroupReloadContext;
70class ObjectGraphCopier;
71class FunctionTypeMapping;
74#define REUSABLE_FORWARD_DECLARATION(name) class Reusable##name##HandleScope;
76#undef REUSABLE_FORWARD_DECLARATION
82#define CHECK_HANDLE() CheckHandle();
90#define ALLSTATIC_CONTAINS_COMPRESSED_IMPLEMENTATION(object, handle) \
92 using UntaggedObjectType = dart::Untagged##object; \
93 using ObjectPtrType = dart::object##Ptr; \
94 static_assert(std::is_base_of<dart::handle##Ptr, ObjectPtrType>::value, \
95 #object "Ptr must be a subtype of " #handle "Ptr"); \
96 static_assert(dart::handle::ContainsCompressedPointers() == \
97 UntaggedObjectType::kContainsCompressedPointers, \
98 "Pointer compression in Untagged" #object \
99 " must match pointer compression in Untagged" #handle); \
100 static constexpr bool ContainsCompressedPointers() { \
101 return UntaggedObjectType::kContainsCompressedPointers; \
106#define BASE_OBJECT_IMPLEMENTATION(object, super) \
108 using UntaggedObjectType = dart::Untagged##object; \
109 using ObjectPtrType = dart::object##Ptr; \
110 static_assert(!dart::super::ContainsCompressedPointers() || \
111 UntaggedObjectType::kContainsCompressedPointers, \
113 " must have compressed pointers, as supertype Untagged" #super \
114 " has compressed pointers"); \
115 static constexpr bool ContainsCompressedPointers() { \
116 return UntaggedObjectType::kContainsCompressedPointers; \
118 object##Ptr ptr() const { \
119 return static_cast<object##Ptr>(ptr_); \
121 bool Is##object() const { \
124 DART_NOINLINE static object& Handle() { \
125 return static_cast<object&>( \
126 HandleImpl(Thread::Current()->zone(), object::null(), kClassId)); \
128 DART_NOINLINE static object& Handle(Zone* zone) { \
129 return static_cast<object&>(HandleImpl(zone, object::null(), kClassId)); \
131 DART_NOINLINE static object& Handle(object##Ptr ptr) { \
132 return static_cast<object&>( \
133 HandleImpl(Thread::Current()->zone(), ptr, kClassId)); \
135 DART_NOINLINE static object& Handle(Zone* zone, object##Ptr ptr) { \
136 return static_cast<object&>(HandleImpl(zone, ptr, kClassId)); \
138 DART_NOINLINE static object& ZoneHandle() { \
139 return static_cast<object&>( \
140 ZoneHandleImpl(Thread::Current()->zone(), object::null(), kClassId)); \
142 DART_NOINLINE static object& ZoneHandle(Zone* zone) { \
143 return static_cast<object&>( \
144 ZoneHandleImpl(zone, object::null(), kClassId)); \
146 DART_NOINLINE static object& ZoneHandle(object##Ptr ptr) { \
147 return static_cast<object&>( \
148 ZoneHandleImpl(Thread::Current()->zone(), ptr, kClassId)); \
150 DART_NOINLINE static object& ZoneHandle(Zone* zone, object##Ptr ptr) { \
151 return static_cast<object&>(ZoneHandleImpl(zone, ptr, kClassId)); \
153 static object* ReadOnlyHandle() { \
154 return static_cast<object*>(ReadOnlyHandleImpl(kClassId)); \
156 DART_NOINLINE static object& CheckedHandle(Zone* zone, ObjectPtr ptr) { \
157 object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(zone)); \
158 initializeHandle(obj, ptr); \
159 if (!obj->Is##object()) { \
160 FATAL("Handle check failed: saw %s expected %s", obj->ToCString(), \
165 DART_NOINLINE static object& CheckedZoneHandle(Zone* zone, ObjectPtr ptr) { \
167 reinterpret_cast<object*>(VMHandles::AllocateZoneHandle(zone)); \
168 initializeHandle(obj, ptr); \
169 if (!obj->Is##object()) { \
170 FATAL("Handle check failed: saw %s expected %s", obj->ToCString(), \
175 DART_NOINLINE static object& CheckedZoneHandle(ObjectPtr ptr) { \
176 return CheckedZoneHandle(Thread::Current()->zone(), ptr); \
181 static const object& Cast(const Object& obj) { \
182 ASSERT(obj.Is##object()); \
183 return reinterpret_cast<const object&>(obj); \
185 static object##Ptr RawCast(ObjectPtr raw) { \
186 ASSERT(Is##object##NoHandle(raw)); \
187 return static_cast<object##Ptr>(raw); \
189 static object##Ptr null() { \
190 return static_cast<object##Ptr>(Object::null()); \
192 virtual const char* ToCString() const; \
193 static const ClassId kClassId = k##object##Cid; \
197 static void initializeHandle(object* obj, ObjectPtr ptr) { \
198 obj->setPtr(ptr, kClassId); \
202 void operator delete(void* pointer) { \
207 void* operator new(size_t size); \
208 object(const object& value) = delete; \
209 void operator=(super##Ptr value) = delete; \
210 void operator=(const object& value) = delete; \
211 void operator=(const super& value) = delete;
221#define OBJECT_SERVICE_SUPPORT(object) \
226 virtual void PrintJSONImpl(JSONStream* stream, bool ref) const; \
229 virtual void PrintImplementationFieldsImpl(const JSONArray& jsarr_fields) \
231 virtual const char* JSONType() const { \
235#define OBJECT_SERVICE_SUPPORT(object) protected:
238#define SNAPSHOT_SUPPORT(object) \
239 friend class object##MessageSerializationCluster; \
240 friend class object##MessageDeserializationCluster;
242#define OBJECT_IMPLEMENTATION(object, super) \
244 DART_NOINLINE void operator=(object##Ptr value) { \
245 initializeHandle(this, value); \
247 DART_NOINLINE void operator^=(ObjectPtr value) { \
248 initializeHandle(this, value); \
249 ASSERT(IsNull() || Is##object()); \
253 object() : super() {} \
254 BASE_OBJECT_IMPLEMENTATION(object, super) \
255 OBJECT_SERVICE_SUPPORT(object) \
260#define HEAP_OBJECT_IMPLEMENTATION(object, super) \
261 OBJECT_IMPLEMENTATION(object, super); \
262 Untagged##object* untag() const { \
263 ASSERT(ptr() != null()); \
264 return const_cast<Untagged##object*>(ptr()->untag()); \
266 SNAPSHOT_SUPPORT(object) \
267 friend class StackFrame; \
268 friend class Thread; \
269 friend void DFLRT_ExitSafepoint(NativeArguments __unusable_);
272#define FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, rettype, super) \
274 void operator=(object##Ptr value) { \
278 void operator^=(ObjectPtr value) { \
284 object() : super() {} \
285 BASE_OBJECT_IMPLEMENTATION(object, super) \
286 OBJECT_SERVICE_SUPPORT(object) \
287 Untagged##object* untag() const { \
288 ASSERT(ptr() != null()); \
289 return const_cast<Untagged##object*>(ptr()->untag()); \
291 static intptr_t NextFieldOffset() { \
294 SNAPSHOT_SUPPORT(rettype) \
295 friend class Object; \
296 friend class StackFrame; \
297 friend class Thread; \
298 friend void DFLRT_ExitSafepoint(NativeArguments __unusable_);
300#define FINAL_HEAP_OBJECT_IMPLEMENTATION(object, super) \
301 FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, object, super)
303#define MINT_OBJECT_IMPLEMENTATION(object, rettype, super) \
304 FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, rettype, super)
309#if defined(DART_PRECOMPILED_RUNTIME)
342 return !
ptr()->IsHeapObject() ?
static_cast<intptr_t
>(kSmiCid)
345 inline ClassPtr
clazz()
const;
349#define DEFINE_CLASS_TESTER(clazz) \
350 virtual bool Is##clazz() const { return false; } \
351 static bool Is##clazz##NoHandle(ObjectPtr ptr) { \
355 char buf[sizeof(Object)]; \
356 Object* obj = reinterpret_cast<Object*>(&buf); \
357 initializeHandle(obj, ptr); \
358 return obj->IsNull() || obj->Is##clazz(); \
361#undef DEFINE_CLASS_TESTER
390 bool IsNew()
const {
return ptr()->IsNewObject(); }
391 bool IsOld()
const {
return ptr()->IsOldObject(); }
402 bool IsZoneHandle()
const;
403 bool IsReadOnlyHandle()
const;
404 bool IsNotTemporaryScopedHandle()
const;
435#if defined(HASH_IN_OBJECT_HEADER)
436 static uint32_t GetCachedHash(
const ObjectPtr obj) {
437 return obj->
untag()->GetHeaderHash();
440 static uint32_t SetCachedHashIfNotSet(ObjectPtr obj, uint32_t
hash) {
441 return obj->untag()->SetHeaderHashIfNotSet(
hash);
457#define SHARED_READONLY_HANDLES_LIST(V) \
458 V(Object, null_object) \
459 V(Class, null_class) \
460 V(Array, null_array) \
461 V(String, null_string) \
462 V(Instance, null_instance) \
463 V(Function, null_function) \
464 V(FunctionType, null_function_type) \
465 V(RecordType, null_record_type) \
466 V(TypeArguments, null_type_arguments) \
467 V(CompressedStackMaps, null_compressed_stackmaps) \
468 V(Closure, null_closure) \
469 V(TypeArguments, empty_type_arguments) \
470 V(Array, empty_array) \
471 V(Array, empty_instantiations_cache_array) \
472 V(Array, empty_subtype_test_cache_array) \
473 V(ContextScope, empty_context_scope) \
474 V(ObjectPool, empty_object_pool) \
475 V(CompressedStackMaps, empty_compressed_stackmaps) \
476 V(PcDescriptors, empty_descriptors) \
477 V(LocalVarDescriptors, empty_var_descriptors) \
478 V(ExceptionHandlers, empty_exception_handlers) \
479 V(ExceptionHandlers, empty_async_exception_handlers) \
480 V(Array, synthetic_getter_parameter_types) \
481 V(Array, synthetic_getter_parameter_names) \
482 V(Sentinel, sentinel) \
483 V(Sentinel, transition_sentinel) \
484 V(Sentinel, unknown_constant) \
485 V(Sentinel, non_constant) \
486 V(Sentinel, optimized_out) \
488 V(Bool, bool_false) \
489 V(Smi, smi_illegal_cid) \
491 V(ApiError, no_callbacks_error) \
492 V(UnwindError, unwind_in_progress_error) \
493 V(LanguageError, snapshot_writer_error) \
494 V(LanguageError, branch_offset_error) \
495 V(LanguageError, speculative_inlining_error) \
496 V(LanguageError, background_compilation_error) \
497 V(LanguageError, out_of_memory_error) \
498 V(Array, vm_isolate_snapshot_object_table) \
499 V(Type, dynamic_type) \
501 V(AbstractType, null_abstract_type)
503#define DEFINE_SHARED_READONLY_HANDLE_GETTER(Type, name) \
504 static const Type& name() { \
505 ASSERT(name##_ != nullptr); \
509#undef DEFINE_SHARED_READONLY_HANDLE_GETTER
522 return ffi_trampoline_data_class_;
529 return kernel_program_info_class_;
534 return instructions_section_class_;
537 return instructions_table_class_;
543 return compressed_stackmaps_class_;
547 return exception_handlers_class_;
555 return unhandled_exception_class_;
561 return monomorphicsmiablecall_class_;
568 return weak_serialization_reference_class_;
585 const uint8_t* kernel_buffer,
586 intptr_t kernel_buffer_size);
589 intptr_t original_size,
596 template <
class FakeObject>
602 ASSERT(builtin_vtables_[
cid] == fake.vtable());
676 intptr_t default_cid) {
683 intptr_t default_cid) {
702 memcpy(&
result,
reinterpret_cast<const void*
>(
this),
707 memcpy(
reinterpret_cast<void*
>(
this), &
value,
715 uword ptr_field_start_offset,
716 uword ptr_field_end_offset);
721 template <
typename T>
722 DART_FORCE_INLINE
static typename T::ObjectPtrType
Allocate(
724 return static_cast<typename T::ObjectPtrType
>(
Allocate(
725 T::kClassId, T::InstanceSize(), space, T::ContainsCompressedPointers(),
726 Object::from_offset<T>(), Object::to_offset<T>()));
728 template <
typename T>
729 DART_FORCE_INLINE
static typename T::ObjectPtrType
Allocate(
732 return static_cast<typename T::ObjectPtrType
>(
733 Allocate(T::kClassId, T::InstanceSize(elements), space,
734 T::ContainsCompressedPointers(), Object::from_offset<T>(),
735 Object::to_offset<T>(elements)));
741 template <
typename T>
745 return static_cast<typename T::ObjectPtrType
>(
Allocate(
746 class_id, T::InstanceSize(), space, T::ContainsCompressedPointers(),
747 Object::from_offset<T>(), Object::to_offset<T>()));
749 template <
typename T>
750 DART_FORCE_INLINE
static typename T::ObjectPtrType
752 return static_cast<typename T::ObjectPtrType
>(
753 Allocate(class_id, T::InstanceSize(elements), space,
754 T::ContainsCompressedPointers(), Object::from_offset<T>(),
755 Object::to_offset<T>(elements)));
770 template <
typename type, std::memory_order order = std::memory_order_relaxed>
775 template <
typename type, std::memory_order order = std::memory_order_relaxed>
779 template <
typename type,
780 typename compressed_type,
781 std::memory_order order = std::memory_order_relaxed>
786 template <
typename type>
799 template <
typename FieldType>
802 value.writeTo(
const_cast<FieldType*
>(
addr));
805 template <
typename FieldType>
807 return *
const_cast<FieldType*
>(
addr);
810 template <
typename FieldType, std::memory_order order>
812 return reinterpret_cast<std::atomic<FieldType>*
>(
813 const_cast<FieldType*
>(
addr))
818 template <
typename FieldType,
typename ValueType>
825 template <
typename FieldType,
typename ValueType, std::memory_order order>
829 reinterpret_cast<std::atomic<FieldType>*
>(
const_cast<FieldType*
>(
addr))
830 ->store(
value, order);
836 template <
typename FieldType>
844 return const_cast<FieldType*
>(
addr);
849#define STORE_NON_POINTER_ILLEGAL_TYPE(type) \
850 template <typename ValueType> \
851 void StoreNonPointer(type##Ptr const* addr, ValueType value) const { \
852 UnimplementedMethod(); \
854 type##Ptr* UnsafeMutableNonPointer(type##Ptr const* addr) const { \
855 UnimplementedMethod(); \
861#undef STORE_NON_POINTER_ILLEGAL_TYPE
866 bool load_with_relaxed_atomics =
false);
878 template <
typename T>
880 return UntaggedObject::from_offset<typename T::UntaggedObjectType>();
892 template <
typename T>
894 return UntaggedObject::to_offset<typename T::UntaggedObjectType>(
length);
898 const char* protocol_type,
902 static intptr_t NextFieldOffset() {
907 static void InitializeObject(
uword address,
911 uword ptr_field_start_offset,
912 uword ptr_field_end_offset);
917 template <
typename T>
918 DART_FORCE_INLINE
static void InitializeObject(
uword address) {
919 return InitializeObject(address, T::kClassId, T::InstanceSize(),
920 T::ContainsCompressedPointers(),
921 Object::from_offset<T>(), Object::to_offset<T>());
923 template <
typename T>
924 DART_FORCE_INLINE
static void InitializeObject(
uword address,
926 return InitializeObject(address, T::kClassId, T::InstanceSize(elements),
927 T::ContainsCompressedPointers(),
928 Object::from_offset<T>(),
929 Object::to_offset<T>(elements));
935 template <
typename T>
936 DART_FORCE_INLINE
static void InitializeObjectVariant(
uword address,
938 return InitializeObject(address, class_id, T::InstanceSize(),
939 T::ContainsCompressedPointers(),
940 Object::from_offset<T>(), Object::to_offset<T>());
942 template <
typename T>
943 DART_FORCE_INLINE
static void InitializeObjectVariant(
uword address,
946 return InitializeObject(address, class_id, T::InstanceSize(elements),
947 T::ContainsCompressedPointers(),
948 Object::from_offset<T>(),
949 Object::to_offset<T>(elements));
952 static void RegisterClass(
const Class& cls,
955 static void RegisterPrivateClass(
const Class& cls,
960 static void initializeHandle(
Object* obj, ObjectPtr
ptr) {
961 obj->setPtr(
ptr, kObjectCid);
968 static ObjectPtr null_;
969 static BoolPtr true_;
970 static BoolPtr false_;
972 static ClassPtr class_class_;
973 static ClassPtr dynamic_class_;
974 static ClassPtr void_class_;
975 static ClassPtr type_parameters_class_;
976 static ClassPtr type_arguments_class_;
977 static ClassPtr patch_class_class_;
978 static ClassPtr function_class_;
979 static ClassPtr closure_data_class_;
980 static ClassPtr ffi_trampoline_data_class_;
981 static ClassPtr field_class_;
982 static ClassPtr script_class_;
983 static ClassPtr library_class_;
984 static ClassPtr namespace_class_;
985 static ClassPtr kernel_program_info_class_;
986 static ClassPtr code_class_;
987 static ClassPtr instructions_class_;
988 static ClassPtr instructions_section_class_;
989 static ClassPtr instructions_table_class_;
990 static ClassPtr object_pool_class_;
991 static ClassPtr pc_descriptors_class_;
992 static ClassPtr code_source_map_class_;
993 static ClassPtr compressed_stackmaps_class_;
994 static ClassPtr var_descriptors_class_;
995 static ClassPtr exception_handlers_class_;
996 static ClassPtr context_class_;
997 static ClassPtr context_scope_class_;
998 static ClassPtr sentinel_class_;
999 static ClassPtr singletargetcache_class_;
1000 static ClassPtr unlinkedcall_class_;
1001 static ClassPtr monomorphicsmiablecall_class_;
1002 static ClassPtr icdata_class_;
1003 static ClassPtr megamorphic_cache_class_;
1004 static ClassPtr subtypetestcache_class_;
1005 static ClassPtr loadingunit_class_;
1006 static ClassPtr api_error_class_;
1007 static ClassPtr language_error_class_;
1008 static ClassPtr unhandled_exception_class_;
1009 static ClassPtr unwind_error_class_;
1010 static ClassPtr weak_serialization_reference_class_;
1011 static ClassPtr weak_array_class_;
1013#define DECLARE_SHARED_READONLY_HANDLE(Type, name) static Type* name##_;
1015#undef DECLARE_SHARED_READONLY_HANDLE
1027#define REUSABLE_FRIEND_DECLARATION(name) \
1028 friend class Reusable##name##HandleScope;
1030#undef REUSABLE_FRIEND_DECLARATION
1048#if defined(DART_PRECOMPILER)
1049#define PRECOMPILER_WSR_FIELD_DECLARATION(Type, Name) \
1050 Type##Ptr Name() const; \
1051 void set_##Name(const Object& value) const { \
1052 untag()->set_##Name(value.ptr()); \
1055#define PRECOMPILER_WSR_FIELD_DECLARATION(Type, Name) \
1056 Type##Ptr Name() const { \
1057 return untag()->Name(); \
1059 void set_##Name(const Type& value) const;
1102 DISALLOW_ALLOCATION();
1103 DISALLOW_COPY_AND_ASSIGN(PassiveObject);
1149#if defined(DART_PRECOMPILER)
1150 return (
untag()->target_instance_size_in_words_ *
1160#if defined(DART_PRECOMPILER)
1161 return (
clazz->untag()->target_instance_size_in_words_ *
1168 intptr_t target_value_in_bytes)
const {
1175 intptr_t target_value)
const {
1179#if defined(DART_PRECOMPILER)
1194#if defined(DART_PRECOMPILER)
1195 return untag()->target_next_field_offset_in_words_ *
1202 intptr_t target_value_in_bytes)
const {
1208 intptr_t target_value)
const {
1212 ASSERT((host_value < 0) ||
1213 ((host_value <=
untag()->host_instance_size_in_words_) &&
1215 untag()->host_instance_size_in_words_)));
1217#if defined(DART_PRECOMPILER)
1218 ASSERT((target_value < 0) ||
1219 ((target_value <=
untag()->target_instance_size_in_words_) &&
1222 untag()->target_instance_size_in_words_)));
1240#if !defined(DART_PRECOMPILED_RUNTIME)
1256 StringPtr
Name()
const;
1266 ClassPtr
Mixin()
const;
1275#if !defined(DART_PRECOMPILED_RUNTIME)
1280#if defined(DART_PRECOMPILED_RUNTIME)
1281 return TokenPosition::kNoSource;
1283 return untag()->token_pos_;
1287#if !defined(DART_PRECOMPILED_RUNTIME)
1292#if defined(DART_PRECOMPILED_RUNTIME)
1293 return TokenPosition::kNoSource;
1295 return untag()->end_token_pos_;
1299#if !defined(DART_PRECOMPILED_RUNTIME)
1303 uint32_t
Hash()
const;
1304 static uint32_t
Hash(ClassPtr);
1331 bool canonicalize =
true)
const;
1340 return untag()->type_parameters();
1377 if (
untag()->host_type_arguments_field_offset_in_words_ ==
1381 return untag()->host_type_arguments_field_offset_in_words_ *
1385#if defined(DART_PRECOMPILER)
1387 if (
untag()->target_type_arguments_field_offset_in_words_ ==
1391 return untag()->target_type_arguments_field_offset_in_words_ *
1398 intptr_t target_value_in_bytes)
const {
1399 intptr_t host_value, target_value;
1415 intptr_t target_value)
const {
1418#if defined(DART_PRECOMPILER)
1433 return untag()->super_type();
1449 return untag()->interfaces();
1467 bool consider_only_super_classes =
false)
const;
1470 bool consider_only_super_classes =
false)
const {
1472 consider_only_super_classes);
1490 bool consider_only_super_classes =
false)
const;
1493 bool consider_only_super_classes =
false)
const {
1495 consider_only_super_classes);
1518#if !defined(PRODUCT) || !defined(DART_PRECOMPILED_RUNTIME)
1523 return untag()->direct_implementors();
1526 return untag()->direct_implementors();
1530#if !defined(DART_PRECOMPILED_RUNTIME)
1535#if !defined(PRODUCT) || !defined(DART_PRECOMPILED_RUNTIME)
1543 return untag()->direct_subclasses();
1547#if !defined(DART_PRECOMPILED_RUNTIME)
1588 cls->untag()->library()->untag()->flags_);
1593 return cls->untag()->id_;
1618 return untag()->fields();
1644 return untag()->functions();
1675 bool instance_only =
false)
const;
1793 return clazz->untag()->num_native_fields_;
1799#if !defined(DART_PRECOMPILED_RUNTIME)
1805#if defined(DART_PRECOMPILED_RUNTIME)
1808 return untag()->kernel_offset_;
1813#if defined(DART_PRECOMPILED_RUNTIME)
1830 const Array& args_desc,
1832 bool create_if_absent)
const;
1839 const Array& arguments,
1840 const Array& argument_names,
1841 bool respect_reflectable =
true,
1842 bool check_is_entrypoint =
false)
const;
1844 bool throw_nsm_if_absent,
1845 bool respect_reflectable =
true,
1846 bool check_is_entrypoint =
false)
const;
1849 bool respect_reflectable =
true,
1850 bool check_is_entrypoint =
false)
const;
1859 const Array& type_definitions,
1860 const Array& param_values,
1871 template <
class FakeObject,
class TargetFakeObject>
1872 static ClassPtr
New(
IsolateGroup* isolate_group,
bool register_class =
true);
1879 bool register_class =
true);
1907#if !defined(DART_PRECOMPILED_RUNTIME)
1930 const Class& old_cls)
const;
1933 const Class& new_cls)
const;
1940 const Array& args_desc,
1944 return cls->untag()->host_instance_size_in_words_;
1948#if defined(DART_PRECOMPILER)
1949 return cls->untag()->target_instance_size_in_words_;
1956 return cls->untag()->host_next_field_offset_in_words_;
1960#if defined(DART_PRECOMPILER)
1961 return cls->untag()->target_next_field_offset_in_words_;
1968 return cls->untag()->host_type_arguments_field_offset_in_words_;
1972 const ClassPtr cls) {
1973#if defined(DART_PRECOMPILER)
1974 return cls->untag()->target_type_arguments_field_offset_in_words_;
1982 const Field& field)
const;
1984#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
1989 TypePtr declaration_type()
const {
1990 return untag()->declaration_type<std::memory_order_acquire>();
1994 void set_declaration_type(
const Type&
type)
const;
1996 TypeArgumentsPtr declaration_instance_type_arguments()
const {
1998 ->declaration_instance_type_arguments<std::memory_order_acquire>();
2000 void set_declaration_instance_type_arguments(
2001 const TypeArguments&
value)
const;
2003 bool CanReloadFinalized(
const Class& replacement,
2004 ProgramReloadContext* context)
const;
2005 bool CanReloadPreFinalized(
const Class& replacement,
2006 ProgramReloadContext* context)
const;
2009 bool RequiresInstanceMorphing(ClassTable* class_table,
2010 const Class& replacement)
const;
2012 template <
class FakeInstance,
class TargetFakeInstance>
2013 static ClassPtr NewCommon(intptr_t index);
2019 kInstanceAllowAbstract,
2025 kImplementedBit = 1,
2026 kClassFinalizedPos = 2,
2027 kClassFinalizedSize = 2,
2028 kClassLoadingPos = kClassFinalizedPos + kClassFinalizedSize,
2029 kClassLoadingSize = 2,
2030 kAbstractBit = kClassLoadingPos + kClassLoadingSize,
2031 kSynthesizedClassBit,
2033 kMixinTypeAppliedBit,
2034 kFieldsMarkedNullableBit,
2036 kTransformedMixinApplicationBit,
2051 kIsIsolateUnsendableBit,
2054 kIsIsolateUnsendableDueToPragmaBit,
2064 kIsDeeplyImmutableBit,
2066 kIsFutureSubtypeBit,
2073 kIsDynamicallyExtendableBit,
2075 kHasDynamicallyExtendableSubtypesBit,
2077 class ConstBit :
public BitField<uint32_t, bool, kConstBit, 1> {};
2078 class ImplementedBit :
public BitField<uint32_t, bool, kImplementedBit, 1> {};
2079 class ClassFinalizedBits :
public BitField<uint32_t,
2080 UntaggedClass::ClassFinalizedState,
2082 kClassFinalizedSize> {};
2083 class ClassLoadingBits :
public BitField<uint32_t,
2084 UntaggedClass::ClassLoadingState,
2086 kClassLoadingSize> {};
2087 class AbstractBit :
public BitField<uint32_t, bool, kAbstractBit, 1> {};
2088 class SynthesizedClassBit
2089 :
public BitField<uint32_t, bool, kSynthesizedClassBit, 1> {};
2090 class FieldsMarkedNullableBit
2091 :
public BitField<uint32_t, bool, kFieldsMarkedNullableBit, 1> {};
2092 class EnumBit :
public BitField<uint32_t, bool, kEnumBit, 1> {};
2093 class TransformedMixinApplicationBit
2094 :
public BitField<uint32_t, bool, kTransformedMixinApplicationBit, 1> {};
2095 class IsAllocatedBit :
public BitField<uint32_t, bool, kIsAllocatedBit, 1> {};
2096 class IsLoadedBit :
public BitField<uint32_t, bool, kIsLoadedBit, 1> {};
2097 class HasPragmaBit :
public BitField<uint32_t, bool, kHasPragmaBit, 1> {};
2098 class SealedBit :
public BitField<uint32_t, bool, kSealedBit, 1> {};
2099 class MixinClassBit :
public BitField<uint32_t, bool, kMixinClassBit, 1> {};
2100 class BaseClassBit :
public BitField<uint32_t, bool, kBaseClassBit, 1> {};
2101 class InterfaceClassBit
2102 :
public BitField<uint32_t, bool, kInterfaceClassBit, 1> {};
2103 class FinalBit :
public BitField<uint32_t, bool, kFinalBit, 1> {};
2104 class IsIsolateUnsendableBit
2105 :
public BitField<uint32_t, bool, kIsIsolateUnsendableBit, 1> {};
2106 class IsIsolateUnsendableDueToPragmaBit
2107 :
public BitField<uint32_t, bool, kIsIsolateUnsendableDueToPragmaBit, 1> {
2109 class IsDeeplyImmutableBit
2110 :
public BitField<uint32_t, bool, kIsDeeplyImmutableBit, 1> {};
2111 class IsFutureSubtypeBit
2112 :
public BitField<uint32_t, bool, kIsFutureSubtypeBit, 1> {};
2113 class CanBeFutureBit :
public BitField<uint32_t, bool, kCanBeFutureBit, 1> {};
2114 class IsDynamicallyExtendableBit
2115 :
public BitField<uint32_t, bool, kIsDynamicallyExtendableBit, 1> {};
2116 class HasDynamicallyExtendableSubtypesBit
2117 :
public BitField<uint32_t,
2119 kHasDynamicallyExtendableSubtypesBit,
2122 void set_name(
const String&
value)
const;
2123 void set_user_name(
const String&
value)
const;
2124 const char* GenerateUserVisibleName()
const;
2125 void set_state_bits(intptr_t
bits)
const;
2126 void set_implementor_cid(intptr_t
value)
const;
2128 FunctionPtr CreateInvocationDispatcher(
const String& target_name,
2129 const Array& args_desc,
2132 FunctionPtr CreateRecordFieldGetter(
const String& getter_name)
const;
2135 UnboxedFieldBitmap CalculateFieldOffsets()
const;
2138 static constexpr intptr_t kFunctionLookupHashThreshold = 16;
2141 static constexpr intptr_t kUnknownNumTypeArguments = -1;
2143 int16_t num_type_arguments()
const {
2144 return LoadNonPointer<int16_t, std::memory_order_relaxed>(
2145 &
untag()->num_type_arguments_);
2148 uint32_t state_bits()
const {
2151 return LoadNonPointer<uint32_t, std::memory_order_acquire>(
2152 &
untag()->state_bits_);
2201 void set_functions(
const Array&
value)
const;
2203 void set_invocation_dispatcher_cache(
const Array&
cache)
const;
2205 ArrayPtr invocation_dispatcher_cache()
const;
2210 intptr_t ComputeNumTypeArguments()
const;
2213 void InitEmptyFields()
const;
2215 static FunctionPtr CheckFunctionType(
const Function& func, MemberKind kind);
2217 MemberKind kind)
const;
2219 MemberKind kind)
const;
2222 FunctionPtr LookupAccessorFunction(
const char*
prefix,
2223 intptr_t prefix_length,
2227 template <
class FakeInstance,
class TargetFakeInstance>
2228 static ClassPtr
New(intptr_t
id,
2230 bool register_class =
true,
2234 static ClassPtr NewInstanceClass();
2274#if !defined(DART_PRECOMPILED_RUNTIME)
2275 return untag()->kernel_library_index_;
2284#if !defined(DART_PRECOMPILED_RUNTIME)
2286 return untag()->kernel_program_info();
2304 void set_wrapped_class(
const Class&
value)
const;
2307 static PatchClassPtr New();
2321#define DEFINE_NON_POINTER_FIELD_ACCESSORS(type, name) \
2322 type name() const { return untag()->name##_; } \
2323 void set_##name(type value) const { \
2324 StoreNonPointer(&untag()->name##_, value); \
2326 static intptr_t name##_offset() { \
2327 return OFFSET_OF(UntaggedSingleTargetCache, name##_); \
2333#undef DEFINE_NON_POINTER_FIELD_ACCESSORS
2339 static SingleTargetCachePtr
New();
2395 void set_arguments_descriptor(
const Array&
value)
const;
2406 return untag()->can_patch_to_monomorphic_;
2416 static UnlinkedCallPtr New();
2421 void set_can_patch_to_monomorphic(
bool value)
const;
2458 FunctionPtr Owner()
const;
2460 ICDataPtr Original()
const;
2466 intptr_t NumArgsTested()
const;
2469#if defined(DART_PRECOMPILED_RUNTIME)
2473 return untag()->deopt_id_;
2479#if !defined(DART_PRECOMPILED_RUNTIME)
2481 return untag()->receivers_static_type();
2484 return untag()->state_bits_.Read<TrackingExactnessBit>();
2487 bool is_tracking_exactness()
const {
return false; }
2493#define DEOPT_REASONS(V) \
2500 V(PolymorphicInstanceCallTestFail) \
2506 V(CheckArrayBound) \
2513#define DEFINE_ENUM_LIST(name) kDeopt##name,
2515#undef DEFINE_ENUM_LIST
2518 static constexpr intptr_t kLastRecordedDeoptReason = kDeoptUnknown - 1;
2525 kGeneralized = 1 << 1
2529 uint32_t DeoptReasons()
const;
2530 void SetDeoptReasons(uint32_t reasons)
const;
2537#define FOR_EACH_REBIND_RULE(V) \
2546#define REBIND_ENUM_DEF(name) k##name,
2548#undef REBIND_ENUM_DEF
2551 static const char* RebindRuleToCString(RebindRule r);
2552 static bool ParseRebindRule(
const char* str, RebindRule*
out);
2553 RebindRule rebind_rule()
const;
2556 untag()->state_bits_.UpdateBool<MegamorphicBit, std::memory_order_release>(
2562 intptr_t Length()
const;
2564 intptr_t NumberOfChecks()
const;
2568 intptr_t NumberOfUsedChecks()
const;
2570 bool NumberOfChecksIs(intptr_t n)
const;
2573 return 0 <= index && index < NumberOfChecks();
2587 return ((1 << kNumArgsTestedSize) - 1) << kNumArgsTestedPos;
2596#if !defined(DART_PRECOMPILED_RUNTIME)
2604 TruncateTo(0, proof_of_reload);
2608 void TruncateTo(intptr_t num_checks,
2613 void ClearCountAt(intptr_t index,
2619 void ClearAndSetStaticTarget(
const Function& func,
2622 void DebugDump()
const;
2633 intptr_t
count = 1)
const;
2639 intptr_t
count = 1)
const;
2648 void EnsureHasReceiverCheck(
2649 intptr_t receiver_class_id,
2657 void AddReceiverCheck(intptr_t receiver_class_id,
2665 void GetCheckAt(intptr_t index,
2671 void GetOneClassCheckAt(intptr_t index,
2675 intptr_t GetCidAt(intptr_t index)
const;
2677 intptr_t GetReceiverClassIdAt(intptr_t index)
const;
2678 intptr_t GetClassIdAt(intptr_t index, intptr_t arg_nr)
const;
2680 FunctionPtr GetTargetAt(intptr_t index)
const;
2682 void IncrementCountAt(intptr_t index, intptr_t
value)
const;
2683 void SetCountAt(intptr_t index, intptr_t
value)
const;
2684 intptr_t GetCountAt(intptr_t index)
const;
2685 intptr_t AggregateCount()
const;
2690 ICDataPtr AsUnaryClassChecksForArgNr(intptr_t arg_nr)
const;
2697 ICDataPtr AsUnaryClassChecksSortedByCount()
const;
2699 UnlinkedCallPtr AsUnlinkedCall()
const;
2701 bool HasReceiverClassId(intptr_t class_id)
const;
2707 static ICDataPtr New(
2712 intptr_t num_args_tested,
2713 RebindRule rebind_rule,
2714 const AbstractType& receiver_type = Object::null_abstract_type());
2717 static ICDataPtr NewWithCheck(
2722 intptr_t num_args_tested,
2723 RebindRule rebind_rule,
2726 const AbstractType& receiver_type = Object::null_abstract_type());
2728 static ICDataPtr NewForStaticCall(
const Function& owner,
2732 intptr_t num_args_tested,
2733 RebindRule rebind_rule);
2735 static ICDataPtr NewFrom(
const ICData& from, intptr_t num_args_tested);
2744 static ICDataPtr ICDataOfEntriesArray(
const Array& array);
2746 static intptr_t TestEntryLengthFor(intptr_t num_args,
2747 bool tracking_exactness);
2757 bool IsUsedAt(intptr_t
i)
const;
2759 void PrintToJSONArray(
const JSONArray& jsarray,
2771 kCachedICDataZeroArgTestedWithoutExactnessTrackingIdx = 0,
2772 kCachedICDataMaxArgsTestedWithoutExactnessTracking = 2,
2773 kCachedICDataOneArgWithExactnessTrackingIdx =
2774 kCachedICDataZeroArgTestedWithoutExactnessTrackingIdx +
2775 kCachedICDataMaxArgsTestedWithoutExactnessTracking + 1,
2776 kCachedICDataArrayCount = kCachedICDataOneArgWithExactnessTrackingIdx + 1,
2779 bool is_static_call()
const;
2784 return untag()->entries<std::memory_order_acquire>();
2788 return untag()->state_bits_.Read<ReceiverCannotBeSmiBit>();
2792 untag()->state_bits_.UpdateBool<ReceiverCannotBeSmiBit>(
value);
2798 static ICDataPtr New();
2802 ArrayPtr Grow(intptr_t* index)
const;
2804 void set_deopt_id(intptr_t
value)
const;
2807 void set_rebind_rule(uint32_t rebind_rule)
const;
2808 void clear_state_bits()
const;
2809 void set_tracking_exactness(
bool value)
const {
2810 untag()->state_bits_.UpdateBool<TrackingExactnessBit>(
value);
2814 void SetNumArgsTested(intptr_t
value)
const;
2815 void SetReceiversStaticType(
const AbstractType&
type)
const;
2816 DEBUG_ONLY(
void AssertInvariantsAreSatisfied()
const;)
2818 static void SetTargetAtPos(
const Array&
data,
2820 intptr_t num_args_tested,
2822 void AddCheckInternal(
const GrowableArray<intptr_t>& class_ids,
2824 intptr_t
count)
const;
2825 void AddReceiverCheckInternal(intptr_t receiver_class_id,
2828 StaticTypeExactnessState exactness)
const;
2836 bool is_megamorphic()
const {
2840 ->state_bits_.Read<MegamorphicBit, std::memory_order_acquire>();
2843 bool ValidateInterceptor(
const Function&
target)
const;
2846 kNumArgsTestedPos = 0,
2847 kNumArgsTestedSize = 2,
2848 kTrackingExactnessPos = kNumArgsTestedPos + kNumArgsTestedSize,
2849 kTrackingExactnessSize = 1,
2850 kDeoptReasonPos = kTrackingExactnessPos + kTrackingExactnessSize,
2851 kDeoptReasonSize = kLastRecordedDeoptReason + 1,
2852 kRebindRulePos = kDeoptReasonPos + kDeoptReasonSize,
2853 kRebindRuleSize = 3,
2854 kMegamorphicPos = kRebindRulePos + kRebindRuleSize,
2855 kMegamorphicSize = 1,
2856 kReceiverCannotBeSmiPos = kMegamorphicPos + kMegamorphicSize,
2857 kReceiverCannotBeSmiSize = 1,
2860 COMPILE_ASSERT(kReceiverCannotBeSmiPos + kReceiverCannotBeSmiSize <=
2864 class NumArgsTestedBits :
public BitField<uint32_t,
2867 kNumArgsTestedSize> {};
2868 class TrackingExactnessBit :
public BitField<uint32_t,
2870 kTrackingExactnessPos,
2871 kTrackingExactnessSize> {};
2872 class DeoptReasonBits :
public BitField<uint32_t,
2874 ICData::kDeoptReasonPos,
2875 ICData::kDeoptReasonSize> {};
2876 class RebindRuleBits :
public BitField<uint32_t,
2878 ICData::kRebindRulePos,
2879 ICData::kRebindRuleSize> {};
2880 class MegamorphicBit
2881 :
public BitField<uint32_t, bool, kMegamorphicPos, kMegamorphicSize> {};
2883 class ReceiverCannotBeSmiBit :
public BitField<uint32_t,
2885 kReceiverCannotBeSmiPos,
2886 kReceiverCannotBeSmiSize> {};
2890 bool HasCheck(
const GrowableArray<intptr_t>& cids)
const;
2893 intptr_t TestEntryLength()
const;
2894 static ArrayPtr NewNonCachedEmptyICDataArray(intptr_t num_args_tested,
2895 bool tracking_exactness);
2896 static ArrayPtr CachedEmptyICDataArray(intptr_t num_args_tested,
2897 bool tracking_exactness);
2898 static bool IsCachedEmptyEntry(
const Array& array);
2899 static ICDataPtr NewDescriptor(Zone* zone,
2900 const Function& owner,
2904 intptr_t num_args_tested,
2905 RebindRule rebind_rule,
2906 const AbstractType& receiver_type);
2908 static void WriteSentinel(
const Array&
data,
2909 intptr_t test_entry_length,
2913 static ArrayPtr cached_icdata_arrays_[kCachedICDataArrayCount];
2952 bool include_class_name =
true;
2959 bool include_parent_name =
true;
2964 : name_visibility(visibility),
2965 disambiguate_names(name_disambiguation ==
2971 params.include_class_name =
false;
2978 params.include_class_name =
false;
2979 params.include_parent_name =
false;
2993 StringPtr UserVisibleName()
const;
2994 const char* UserVisibleNameCString()
const;
3000 StringPtr QualifiedScrubbedName()
const;
3001 const char* QualifiedScrubbedNameCString()
const;
3002 StringPtr QualifiedUserVisibleName()
const;
3003 const char* QualifiedUserVisibleNameCString()
const;
3007 StringPtr GetSource()
const;
3014 FunctionTypePtr FfiCSignature()
const;
3016 bool FfiCSignatureContainsHandles()
const;
3017 bool FfiCSignatureReturnsStruct()
const;
3020 int32_t FfiCallbackId()
const;
3023 void AssignFfiCallbackId(int32_t callback_id)
const;
3026 bool FfiIsLeaf()
const;
3029 FunctionPtr FfiCallbackTarget()
const;
3035 InstancePtr FfiCallbackExceptionalReturn()
const;
3038 void SetFfiCallbackExceptionalReturn(
const Instance&
value)
const;
3057 StringPtr InternalSignature()
const;
3064 StringPtr UserVisibleSignature()
const;
3071 bool HasInstantiatedSignature(
3073 intptr_t num_free_fun_type_params =
kAllFree)
const;
3075 bool IsPrivate()
const;
3077 ClassPtr Owner()
const;
3079 ScriptPtr
script()
const;
3080#if !defined(DART_PRECOMPILED_RUNTIME)
3085 RegExpPtr regexp()
const;
3086 intptr_t string_specialization_cid()
const;
3087 bool is_sticky_specialization()
const;
3088 void SetRegExpData(
const RegExp& regexp,
3089 intptr_t string_specialization_cid,
3092 StringPtr native_name()
const;
3093 void set_native_name(
const String&
name)
const;
3095 InstancePtr GetNativeAnnotation()
const;
3096 bool is_ffi_native()
const;
3097 bool is_old_native()
const;
3100 return signature()->untag()->result_type();
3106 AbstractTypePtr ParameterTypeAt(intptr_t index)
const;
3108 return signature()->untag()->parameter_types();
3115 StringPtr ParameterNameAt(intptr_t index)
const;
3118 void SetParameterNameAt(intptr_t index,
const String&
value)
const;
3125 bool IsRequiredAt(intptr_t index)
const;
3130 return signature()->untag()->type_parameters();
3134 intptr_t NumTypeParameters()
const;
3136 intptr_t NumParentTypeArguments()
const;
3139 intptr_t NumTypeArguments()
const;
3141 bool IsGeneric()
const;
3146 TypeParameterPtr TypeParameterAt(
3152 void InstallOptimizedCode(
const Code&
code)
const;
3153 void AttachCode(
const Code&
value)
const;
3154 void SetInstructions(
const Code&
value)
const;
3155 void SetInstructionsSafe(
const Code&
value)
const;
3156 void ClearCode()
const;
3157 void ClearCodeSafe()
const;
3160 void SwitchToUnoptimizedCode()
const;
3166 CodePtr EnsureHasCode()
const;
3170 void SwitchToLazyCompiledUnoptimizedCode()
const;
3173 void EnsureHasCompiledUnoptimizedCode()
const;
3179 bool SafeToClosurize()
const;
3182 return function->untag()->code<std::memory_order_acquire>();
3186#if defined(DART_PRECOMPILED_RUNTIME)
3189 return untag()->unoptimized_code();
3192 void set_unoptimized_code(
const Code&
value)
const;
3193 bool HasCode()
const;
3194 static bool HasCode(FunctionPtr
function);
3200 return function->untag()->entry_point_;
3205 switch (entry_kind) {
3223 bool HasBreakpoint()
const;
3225 ContextScopePtr context_scope()
const;
3231 uint8_t depth = UntaggedClosureData::kNoAwaiterLinkDepth;
3234 uint8_t index =
static_cast<uint8_t
>(-1);
3240 return IsClosureFunction() &&
3241 (awaiter_link().depth != UntaggedClosureData::kNoAwaiterLinkDepth);
3245 FunctionPtr parent_function()
const;
3257 TypeArgumentsPtr DefaultTypeArguments(
Zone* zone)
const;
3261 void set_default_type_arguments_instantiation_mode(
3265 FunctionPtr GetOutermostFunction()
const;
3268 FunctionPtr extracted_method_closure()
const;
3270 void set_saved_args_desc(
const Array& array)
const;
3271 ArrayPtr saved_args_desc()
const;
3274 return IsInvokeFieldDispatcher() || IsNoSuchMethodDispatcher();
3277 void set_accessor_field(
const Field&
value)
const;
3278 FieldPtr accessor_field()
const;
3281 return kind() == UntaggedFunction::kRegularFunction;
3285 return kind() == UntaggedFunction::kMethodExtractor;
3289 return kind() == UntaggedFunction::kNoSuchMethodDispatcher;
3293 return kind() == UntaggedFunction::kRecordFieldGetter;
3297 return kind() == UntaggedFunction::kInvokeFieldDispatcher;
3301 return IsInvokeFieldDispatcher() &&
3302 IsDynamicInvocationForwarderName(
name());
3309 if (!IsDynamicInvokeFieldDispatcher())
return false;
3312 bool IsDynamicClosureCallDispatcher(
Thread* thread)
const;
3315 return kind() == UntaggedFunction::kDynamicInvocationForwarder;
3319 return kind() == UntaggedFunction::kImplicitGetter ||
3320 kind() == UntaggedFunction::kImplicitSetter ||
3321 kind() == UntaggedFunction::kImplicitStaticGetter;
3327 return implicit_closure_function() !=
null();
3333 FunctionPtr ImplicitClosureFunction()
const;
3334 void DropUncompiledImplicitClosureFunction()
const;
3338 ClosurePtr ImplicitStaticClosure()
const;
3340 ClosurePtr ImplicitInstanceClosure(
const Instance& receiver)
const;
3344 FunctionPtr ImplicitClosureTarget(
Zone* zone)
const;
3346 FunctionPtr ForwardingTarget()
const;
3351 return func->untag()->kind_tag_.Read<
KindBits>();
3361 return kind() == UntaggedFunction::kConstructor;
3364 return IsConstructor() && !is_static();
3366 bool IsImplicitConstructor()
const;
3367 bool IsFactory()
const {
return IsConstructor() && is_static(); }
3370 return IsDynamicFunction(
true) ||
3371 IsGenerativeConstructor() || (IsFieldInitializer() && !is_static());
3375 if (is_static() || (!allow_abstract && is_abstract())) {
3379 case UntaggedFunction::kRegularFunction:
3380 case UntaggedFunction::kGetterFunction:
3381 case UntaggedFunction::kSetterFunction:
3382 case UntaggedFunction::kImplicitGetter:
3383 case UntaggedFunction::kImplicitSetter:
3384 case UntaggedFunction::kMethodExtractor:
3385 case UntaggedFunction::kNoSuchMethodDispatcher:
3386 case UntaggedFunction::kInvokeFieldDispatcher:
3387 case UntaggedFunction::kDynamicInvocationForwarder:
3388 case UntaggedFunction::kRecordFieldGetter:
3390 case UntaggedFunction::kClosureFunction:
3391 case UntaggedFunction::kImplicitClosureFunction:
3392 case UntaggedFunction::kConstructor:
3393 case UntaggedFunction::kImplicitStaticGetter:
3394 case UntaggedFunction::kFieldInitializer:
3395 case UntaggedFunction::kIrregexpFunction:
3407 case UntaggedFunction::kRegularFunction:
3408 case UntaggedFunction::kGetterFunction:
3409 case UntaggedFunction::kSetterFunction:
3410 case UntaggedFunction::kImplicitGetter:
3411 case UntaggedFunction::kImplicitSetter:
3412 case UntaggedFunction::kImplicitStaticGetter:
3413 case UntaggedFunction::kFieldInitializer:
3414 case UntaggedFunction::kIrregexpFunction:
3416 case UntaggedFunction::kClosureFunction:
3417 case UntaggedFunction::kImplicitClosureFunction:
3418 case UntaggedFunction::kConstructor:
3419 case UntaggedFunction::kMethodExtractor:
3420 case UntaggedFunction::kNoSuchMethodDispatcher:
3421 case UntaggedFunction::kInvokeFieldDispatcher:
3422 case UntaggedFunction::kDynamicInvocationForwarder:
3423 case UntaggedFunction::kFfiTrampoline:
3424 case UntaggedFunction::kRecordFieldGetter:
3433 return !(is_static() || (kind() == UntaggedFunction::kConstructor));
3437 return !(is_static() || (kind() == UntaggedFunction::kConstructor));
3440 bool NeedsMonomorphicCheckedEntry(
Zone* zone)
const;
3441 bool HasDynamicCallers(
Zone* zone)
const;
3442 bool PrologueNeedsArgumentsDescriptor()
const;
3444 bool MayHaveUncheckedEntryPoint()
const;
3447#if defined(DART_PRECOMPILED_RUNTIME)
3448 return TokenPosition::kNoSource;
3450 return untag()->token_pos_;
3456#if defined(DART_PRECOMPILED_RUNTIME)
3457 return TokenPosition::kNoSource;
3459 return untag()->end_token_pos_;
3463#if defined(DART_PRECOMPILED_RUNTIME)
3470#if !defined(PRODUCT) && \
3471 (defined(DART_PRECOMPILER) || defined(DART_PRECOMPILED_RUNTIME))
3472 int32_t
line()
const {
return untag()->token_pos_.Serialize(); }
3474 void set_line(int32_t
line)
const {
3480 intptr_t SourceSize()
const;
3483#if defined(DART_PRECOMPILED_RUNTIME)
3486 return untag()->packed_fields_;
3489 void set_packed_fields(uint32_t packed_fields)
const;
3492 intptr_t num_fixed_parameters()
const;
3494 bool HasOptionalParameters()
const;
3496 bool HasOptionalNamedParameters()
const;
3498 bool HasRequiredNamedParameters()
const;
3500 bool HasOptionalPositionalParameters()
const;
3502 intptr_t NumOptionalParameters()
const;
3504 intptr_t NumOptionalPositionalParameters()
const;
3506 intptr_t NumOptionalNamedParameters()
const;
3508 intptr_t NumParameters()
const;
3510 intptr_t NumImplicitParameters()
const;
3515 return HasOptionalParameters() || IsSuspendableFunction();
3518#if !defined(DART_PRECOMPILED_RUNTIME)
3519 intptr_t MaxNumberOfParametersInRegisters(
Zone* zone)
const;
3522#if defined(DART_PRECOMPILED_RUNTIME)
3523#define DEFINE_GETTERS_AND_SETTERS(return_type, type, name) \
3524 static intptr_t name##_offset() { \
3528 return_type name() const { return 0; } \
3530 void set_##name(type value) const { UNREACHABLE(); }
3532#define DEFINE_GETTERS_AND_SETTERS(return_type, type, name) \
3533 static intptr_t name##_offset() { \
3534 return OFFSET_OF(UntaggedFunction, name##_); \
3536 return_type name() const { \
3537 return LoadNonPointer<type, std::memory_order_relaxed>(&untag()->name##_); \
3540 void set_##name(type value) const { \
3541 StoreNonPointer<type, type, std::memory_order_relaxed>(&untag()->name##_, \
3548#undef DEFINE_GETTERS_AND_SETTERS
3551#if defined(DART_PRECOMPILED_RUNTIME)
3554 return untag()->kernel_offset_;
3559#if defined(DART_PRECOMPILED_RUNTIME)
3567 void InheritKernelOffsetFrom(
const Function&
src)
const;
3568 void InheritKernelOffsetFrom(
const Field&
src)
const;
3570 static constexpr intptr_t kMaxInstructionCount = (1 << 16) - 1;
3573 if (
value > kMaxInstructionCount)
value = kMaxInstructionCount;
3574 set_optimized_instruction_count(
value);
3578 if (
value > kMaxInstructionCount)
value = kMaxInstructionCount;
3579 set_optimized_call_site_count(
value);
3582 void SetKernelLibraryAndEvalScript(
3585 intptr_t index)
const;
3587 intptr_t KernelLibraryOffset()
const;
3588 intptr_t KernelLibraryIndex()
const;
3590 TypedDataViewPtr KernelLibrary()
const;
3592 bool IsOptimizable()
const;
3593 void SetIsOptimizable(
bool value)
const;
3600 bool ForceOptimize()
const;
3603 bool IsPreferInline()
const;
3610 bool IsIdempotent()
const;
3612 bool IsCachableIdempotent()
const;
3615 bool RecognizedKindForceOptimize()
const;
3617 bool CanBeInlined()
const;
3628 bool HasOptimizedCode()
const;
3633 bool AreValidArgumentCounts(intptr_t num_type_arguments,
3634 intptr_t num_arguments,
3635 intptr_t num_named_arguments,
3636 String* error_message)
const;
3689 bool AreValidArguments(intptr_t num_type_arguments,
3690 intptr_t num_arguments,
3691 const Array& argument_names,
3692 String* error_message)
const;
3694 String* error_message)
const;
3698 const char* ToFullyQualifiedCString()
const;
3700 const char* ToLibNamePrefixedQualifiedCString()
const;
3702 const char* ToQualifiedCString()
const;
3710#if !defined(DART_PRECOMPILED_RUNTIME)
3717#if !defined(DART_PRECOMPILED_RUNTIME)
3718 ASSERT(index >= 0 && index < maximum_unboxed_parameter_count());
3721 &
untag()->unboxed_parameters_info_)
3722 ->SetUnboxedInteger(index);
3729#if !defined(DART_PRECOMPILED_RUNTIME)
3730 ASSERT(index >= 0 && index < maximum_unboxed_parameter_count());
3733 &
untag()->unboxed_parameters_info_)
3734 ->SetUnboxedDouble(index);
3742#if !defined(DART_PRECOMPILED_RUNTIME)
3744 &
untag()->unboxed_parameters_info_)
3745 ->SetUnboxedInteger(0);
3752#if !defined(DART_PRECOMPILED_RUNTIME)
3754 &
untag()->unboxed_parameters_info_)
3755 ->SetUnboxedDouble(0);
3763#if !defined(DART_PRECOMPILED_RUNTIME)
3765 &
untag()->unboxed_parameters_info_)
3766 ->SetUnboxedRecord(0);
3774#if !defined(DART_PRECOMPILED_RUNTIME)
3777 return untag()->unboxed_parameters_info_.IsUnboxed(index);
3784#if !defined(DART_PRECOMPILED_RUNTIME)
3787 return untag()->unboxed_parameters_info_.IsUnboxedInteger(index);
3794#if !defined(DART_PRECOMPILED_RUNTIME)
3797 return untag()->unboxed_parameters_info_.IsUnboxedDouble(index);
3804#if !defined(DART_PRECOMPILED_RUNTIME)
3805 return untag()->unboxed_parameters_info_.IsUnboxed(0);
3812#if !defined(DART_PRECOMPILED_RUNTIME)
3813 return untag()->unboxed_parameters_info_.IsUnboxedInteger(0);
3820#if !defined(DART_PRECOMPILED_RUNTIME)
3821 return untag()->unboxed_parameters_info_.IsUnboxedDouble(0);
3828#if !defined(DART_PRECOMPILED_RUNTIME)
3829 return untag()->unboxed_parameters_info_.IsUnboxedRecord(0);
3835#if !defined(DART_PRECOMPILED_RUNTIME)
3837 return untag()->unboxed_parameters_info_.HasUnboxedParameters();
3844 case UntaggedFunction::kImplicitGetter:
3845 case UntaggedFunction::kImplicitSetter:
3846 case UntaggedFunction::kImplicitStaticGetter:
3847 case UntaggedFunction::kNoSuchMethodDispatcher:
3848 case UntaggedFunction::kInvokeFieldDispatcher:
3849 case UntaggedFunction::kDynamicInvocationForwarder:
3858 return kind() == UntaggedFunction::kGetterFunction;
3863 return kind() == UntaggedFunction::kImplicitGetter;
3869 return kind() == UntaggedFunction::kImplicitStaticGetter;
3874 return kind() == UntaggedFunction::kSetterFunction;
3879 return kind() == UntaggedFunction::kImplicitSetter;
3886 return kind() == UntaggedFunction::kFieldInitializer;
3893 return (k == UntaggedFunction::kClosureFunction) ||
3894 (k == UntaggedFunction::kImplicitClosureFunction);
3899 return kind() == UntaggedFunction::kIrregexpFunction;
3904 return kind() == UntaggedFunction::kImplicitClosureFunction;
3907 return KindOf(func) == UntaggedFunction::kImplicitClosureFunction;
3912 return IsClosureFunction() && !IsImplicitClosureFunction();
3918 return IsImplicitClosureFunction() && is_static();
3920 static bool IsImplicitStaticClosureFunction(FunctionPtr func);
3925 return IsImplicitClosureFunction() && !is_static();
3927 static bool IsImplicitInstanceClosureFunction(FunctionPtr func);
3934 return !IsImplicitClosureFunction() && HasParent();
3939 return kind() == UntaggedFunction::kFfiTrampoline;
3944 UntaggedFunction::kFfiTrampoline;
3949 bool IsFfiCallClosure()
const;
3952 InstancePtr GetFfiCallClosurePragmaValue()
const;
3976 bool IsTypedDataViewFactory()
const;
3977 bool IsUnmodifiableTypedDataViewFactory()
const;
3980 ErrorPtr VerifyCallEntryPoint()
const;
3983 ErrorPtr VerifyClosurizedEntryPoint()
const;
4011 static FunctionPtr NewClosureFunction(
const String&
name,
4016 static FunctionPtr NewImplicitClosureFunction(
const String&
name,
4020 FunctionPtr CreateMethodExtractor(
const String& getter_name)
const;
4021 FunctionPtr GetMethodExtractor(
const String& getter_name)
const;
4023 static bool IsDynamicInvocationForwarderName(
const String&
name);
4024 static bool IsDynamicInvocationForwarderName(StringPtr
name);
4026 static StringPtr DemangleDynamicInvocationForwarderName(
const String&
name);
4028 static StringPtr CreateDynamicInvocationForwarderName(
const String&
name);
4030#if !defined(DART_PRECOMPILED_RUNTIME)
4031 FunctionPtr CreateDynamicInvocationForwarder(
4032 const String& mangled_name)
const;
4034 FunctionPtr GetDynamicInvocationForwarder(
const String& mangled_name)
const;
4039 int32_t SourceFingerprint()
const;
4042 bool CheckSourceFingerprint(int32_t
fp,
const char* kind =
nullptr)
const;
4047 const Array& edge_counters_array,
4048 const Array& coverage_array)
const;
4052 bool clone_ic_data)
const;
4058 static constexpr intptr_t kEdgeCounters = 0;
4059 static constexpr intptr_t kCoverageData = 1;
4060 static constexpr intptr_t kFirstICData = 2;
4063 ArrayPtr ic_data_array()
const;
4064 void ClearICDataArray()
const;
4065 ICDataPtr
FindICData(intptr_t deopt_id)
const;
4070 ArrayPtr GetCoverageArray()
const;
4073 void AddFunctionServiceId(
const JSONObject& obj)
const;
4090#define STATE_BITS_LIST(V) \
4093 V(ProhibitsInstructionHoisting) \
4094 V(ProhibitsBoundsCheckGeneralization) \
4095 V(IsDynamicallyOverridden)
4098#define DECLARE_FLAG_POS(Name) k##Name##Pos,
4100#undef DECLARE_FLAG_POS
4102#define DEFINE_FLAG_BIT(Name) \
4103 class Name##Bit : public BitField<uint8_t, bool, k##Name##Pos, 1> {};
4105#undef DEFINE_FLAG_BIT
4107#define DEFINE_FLAG_ACCESSORS(Name) \
4108 void Set##Name(bool value) const { \
4109 set_state_bits(Name##Bit::update(value, state_bits())); \
4111 bool Name() const { return Name##Bit::decode(state_bits()); }
4113#undef DEFINE_FLAG_ACCESSORS
4116 if (usage_counter() > 0) {
4117 SetWasExecuted(
true);
4119 set_usage_counter(
value);
4122 bool WasExecuted()
const {
return (usage_counter() > 0) || WasExecutedBit(); }
4157#define FOR_EACH_FUNCTION_KIND_BIT(V) \
4158 V(Static, is_static) \
4159 V(Const, is_const) \
4160 V(Abstract, is_abstract) \
4161 V(Reflectable, is_reflectable) \
4162 V(Visible, is_visible) \
4163 V(Debuggable, is_debuggable) \
4164 V(Intrinsic, is_intrinsic) \
4165 V(Native, is_native) \
4166 V(External, is_external) \
4167 V(PolymorphicTarget, is_polymorphic_target) \
4168 V(HasPragma, has_pragma) \
4169 V(IsSynthetic, is_synthetic) \
4170 V(IsExtensionMember, is_extension_member) \
4171 V(IsExtensionTypeMember, is_extension_type_member) \
4172 V(IsRedirectingFactory, is_redirecting_factory)
4175#define FOR_EACH_FUNCTION_VOLATILE_KIND_BIT(V) V(Inlinable, is_inlinable)
4177#define DEFINE_ACCESSORS(name, accessor_name) \
4178 void set_##accessor_name(bool value) const { \
4179 untag()->kind_tag_.UpdateUnsynchronized<name##Bit>(value); \
4181 bool accessor_name() const { return untag()->kind_tag_.Read<name##Bit>(); }
4183#undef DEFINE_ACCESSORS
4186 return f.untag()->kind_tag_.Read<VisibleBit>();
4189#define DEFINE_ACCESSORS(name, accessor_name) \
4190 void set_##accessor_name(bool value) const { \
4191 untag()->kind_tag_.UpdateBool<name##Bit>(value); \
4193 bool accessor_name() const { return untag()->kind_tag_.Read<name##Bit>(); }
4195#undef DEFINE_ACCESSORS
4201#if defined(DART_PRECOMPILED_RUNTIME)
4208#if defined(DART_PRECOMPILED_RUNTIME)
4219 kRecognizedTagPos = kKindTagPos + kKindTagSize,
4220 kRecognizedTagSize = 9,
4221 kModifierPos = kRecognizedTagPos + kRecognizedTagSize,
4223 kLastModifierBitPos = kModifierPos + (kModifierSize - 1),
4233 (1 << kRecognizedTagSize));
4236 sizeof(
decltype(UntaggedFunction::kind_tag_))));
4238#define ASSERT_FUNCTION_KIND_IN_RANGE(Name) \
4239 COMPILE_ASSERT(UntaggedFunction::k##Name < (1 << kKindTagSize));
4241#undef ASSERT_FUNCTION_KIND_IN_RANGE
4244 UntaggedFunction::Kind,
4249 MethodRecognizer::Kind,
4251 kRecognizedTagSize> {};
4253 UntaggedFunction::AsyncModifier,
4257#define DEFINE_BIT(name, _) \
4258 class name##Bit : public BitField<uint32_t, bool, k##name##Bit, 1> {};
4264 enum class EvalFunctionData {
4267 kKernelLibraryIndex,
4270 enum NativeFunctionData {
4276 void set_ic_data_array(
const Array&
value)
const;
4277 void set_name(
const String&
value)
const;
4279 void set_parent_function(
const Function&
value)
const;
4280 FunctionPtr implicit_closure_function()
const;
4281 void set_implicit_closure_function(
const Function&
value)
const;
4282 ClosurePtr implicit_static_closure()
const;
4284 ScriptPtr eval_script()
const;
4285 void set_eval_script(
const Script&
value)
const;
4286 void set_num_optional_parameters(intptr_t
value)
const;
4287 void set_kind_tag(uint32_t
value)
const;
4288 bool is_eval_function()
const;
4290#if !defined(DART_PRECOMPILED_RUNTIME)
4291 ArrayPtr positional_parameter_names()
const {
4292 return untag()->positional_parameter_names();
4294 void set_positional_parameter_names(
const Array&
value)
const;
4297 ObjectPtr
data()
const {
return untag()->data<std::memory_order_acquire>(); }
4326 static constexpr uint8_t kNoAwaiterLinkDepth =
4327 UntaggedClosureData::kNoAwaiterLinkDepth;
4330 ContextScopePtr context_scope()
const {
return untag()->context_scope(); }
4333 void set_packed_fields(uint32_t
value)
const {
4337 Function::AwaiterLink awaiter_link()
const;
4338 void set_awaiter_link(Function::AwaiterLink
link)
const;
4343 ClosurePtr implicit_static_closure()
const {
4344 return untag()->closure<std::memory_order_acquire>();
4349 ClosureDataPtr
ptr) {
4350 return ptr->
untag()->packed_fields_.Read<PackedInstantiationMode>();
4353 return DefaultTypeArgumentsInstantiationMode(
ptr());
4355 void set_default_type_arguments_instantiation_mode(
4358 static ClosureDataPtr New();
4381 FunctionTypePtr c_signature()
const {
return untag()->c_signature(); }
4382 void set_c_signature(
const FunctionType&
value)
const;
4384 FunctionPtr callback_target()
const {
return untag()->callback_target(); }
4385 void set_callback_target(
const Function&
value)
const;
4387 InstancePtr callback_exceptional_return()
const {
4388 return untag()->callback_exceptional_return();
4390 void set_callback_exceptional_return(
const Instance&
value)
const;
4397 int32_t callback_id()
const {
return untag()->callback_id_; }
4398 void set_callback_id(int32_t
value)
const;
4400 static FfiTrampolineDataPtr New();
4412 FieldPtr Original()
const;
4423 return !
untag()->owner()->IsField();
4428 FieldPtr CloneFromOriginal()
const;
4431 StringPtr UserVisibleName()
const;
4432 const char* UserVisibleNameCString()
const;
4436 return LoadNonPointer<uint16_t, std::memory_order_acquire>(
4437 &
untag()->kind_bits_);
4458 set_kind_bits(ReflectableBit::update(
value,
untag()->kind_bits_));
4466 set_kind_bits(InitializerChangedAfterInitializationBit::update(
4473 set_kind_bits(HasPragmaBit::update(
value,
untag()->kind_bits_));
4479 set_kind_bits(CovariantBit::update(
value,
untag()->kind_bits_));
4487 set_kind_bits(GenericCovariantImplBit::update(
value,
untag()->kind_bits_));
4491 set_kind_bits(SharedBit::update(
value,
untag()->kind_bits_));
4496#if defined(DART_PRECOMPILED_RUNTIME)
4499 return untag()->kernel_offset_;
4504#if defined(DART_PRECOMPILED_RUNTIME)
4512 void InheritKernelOffsetFrom(
const Field&
src)
const;
4514 TypedDataViewPtr KernelLibrary()
const;
4515 intptr_t KernelLibraryOffset()
const;
4516 intptr_t KernelLibraryIndex()
const;
4519 inline void SetOffset(intptr_t host_offset_in_bytes,
4520 intptr_t target_offset_in_bytes)
const;
4522 inline intptr_t HostOffset()
const;
4527 inline intptr_t TargetOffset()
const;
4528 static inline intptr_t TargetOffsetOf(FieldPtr field);
4530 ObjectPtr StaticConstFieldValue()
const;
4532 bool assert_initializing_store =
true)
const;
4537 inline intptr_t field_id()
const;
4538 inline void set_field_id(intptr_t field_id)
const;
4539 inline void set_field_id_unsafe(intptr_t field_id)
const;
4541 ClassPtr Owner()
const;
4542 ScriptPtr
Script()
const;
4543#if !defined(DART_PRECOMPILED_RUNTIME)
4548 uint32_t
Hash()
const;
4566 bool is_reflectable,
4573 static FieldPtr NewTopLevel(
const String&
name,
4592 int32_t SourceFingerprint()
const;
4594 StringPtr InitializingExpression()
const;
4601 bool has_nontrivial_initializer)
const {
4604 set_kind_bits(HasNontrivialInitializerBit::update(
4605 has_nontrivial_initializer,
untag()->kind_bits_));
4610 set_has_nontrivial_initializer_unsafe(has_nontrivial_initializer);
4621 HasInitializerBit::update(has_initializer,
untag()->kind_bits_));
4626 set_has_initializer_unsafe(has_initializer);
4630 return has_initializer() && !has_nontrivial_initializer();
4635 LoadNonPointer<int8_t, std::memory_order_relaxed>(
4636 &
untag()->static_type_exactness_state_));
4642 set_static_type_exactness_state_unsafe(
state);
4647 StoreNonPointer<int8_t, int8_t, std::memory_order_relaxed>(
4648 &
untag()->static_type_exactness_state_,
state.Encode());
4658 intptr_t guarded_cid()
const;
4663 set_guarded_cid_unsafe(
cid);
4666 StoreNonPointer<ClassIdTagType, ClassIdTagType, std::memory_order_relaxed>(
4676 intptr_t guarded_list_length()
const;
4677 void set_guarded_list_length_unsafe(intptr_t list_length)
const;
4681 set_guarded_list_length_unsafe(list_length);
4686 intptr_t guarded_list_length_in_object_offset()
const;
4687 void set_guarded_list_length_in_object_offset_unsafe(intptr_t
offset)
const;
4691 set_guarded_list_length_in_object_offset_unsafe(
offset);
4699 ASSERT(!r || is_final());
4703 bool NeedsSetter()
const;
4704 bool NeedsGetter()
const;
4707 return needs_load_guard() || (is_late() && !has_trivial_initializer());
4710 const char* GuardedPropertiesAsCString()
const;
4717 set_kind_bits(UnboxedBit::update(
b,
untag()->kind_bits_));
4723 set_is_unboxed_unsafe(
b);
4727 kUnknownLengthOffset = -1,
4728 kUnknownFixedLength = -1,
4729 kNoFixedLength = -2,
4733 set_kind_bits(IsLateBit::update(
value,
untag()->kind_bits_));
4737 set_kind_bits(IsExtensionMemberBit::update(
value,
untag()->kind_bits_));
4741 set_kind_bits(IsExtensionTypeMemberBit::update(
value,
untag()->kind_bits_));
4745 set_kind_bits(NeedsLoadGuardBit::update(
value,
untag()->kind_bits_));
4752 bool is_nullable()
const;
4756 set_is_nullable_unsafe(val);
4759 return LoadNonPointer<ClassIdTagType, std::memory_order_relaxed>(
4763 StoreNonPointer<ClassIdTagType, ClassIdTagType, std::memory_order_relaxed>(
4774 void InitializeGuardedListLengthInObjectOffset(
bool unsafe =
false)
const;
4780 WeakArrayPtr dependent_code()
const;
4781 void set_dependent_code(
const WeakArray& array)
const;
4784 void RegisterDependentCode(
const Code&
code)
const;
4787 void DeoptimizeDependentCode(
bool are_mutators_stopped =
false)
const;
4791 bool IsConsistentWith(
const Field& field)
const;
4793 bool IsUninitialized()
const;
4803 FunctionPtr EnsureInitializerFunction()
const;
4805 return untag()->initializer_function<std::memory_order_acquire>();
4808 bool HasInitializerFunction()
const;
4815 InstancePtr GetterClosure()
const;
4816 InstancePtr SetterClosure()
const;
4817 InstancePtr AccessorClosure(
bool make_setter)
const;
4820 static StringPtr GetterName(
const String& field_name);
4821 static StringPtr GetterSymbol(
const String& field_name);
4823 static StringPtr LookupGetterSymbol(
const String& field_name);
4824 static StringPtr SetterName(
const String& field_name);
4825 static StringPtr SetterSymbol(
const String& field_name);
4827 static StringPtr LookupSetterSymbol(
const String& field_name);
4828 static StringPtr NameFromGetter(
const String& getter_name);
4829 static StringPtr NameFromSetter(
const String& setter_name);
4830 static StringPtr NameFromInit(
const String& init_name);
4841 bool is_reflectable,
4852 kHasNontrivialInitializerBit,
4855 kInitializerChangedAfterInitializationBit,
4858 kGenericCovariantImplBit,
4860 kIsExtensionMemberBit,
4861 kIsExtensionTypeMemberBit,
4866 class ConstBit :
public BitField<uint16_t, bool, kConstBit, 1> {};
4867 class StaticBit :
public BitField<uint16_t, bool, kStaticBit, 1> {};
4868 class FinalBit :
public BitField<uint16_t, bool, kFinalBit, 1> {};
4869 class HasNontrivialInitializerBit
4870 :
public BitField<uint16_t, bool, kHasNontrivialInitializerBit, 1> {};
4871 class UnboxedBit :
public BitField<uint16_t, bool, kUnboxedBit, 1> {};
4872 class ReflectableBit :
public BitField<uint16_t, bool, kReflectableBit, 1> {};
4873 class InitializerChangedAfterInitializationBit
4874 :
public BitField<uint16_t,
4876 kInitializerChangedAfterInitializationBit,
4878 class HasPragmaBit :
public BitField<uint16_t, bool, kHasPragmaBit, 1> {};
4879 class CovariantBit :
public BitField<uint16_t, bool, kCovariantBit, 1> {};
4880 class GenericCovariantImplBit
4881 :
public BitField<uint16_t, bool, kGenericCovariantImplBit, 1> {};
4882 class IsLateBit :
public BitField<uint16_t, bool, kIsLateBit, 1> {};
4883 class IsExtensionMemberBit
4884 :
public BitField<uint16_t, bool, kIsExtensionMemberBit, 1> {};
4885 class IsExtensionTypeMemberBit
4886 :
public BitField<uint16_t, bool, kIsExtensionTypeMemberBit, 1> {};
4887 class NeedsLoadGuardBit
4888 :
public BitField<uint16_t, bool, kNeedsLoadGuardBit, 1> {};
4889 class HasInitializerBit
4890 :
public BitField<uint16_t, bool, kHasInitializerBit, 1> {};
4891 class SharedBit :
public BitField<uint16_t, bool, kSharedBit, 1> {};
4894 void ForceDynamicGuardedCidAndLength()
const;
4896 void set_name(
const String&
value)
const;
4897 void set_is_static(
bool is_static)
const {
4899 set_kind_bits(StaticBit::update(is_static,
untag()->kind_bits_));
4901 void set_is_final(
bool is_final)
const {
4903 set_kind_bits(FinalBit::update(is_final,
untag()->kind_bits_));
4905 void set_is_const(
bool value)
const {
4907 set_kind_bits(ConstBit::update(
value,
untag()->kind_bits_));
4910 void set_token_pos(TokenPosition token_pos)
const {
4913 void set_end_token_pos(TokenPosition token_pos)
const {
4916 void set_kind_bits(uint16_t
value)
const {
4917 StoreNonPointer<uint16_t, uint16_t, std::memory_order_release>(
4921 static FieldPtr New();
4936 StringPtr resolved_url()
const;
4937 bool HasSource()
const;
4938 StringPtr Source()
const;
4939 bool IsPartOfDartColonLibrary()
const;
4941 GrowableObjectArrayPtr GenerateLineNumberArray()
const;
4952#if !defined(DART_PRECOMPILED_RUNTIME)
4955 intptr_t script_index,
4968 TypedDataPtr line_starts()
const;
4970#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
4971 TypedDataViewPtr constant_coverage()
const;
4974 LibraryPtr FindLibrary()
const;
4976 StringPtr GetSnippet(intptr_t from_line,
4977 intptr_t from_column,
4979 intptr_t to_column)
const;
4990 intptr_t* column =
nullptr)
const;
4994 intptr_t GetTokenLength(
const TokenPosition& token_pos)
const;
4999 bool TokenRangeAtLine(intptr_t line_number,
5009 static ScriptPtr New(
const String& url,
5010 const String& resolved_url,
5013#if !defined(DART_PRECOMPILED_RUNTIME)
5014 void LoadSourceFromKernel(
const uint8_t* kernel_buffer,
5015 intptr_t kernel_buffer_len)
const;
5018 void CollectTokenPositionsFor()
const;
5019 ArrayPtr CollectConstConstructorCoverageFrom()
const;
5022 KernelProgramInfoPtr kernel_program_info()
const {
5023 return untag()->kernel_program_info();
5026 void set_debug_positions(
const Array&
value)
const;
5028#if !defined(DART_PRECOMPILED_RUNTIME)
5029 bool HasCachedMaxPosition()
const;
5031 void SetHasCachedMaxPosition(
bool value)
const;
5032 void SetCachedMaxPosition(intptr_t
value)
const;
5035 void set_resolved_url(
const String&
value)
const;
5036 void set_source(
const String&
value)
const;
5037 void set_load_timestamp(int64_t
value)
const;
5038 ArrayPtr debug_positions()
const;
5055 void MoveToNextObject();
5057 const Array& array_;
5075 IterationKind kind = kNoIteratePrivate);
5078 return (next_ix_ < size_) || !toplevel_class_.IsNull();
5082 ClassPtr GetNextClass();
5085 void MoveToNextClass();
5087 Class& toplevel_class_;
5098 static StringPtr
UrlOf(LibraryPtr lib) {
return lib->untag()->url(); }
5101 return untag()->load_state_ == UntaggedLibrary::kAllocated;
5104 return untag()->load_state_ == UntaggedLibrary::kLoadRequested;
5107 return untag()->load_state_ == UntaggedLibrary::kLoadInProgress;
5109 void SetLoadRequested()
const;
5110 void SetLoadInProgress()
const;
5112 return untag()->load_state_ == UntaggedLibrary::kLoaded;
5114 void SetLoaded()
const;
5123 static LibraryPtr New(
const String& url);
5126 const Array& arguments,
5127 const Array& argument_names,
5128 bool respect_reflectable =
true,
5129 bool check_is_entrypoint =
false)
const;
5131 bool throw_nsm_if_absent,
5132 bool respect_reflectable =
true,
5133 bool check_is_entrypoint =
false)
const;
5136 bool respect_reflectable =
true,
5137 bool check_is_entrypoint =
false)
const;
5146 const Array& type_definitions,
5147 const Array& param_values,
5161 LibraryPrefixPtr LookupLocalLibraryPrefix(
const String&
name)
const;
5164 ClassPtr LookupClass(
const String&
name)
const;
5165 ClassPtr LookupClassAllowPrivate(
const String&
name)
const;
5166 FieldPtr LookupFieldAllowPrivate(
const String&
name)
const;
5167 FunctionPtr LookupFunctionAllowPrivate(
const String&
name)
const;
5175 ScriptPtr LookupScript(
const String& url,
bool useResolvedUri =
false)
const;
5176 ArrayPtr LoadedScripts()
const;
5178 void AddExport(
const Namespace& ns)
const;
5180 void AddMetadata(
const Object& declaration, intptr_t kernel_offset)
const;
5183#if !defined(DART_PRECOMPILED_RUNTIME)
5184 void EvaluatePragmas();
5185 void CopyPragmas(
const Library& old_lib);
5201 static bool FindPragma(
Thread*
T,
5204 const String& pragma_name,
5205 bool multiple =
false,
5209 void set_toplevel_class(
const Class&
value)
const;
5212 return untag()->used_scripts();
5218 void AddImport(
const Namespace& ns)
const;
5220 NamespacePtr ImportAt(intptr_t index)
const;
5221 LibraryPtr ImportLibraryAt(intptr_t index)
const;
5224 void set_dependencies(
const Array& deps)
const;
5226 void DropDependenciesAndCaches()
const;
5230 return LoadNonPointer<Dart_NativeEntryResolver, std::memory_order_relaxed>(
5231 &
untag()->native_entry_resolver_);
5235 std::memory_order_relaxed>(&
untag()->native_entry_resolver_,
5239 return LoadNonPointer<Dart_NativeEntrySymbol, std::memory_order_relaxed>(
5240 &
untag()->native_entry_symbol_resolver_);
5245 std::memory_order_relaxed>(
5246 &
untag()->native_entry_symbol_resolver_, native_symbol_resolver);
5251 return LoadNonPointer<Dart_FfiNativeResolver, std::memory_order_relaxed>(
5252 &
untag()->ffi_native_resolver_);
5256 std::memory_order_relaxed>(&
untag()->ffi_native_resolver_,
5265 UntaggedLibrary::InFullSnapshotBit::update(
value,
untag()->flags_));
5268 StringPtr PrivateName(
const String&
name)
const;
5278 static void RegisterLibraries(
Thread* thread,
5285 set_flags(UntaggedLibrary::DebuggableBit::update(
value,
untag()->flags_));
5292 set_flags(UntaggedLibrary::DartSchemeBit::update(
value,
untag()->flags_));
5296 bool IsAnyCoreLibrary()
const;
5298 inline intptr_t UrlHash()
const;
5300#if !defined(DART_PRECOMPILED_RUNTIME)
5302 return untag()->kernel_program_info();
5305 TypedDataViewPtr KernelLibrary()
const;
5306 intptr_t KernelLibraryOffset()
const;
5310#if defined(DART_PRECOMPILED_RUNTIME)
5313 return untag()->kernel_library_index_;
5318#if defined(DART_PRECOMPILED_RUNTIME)
5326 static LibraryPtr LookupLibrary(
Thread* thread,
const String& url);
5327 static LibraryPtr GetLibrary(intptr_t index);
5329 static void InitCoreLibrary(
IsolateGroup* isolate_group);
5330 static void InitNativeWrappersLibrary(
IsolateGroup* isolate_group,
5331 bool is_kernel_file);
5333 static LibraryPtr AsyncLibrary();
5334 static LibraryPtr ConvertLibrary();
5335 static LibraryPtr CoreLibrary();
5336 static LibraryPtr CollectionLibrary();
5337 static LibraryPtr DeveloperLibrary();
5338 static LibraryPtr FfiLibrary();
5339 static LibraryPtr InternalLibrary();
5340 static LibraryPtr IsolateLibrary();
5341 static LibraryPtr MathLibrary();
5342#if !defined(DART_PRECOMPILED_RUNTIME)
5343 static LibraryPtr MirrorsLibrary();
5345 static LibraryPtr NativeWrappersLibrary();
5346 static LibraryPtr TypedDataLibrary();
5347 static LibraryPtr VMServiceLibrary();
5350 static ErrorPtr CompileAll(
bool ignore_error =
false);
5351#if !defined(DART_PRECOMPILED_RUNTIME)
5353 static ErrorPtr FinalizeAllClasses();
5356#if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
5359 static void CheckFunctionFingerprints();
5365 static const String& PrivateCoreLibName(
const String& member);
5368 static bool IsPrivateCoreLibName(
const String&
name,
const String& member);
5380 static const char kPrivateIdentifierStart =
'_';
5384 static const char kPrivateKeySeparator =
'@';
5386 void CheckReload(
const Library& replacement,
5395 void EnsureTopLevelClassIsFinalized()
const;
5398 static constexpr int kInitialImportsCapacity = 4;
5399 static constexpr int kImportsCapacityIncrement = 8;
5401 static LibraryPtr New();
5406 void set_url(
const String& url)
const;
5407 void set_private_key(
const String&
key)
const;
5409 void set_num_imports(intptr_t
value)
const;
5410 void set_flags(uint8_t
flags)
const;
5411 bool HasExports()
const;
5412 ArrayPtr loaded_scripts()
const {
return untag()->loaded_scripts(); }
5413 ArrayPtr metadata()
const {
5416 return untag()->metadata();
5418 void set_metadata(
const Array&
value)
const;
5419 ArrayPtr dictionary()
const {
return untag()->dictionary(); }
5420 void InitClassDictionary()
const;
5422 void InitImportList()
const;
5423 void RehashDictionary(
const Array& old_dict, intptr_t new_dict_size)
const;
5424 static LibraryPtr NewLibraryHelper(
const String& url,
bool import_core_lib);
5425 ObjectPtr LookupEntry(
const String&
name, intptr_t* index)
const;
5426 ObjectPtr LookupLocalObject(
const String&
name)
const;
5427 ObjectPtr LookupLocalObjectAllowPrivate(
const String&
name)
const;
5429 void AllocatePrivateKey()
const;
5461 static NamespacePtr New(
const Library& library,
5462 const Array& show_names,
5463 const Array& hide_names,
5467 static NamespacePtr New();
5476 static KernelProgramInfoPtr New(
const TypedDataBase& kernel_component,
5484 const Array& libraries_cache,
5485 const Array& classes_cache);
5494 return untag()->kernel_component();
5501 return untag()->metadata_payloads();
5505 return untag()->metadata_mappings();
5508 intptr_t KernelLibraryStartOffset(intptr_t library_index)
const;
5509 intptr_t KernelLibraryEndOffset(intptr_t library_index)
const;
5510 TypedDataViewPtr KernelLibrary(intptr_t library_index)
const;
5513 return untag()->constants_table();
5522 void set_constants(
const Array& constants)
const;
5524 ScriptPtr ScriptAt(intptr_t index)
const;
5527 void set_libraries_cache(
const Array&
cache)
const;
5528 LibraryPtr LookupLibrary(
Thread* thread,
const Smi& name_index)
const;
5529 LibraryPtr InsertLibrary(
Thread* thread,
5530 const Smi& name_index,
5534 void set_classes_cache(
const Array&
cache)
const;
5535 ClassPtr LookupClass(
Thread* thread,
const Smi& name_index)
const;
5536 ClassPtr InsertClass(
Thread* thread,
5537 const Smi& name_index,
5538 const Class& klass)
const;
5541 static KernelProgramInfoPtr New();
5563 : obj_(obj), type_(
EntryType::kTaggedObject) {}
5597 ASSERT((index >= 0) && (index <= Length()));
5602 ASSERT((index >= 0) && (index <= Length()));
5607 ASSERT((index >= 0) && (index <= Length()));
5622 ASSERT(index >= 0 && index <= Length());
5623 const uint8_t
bits = EncodeBits(
type, patchable, snapshot_behavior);
5627 template <std::memory_order order = std::memory_order_relaxed>
5629 ASSERT(TypeAt(index) == EntryType::kTaggedObject);
5630 return LoadPointer<ObjectPtr, order>(&(EntryAddr(index)->raw_obj_));
5633 template <std::memory_order order = std::memory_order_relaxed>
5635 ASSERT((TypeAt(index) == EntryType::kTaggedObject) ||
5636 (TypeAt(index) == EntryType::kImmediate && obj.IsSmi()));
5637 StorePointer<ObjectPtr, order>(&EntryAddr(index)->raw_obj_, obj.
ptr());
5641 ASSERT(TypeAt(index) != EntryType::kTaggedObject);
5642 return EntryAddr(index)->raw_value_;
5645 ASSERT(TypeAt(index) != EntryType::kTaggedObject);
5655 static constexpr intptr_t kBytesPerElement =
5657 static constexpr intptr_t kMaxElements =
kSmiMax / kBytesPerElement;
5665 (
len * kBytesPerElement));
5668 static ObjectPoolPtr NewFromBuilder(
5670 static ObjectPoolPtr New(intptr_t
len);
5679#if defined(DART_PRECOMPILER)
5692 void DebugPrint()
const;
5696 ASSERT((index >= 0) && (index < Length()));
5697 return &
untag()->data()[index];
5711 kFlagsPos = kSizePos + kSizeSize,
5715#define INSTRUCTIONS_FLAGS_LIST(V) \
5716 V(HasMonomorphicEntry) \
5720#define DEFINE_INSTRUCTIONS_FLAG(Name) k##Name##Index,
5722#undef DEFINE_INSTRUCTIONS_FLAG
5727#define DEFINE_INSTRUCTIONS_FLAG_HANDLING(Name) \
5729 : public BitField<uint32_t, bool, kFlagsPos + k##Name##Index, 1> {}; \
5730 bool Name() const { return Name##Bit::decode(untag()->size_and_flags_); } \
5731 static bool Name(const InstructionsPtr instr) { \
5732 return Name##Bit::decode(instr->untag()->size_and_flags_); \
5737#undef DEFINE_INSTRUCTIONS_FLAG_HANDLING
5741 static intptr_t
Size(
const InstructionsPtr instr) {
5754#if defined(TARGET_ARCH_IA32)
5755 static constexpr intptr_t kMonomorphicEntryOffsetJIT = 6;
5756 static constexpr intptr_t kPolymorphicEntryOffsetJIT = 36;
5757 static constexpr intptr_t kMonomorphicEntryOffsetAOT = 0;
5758 static constexpr intptr_t kPolymorphicEntryOffsetAOT = 0;
5759#elif defined(TARGET_ARCH_X64)
5760 static constexpr intptr_t kMonomorphicEntryOffsetJIT = 8;
5761 static constexpr intptr_t kPolymorphicEntryOffsetJIT = 42;
5762 static constexpr intptr_t kMonomorphicEntryOffsetAOT = 8;
5763 static constexpr intptr_t kPolymorphicEntryOffsetAOT = 22;
5764#elif defined(TARGET_ARCH_ARM)
5765 static constexpr intptr_t kMonomorphicEntryOffsetJIT = 0;
5766 static constexpr intptr_t kPolymorphicEntryOffsetJIT = 44;
5767 static constexpr intptr_t kMonomorphicEntryOffsetAOT = 0;
5768 static constexpr intptr_t kPolymorphicEntryOffsetAOT = 16;
5769#elif defined(TARGET_ARCH_ARM64)
5770 static constexpr intptr_t kMonomorphicEntryOffsetJIT = 8;
5771 static constexpr intptr_t kPolymorphicEntryOffsetJIT = 52;
5772 static constexpr intptr_t kMonomorphicEntryOffsetAOT = 8;
5773 static constexpr intptr_t kPolymorphicEntryOffsetAOT = 24;
5774#elif defined(TARGET_ARCH_RISCV32)
5775 static constexpr intptr_t kMonomorphicEntryOffsetJIT = 6;
5776 static constexpr intptr_t kPolymorphicEntryOffsetJIT = 44;
5777 static constexpr intptr_t kMonomorphicEntryOffsetAOT = 6;
5778 static constexpr intptr_t kPolymorphicEntryOffsetAOT = 18;
5779#elif defined(TARGET_ARCH_RISCV64)
5780 static constexpr intptr_t kMonomorphicEntryOffsetJIT = 6;
5781 static constexpr intptr_t kPolymorphicEntryOffsetJIT = 44;
5782 static constexpr intptr_t kMonomorphicEntryOffsetAOT = 6;
5783 static constexpr intptr_t kPolymorphicEntryOffsetAOT = 18;
5785#error Missing entry offsets for current architecture
5789 uword entry = PayloadStart(instr);
5790 if (HasMonomorphicEntry(instr)) {
5791 entry += !FLAG_precompiled_mode ? kMonomorphicEntryOffsetJIT
5792 : kMonomorphicEntryOffsetAOT;
5798 uword entry = PayloadStart(instr);
5799 if (HasMonomorphicEntry(instr)) {
5800 entry += !FLAG_precompiled_mode ? kPolymorphicEntryOffsetJIT
5801 : kPolymorphicEntryOffsetAOT;
5806 static constexpr intptr_t kMaxElements =
5815 static constexpr intptr_t kBarePayloadAlignment = 4;
5819 static constexpr intptr_t kNonBarePayloadAlignment =
kWordSize;
5826#if defined(DART_PRECOMPILED_RUNTIME)
5830 kNonBarePayloadAlignment);
5840#if defined(DART_PRECOMPILED_RUNTIME)
5847#if defined(DART_PRECOMPILED_RUNTIME)
5850 return static_cast<InstructionsPtr
>(payload_start -
HeaderSize() +
5858 static bool Equals(InstructionsPtr
a, InstructionsPtr
b) {
5867 if (
a->untag()->size_and_flags_ !=
b->untag()->size_and_flags_) {
5871 return memcmp(
a->untag()->data(),
b->untag()->data(),
Size(
a)) == 0;
5876 static uint32_t
Hash(
const InstructionsPtr instr) {
5877 return HashBytes(
reinterpret_cast<const uint8_t*
>(PayloadStart(instr)),
5885 friend struct RelocatorTestHelper;
5887 void SetSize(intptr_t
value)
const {
5890 SizeBits::update(
value,
untag()->size_and_flags_));
5893#define DEFINE_INSTRUCTIONS_FLAG_HANDLING(Name) \
5894 void Set##Name(bool value) const { \
5895 StoreNonPointer(&untag()->size_and_flags_, \
5896 Name##Bit::update(value, untag()->size_and_flags_)); \
5901#undef DEFINE_INSTRUCTIONS_FLAG_HANDLING
5907 static InstructionsPtr New(intptr_t
size,
5908 bool has_monomorphic_entry,
5909 bool should_be_aligned);
5914 friend class AssemblyImageWriter;
5932 static intptr_t
Size(
const InstructionsSectionPtr instr) {
5933 return instr->untag()->payload_length_;
5945 static constexpr intptr_t kPayloadAlignment = 32;
5973 static InstructionsTablePtr New(intptr_t
length,
5978 void SetCodeAt(intptr_t index, CodePtr
code)
const;
5981 static bool ContainsPc(InstructionsTablePtr
table,
uword pc);
5983 static CodePtr FindCode(InstructionsTablePtr
table,
uword pc);
5989 InstructionsTablePtr
table);
6002 uword EntryPointAt(intptr_t index)
const;
6005 uword start_pc()
const {
return InstructionsTable::start_pc(this->
ptr()); }
6006 static uword start_pc(InstructionsTablePtr
table) {
6007 return table->untag()->start_pc_;
6010 uword end_pc()
const {
return InstructionsTable::end_pc(this->
ptr()); }
6011 static uword end_pc(InstructionsTablePtr
table) {
6012 return table->untag()->end_pc_;
6015 ArrayPtr code_objects()
const {
return untag()->code_objects_; }
6017 void set_length(intptr_t
value)
const;
6020 void set_code_objects(
const Array&
value)
const;
6021 void set_rodata(
uword rodata)
const;
6023 uint32_t ConvertPcToOffset(
uword pc)
const {
6024 return InstructionsTable::ConvertPcToOffset(this->
ptr(), pc);
6026 static uint32_t ConvertPcToOffset(InstructionsTablePtr
table,
uword pc);
6028 static intptr_t FindEntry(InstructionsTablePtr
table,
6030 intptr_t start_index = 0);
6039 intptr_t Length()
const;
6041 StringPtr GetName(intptr_t var_index)
const;
6043 void SetVar(intptr_t var_index,
6047 void GetInfo(intptr_t var_index,
6050 static constexpr intptr_t kBytesPerElement =
6052 static constexpr intptr_t kMaxElements =
6068 static LocalVarDescriptorsPtr New(intptr_t num_variables);
6070 static const char* KindToCString(
6081 static constexpr intptr_t kBytesPerElement = 1;
6082 static constexpr intptr_t kMaxElements =
kMaxInt32 / kBytesPerElement;
6086 return UnroundedSize(
desc->untag()->length_);
6099 static PcDescriptorsPtr New(
const void* delta_encoded_data, intptr_t
size);
6104 void PrintToJSONObject(
JSONObject* jsobj,
bool ref)
const;
6113 : descriptors_(descriptors),
6114 kind_mask_(kind_mask),
6128 while (byte_index_ < descriptors_.Length()) {
6129 const int32_t kind_and_metadata =
stream.ReadSLEB128<int32_t>();
6138 cur_pc_offset_ +=
stream.ReadSLEB128();
6140 if (!FLAG_precompiled_mode) {
6141 cur_deopt_id_ +=
stream.ReadSLEB128();
6143 cur_token_pos_,
stream.ReadSLEB128<int32_t>());
6145 byte_index_ =
stream.Position();
6147 if ((cur_kind_ & kind_mask_) != 0) {
6155 intptr_t
DeoptId()
const {
return cur_deopt_id_; }
6171 descriptors_(iter.descriptors_),
6172 kind_mask_(iter.kind_mask_),
6173 byte_index_(iter.byte_index_),
6174 cur_pc_offset_(iter.cur_pc_offset_),
6175 cur_kind_(iter.cur_kind_),
6176 cur_deopt_id_(iter.cur_deopt_id_),
6177 cur_token_pos_(iter.cur_token_pos_),
6178 cur_try_index_(iter.cur_try_index_),
6179 cur_yield_index_(iter.cur_yield_index_) {}
6182 const intptr_t kind_mask_;
6183 intptr_t byte_index_;
6185 intptr_t cur_pc_offset_;
6187 intptr_t cur_deopt_id_;
6188 int32_t cur_token_pos_;
6189 intptr_t cur_try_index_;
6190 intptr_t cur_yield_index_;
6193 intptr_t Length()
const;
6195 if (Length() != other.
Length()) {
6199 return memcmp(
untag()->
data(), other.untag()->data(), Length()) == 0;
6209 static PcDescriptorsPtr New(intptr_t
length);
6211 void SetLength(intptr_t
value)
const;
6212 void CopyData(
const void* bytes, intptr_t
size);
6221 static constexpr intptr_t kBytesPerElement = 1;
6222 static constexpr intptr_t kMaxElements =
kMaxInt32 / kBytesPerElement;
6226 return UnroundedSize(
map->untag()->length_);
6239 static CodeSourceMapPtr New(intptr_t
length);
6245 if (Length() != other.
Length()) {
6249 return memcmp(
untag()->
data(), other.untag()->data(), Length()) == 0;
6260 void SetLength(intptr_t
value)
const;
6272 raw->untag()->payload()->flags_and_size());
6280 if (
untag()->payload()->flags_and_size() !=
6281 other.untag()->payload()->flags_and_size()) {
6285 return memcmp(
data(), other.
data(), payload_size()) == 0;
6307 raw->untag()->payload()->flags_and_size());
6313 raw->untag()->payload()->flags_and_size());
6317 return New(payload,
size,
false,
6322 return New(payload,
size,
false,
6328 return New(payload,
size,
true,
6341 bool IsNull()
const {
return payload_ ==
nullptr; }
6351 payload_ = maps.untag()->payload();
6357 payload_ = maps.untag()->payload();
6363 payload()->flags_and_size());
6365 const uint8_t*
data()
const {
return payload()->data(); }
6369 payload()->flags_and_size());
6374 payload()->flags_and_size());
6381 template <
typename PayloadHandle>
6384 Iterator(
const PayloadHandle& maps,
const PayloadHandle& global_table)
6386 bits_container_(maps.UsesGlobalTable() ? global_table : maps) {
6388 ASSERT(!bits_container_.IsNull());
6389 ASSERT(!maps_.IsGlobalTable());
6390 ASSERT(!maps_.UsesGlobalTable() || bits_container_.IsGlobalTable());
6395 bits_container_(it.bits_container_),
6396 next_offset_(it.next_offset_),
6397 current_pc_offset_(it.current_pc_offset_),
6398 current_global_table_offset_(it.current_global_table_offset_),
6399 current_spill_slot_bit_count_(it.current_spill_slot_bit_count_),
6400 current_non_spill_slot_bit_count_(it.current_spill_slot_bit_count_),
6401 current_bits_offset_(it.current_bits_offset_) {}
6406 if (next_offset_ >= maps_.payload_size()) {
6413 auto const pc_delta =
stream.ReadLEB128();
6415 current_pc_offset_ += pc_delta;
6422 if (maps_.UsesGlobalTable()) {
6423 current_global_table_offset_ =
stream.ReadLEB128();
6424 ASSERT(current_global_table_offset_ < bits_container_.payload_size());
6430 current_spill_slot_bit_count_ = -1;
6431 current_non_spill_slot_bit_count_ = -1;
6432 current_bits_offset_ = -1;
6434 next_offset_ =
stream.Position();
6436 current_spill_slot_bit_count_ =
stream.ReadLEB128();
6437 ASSERT(current_spill_slot_bit_count_ >= 0);
6439 current_non_spill_slot_bit_count_ =
stream.ReadLEB128();
6440 ASSERT(current_non_spill_slot_bit_count_ >= 0);
6442 const auto stackmap_bits =
6443 current_spill_slot_bit_count_ + current_non_spill_slot_bit_count_;
6444 const uintptr_t stackmap_size =
6446 ASSERT(stackmap_size <= (maps_.payload_size() -
stream.Position()));
6448 current_bits_offset_ =
stream.Position();
6449 next_offset_ = current_bits_offset_ + stackmap_size;
6460 if (pc_offset == 0)
return false;
6462 if (current_pc_offset_ >= pc_offset)
break;
6463 }
while (MoveNext());
6464 return current_pc_offset_ == pc_offset;
6472 ASSERT(HasLoadedEntry());
6473 return current_pc_offset_;
6478 EnsureFullyLoadedEntry();
6479 return current_spill_slot_bit_count_ + current_non_spill_slot_bit_count_;
6483 EnsureFullyLoadedEntry();
6484 return current_spill_slot_bit_count_;
6489 EnsureFullyLoadedEntry();
6490 ASSERT(bit_index >= 0 && bit_index < Length());
6492 const intptr_t bit_remainder = bit_index & (
kBitsPerByte - 1);
6493 uint8_t byte_mask = 1U << bit_remainder;
6494 const intptr_t byte_offset = current_bits_offset_ + byte_index;
6496 return (bits_container_.data()[byte_offset] & byte_mask) != 0;
6500 bool HasLoadedEntry()
const {
return next_offset_ > 0; }
6504 void LazyLoadGlobalTableEntry()
const {
6505 ASSERT(maps_.UsesGlobalTable());
6506 ASSERT(HasLoadedEntry());
6507 ASSERT(current_global_table_offset_ < bits_container_.payload_size());
6511 current_global_table_offset_);
6513 current_spill_slot_bit_count_ =
stream.ReadLEB128();
6514 ASSERT(current_spill_slot_bit_count_ >= 0);
6516 current_non_spill_slot_bit_count_ =
stream.ReadLEB128();
6517 ASSERT(current_non_spill_slot_bit_count_ >= 0);
6519 const auto stackmap_bits = Length();
6520 const uintptr_t stackmap_size =
6523 (bits_container_.payload_size() -
stream.Position()));
6525 current_bits_offset_ =
stream.Position();
6528 void EnsureFullyLoadedEntry()
const {
6529 ASSERT(HasLoadedEntry());
6530 if (current_spill_slot_bit_count_ < 0) {
6531 LazyLoadGlobalTableEntry();
6532 ASSERT(current_spill_slot_bit_count_ >= 0);
6536 const PayloadHandle& maps_;
6537 const PayloadHandle& bits_container_;
6539 uintptr_t next_offset_ = 0;
6540 uint32_t current_pc_offset_ = 0;
6542 uintptr_t current_global_table_offset_ = 0;
6546 mutable intptr_t current_spill_slot_bit_count_ = -1;
6547 mutable intptr_t current_non_spill_slot_bit_count_ = -1;
6548 mutable intptr_t current_bits_offset_ = -1;
6560 const char* separator)
const;
6563 static CompressedStackMapsPtr New(
const void* payload,
6565 bool is_global_table,
6566 bool uses_global_table);
6574 static constexpr intptr_t kInvalidPcOffset = 0;
6576 intptr_t num_entries()
const;
6578 bool has_async_handler()
const;
6579 void set_has_async_handler(
bool value)
const;
6583 uword HandlerPCOffset(intptr_t try_index)
const;
6584 intptr_t OuterTryIndex(intptr_t try_index)
const;
6585 bool NeedsStackTrace(intptr_t try_index)
const;
6586 bool IsGenerated(intptr_t try_index)
const;
6588 void SetHandlerInfo(intptr_t try_index,
6589 intptr_t outer_try_index,
6590 uword handler_pc_offset,
6591 bool needs_stacktrace,
6593 bool is_generated)
const;
6595 ArrayPtr GetHandledTypes(intptr_t try_index)
const;
6596 void SetHandledTypes(intptr_t try_index,
const Array& handled_types)
const;
6597 bool HasCatchAll(intptr_t try_index)
const;
6616 static ExceptionHandlersPtr New(intptr_t num_handlers);
6617 static ExceptionHandlersPtr New(
const Array& handled_types_data);
6630 static constexpr intptr_t kMaxHandlers = 1024 * 1024;
6632 void set_handled_types_data(
const Array&
value)
const;
6664 return obj->
untag()->target();
6668#if defined(DART_PRECOMPILER)
6669 if (obj->IsHeapObject() && obj->IsWeakSerializationReference()) {
6670 return TargetOf(
static_cast<WeakSerializationReferencePtr
>(obj));
6698 static inline intptr_t LengthOf(
const WeakArrayPtr array);
6708 kBytesPerElement * index;
6711 intptr_t index = (offset_in_bytes - data_offset()) / kBytesPerElement;
6729 return untag()->element<std::memory_order_acquire>(index);
6732 untag()->set_element<std::memory_order_release>(index,
value.ptr());
6736 static constexpr intptr_t kMaxElements =
kSmiMax / kBytesPerElement;
6750 (
len * kBytesPerElement));
6765#if defined(DART_PRECOMPILED_RUNTIME)
6769 return untag()->active_instructions();
6776 return code->untag()->instructions();
6782#if !defined(DART_PRECOMPILED_RUNTIME)
6790 static const char* EntryKindToCString(
EntryKind kind);
6791 static bool ParseEntryKind(
const char* str,
EntryKind*
out);
6797 case EntryKind::kUnchecked:
6799 case EntryKind::kMonomorphic:
6801 case EntryKind::kMonomorphicUnchecked:
6820 void set_is_optimized(
bool value)
const;
6828 void set_is_force_optimized(
bool value)
const;
6831 void set_is_alive(
bool value)
const;
6837 void set_is_discarded(
bool value)
const;
6841#if defined(DART_PRECOMPILED_RUNTIME)
6842 return code->untag()->entry_point_ !=
6843 code->untag()->monomorphic_entry_point_;
6845 return Instructions::HasMonomorphicEntry(InstructionsOf(
code));
6852#if defined(DART_PRECOMPILED_RUNTIME)
6853 if (IsUnknownDartCode(
code))
return 0;
6854 const uword entry_offset = HasMonomorphicEntry(
code)
6855 ? Instructions::kPolymorphicEntryOffsetAOT
6857 return EntryPointOf(
code) - entry_offset;
6866#if defined(DART_PRECOMPILED_RUNTIME)
6867 return code->untag()->entry_point_;
6874 return code->untag()->unchecked_entry_point_;
6879#if defined(DART_PRECOMPILED_RUNTIME)
6880 return untag()->unchecked_entry_point_;
6882 return EntryPoint() +
untag()->unchecked_offset_;
6887#if defined(DART_PRECOMPILED_RUNTIME)
6888 return untag()->monomorphic_entry_point_;
6895#if defined(DART_PRECOMPILED_RUNTIME)
6896 return untag()->monomorphic_unchecked_entry_point_;
6898 return MonomorphicEntryPoint() +
untag()->unchecked_offset_;
6905#if defined(DART_PRECOMPILED_RUNTIME)
6907 return code->untag()->instructions_length_;
6913 ObjectPoolPtr GetObjectPool()
const;
6916 return ContainsInstructionAt(
ptr(),
addr);
6921 return UntaggedCode::ContainsPC(
code, pc);
6925 bool HasBreakpoint()
const;
6930 untag()->set_pc_descriptors(descriptors.
ptr());
6934 return untag()->code_source_map();
6939 untag()->set_code_source_map(code_source_map.
ptr());
6944#if defined(DART_PRECOMPILED_RUNTIME)
6948 return untag()->deopt_info_array();
6951 void set_deopt_info_array(
const Array& array)
const;
6953#if !defined(DART_PRECOMPILED_RUNTIME)
6954 intptr_t num_variables()
const;
6955 void set_num_variables(intptr_t num_variables)
const;
6958#if defined(DART_PRECOMPILED_RUNTIME) || defined(DART_PRECOMPILER)
6959 TypedDataPtr catch_entry_moves_maps()
const;
6960 void set_catch_entry_moves_maps(
const TypedData& maps)
const;
6964 return untag()->compressed_stackmaps();
6969 kPcRelativeCall = 1,
6970 kPcRelativeTTSCall = 2,
6971 kPcRelativeTailCall = 3,
6981 kSCallTableKindAndOffset = 0,
6982 kSCallTableCodeOrTypeTarget = 1,
6983 kSCallTableFunctionTarget = 2,
6984 kSCallTableEntryLength = 3,
6994 :
public BitField<intptr_t, CallEntryPoint, KindField::kNextBit, 1> {};
6996 :
public BitField<intptr_t, intptr_t, EntryPointField::kNextBit, 26> {};
6998 void set_static_calls_target_table(
const Array&
value)
const;
7000#if defined(DART_PRECOMPILED_RUNTIME)
7004 return untag()->static_calls_target_table();
7008 TypedDataPtr GetDeoptInfoAtPc(
uword pc,
7010 uint32_t* deopt_flags)
const;
7013 FunctionPtr GetStaticCallTargetFunctionAt(
uword pc)
const;
7015 void SetStaticCallTargetCodeAt(
uword pc,
const Code&
code)
const;
7016 void SetStubCallTargetCodeAt(
uword pc,
const Code&
code)
const;
7020#if defined(INCLUDE_IL_PRINTER)
7021 class Comments :
public ZoneAllocated,
public CodeComments {
7023 static Comments& New(intptr_t
count);
7025 intptr_t Length()
const override;
7027 void SetPCOffsetAt(intptr_t idx, intptr_t pc_offset);
7028 void SetCommentAt(intptr_t idx,
const String& comment);
7030 intptr_t PCOffsetAt(intptr_t idx)
const override;
7031 const char* CommentAt(intptr_t idx)
const override;
7034 explicit Comments(
const Array& comments);
7043 const Array& comments_;
7051 const CodeComments& comments()
const;
7052 void set_comments(
const CodeComments& comments)
const;
7060 return untag()->return_address_metadata();
7064 void SetPrologueOffset(intptr_t
offset)
const;
7066 intptr_t GetPrologueOffset()
const;
7068 ArrayPtr inlined_id_to_function()
const;
7069 void set_inlined_id_to_function(
const Array&
value)
const;
7079 void GetInlinedFunctionsAtInstruction(
7089 GetInlinedFunctionsAtInstruction(pc_offset - 1, functions, token_positions);
7093 void DumpInlineIntervals()
const;
7094 void DumpSourcePositions(
bool relative_addresses =
false)
const;
7101 return untag()->var_descriptors();
7114 LocalVarDescriptorsPtr GetLocalVarDescriptors()
const;
7117 return untag()->exception_handlers();
7121 untag()->set_exception_handlers(handlers.
ptr());
7131 ASSERT(IsFunctionCode());
7138 void set_owner(
const Object& owner)
const;
7143 if (!owner->IsHeapObject()) {
7154 static constexpr intptr_t kBytesPerElement =
7156 static constexpr intptr_t kMaxElements =
kSmiMax / kBytesPerElement;
7160 static constexpr intptr_t kElementSize = kBytesPerElement;
7171 (
len * kBytesPerElement));
7173#if !defined(DART_PRECOMPILED_RUNTIME)
7184 PoolAttachment pool_attachment,
7189 static void NotifyCodeObservers(
const Code&
code,
bool optimized);
7193 static void NotifyCodeObservers(
const char*
name,
7201 PoolAttachment pool_attachment,
7202 bool optimized =
false,
7204 static CodePtr FinalizeCodeAndNotify(
const char*
name,
7207 PoolAttachment pool_attachment,
7208 bool optimized =
false,
7212 static CodePtr FindCode(
uword pc, int64_t timestamp);
7213 static CodePtr FindCodeUnsafe(
uword pc);
7217 return *PointerOffsetAddrAt(index);
7222 uword GetPcForDeoptId(intptr_t deopt_id,
7224 intptr_t GetDeoptIdForOsr(
uword pc)
const;
7226 uint32_t
Hash()
const;
7227 const char*
Name()
const;
7234 return untag()->compile_timestamp_;
7238 bool IsStubCode()
const;
7239 bool IsAllocationStubCode()
const;
7240 bool IsTypeTestStubCode()
const;
7241 bool IsFunctionCode()
const;
7246 static bool IsUnknownDartCode(CodePtr
code);
7248 void DisableDartCode()
const;
7250 void DisableStubCode(
bool is_cls_parameterized)
const;
7253 if (!IsDisabled())
return;
7254 ResetActiveInstructions();
7259#if defined(DART_PRECOMPILED_RUNTIME)
7263 return code->untag()->instructions() !=
7264 code->untag()->active_instructions();
7269 untag()->set_object_pool(object_pool);
7273 void set_state_bits(intptr_t
bits)
const;
7277 friend struct RelocatorTestHelper;
7281 kForceOptimizedBit = 1,
7288 class OptimizedBit :
public BitField<int32_t, bool, kOptimizedBit, 1> {};
7292 class ForceOptimizedBit
7293 :
public BitField<int32_t, bool, kForceOptimizedBit, 1> {};
7295 class AliveBit :
public BitField<int32_t, bool, kAliveBit, 1> {};
7301 class DiscardedBit :
public BitField<int32_t, bool, kDiscardedBit, 1> {};
7304 :
public BitField<int32_t, intptr_t, kPtrOffBit, kPtrOffSize> {};
7306 static constexpr intptr_t kEntrySize =
sizeof(int32_t);
7308 void set_compile_timestamp(int64_t timestamp)
const {
7318 static void InitializeCachedEntryPointsFrom(CodePtr
code,
7319 InstructionsPtr instructions,
7320 uint32_t unchecked_offset);
7324 void SetActiveInstructions(
const Instructions& instructions,
7325 uint32_t unchecked_offset)
const;
7326 void SetActiveInstructionsSafe(
const Instructions& instructions,
7327 uint32_t unchecked_offset)
const;
7331 void ResetActiveInstructions()
const;
7333 void set_instructions(
const Instructions& instructions)
const {
7335 untag()->set_instructions(instructions.ptr());
7337#if !defined(DART_PRECOMPILED_RUNTIME)
7344 uint32_t UncheckedEntryPointOffset()
const {
7345 return UncheckedEntryPointOffsetOf(
ptr());
7347 static uint32_t UncheckedEntryPointOffsetOf(CodePtr
code) {
7348#if defined(DART_PRECOMPILED_RUNTIME)
7351 return code->untag()->unchecked_offset_;
7355 void set_pointer_offsets_length(intptr_t
value) {
7358 set_state_bits(PtrOffBits::update(
value,
untag()->state_bits_));
7360 int32_t* PointerOffsetAddrAt(
int index)
const {
7362 ASSERT(index < pointer_offsets_length());
7366 void SetPointerOffsetAt(
int index, int32_t offset_in_instructions) {
7367 NoSafepointScope no_safepoint;
7368 *PointerOffsetAddrAt(index) = offset_in_instructions;
7371 intptr_t BinarySearchInSCallTable(
uword pc)
const;
7372 static CodePtr LookupCodeInIsolateGroup(IsolateGroup* isolate_group,
7379 static CodePtr New(intptr_t pointer_offsets_length);
7398 friend class CodeKeyValueTrait;
7399 friend class InstanceCall;
7400 friend class StaticCall;
7419 return context->untag()->num_variables_;
7423 return untag()->element(context_index);
7425 inline void SetAt(intptr_t context_index,
const Object&
value)
const;
7427 intptr_t GetLevel()
const;
7429 void Dump(
int indent = 0)
const;
7432 static constexpr intptr_t kMaxElements =
kSmiMax / kBytesPerElement;
7436 static constexpr intptr_t kElementSize = kBytesPerElement;
7441 (kBytesPerElement * context_index);
7457 (
len * kBytesPerElement));
7463 void set_num_variables(intptr_t num_variables)
const {
7487 void SetTokenIndexAt(intptr_t scope_index,
TokenPosition token_pos)
const;
7489 TokenPosition DeclarationTokenIndexAt(intptr_t scope_index)
const;
7490 void SetDeclarationTokenIndexAt(intptr_t scope_index,
7493 StringPtr NameAt(intptr_t scope_index)
const;
7494 void SetNameAt(intptr_t scope_index,
const String&
name)
const;
7496 void ClearFlagsAt(intptr_t scope_index)
const;
7498 intptr_t LateInitOffsetAt(intptr_t scope_index)
const;
7499 void SetLateInitOffsetAt(intptr_t scope_index,
7500 intptr_t late_init_offset)
const;
7502#define DECLARE_FLAG_ACCESSORS(Name) \
7503 bool Is##Name##At(intptr_t scope_index) const; \
7504 void SetIs##Name##At(intptr_t scope_index, bool value) const;
7507#undef DECLARE_FLAG_ACCESSORS
7509 AbstractTypePtr TypeAt(intptr_t scope_index)
const;
7510 void SetTypeAt(intptr_t scope_index,
const AbstractType&
type)
const;
7512 intptr_t CidAt(intptr_t scope_index)
const;
7513 void SetCidAt(intptr_t scope_index, intptr_t
cid)
const;
7515 intptr_t ContextIndexAt(intptr_t scope_index)
const;
7516 void SetContextIndexAt(intptr_t scope_index, intptr_t context_index)
const;
7518 intptr_t ContextLevelAt(intptr_t scope_index)
const;
7519 void SetContextLevelAt(intptr_t scope_index, intptr_t context_level)
const;
7521 intptr_t KernelOffsetAt(intptr_t scope_index)
const;
7522 void SetKernelOffsetAt(intptr_t scope_index, intptr_t kernel_offset)
const;
7524 static constexpr intptr_t kBytesPerElement =
7525 sizeof(UntaggedContextScope::VariableDesc);
7526 static constexpr intptr_t kMaxElements =
kSmiMax / kBytesPerElement;
7532 static constexpr intptr_t kElementSize = kBytesPerElement;
7544 (
len * kBytesPerElement));
7547 static ContextScopePtr New(intptr_t num_variables,
bool is_implicit);
7550 void set_num_variables(intptr_t num_variables)
const {
7554 void set_is_implicit(
bool is_implicit)
const {
7558 const UntaggedContextScope::VariableDesc* VariableDescAddr(
7559 intptr_t index)
const {
7560 ASSERT((index >= 0) && (index < num_variables()));
7561 return untag()->VariableDescAddr(index);
7564 bool GetFlagAt(intptr_t scope_index, intptr_t bit_index)
const;
7565 void SetFlagAt(intptr_t scope_index, intptr_t bit_index,
bool value)
const;
7589 static SentinelPtr New();
7599 static constexpr intptr_t kInitialCapacity = 16;
7600 static constexpr intptr_t kSpreadFactor = 7;
7601 static constexpr double kLoadFactor = 0.50;
7609 ArrayPtr buckets()
const;
7610 void set_buckets(
const Array& buckets)
const;
7612 intptr_t mask()
const;
7613 void set_mask(intptr_t mask)
const;
7615 intptr_t filled_entry_count()
const;
7616 void set_filled_entry_count(intptr_t num)
const;
7643 static MegamorphicCachePtr New();
7647 void EnsureCapacityLocked()
const;
7650 void InsertEntryLocked(
const Smi& class_id,
const Object&
target)
const;
7652 static inline void SetEntry(
const Array& array,
7654 const Smi& class_id,
7658 static inline ObjectPtr GetTargetFunction(
const Array& array, intptr_t index);
7689 kInstanceCidOrSignature = 0,
7690 kInstanceTypeArguments = 1,
7691 kInstantiatorTypeArguments = 2,
7692 kFunctionTypeArguments = 3,
7693 kInstanceParentFunctionTypeArguments = 4,
7694 kInstanceDelayedFunctionTypeArguments = 5,
7695 kDestinationType = 6,
7697 kTestEntryLength = 8,
7701 static_assert(kInstanceCidOrSignature == 0 &&
7702 kDestinationType + 1 == kTestResult &&
7703 kTestResult + 1 == kTestEntryLength,
7704 "Need to adjust number of max inputs");
7705 static constexpr intptr_t kMaxInputs = kTestResult;
7708 intptr_t NumberOfChecks()
const;
7715 const Object& instance_class_id_or_signature,
7720 const TypeArguments& instance_parent_function_type_arguments,
7722 const Bool& test_result)
const;
7723 void GetCheck(intptr_t ix,
7724 Object* instance_class_id_or_signature,
7731 Bool* test_result)
const;
7735 void GetCurrentCheck(intptr_t ix,
7736 Object* instance_class_id_or_signature,
7743 Bool* test_result)
const;
7749 bool GetNextCheck(intptr_t* ix,
7750 Object* instance_class_id_or_signature,
7757 Bool* test_result)
const;
7770 bool HasCheck(
const Object& instance_class_id_or_signature,
7775 const TypeArguments& instance_parent_function_type_arguments,
7784 void WriteEntryToBuffer(
Zone* zone,
7787 const char* line_prefix =
nullptr)
const;
7790 void WriteToBuffer(
Zone* zone,
7792 const char* line_prefix =
nullptr)
const;
7800 bool IsHash()
const;
7803 SubtypeTestCachePtr Copy(
Thread* thread)
const;
7805 static SubtypeTestCachePtr New(intptr_t num_inputs);
7814 ArrayPtr
cache()
const;
7825#if defined(TARGET_ARCH_IA32)
7828 static constexpr intptr_t kMaxLinearCacheEntries = 100;
7830 static constexpr intptr_t kMaxLinearCacheEntries = 30;
7835 bool IsOccupied(intptr_t index)
const;
7845 if (
count <= kMaxLinearCacheEntries)
return count;
7847 if (LoadFactor(
count, allocated_entries) >= kMaxLoadFactor) {
7848 allocated_entries *= 2;
7850 const intptr_t max_entries =
7851 static_cast<intptr_t
>(kMaxLoadFactor * allocated_entries);
7852 assert(LoadFactor(max_entries, allocated_entries) < kMaxLoadFactor);
7853 assert(max_entries >=
count);
7858 static constexpr double LoadFactor(intptr_t occupied, intptr_t capacity) {
7859 return occupied /
static_cast<double>(capacity);
7864 static intptr_t
NumEntries(
const Array& array);
7867 static bool IsLinear(
const Array& array) {
return !IsHash(array); }
7870 static bool IsHash(
const Array& array);
7872 struct KeyLocation {
7887 static KeyLocation FindKeyOrUnused(
7889 intptr_t num_inputs,
7890 const Object& instance_class_id_or_signature,
7891 const AbstractType& destination_type,
7892 const TypeArguments& instance_type_arguments,
7893 const TypeArguments& instantiator_type_arguments,
7894 const TypeArguments& function_type_arguments,
7895 const TypeArguments& instance_parent_function_type_arguments,
7896 const TypeArguments& instance_delayed_type_arguments);
7904 ArrayPtr EnsureCapacity(Zone* zone,
7906 intptr_t new_capacity,
7907 bool* was_grown)
const;
7912 static constexpr intptr_t kMaxLinearCacheSize =
7913 (kMaxLinearCacheEntries + 1) * kTestEntryLength;
7918 static constexpr intptr_t kNumInitialHashCacheEntries =
7921 "number of hash-based cache entries must be a power of two");
7924 static constexpr double kMaxLoadFactor = 0.71;
7927 void set_num_occupied(intptr_t
value)
const;
7930 static void GetCheckFromArray(
7932 intptr_t num_inputs,
7934 Object* instance_class_id_or_signature,
7946 void WriteCurrentEntryToBuffer(
Zone* zone,
7949 const char* line_prefix =
nullptr)
const;
7954 void WriteToBufferUnlocked(
Zone* zone,
7956 const char* line_prefix =
nullptr)
const;
7967 static constexpr intptr_t kIllegalId = 0;
7969 static constexpr intptr_t kRootId = 1;
7971 static LoadingUnitPtr New(intptr_t
id,
const LoadingUnit& parent);
7978 static intptr_t LoadingUnitOf(
const Code&
code);
7983 void set_base_objects(
const Array&
value)
const;
7992 UntaggedLoadingUnit::kLoaded;
7996 ASSERT(load_outstanding());
7997 auto const expected =
7998 value ? UntaggedLoadingUnit::kLoaded : UntaggedLoadingUnit::kNotLoaded;
7999 auto const got =
untag()
8002 expected, UntaggedLoadingUnit::kLoadOutstanding);
8011 UntaggedLoadingUnit::kLoadOutstanding;
8014 auto const previous = UntaggedLoadingUnit::kNotLoaded;
8018 auto const expected = UntaggedLoadingUnit::kLoadOutstanding;
8019 auto const got =
untag()
8022 expected, previous);
8030 return untag()->instructions_image_;
8033 ASSERT(load_outstanding());
8037 return loaded() && instructions_image() !=
nullptr;
8042 bool transient_error)
const;
8051 virtual const char* ToErrorCString()
const;
8067 virtual const char* ToErrorCString()
const;
8072 static ApiErrorPtr New();
8085 StringPtr FormatMessage()
const;
8092 static LanguageErrorPtr NewFormatted(
const Error& prev_error,
8095 bool report_after_token,
8101 static LanguageErrorPtr NewFormattedV(const
Error& prev_error,
8104 bool report_after_token,
8110 static LanguageErrorPtr New(const
String& formatted_message,
8114 virtual const
char* ToErrorCString() const;
8119 ErrorPtr previous_error()
const {
return untag()->previous_error(); }
8120 void set_previous_error(
const Error&
value)
const;
8122 ScriptPtr
script()
const {
return untag()->script(); }
8123 void set_script(
const Script&
value)
const;
8125 void set_token_pos(TokenPosition
value)
const;
8127 bool report_after_token()
const {
return untag()->report_after_token_; }
8128 void set_report_after_token(
bool value)
const;
8130 void set_kind(uint8_t
value)
const;
8132 StringPtr
message()
const {
return untag()->message(); }
8133 void set_message(
const String&
value)
const;
8135 StringPtr formatted_message()
const {
return untag()->formatted_message(); }
8136 void set_formatted_message(
const String&
value)
const;
8138 static LanguageErrorPtr New();
8160 static UnhandledExceptionPtr New(
const Instance& exception,
8164 virtual const char* ToErrorCString()
const;
8169 void set_exception(
const Instance& exception)
const;
8170 void set_stacktrace(
const Instance& stacktrace)
const;
8180 void set_is_user_initiated(
bool value)
const;
8191 virtual const char* ToErrorCString()
const;
8211 virtual bool OperatorEquals(
const Instance& other)
const;
8212 bool IsIdenticalTo(
const Instance& other)
const;
8213 virtual bool CanonicalizeEquals(
const Instance& other)
const;
8214 virtual uint32_t CanonicalizeHash()
const;
8221 return (
clazz()->
untag()->host_instance_size_in_words_ *
8227 virtual InstancePtr CanonicalizeLocked(
Thread* thread)
const;
8228 virtual void CanonicalizeFieldsLocked(
Thread* thread)
const;
8230 InstancePtr CopyShallowToOldSpace(
Thread* thread)
const;
8241 virtual TypeArgumentsPtr GetTypeArguments()
const;
8260 static bool NullIsAssignableTo(
const AbstractType& other);
8265 static bool NullIsAssignableTo(
8271 return ((index >= 0) && (index <
clazz()->
untag()->num_native_fields_));
8274 intptr_t* NativeFieldsDataAddr()
const;
8275 inline intptr_t GetNativeField(
int index)
const;
8276 inline void GetNativeFields(uint16_t num_fields,
8277 intptr_t* field_values)
const;
8278 void SetNativeFields(uint16_t num_fields,
const intptr_t* field_values)
const;
8281 return clazz()->untag()->num_native_fields_;
8284 void SetNativeField(
int index, intptr_t
value)
const;
8292 const Array& arguments,
8293 const Array& argument_names,
8294 bool respect_reflectable =
true,
8295 bool check_is_entrypoint =
false)
const;
8297 bool respect_reflectable =
true,
8298 bool check_is_entrypoint =
false)
const;
8301 bool respect_reflectable =
true,
8302 bool check_is_entrypoint =
false)
const;
8307 const Array& type_definitions,
8308 const Array& arguments,
8326 const Array& type_definitions,
8327 const Array& param_values,
8334 IntegerPtr IdentityHashCode(
Thread* thread)
const;
8342 static InstancePtr NewAlreadyFinalized(
const Class& cls,
8346 static intptr_t DataOffsetFor(intptr_t
cid);
8347 static intptr_t ElementSizeFor(intptr_t
cid);
8353 virtual bool IsPointer()
const;
8361 virtual void PrintSharedInstanceJSON(
JSONObject* jsobj,
8363 bool include_id =
true)
const;
8368 bool RuntimeTypeIsSubtypeOf(
8376 bool RuntimeTypeIsSubtypeOfFutureOr(
Zone* zone,
8380 static bool NullIsInstanceOf(
8391 return FieldAddrAtOffset(field.HostOffset());
8394 return FieldAddrAtOffset(
sizeof(UntaggedObject));
8399 bool IsValidFieldOffset(intptr_t
offset)
const;
8407 ObjectPtr RawGetFieldAtOffset(intptr_t
offset)
const {
8413 void RawSetFieldAtOffset(intptr_t
offset, ObjectPtr
value)
const {
8417 template <
typename T>
8418 T* RawUnboxedFieldAddrAtOffset(intptr_t
offset)
const {
8421 template <
typename T>
8422 T RawGetUnboxedFieldAtOffset(intptr_t
offset)
const {
8423 return *RawUnboxedFieldAddrAtOffset<T>(
offset);
8425 template <
typename T>
8426 void RawSetUnboxedFieldAtOffset(intptr_t
offset,
const T&
value)
const {
8458 LibraryPtr GetLibrary(
int index)
const;
8459 void AddImport(
const Namespace&
import)
const;
8467 static LibraryPrefixPtr New(
const String&
name,
8474 static constexpr int kIncrementSize = 2;
8478 void set_num_imports(intptr_t
value)
const;
8481 static LibraryPrefixPtr New();
8491 intptr_t Length()
const;
8496 StringPtr NameAt(intptr_t index)
const;
8497 void SetNameAt(intptr_t index,
const String&
value)
const;
8506 AbstractTypePtr BoundAt(intptr_t index)
const;
8508 bool AllDynamicBounds()
const;
8513 AbstractTypePtr DefaultAt(intptr_t index)
const;
8515 bool AllDynamicDefaults()
const;
8519 bool IsGenericCovariantImplAt(intptr_t index)
const;
8520 void SetIsGenericCovariantImplAt(intptr_t index,
bool value)
const;
8524#if !defined(DART_COMPRESSED_POINTERS)
8529 static constexpr intptr_t kFlagsPerSmi = 1LL << kFlagsPerSmiShift;
8531 static constexpr intptr_t kFlagsPerSmiMask = kFlagsPerSmi - 1;
8535 bool are_class_type_parameters,
8548 ArrayPtr
names()
const {
return untag()->names(); }
8549 void set_names(
const Array&
value)
const;
8550 ArrayPtr
flags()
const {
return untag()->flags(); }
8551 void set_flags(
const Array&
value)
const;
8552 TypeArgumentsPtr
bounds()
const {
return untag()->bounds(); }
8553 void set_bounds(
const TypeArguments&
value)
const;
8554 TypeArgumentsPtr defaults()
const {
return untag()->defaults(); }
8555 void set_defaults(
const TypeArguments&
value)
const;
8560 void OptimizeFlags()
const;
8578 static constexpr intptr_t kAllDynamicHash = 1;
8582 bool HasCount(intptr_t
count)
const;
8586 intptr_t Length()
const;
8587 AbstractTypePtr TypeAt(intptr_t index)
const;
8588 AbstractTypePtr TypeAtNullSafe(intptr_t index)
const;
8619 static constexpr intptr_t kNullabilityBitsPerType = 1;
8620 static constexpr intptr_t kNullabilityMaxTypes =
8621 kSmiBits / kNullabilityBitsPerType;
8622 static constexpr intptr_t kNonNullableBit = 0;
8623 static constexpr intptr_t kNullableBit = 1;
8624 intptr_t nullability()
const;
8630 StringPtr
Name()
const;
8634 StringPtr UserVisibleName()
const;
8638 void PrintSubvectorName(intptr_t from_index,
8647 return IsDynamicTypes(
false, from_index,
len);
8657 return IsDynamicTypes(
true, 0,
len);
8660 TypeArgumentsPtr Prepend(
Zone* zone,
8662 intptr_t other_length,
8663 intptr_t total_length)
const;
8666 TypeArgumentsPtr ConcatenateTypeParameters(
Zone* zone,
8683 const Class* cls =
nullptr)
const;
8687 return IsSubvectorEquivalent(other, 0,
IsNull() ? 0 : Length(),
8696 return IsSubvectorEquivalent(other, 0,
IsNull() ? other.
Length() : Length(),
8697 kind, function_type_equivalence);
8699 bool IsSubvectorEquivalent(
8701 intptr_t from_index,
8708 intptr_t num_free_fun_type_params =
kAllFree)
const {
8709 return IsSubvectorInstantiated(0, Length(), genericity,
8710 num_free_fun_type_params);
8712 bool IsSubvectorInstantiated(
8713 intptr_t from_index,
8716 intptr_t num_free_fun_type_params =
kAllFree)
const;
8717 bool IsUninstantiatedIdentity()
const;
8726 bool CanShareInstantiatorTypeArguments(
8727 const Class& instantiator_class,
8728 bool* with_runtime_check =
nullptr)
const;
8730 bool* with_runtime_check =
nullptr)
const;
8731 TypeArgumentsPtr TruncatedTo(intptr_t
length)
const;
8734 bool IsFinalized()
const;
8745 TypeArgumentsPtr FromInstanceTypeArguments(
Thread* thread,
8746 const Class& cls)
const;
8755 TypeArgumentsPtr ToInstantiatorTypeArguments(
Thread* thread,
8756 const Class& cls)
const;
8760 void EnumerateURIs(
URIs* uris)
const;
8767 TypeArgumentsPtr InstantiateFrom(
8770 intptr_t num_free_fun_type_params,
8773 intptr_t num_parent_type_args_adjustment = 0)
const;
8777 TypeArgumentsPtr UpdateFunctionTypes(
8778 intptr_t num_parent_type_args_adjustment,
8779 intptr_t num_free_fun_type_params,
8785 TypeArgumentsPtr InstantiateAndCanonicalizeFrom(
8826 NumOccupiedBits::kNextBit,
8835 kInstantiatorTypeArgsIndex = kSentinelIndex,
8867 return FindKeyOrUnused(data_, instantiator_tav, function_tav);
8871 bool IsOccupied(intptr_t entry)
const;
8874 TypeArgumentsPtr Retrieve(intptr_t entry)
const;
8883 KeyLocation AddEntry(intptr_t entry,
8892 return Object::empty_instantiations_cache_array();
8902 static constexpr double LoadFactor(intptr_t occupied, intptr_t capacity) {
8903 return occupied /
static_cast<double>(capacity);
8908 static intptr_t NumOccupied(
const Array& array);
8911 static bool IsLinear(
const Array& array) {
return !IsHash(array); }
8914 static bool IsHash(
const Array& array);
8921 bool EnsureCapacity(intptr_t occupied)
const;
8929#if defined(TARGET_ARCH_IA32)
8931 static constexpr intptr_t kMaxLinearCacheEntries = 500;
8933 static constexpr intptr_t kMaxLinearCacheEntries = 10;
8951 static constexpr intptr_t kSentinelValue = 0;
8956 static constexpr intptr_t kMaxLinearCacheSize =
8957 kHeaderSize + (kMaxLinearCacheEntries + 1) * kEntrySize;
8962 static constexpr intptr_t kNumInitialHashCacheEntries =
8965 "number of hash-based cache entries must be a power of two");
8968 static constexpr double kMaxLoadFactor = 0.71;
8979 bool HasInstantiations()
const;
8986 static constexpr intptr_t kMaxElements =
kSmiMax / kBytesPerElement;
9001 (
len * kBytesPerElement));
9006 uword HashForRange(intptr_t from_index, intptr_t
len)
const;
9014 intptr_t ComputeNullability()
const;
9015 void set_nullability(intptr_t
value)
const;
9017 uword ComputeHash()
const;
9018 void SetHash(intptr_t
value)
const;
9024 bool IsDynamicTypes(
bool raw_instantiated,
9025 intptr_t from_index,
9026 intptr_t
len)
const;
9028 ArrayPtr instantiations()
const;
9029 void set_instantiations(
const Array&
value)
const;
9030 void SetLength(intptr_t
value)
const;
9033 static constexpr int kNumFields = 4;
9054 const auto state = type_state();
9058 void SetIsFinalized()
const;
9076 bool IsStrictlyNonNullable()
const;
9078 virtual AbstractTypePtr SetInstantiatedNullability(
9081 virtual AbstractTypePtr NormalizeFutureOrType(
Heap::Space space)
const;
9084 virtual classid_t type_class_id()
const;
9085 virtual ClassPtr type_class()
const;
9086 virtual TypeArgumentsPtr arguments()
const;
9087 virtual bool IsInstantiated(
9089 intptr_t num_free_fun_type_params =
kAllFree)
const;
9097 virtual bool IsEquivalent(
9113 virtual AbstractTypePtr InstantiateFrom(
9116 intptr_t num_free_fun_type_params,
9119 intptr_t num_parent_type_args_adjustment = 0)
const;
9131 virtual AbstractTypePtr UpdateFunctionTypes(
9132 intptr_t num_parent_type_args_adjustment,
9133 intptr_t num_free_fun_type_params,
9149 static StringPtr PrintURIs(
URIs* uris);
9153 virtual const char* NullabilitySuffix(
NameVisibility name_visibility)
const;
9156 StringPtr
Name()
const;
9157 const char* NameCString()
const;
9161 StringPtr UserVisibleName()
const;
9162 const char* UserVisibleNameCString()
const;
9166 StringPtr ScrubbedName()
const;
9167 const char* ScrubbedNameCString()
const;
9176 virtual void EnumerateURIs(
URIs* uris)
const;
9179 virtual uword ComputeHash()
const;
9183 StringPtr ClassName()
const;
9192 bool IsNullType()
const;
9195 bool IsNeverType()
const;
9198 bool IsSentinelType()
const;
9215 bool IsTopTypeForSubtyping()
const;
9219 bool IsTopTypeForInstanceOf()
const;
9225 bool IsIntType()
const;
9228 bool IsIntegerImplementationType()
const;
9234 bool IsFloat32x4Type()
const;
9237 bool IsFloat64x2Type()
const;
9240 bool IsInt32x4Type()
const;
9246 bool IsSmiType()
const {
return type_class_id() == kSmiCid; }
9252 bool IsStringType()
const;
9255 bool IsDartFunctionType()
const;
9258 bool IsDartClosureType()
const;
9261 bool IsDartRecordType()
const;
9264 bool IsFfiPointerType()
const;
9271 AbstractTypePtr UnwrapFutureOr()
const;
9281 bool IsTypeClassAllowedBySpawnUri()
const;
9291 static bool InstantiateAndTestSubtype(
9302 return untag()->type_test_stub_entry_point_;
9313 void SetTypeTestingStub(
const Code& stub)
const;
9320 void InitializeTypeTestingStubNonAtomic(
const Code& stub)
const;
9338 bool IsSubtypeOfFutureOr(
9345 bool IsNullabilityEquivalent(
Thread* thread,
9349 void SetHash(intptr_t
value)
const;
9355 void set_flags(uint32_t
value)
const;
9387 bool canonicalize =
true)
const;
9391 intptr_t num_free_fun_type_params =
kAllFree)
const;
9404 intptr_t num_free_fun_type_params,
9407 intptr_t num_parent_type_args_adjustment = 0)
const;
9410 intptr_t num_parent_type_args_adjustment,
9411 intptr_t num_free_fun_type_params,
9501 void set_type_class_id(intptr_t
id)
const;
9531 virtual bool IsInstantiated(
9533 intptr_t num_free_fun_type_params =
kAllFree)
const;
9534 virtual bool IsEquivalent(
9539 virtual AbstractTypePtr InstantiateFrom(
9542 intptr_t num_free_fun_type_params,
9545 intptr_t num_parent_type_args_adjustment = 0)
const;
9547 virtual AbstractTypePtr UpdateFunctionTypes(
9548 intptr_t num_parent_type_args_adjustment,
9549 intptr_t num_free_fun_type_params,
9554 virtual void EnumerateURIs(
URIs* uris)
const;
9558 virtual uword ComputeHash()
const;
9571 return NumParentTypeArgumentsOf(
ptr());
9573 void SetNumParentTypeArguments(intptr_t
value)
const;
9581 return NumTypeParametersOf(
ptr) + NumParentTypeArgumentsOf(
ptr);
9589 void set_num_implicit_parameters(intptr_t
value)
const;
9596 void set_num_fixed_parameters(intptr_t
value)
const;
9610 return HasOptionalNamedParameters(
ptr());
9612 bool HasRequiredNamedParameters()
const;
9615 return !HasOptionalNamedParameters(
ptr) && HasOptionalParameters(
ptr);
9618 return HasOptionalPositionalParameters(
ptr());
9626 return NumOptionalParametersOf(
ptr());
9628 void SetNumOptionalParameters(intptr_t num_optional_parameters,
9629 bool are_optional_positional)
const;
9632 return HasOptionalNamedParameters(
ptr) ? 0 : NumOptionalParametersOf(
ptr);
9635 return NumOptionalPositionalParametersOf(
ptr());
9639 return HasOptionalNamedParameters(
ptr) ? NumOptionalParametersOf(
ptr) : 0;
9642 return NumOptionalNamedParametersOf(
ptr());
9646 return NumFixedParametersOf(
ptr) + NumOptionalParametersOf(
ptr);
9651 return untag()->packed_parameter_counts_;
9653 void set_packed_parameter_counts(uint32_t packed_parameter_counts)
const;
9658 return untag()->packed_type_parameter_counts_;
9660 void set_packed_type_parameter_counts(uint16_t packed_parameter_counts)
const;
9666 TypeParameterPtr TypeParameterAt(
9676 AbstractTypePtr ParameterTypeAt(intptr_t index)
const;
9679 void set_parameter_types(
const Array&
value)
const;
9690 return untag()->named_parameter_names();
9692 void set_named_parameter_names(
const Array&
value)
const;
9698 StringPtr ParameterNameAt(intptr_t index)
const;
9700 void SetParameterNameAt(intptr_t index,
const String&
value)
const;
9704 bool IsRequiredAt(intptr_t index)
const;
9705 void SetIsRequiredAt(intptr_t index)
const;
9718 void FinalizeNameArray()
const;
9728 return untag()->type_parameters();
9738 bool HasSameTypeParametersAndBounds(
9755 bool IsContravariantParameter(
9756 intptr_t parameter_position,
9758 intptr_t other_parameter_position,
9765 intptr_t GetRequiredFlagIndex(intptr_t index, intptr_t* flag_mask)
const;
9768 void PrintParameters(
Thread* thread,
9773 StringPtr ToUserVisibleString()
const;
9774 const char* ToUserVisibleCString()
const;
9780 static FunctionTypePtr New(
9781 intptr_t num_parent_type_arguments = 0,
9787 bool ContainsHandles()
const;
9820 void set_base(intptr_t
value)
const;
9822 void set_index(intptr_t
value)
const;
9827 classid_t parameterized_class_id()
const;
9829 ClassPtr parameterized_class()
const;
9830 FunctionTypePtr parameterized_function_type()
const;
9832 AbstractTypePtr bound()
const;
9834 virtual bool IsInstantiated(
9836 intptr_t num_free_fun_type_params =
kAllFree)
const;
9837 virtual bool IsEquivalent(
9841 virtual AbstractTypePtr InstantiateFrom(
9844 intptr_t num_free_fun_type_params,
9847 intptr_t num_parent_type_args_adjustment = 0)
const;
9849 virtual AbstractTypePtr UpdateFunctionTypes(
9850 intptr_t num_parent_type_args_adjustment,
9851 intptr_t num_free_fun_type_params,
9864 AbstractTypePtr GetFromTypeArguments(
9870 return CanonicalNameCString(IsClassTypeParameter(),
base(), index());
9873 static const char* CanonicalNameCString(
bool is_class_type_parameter,
9882 static TypeParameterPtr New(
const Object& owner,
9888 virtual uword ComputeHash()
const;
9892 static TypeParameterPtr New();
9916 static IntegerPtr NewFromUint64(uint64_t
value,
9921 static IntegerPtr NewCanonical(
const String& str);
9922 static IntegerPtr NewCanonical(int64_t
value);
9927 static bool IsValueInRange(uint64_t
value);
9935 virtual uint32_t CanonicalizeHash()
const;
9940 virtual bool IsZero()
const;
9941 virtual bool IsNegative()
const;
9943 virtual double AsDoubleValue()
const;
9944 virtual int64_t AsInt64Value()
const;
9946 virtual uint32_t AsTruncatedUint32Value()
const;
9948 virtual bool FitsIntoSmi()
const;
9951 virtual int CompareWith(
const Integer& other)
const;
9954 const char* ToHexCString(
Zone* zone)
const;
9957 IntegerPtr AsValidInteger()
const;
9972 return RawSmiValue(
static_cast<const SmiPtr
>(obj));
9975 return static_cast<const MintPtr
>(obj)->
untag()->value_;
9996 virtual double AsDoubleValue()
const;
9997 virtual int64_t AsInt64Value()
const;
9998 virtual uint32_t AsTruncatedUint32Value()
const;
10002 virtual int CompareWith(
const Integer& other)
const;
10007 SmiPtr raw_smi =
static_cast<SmiPtr
>(
10016#if defined(DART_COMPRESSED_POINTERS)
10017 static intptr_t
Value(
const CompressedSmiPtr raw_smi) {
10018 return Smi::Value(
static_cast<SmiPtr
>(raw_smi.DecompressSmi()));
10023 return static_cast<intptr_t
>(New(
value));
10038 static intptr_t NextFieldOffset() {
10043 Smi() : Integer() {}
10049 friend class ReusableSmiHandleScope;
10055 static const char*
Name() {
return "SmiTraits"; }
10059 return Smi::Cast(
a).Value() == Smi::Cast(
b).Value();
10068 static constexpr int64_t kMaxValue =
10070 static constexpr int64_t kMinValue =
10075 static int64_t
Value(MintPtr mint) {
return mint->untag()->value_; }
10082 virtual double AsDoubleValue()
const;
10083 virtual int64_t AsInt64Value()
const;
10084 virtual uint32_t AsTruncatedUint32Value()
const;
10086 virtual bool FitsIntoSmi()
const;
10088 virtual int CompareWith(
const Integer& other)
const;
10101 static MintPtr NewCanonical(int64_t
value);
10116 static double Value(DoublePtr dbl) {
return dbl->untag()->value_; }
10118 bool BitwiseEqualsToDouble(
double value)
const;
10119 virtual bool OperatorEquals(
const Instance& other)
const;
10120 virtual bool CanonicalizeEquals(
const Instance& other)
const;
10121 virtual uint32_t CanonicalizeHash()
const;
10128 static DoublePtr NewCanonical(
double d);
10133 static DoublePtr NewCanonical(
const String& str);
10160 static constexpr intptr_t kOneByteChar = 1;
10161 static constexpr intptr_t kTwoByteChar = 2;
10166#if defined(HASH_IN_OBJECT_HEADER)
10167 static constexpr intptr_t kSizeofRawString =
10170 static constexpr intptr_t kSizeofRawString =
10173 static constexpr intptr_t kMaxElements =
kSmiMax / kTwoByteChar;
10184 : str_(str), ch_(0), index_(-1), end_(str.Length()) {
10231 return GetCachedHash(
ptr()) != 0;
10235#if defined(HASH_IN_OBJECT_HEADER)
10244 static uword Hash(
const char* characters, intptr_t
len);
10245 static uword Hash(
const uint16_t* characters, intptr_t
len);
10248 ASSERT(symbol->untag()->IsCanonical());
10260 static uint16_t CharAt(StringPtr str, intptr_t index);
10262 intptr_t CharSize()
const;
10267 intptr_t begin_index,
10268 intptr_t
len)
const;
10271 bool Equals(
const char* cstr)
const;
10279 bool Equals(
const uint16_t* characters, intptr_t
len)
const;
10282 bool Equals(
const int32_t* characters, intptr_t
len)
const;
10285 bool EqualsConcat(
const String& str1,
const String& str2)
const;
10296 intptr_t CompareTo(
const String& other)
const;
10300 return StartsWith(
ptr(), other.
ptr());
10302 static bool StartsWith(StringPtr str, StringPtr
prefix);
10303 bool EndsWith(
const String& other)
const;
10307 virtual InstancePtr CanonicalizeLocked(
Thread* thread)
const;
10319 char* ToMallocCString()
const;
10320 void ToUTF8(uint8_t* utf8_array, intptr_t array_len)
const;
10329 static StringPtr FromUTF8(
const uint8_t* utf8_array,
10330 intptr_t array_len,
10334 static StringPtr FromLatin1(
const uint8_t* latin1_array,
10335 intptr_t array_len,
10339 static StringPtr FromUTF16(
const uint16_t* utf16_array,
10340 intptr_t array_len,
10344 static StringPtr FromUTF32(
const int32_t* utf32_array,
10345 intptr_t array_len,
10354 intptr_t array_len,
10356 intptr_t external_allocation_size,
10363 intptr_t array_len,
10365 intptr_t external_allocation_size,
10370 intptr_t dst_offset,
10371 const uint8_t* characters,
10374 intptr_t dst_offset,
10375 const uint16_t* characters,
10378 intptr_t dst_offset,
10380 intptr_t src_offset,
10383 static StringPtr EscapeSpecialCharacters(
const String& str);
10386 static const char* EncodeIRI(
const String& str);
10388 static StringPtr DecodeIRI(
const String& str);
10392 static StringPtr ConcatAll(
const Array& strings,
10395 static StringPtr ConcatAllRange(
const Array& strings,
10400 static StringPtr SubString(
const String& str,
10401 intptr_t begin_index,
10404 intptr_t begin_index,
10409 static StringPtr SubString(
Thread* thread,
10411 intptr_t begin_index,
10415 static StringPtr
Transform(int32_t (*mapping)(int32_t ch),
10419 static StringPtr ToUpperCase(
const String& str,
10424 static StringPtr RemovePrivateKey(
const String&
name);
10426 static const char* ScrubName(
const String&
name,
bool is_extension =
false);
10427 static StringPtr ScrubNameRetainPrivate(
const String&
name,
10428 bool is_extension =
false);
10433 static StringPtr NewFormatted(
Heap::Space space, const
char*
format, ...)
10435 static StringPtr NewFormattedV(const
char*
format,
10439 static
bool ParseDouble(const
String& str,
10444#if !defined(HASH_IN_OBJECT_HEADER)
10451 Smi::Value(obj->untag()->hash_) ==
static_cast<intptr_t
>(
hash));
10452 return SetCachedHash(obj,
hash);
10459 static uint32_t SetCachedHash(StringPtr obj, uint32_t
hash) {
10460 return Object::SetCachedHashIfNotSet(obj,
hash);
10468 bool Equals(
const uint8_t* characters, intptr_t
len)
const;
10469 static uword Hash(
const uint8_t* characters, intptr_t
len);
10478 const intptr_t hash_set = SetCachedHashIfNotSet(
ptr(),
value);
10487 template <
typename CharType>
10494 friend class Pass2Visitor;
10502 void Add(
const uint8_t* code_units, intptr_t
len) {
10509 void Add(
const uint16_t* code_units, intptr_t
len) {
10516 void Add(
const String& str, intptr_t begin_index, intptr_t
len);
10531 static uint16_t
CharAt(OneByteStringPtr str, intptr_t index) {
10533 return str->untag()->data()[index];
10538 *CharAddr(str, index) = code_unit;
10540 static OneByteStringPtr EscapeSpecialCharacters(
const String& str);
10542 static constexpr intptr_t kBytesPerElement = 1;
10544 static constexpr intptr_t kMaxNewSpaceElements =
10551 static constexpr intptr_t kElementSize = kBytesPerElement;
10559 return UnroundedSize(
Smi::Value(str->untag()->length()));
10576 static OneByteStringPtr
New(
const char* c_string,
10578 return New(
reinterpret_cast<const uint8_t*
>(c_string), strlen(c_string),
10581 static OneByteStringPtr New(
const uint8_t* characters,
10584 static OneByteStringPtr New(
const uint16_t* characters,
10587 static OneByteStringPtr New(
const int32_t* characters,
10592 static OneByteStringPtr New(
const String& other_one_byte_string,
10593 intptr_t other_start_index,
10594 intptr_t other_len,
10597 static OneByteStringPtr New(
const TypedDataBase& other_typed_data,
10598 intptr_t other_start_index,
10599 intptr_t other_len,
10605 static OneByteStringPtr ConcatAll(
const Array& strings,
10611 static OneByteStringPtr
Transform(int32_t (*mapping)(int32_t ch),
10617 static OneByteStringPtr SubStringUnchecked(
const String& str,
10618 intptr_t begin_index,
10629 static OneByteStringPtr raw(
const String& str) {
10630 return static_cast<OneByteStringPtr
>(str.
ptr());
10633 static const UntaggedOneByteString*
untag(
const String& str) {
10634 return reinterpret_cast<const UntaggedOneByteString*
>(str.untag());
10637 static uint8_t* CharAddr(
const String& str, intptr_t index) {
10638 ASSERT((index >= 0) && (index < str.Length()));
10639 ASSERT(str.IsOneByteString());
10640 return &str.UnsafeMutableNonPointer(
untag(str)->
data())[index];
10643 static uint8_t* DataStart(
const String& str) {
10644 ASSERT(str.IsOneByteString());
10645 return &str.UnsafeMutableNonPointer(
untag(str)->
data())[0];
10670 static uint16_t
CharAt(TwoByteStringPtr str, intptr_t index) {
10672 return str->untag()->data()[index];
10677 *CharAddr(str, index) = ch;
10680 static TwoByteStringPtr EscapeSpecialCharacters(
const String& str);
10683 static constexpr intptr_t kBytesPerElement = 2;
10685 static constexpr intptr_t kMaxNewSpaceElements =
10692 static constexpr intptr_t kElementSize = kBytesPerElement;
10699 return UnroundedSize(
Smi::Value(str->untag()->length()));
10716 static TwoByteStringPtr New(
const uint16_t* characters,
10719 static TwoByteStringPtr New(intptr_t utf16_len,
10720 const int32_t* characters,
10725 static TwoByteStringPtr New(
const TypedDataBase& other_typed_data,
10726 intptr_t other_start_index,
10727 intptr_t other_len,
10733 static TwoByteStringPtr ConcatAll(
const Array& strings,
10739 static TwoByteStringPtr
Transform(int32_t (*mapping)(int32_t ch),
10750 static TwoByteStringPtr raw(
const String& str) {
10751 return static_cast<TwoByteStringPtr
>(str.
ptr());
10758 static uint16_t* CharAddr(
const String& str, intptr_t index) {
10759 ASSERT((index >= 0) && (index < str.Length()));
10760 ASSERT(str.IsTwoByteString());
10761 return &str.UnsafeMutableNonPointer(
untag(str)->
data())[index];
10766 static uint16_t* DataStart(
const String& str) {
10767 ASSERT(str.IsTwoByteString());
10768 return &str.UnsafeMutableNonPointer(
untag(str)->
data())[0];
10819 const intptr_t array_length) {
10827 static constexpr intptr_t kMaxLengthForWriteBarrierElimination = 8;
10831 return Smi::Value(array->untag()->length());
10840 kBytesPerElement * index;
10843 intptr_t index = (offset_in_bytes - data_offset()) / kBytesPerElement;
10855 if (
a ==
b)
return true;
10856 if (
a->IsRawNull() ||
b->IsRawNull())
return false;
10857 if (
a->untag()->length() !=
b->untag()->length())
return false;
10858 if (
a->untag()->type_arguments() !=
b->untag()->type_arguments()) {
10861 const intptr_t
length = LengthOf(
a);
10862 return memcmp(
a->untag()->data(),
b->untag()->data(),
10863 kBytesPerElement *
length) == 0;
10871 return array->
untag()->data();
10874 template <std::memory_order order = std::memory_order_relaxed>
10876 ASSERT((0 <= index) && (index < Length()));
10877 return untag()->element<order>(index);
10879 template <std::memory_order order = std::memory_order_relaxed>
10881 ASSERT((0 <= index) && (index < Length()));
10882 untag()->set_element<order>(index,
value.ptr());
10884 template <std::memory_order order = std::memory_order_relaxed>
10886 ASSERT((0 <= index) && (index < Length()));
10887 untag()->set_element<order>(index,
value.ptr(), thread);
10892 ASSERT((0 <= index) && (index < Length()));
10893 return untag()->element<std::memory_order_acquire>(index);
10896 ASSERT((0 <= index) && (index < Length()));
10897 untag()->set_element<std::memory_order_release>(index,
value.ptr());
10903 static constexpr intptr_t kElementTypeTypeArgPos = 0;
10906 return untag()->type_arguments();
10913 ((
value.Length() >= 1) &&
10914 value.IsInstantiated() ));
10917 StoreArrayPointer(&
untag()->type_arguments_,
value.ptr());
10920 virtual bool CanonicalizeEquals(
const Instance& other)
const;
10921 virtual uint32_t CanonicalizeHash()
const;
10923 static constexpr intptr_t kBytesPerElement = ArrayTraits::kElementSize;
10924 static constexpr intptr_t kMaxElements =
kSmiMax / kBytesPerElement;
10925 static constexpr intptr_t kMaxNewSpaceElements =
10933 return 0 <=
len &&
len <= kMaxElements;
10953 virtual void CanonicalizeFieldsLocked(
Thread* thread)
const;
10957 void MakeImmutable()
const;
10960 return New(kArrayCid,
len, space);
10966 return NewUninitialized(kArrayCid,
len, space);
10968 static ArrayPtr New(intptr_t
len,
10976 intptr_t new_length,
10983 void Truncate(intptr_t new_length)
const;
10994 bool unique =
false);
10996 ArrayPtr Slice(intptr_t start, intptr_t
count,
bool with_type_argument)
const;
10998 return Slice(0, Length(),
true);
11002 static ArrayPtr New(intptr_t class_id,
11005 static ArrayPtr NewUninitialized(intptr_t class_id,
11012 ASSERT((index >= 0) && (index < Length()));
11013 return &
untag()->data()[index];
11017 void SetLengthRelease(intptr_t
value)
const {
11021 template <
typename type,
11022 std::memory_order order = std::memory_order_relaxed,
11023 typename value_type>
11024 void StoreArrayPointer(
type const*
addr, value_type
value)
const {
11053 static intptr_t NextFieldOffset() {
11058 static ImmutableArrayPtr raw(
const Array& array) {
11059 return static_cast<ImmutableArrayPtr
>(array.ptr());
11088 ASSERT(index < Length());
11089 return data()->untag()->element(index);
11093 ASSERT(index < Length());
11096 data()->untag()->set_element(index,
value.ptr());
11105 return untag()->type_arguments();
11112 value.IsCanonical()));
11145 return New(kDefaultInitialCapacity, space);
11147 static GrowableObjectArrayPtr New(intptr_t capacity,
11149 static GrowableObjectArrayPtr New(
const Array& array,
11153 return array->untag()->length();
11157 return array->untag()->data();
11163 static constexpr int kDefaultInitialCapacity = 0;
11172 static Float32x4Ptr New(
float value0,
11185 void set_x(
float x)
const;
11186 void set_y(
float y)
const;
11187 void set_z(
float z)
const;
11188 void set_w(
float w)
const;
11201 virtual bool CanonicalizeEquals(
const Instance& other)
const;
11202 virtual uint32_t CanonicalizeHash()
const;
11211 static Int32x4Ptr New(int32_t value0,
11223 void set_x(int32_t
x)
const;
11224 void set_y(int32_t
y)
const;
11225 void set_z(int32_t z)
const;
11226 void set_w(int32_t
w)
const;
11237 virtual bool CanonicalizeEquals(
const Instance& other)
const;
11238 virtual uint32_t CanonicalizeHash()
const;
11247 static Float64x2Ptr New(
double value0,
11256 void set_x(
double x)
const;
11257 void set_y(
double y)
const;
11270 virtual bool CanonicalizeEquals(
const Instance& other)
const;
11271 virtual uint32_t CanonicalizeHash()
const;
11281 kNumFieldsBits = 16,
11282 kFieldNamesIndexBits =
kSmiBits - kNumFieldsBits,
11287 NumFieldsBitField::kNextBit,
11288 kFieldNamesIndexBits>;
11291 static constexpr intptr_t kNumFieldsMask = NumFieldsBitField::mask();
11292 static constexpr intptr_t kMaxNumFields = kNumFieldsMask;
11293 static constexpr intptr_t kFieldNamesIndexMask =
11294 FieldNamesIndexBitField::mask();
11295 static constexpr intptr_t kFieldNamesIndexShift =
11296 FieldNamesIndexBitField::shift();
11297 static constexpr intptr_t kMaxFieldNamesIndex = kFieldNamesIndexMask;
11325 return value_ == other.value_;
11328 return value_ != other.value_;
11334 intptr_t num_fields,
11335 const Array& field_names);
11338 ArrayPtr GetFieldNames(
Thread* thread)
const;
11354 virtual bool IsInstantiated(
11356 intptr_t num_free_fun_type_params =
kAllFree)
const;
11357 virtual bool IsEquivalent(
11362 virtual AbstractTypePtr InstantiateFrom(
11365 intptr_t num_free_fun_type_params,
11368 intptr_t num_parent_type_args_adjustment = 0)
const;
11370 virtual AbstractTypePtr UpdateFunctionTypes(
11371 intptr_t num_parent_type_args_adjustment,
11372 intptr_t num_free_fun_type_params,
11377 virtual void EnumerateURIs(
URIs* uris)
const;
11381 virtual uword ComputeHash()
const;
11392 AbstractTypePtr FieldTypeAt(intptr_t index)
const;
11396 ArrayPtr GetFieldNames(
Thread* thread)
const;
11398 intptr_t NumFields()
const;
11407 const Array& field_types,
11413 void set_field_types(
const Array&
value)
const;
11434 return untag()->field(field_index);
11437 untag()->set_field(field_index,
value.ptr());
11445 static constexpr intptr_t kElementSize = kBytesPerElement;
11450 kBytesPerElement * index;
11453 const intptr_t index =
11468 (num_fields * kBytesPerElement));
11473 virtual bool CanonicalizeEquals(
const Instance& other)
const;
11474 virtual uint32_t CanonicalizeHash()
const;
11475 virtual void CanonicalizeFieldsLocked(
Thread* thread)
const;
11481 RecordTypePtr GetRecordType()
const;
11485 static intptr_t GetPositionalFieldIndexFromFieldName(
11486 const String& field_name);
11491 intptr_t GetFieldIndexByName(
Thread* thread,
const String& field_name)
const;
11494 return shape().GetFieldNames(thread);
11541 return kUint8ArrayElement;
11543 const intptr_t index =
11548 const intptr_t index =
11553 const intptr_t index =
11559 const intptr_t index =
11566 bool IsExternalOrExternalView()
const;
11567 TypedDataViewPtr ViewFromTo(intptr_t start,
11572 ASSERT((byte_offset == 0) ||
11573 ((byte_offset > 0) && (byte_offset < LengthInBytes())));
11574 return reinterpret_cast<void*
>(
Validate(
untag()->data_) + byte_offset);
11577#define TYPED_GETTER_SETTER(name, type) \
11578 type Get##name(intptr_t byte_offset) const { \
11579 ASSERT(static_cast<uintptr_t>(byte_offset) <= \
11580 static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
11581 return LoadUnaligned( \
11582 reinterpret_cast<type*>(untag()->data_ + byte_offset)); \
11584 void Set##name(intptr_t byte_offset, type value) const { \
11585 ASSERT(static_cast<uintptr_t>(byte_offset) <= \
11586 static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
11587 StoreUnaligned(reinterpret_cast<type*>(untag()->data_ + byte_offset), \
11605#undef TYPED_GETTER_SETTER
11621 ASSERT(0 <= index && index < kNumElementSizes);
11622 intptr_t
size = element_size_table[index];
11626 static constexpr intptr_t kNumElementSizes =
11629 static const intptr_t element_size_table[kNumElementSizes];
11636 virtual bool CanonicalizeEquals(
const Instance& other)
const;
11637 virtual uint32_t CanonicalizeHash()
const;
11639#define TYPED_GETTER_SETTER(name, type) \
11640 type Get##name(intptr_t byte_offset) const { \
11641 ASSERT(static_cast<uintptr_t>(byte_offset) <= \
11642 static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
11643 return LoadUnaligned( \
11644 reinterpret_cast<const type*>(untag()->data() + byte_offset)); \
11646 void Set##name(intptr_t byte_offset, type value) const { \
11647 ASSERT(static_cast<uintptr_t>(byte_offset) <= \
11648 static_cast<uintptr_t>(LengthInBytes()) - sizeof(type)); \
11649 return StoreUnaligned( \
11650 reinterpret_cast<type*>(untag()->data() + byte_offset), value); \
11667#undef TYPED_GETTER_SETTER
11686 return (
kSmiMax / ElementSizeInBytes(class_id));
11692 ElementSizeInBytes(class_id);
11695 static TypedDataPtr New(intptr_t class_id,
11699 static TypedDataPtr Grow(
const TypedData& current,
11719 template <
typename FieldType>
11720 const FieldType* ReadOnlyDataAddr(intptr_t byte_offset)
const {
11721 return reinterpret_cast<const FieldType*
>((
untag()->data()) + byte_offset);
11734 static constexpr int kDataSerializationAlignment = 8;
11738 intptr_t external_size)
const;
11746 return (
kSmiMax / ElementSizeInBytes(class_id));
11749 static ExternalTypedDataPtr New(
11754 bool perform_eager_msan_initialization_check =
true);
11756 static ExternalTypedDataPtr NewFinalizeWithFree(uint8_t*
data, intptr_t
len);
11785 static TypedDataViewPtr New(intptr_t class_id,
11787 static TypedDataViewPtr New(intptr_t class_id,
11789 intptr_t offset_in_bytes,
11807 intptr_t
cid =
data.ptr()->GetClassId();
11823 intptr_t offset_in_bytes,
11827 untag()->set_typed_data(typed_data.
ptr());
11832 RecomputeDataField();
11841 void RecomputeDataField()
const {
ptr()->
untag()->RecomputeDataField(); }
11865 return reinterpret_cast<CompressedInstancePtr*
>(
11866 reinterpret_cast<uword>(view_obj.untag()) + data_offset())
11867 ->
Decompress(view_obj.untag()->heap_base());
11891 static bool IsPointer(
const Instance& obj);
11894 return reinterpret_cast<size_t>(
untag()->data_);
11898 uint8_t*
value =
reinterpret_cast<uint8_t*
>(address);
11906 static constexpr intptr_t kNativeTypeArgPos = 0;
11922 static DynamicLibraryPtr New(
void* handle,
11938 return untag()->handle_;
11947 return untag()->canBeClosed_;
11957 return untag()->isClosed_;
11974 ASSERT(index_size >= kInitialIndexSize);
11976#if defined(HAS_SMI_63_BITS)
11977 return (1 << (32 - index_bits)) - 1;
12011 ASSERT(obj.IsMap() || obj.IsSet());
12020 return untag()->type_arguments();
12023 const intptr_t num_type_args = IsMap() ? 2 : 1;
12025 ((
value.Length() >= num_type_args) &&
12026 value.IsInstantiated() ));
12066 return used - deleted;
12072 void ComputeAndSetHashMask()
const;
12074 virtual bool CanonicalizeEquals(
const Instance& other)
const;
12075 virtual uint32_t CanonicalizeHash()
const;
12076 virtual void CanonicalizeFieldsLocked(
Thread* thread)
const;
12080 static constexpr intptr_t kInitialIndexBits = 2;
12081 static constexpr intptr_t kInitialIndexSize = 1 << (kInitialIndexBits + 1);
12084 LinkedHashBasePtr
ptr()
const {
return static_cast<LinkedHashBasePtr
>(
ptr_); }
12092 friend class LinkedHashBaseDeserializationCluster;
12116 static MapPtr NewDefault(intptr_t class_id = kMapCid,
12118 static MapPtr New(intptr_t class_id,
12121 intptr_t hash_mask,
12122 intptr_t used_data,
12123 intptr_t deleted_keys,
12142 if (offset_ >= length_) {
12145 scratch_ = data_.At(offset_);
12146 if (scratch_.ptr() != data_.ptr()) {
12158 const Array& data_;
12161 const intptr_t length_;
12169 static MapPtr NewUninitialized(intptr_t class_id,
12195 static intptr_t NextFieldOffset() {
12200 static ConstMapPtr raw(
const Map&
map) {
12201 return static_cast<ConstMapPtr
>(
map.ptr());
12219 static SetPtr NewDefault(intptr_t class_id = kSetCid,
12221 static SetPtr New(intptr_t class_id,
12224 intptr_t hash_mask,
12225 intptr_t used_data,
12226 intptr_t deleted_keys,
12245 if (offset_ >= length_) {
12248 scratch_ = data_.At(offset_);
12249 if (scratch_.ptr() != data_.ptr()) {
12259 const Array& data_;
12262 const intptr_t length_;
12270 static SetPtr NewUninitialized(intptr_t class_id,
12296 static intptr_t NextFieldOffset() {
12301 static ConstSetPtr raw(
const Set&
map) {
12302 return static_cast<ConstSetPtr
>(
map.ptr());
12310#if defined(DART_PRECOMPILED_RUNTIME)
12311 uword entry_point()
const {
return untag()->entry_point_; }
12312 void set_entry_point(
uword entry_point)
const {
12315 static intptr_t entry_point_offset() {
12321 return untag()->instantiator_type_arguments();
12324 untag()->set_instantiator_type_arguments(
args.ptr());
12331 return untag()->function_type_arguments();
12334 untag()->set_function_type_arguments(
args.ptr());
12341 return untag()->delayed_type_arguments();
12344 untag()->set_delayed_type_arguments(
args.ptr());
12355 return closure.untag()->function();
12377 return delayed_type_arguments() == Object::empty_type_arguments().ptr();
12387 virtual void CanonicalizeFieldsLocked(
Thread* thread)
const;
12388 virtual bool CanonicalizeEquals(
const Instance& other)
const;
12392 uword ComputeHash()
const;
12394 static ClosurePtr New(
const TypeArguments& instantiator_type_arguments,
12400 static ClosurePtr New(
const TypeArguments& instantiator_type_arguments,
12407 FunctionTypePtr GetInstantiatedSignature(
Zone* zone)
const;
12458 const auto updated =
12463#if !defined(PRODUCT)
12465 return untag()->allocation_location();
12474 static ReceivePortPtr New(
Dart_Port id,
12475 const String& debug_name,
12479 class IsOpen :
public BitField<intptr_t, bool, 0, 1> {};
12480 class IsKeepIsolateAlive
12481 :
public BitField<intptr_t, bool, IsOpen::kNextBit, 1> {};
12494 ASSERT(origin_id() == 0);
12521 uint8_t*
data()
const {
return data_; }
12542 static TransferableTypedDataPtr New(uint8_t*
data, intptr_t
len);
12558 static constexpr int kPreallocatedStackdepth = 90;
12560 intptr_t Length()
const;
12563 void set_async_link(
const StackTrace& async_link)
const;
12564 void set_expand_inlined(
bool value)
const;
12567 ObjectPtr CodeAtFrame(intptr_t frame_index)
const;
12568 void SetCodeAtFrame(intptr_t frame_index,
const Object&
code)
const;
12571 uword PcOffsetAtFrame(intptr_t frame_index)
const;
12572 void SetPcOffsetAtFrame(intptr_t frame_index,
uword pc_offset)
const;
12574 bool skip_sync_start_in_parent_stack()
const;
12575 void set_skip_sync_start_in_parent_stack(
bool value)
const;
12589 static constexpr intptr_t kSyncAsyncCroppedFrames = 2;
12594 static StackTracePtr New(
const Array& code_array,
12598 static StackTracePtr New(
const Array& code_array,
12601 bool skip_sync_start_in_parent_stack,
12605 void set_code_array(
const Array& code_array)
const;
12606 void set_pc_offset_array(
const TypedData& pc_offset_array)
const;
12607 bool expand_inlined()
const;
12617 static constexpr intptr_t kSuspendStateVarIndex = 0;
12621 return UnroundedSize(
ptr->
untag()->frame_capacity());
12641#if !defined(DART_PRECOMPILED_RUNTIME)
12663 static SuspendStatePtr New(intptr_t frame_size,
12684 CodePtr GetCodeObject()
const;
12687#if !defined(DART_PRECOMPILED_RUNTIME)
12688 void set_frame_capacity(intptr_t frame_capcity)
const;
12690 void set_frame_size(intptr_t frame_size)
const;
12691 void set_pc(
uword pc)
const;
12692 void set_function_data(
const Instance& function_data)
const;
12693 void set_then_callback(
const Closure& then_callback)
const;
12694 void set_error_callback(
const Closure& error_callback)
const;
12696 uint8_t* payload()
const {
return untag()->payload(); }
12717 static constexpr int kDefaultFlags = 0;
12722 inline bool IsGlobal()
const {
return (value_ & kGlobal) != 0; }
12723 inline bool IgnoreCase()
const {
return (value_ & kIgnoreCase) != 0; }
12725 inline bool IsUnicode()
const {
return (value_ & kUnicode) != 0; }
12726 inline bool IsDotAll()
const {
return (value_ & kDotAll) != 0; }
12731 return IsUnicode() && IgnoreCase();
12745 return value_ == other.value_;
12748 return value_ != other.value_;
12763 kUninitialized = 0,
12780 :
public BitField<int8_t, bool, IgnoreCaseBit::kNextBit, 1> {};
12792 return LoadNonPointer<intptr_t, std::memory_order_relaxed>(
12793 is_one_byte ? &
untag()->num_one_byte_registers_
12794 : &
untag()->num_two_byte_registers_);
12799 return untag()->num_bracket_expressions_;
12803 TypedDataPtr
bytecode(
bool is_one_byte,
bool sticky)
const {
12806 is_one_byte ?
untag()->one_byte_sticky<std::memory_order_acquire>()
12807 :
untag()->two_byte_sticky<std::memory_order_acquire>());
12810 is_one_byte ?
untag()->one_byte<std::memory_order_acquire>()
12811 :
untag()->two_byte<std::memory_order_acquire>());
12818 case kOneByteStringCid:
12820 case kTwoByteStringCid:
12825 case kOneByteStringCid:
12827 case kTwoByteStringCid:
12839 case kOneByteStringCid:
12840 return static_cast<FunctionPtr
>(
untag()->one_byte_sticky());
12841 case kTwoByteStringCid:
12842 return static_cast<FunctionPtr
>(
untag()->two_byte_sticky());
12846 case kOneByteStringCid:
12847 return static_cast<FunctionPtr
>(
untag()->one_byte());
12848 case kTwoByteStringCid:
12849 return static_cast<FunctionPtr
>(
untag()->two_byte());
12857 void set_pattern(
const String& pattern)
const;
12858 void set_function(intptr_t
cid,
bool sticky,
const Function&
value)
const;
12859 void set_bytecode(
bool is_one_byte,
12865 void set_num_bracket_expressions(intptr_t
value)
const;
12866 void set_capture_name_map(
const Array& array)
const;
12885 StoreNonPointer<intptr_t, intptr_t, std::memory_order_relaxed>(
12886 is_one_byte ? &
untag()->num_one_byte_registers_
12887 : &
untag()->num_two_byte_registers_,
12898 virtual bool CanonicalizeEquals(
const Instance& other)
const;
12899 virtual uint32_t CanonicalizeHash()
const;
12908 void set_type(RegExType
type)
const {
12909 untag()->type_flags_.Update<TypeBits>(
type);
12911 RegExType
type()
const {
return untag()->type_flags_.Read<TypeBits>(); }
13027 static FinalizerEntryPtr New(
const FinalizerBase& finalizer,
13056 return untag()->entries_collected();
13059 untag()->set_entries_collected(
value.ptr());
13111 const char* trace_context)
const;
13123 untag()->set_referent(referent.
ptr());
13126 AbstractTypePtr GetAbstractTypeReferent()
const;
13128 ClassPtr GetClassReferent()
const;
13130 FieldPtr GetFieldReferent()
const;
13132 FunctionPtr GetFunctionReferent()
const;
13134 FunctionTypePtr GetFunctionTypeReferent()
const;
13136 LibraryPtr GetLibraryReferent()
const;
13138 TypeParameterPtr GetTypeParameterReferent()
const;
13140 static MirrorReferencePtr New(
const Object& referent,
13170 UserTagPtr MakeActive()
const;
13177 static UserTagPtr DefaultTag();
13179 static bool TagTableIsFull(
Thread* thread);
13180 static UserTagPtr FindTagById(
const Isolate* isolate,
uword tag_id);
13181 static UserTagPtr FindTagInIsolate(
Isolate* isolate,
13186 static UserTagPtr FindTagInIsolate(
Thread* thread,
const String& label);
13187 static void AddTagToIsolate(
Thread* thread,
const UserTag& tag);
13189 void set_label(
const String& tag_label)
const {
13190 untag()->set_label(tag_label.
ptr());
13205 return untag()->type_arguments();
13229 intptr_t
cid =
value->GetClassIdMayBeSmi();
13236 cid = kInstanceCid;
13248#if !defined(DART_PRECOMPILED_RUNTIME)
13251 return HostOffset();
13256#if !defined(DART_PRECOMPILED_RUNTIME)
13257 return field->untag()->target_offset_;
13259 return Smi::Value(field->untag()->host_offset_or_field_id());
13264 intptr_t target_offset_in_bytes)
const {
13267 untag()->set_host_offset_or_field_id(
13269#if !defined(DART_PRECOMPILED_RUNTIME)
13272 &
untag()->target_offset_,
13275 ASSERT(host_offset_in_bytes == target_offset_in_bytes);
13291 set_field_id_unsafe(field_id);
13300 return Smi::Value(array->untag()->length());
13308 ASSERT(IsValidNativeIndex(index));
13310 TypedDataPtr native_fields =
static_cast<TypedDataPtr
>(
13311 NativeFieldsAddr()->Decompress(
untag()->heap_base()));
13315 return reinterpret_cast<intptr_t*
>(native_fields->untag()->data())[index];
13319 intptr_t* field_values)
const {
13321 ASSERT(num_fields == NumNativeFields());
13322 ASSERT(field_values !=
nullptr);
13323 TypedDataPtr native_fields =
static_cast<TypedDataPtr
>(
13324 NativeFieldsAddr()->Decompress(
untag()->heap_base()));
13326 for (intptr_t
i = 0;
i < num_fields;
i++) {
13327 field_values[
i] = 0;
13331 reinterpret_cast<intptr_t*
>(native_fields->untag()->data());
13332 for (intptr_t
i = 0;
i < num_fields;
i++) {
13333 field_values[
i] = fields[
i];
13338 if (
ptr() == str.
ptr()) {
13359void MegamorphicCache::SetEntry(
const Array& array,
13361 const Smi& class_id,
13364 array.
SetAt((index * kEntryLength) + kClassIdIndex, class_id);
13365 array.
SetAt((index * kEntryLength) + kTargetFunctionIndex,
target);
13369 return array.At((index * kEntryLength) + kClassIdIndex);
13372ObjectPtr MegamorphicCache::GetTargetFunction(
const Array& array,
13374 return array.At((index * kEntryLength) + kTargetFunctionIndex);
13383 return ComputeHash();
13397 if (
IsNull())
return kAllDynamicHash;
13402 return ComputeHash();
13405inline void TypeArguments::SetHash(intptr_t
value)
const {
13412 switch (str->GetClassId()) {
13413 case kOneByteStringCid:
13415 case kTwoByteStringCid:
13461template <
typename EnumType,
typename TupleT,
int kStartOffset = 0>
13471 : array_(array), index_(index) {}
13473 template <EnumType kElement,
13474 std::memory_order order = std::memory_order_relaxed>
13475 typename std::tuple_element<kElement, TupleT>::type::ObjectPtrType
Get()
13478 return object_type::RawCast(array_.At<order>(index_ + kElement));
13481 template <EnumType kElement,
13482 std::memory_order order = std::memory_order_relaxed>
13485 array_.SetAt<order>(index_ + kElement,
value);
13488 intptr_t
index()
const {
return (index_ - kStartOffset) / EntrySize; }
13491 const Array& array_;
13502 return entry_.index_ == other.entry_.index_;
13505 return entry_.index_ != other.entry_.index_;
13511 entry_.index_ += EntrySize;
13526 return (array_.Length() - kStartOffset) / EntrySize;
13530 return TupleView(array_, kStartOffset +
i * EntrySize);
13538 return Iterator(array_, kStartOffset + Length() * EntrySize);
13542 const Array& array_;
13565 std::tuple<Object, TypeArguments, TypeArguments>,
13573 const Object& metadata_obj,
13574 const String& pragma_name,
13575 bool multiple =
false,
13579 const Array& metadata,
13580 Field* reusable_field_handle,
13581 Object* reusable_object_handle);
13589#undef PRECOMPILER_WSR_FIELD_DECLARATION
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static constexpr uint64_t kBits
static struct Initializer initializer
static constexpr size_t kHeaderSize
static void operation(T operation, uint32_t &a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint8_t s, uint32_t t)
static void encode(uint8_t output[16], const uint32_t input[4])
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
static uint32_t hash(const SkShaderBase::GradientInfo &v)
void Dump(const SkPath &path)
#define DEBUG_ASSERT(cond)
#define ASSERT_EQUAL(expected, actual)
bool IsNullableObjectType() const
bool IsNonNullable() const
UntaggedAbstractType::TypeState type_state() const
static intptr_t flags_offset()
virtual bool HasTypeClass() const
void SetHash(intptr_t value) const
static intptr_t type_test_stub_entry_point_offset()
static intptr_t NextFieldOffset()
uword type_test_stub_entry_point() const
Nullability nullability() const
virtual bool Equals(const Instance &other) const
static intptr_t InstanceSize()
bool IsObjectType() const
bool IsNumberType() const
virtual uint32_t CanonicalizeHash() const
bool IsCatchAllType() const
bool IsFutureOrType() const
CodePtr type_test_stub() const
HEAP_OBJECT_IMPLEMENTATION(AbstractType, Instance)
void UpdateTypeTestingStubEntryPoint() const
static intptr_t hash_offset()
bool IsDynamicType() const
virtual InstancePtr CanonicalizeLocked(Thread *thread) const
virtual bool CanonicalizeEquals(const Instance &other) const
StringPtr message() const
static intptr_t InstanceSize()
Iterator(const Array &array, intptr_t index)
const TupleView & operator*() const
bool operator==(const Iterator &other)
bool operator!=(const Iterator &other)
std::tuple_element< kElement, TupleT >::type::ObjectPtrType Get() const
void Set(const typename std::tuple_element< kElement, TupleT >::type &value) const
TupleView(const Array &array, intptr_t index)
ArrayOfTuplesView(const Array &array)
TupleView operator[](intptr_t i) const
TupleView At(intptr_t i) const
static intptr_t type_arguments_offset()
static intptr_t InstanceSize()
void SetAt(intptr_t index, const Object &value, Thread *thread) const
static intptr_t index_at_offset(intptr_t offset_in_bytes)
static CompressedObjectPtr * DataOf(ArrayPtr array)
static bool Equals(ArrayPtr a, ArrayPtr b)
ObjectPtr AtAcquire(intptr_t index) const
static intptr_t element_offset(intptr_t index)
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
static constexpr intptr_t InstanceSize(intptr_t len)
void SetAtRelease(intptr_t index, const Object &value) const
virtual TypeArgumentsPtr GetTypeArguments() const
static constexpr bool UseCardMarkingForAllocation(const intptr_t array_length)
static constexpr bool IsValidLength(intptr_t len)
virtual void SetTypeArguments(const TypeArguments &value) const
static intptr_t LengthOf(const ArrayPtr array)
ObjectPtr At(intptr_t index) const
static ArrayPtr NewUninitialized(intptr_t len, Heap::Space space=Heap::kNew)
static constexpr intptr_t UnroundedSize(intptr_t len)
static intptr_t data_offset()
void SetAt(intptr_t index, const Object &value) const
static intptr_t length_offset()
bool Equals(const Array &other) const
static constexpr T decode(S value)
static constexpr bool is_valid(ClassIdTagType value)
static intptr_t InstanceSize()
virtual uint32_t CanonicalizeHash() const
static const Bool & False()
static const Bool & Get(bool value)
static const Bool & True()
static InstancePtr Data(const Instance &view_obj)
static constexpr bool ContainsCompressedPointers()
static intptr_t NumberOfFields()
static intptr_t data_offset()
intptr_t CountWithTypeArgs() const
intptr_t CountWithoutTypeArgs() const
static intptr_t target_name_offset()
intptr_t SizeWithoutTypeArgs() const
StringPtr target_name() const
intptr_t SizeWithTypeArgs() const
static intptr_t arguments_descriptor_offset()
intptr_t TypeArgsLen() const
ArrayPtr arguments_descriptor() const
static intptr_t InstanceSize()
void Register(const Class &cls)
ClassPtr At(intptr_t cid) const
static intptr_t target_instance_size(ClassPtr clazz)
void PatchFieldsAndFunctions() const
void CopyDeclarationType(const Class &old_cls) const
void AddFields(const GrowableArray< const Field * > &fields) const
static intptr_t id_offset()
bool has_dynamically_extendable_subtypes() const
TypeArgumentsPtr DefaultTypeArguments(Zone *zone) const
void AddFunction(const Function &function) const
void set_is_implemented_unsafe() const
void set_num_type_arguments(intptr_t value) const
void set_is_transformed_mixin_application() const
bool is_base_class() const
static intptr_t host_instance_size(ClassPtr clazz)
void set_is_implemented() const
FieldPtr LookupInstanceField(const String &name) const
intptr_t kernel_offset() const
void set_has_pragma(bool value) const
const char * NameCString(NameVisibility name_visibility) const
void set_is_finalized_unsafe() const
intptr_t FindImplicitClosureFunctionIndex(const Function &needle) const
intptr_t NumTypeParameters() const
const char * ScrubbedNameCString() const
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
ObjectPtr InvokeSetter(const String &selector, const Instance &argument, bool respect_reflectable=true, bool check_is_entrypoint=false) const
CodePtr allocation_stub() const
void set_is_deeply_immutable(bool value) const
FunctionPtr LookupDynamicFunctionAllowPrivate(const String &name) const
void set_instance_size(intptr_t host_value_in_bytes, intptr_t target_value_in_bytes) const
LibraryPtr library() const
void set_is_isolate_unsendable_due_to_pragma(bool value) const
void set_super_type(const Type &value) const
bool TraceAllocation(IsolateGroup *isolate_group) const
FunctionPtr InvocationDispatcherFunctionFromIndex(intptr_t idx) const
void set_is_allocate_finalized() const
FunctionPtr LookupConstructorAllowPrivate(const String &name) const
static ClassPtr NewTypedDataViewClass(intptr_t class_id, IsolateGroup *isolate_group)
void set_is_enum_class() const
void set_is_synthesized_class() const
ObjectPtr Invoke(const String &selector, const Array &arguments, const Array &argument_names, bool respect_reflectable=true, bool check_is_entrypoint=false) const
FunctionPtr LookupGetterFunction(const String &name) const
void CopyCanonicalConstants(const Class &old_cls) const
static uint16_t NumNativeFieldsOf(ClassPtr clazz)
static int32_t target_next_field_offset_in_words(const ClassPtr cls)
static int32_t host_next_field_offset_in_words(const ClassPtr cls)
bool IsRecordClass() const
bool IsInFullSnapshot() const
ObjectPtr InvokeGetter(const String &selector, bool throw_nsm_if_absent, bool respect_reflectable=true, bool check_is_entrypoint=false) const
FieldPtr LookupInstanceFieldAllowPrivate(const String &name) const
void set_is_allocated_unsafe(bool value) const
bool can_be_future() const
void AddDirectImplementor(const Class &subclass, bool is_mixin) const
TypePtr GetInstantiationOf(Zone *zone, const Class &cls) const
bool is_declaration_loaded() const
intptr_t target_type_arguments_field_offset() const
static intptr_t super_type_offset()
void SetFields(const Array &value) const
void set_is_prefinalized() const
void set_is_interface_class() const
bool IsDartFunctionClass() const
void set_next_field_offset_in_words(intptr_t host_value, intptr_t target_value) const
StringPtr ScrubbedName() const
static intptr_t InstanceSize()
GrowableObjectArrayPtr direct_subclasses() const
GrowableObjectArrayPtr direct_implementors_unsafe() const
bool is_mixin_class() const
TypeArgumentsPtr GetDeclarationInstanceTypeArguments() const
TypePtr super_type() const
FunctionPtr GetInvocationDispatcher(const String &target_name, const Array &args_desc, UntaggedFunction::Kind kind, bool create_if_absent) const
intptr_t host_next_field_offset() const
FunctionPtr LookupStaticFunction(const String &name) const
static intptr_t UnboxedFieldSizeInBytesByCid(intptr_t cid)
void set_is_declaration_loaded() const
static ClassPtr NewExternalTypedDataClass(intptr_t class_id, IsolateGroup *isolate)
void set_num_type_arguments_unsafe(intptr_t value) const
intptr_t target_instance_size() const
void set_is_fields_marked_nullable() const
intptr_t NumTypeArguments() const
void set_is_abstract() const
static intptr_t host_type_arguments_field_offset_in_words_offset()
void set_is_mixin_class() const
FunctionPtr LookupConstructor(const String &name) const
void set_type_arguments_field_offset_in_words(intptr_t host_value, intptr_t target_value) const
void set_num_native_fields(uint16_t value) const
static ClassPtr NewTypedDataClass(intptr_t class_id, IsolateGroup *isolate_group)
void set_type_arguments_field_offset(intptr_t host_value_in_bytes, intptr_t target_value_in_bytes) const
WeakArrayPtr dependent_code() const
static bool is_valid_id(intptr_t value)
void set_dependent_code(const WeakArray &array) const
intptr_t target_next_field_offset() const
static int32_t host_type_arguments_field_offset_in_words(const ClassPtr cls)
bool is_isolate_unsendable() const
ObjectPtr EvaluateCompiledExpression(const ExternalTypedData &kernel_buffer, const Array &type_definitions, const Array ¶m_values, const TypeArguments &type_param_values) const
FunctionPtr LookupSetterFunction(const String &name) const
FunctionPtr GetRecordFieldGetter(const String &getter_name) const
void set_is_sealed() const
void set_direct_subclasses(const GrowableObjectArray &subclasses) const
static intptr_t declaration_type_offset()
intptr_t host_type_arguments_field_offset() const
static bool IsIsolateUnsendable(ClassPtr clazz)
ArrayPtr interfaces() const
bool IsObjectClass() const
bool InjectCIDFields() const
void set_interfaces(const Array &value) const
bool is_type_finalized() const
void SetUserVisibleNameInClassTable()
static int32_t target_type_arguments_field_offset_in_words(const ClassPtr cls)
InstancePtr InsertCanonicalConstant(Zone *zone, const Instance &constant) const
void set_script(const Script &value) const
bool is_deeply_immutable() const
static bool IsSubtypeOf(const Class &cls, const TypeArguments &type_arguments, Nullability nullability, const AbstractType &other, Heap::Space space, FunctionTypeMapping *function_type_equivalence=nullptr)
void DisableAllocationStub() const
void SetTraceAllocation(bool trace_allocation) const
ArrayPtr constants() const
bool HasInstanceFields() const
void set_is_future_subtype(bool value) const
void set_is_declaration_loaded_unsafe() const
InstancePtr LookupCanonicalInstance(Zone *zone, const Instance &value) const
uint16_t num_native_fields() const
void MigrateImplicitStaticClosures(ProgramReloadContext *context, const Class &new_cls) const
intptr_t implementor_cid() const
void set_is_finalized() const
ArrayPtr OffsetToFieldMap(ClassTable *class_table=nullptr) const
intptr_t host_instance_size() const
static bool IsDeeplyImmutable(ClassPtr clazz)
void DisableAllCHAOptimizedCode()
FunctionPtr LookupFunctionReadLocked(const String &name) const
void AddField(const Field &field) const
void DisableCHAOptimizedCode(const Class &subclass)
bool HasCompressedPointers() const
static intptr_t num_type_arguments_offset()
void set_is_allocated(bool value) const
void set_allocation_stub(const Code &value) const
int32_t SourceFingerprint() const
static int32_t host_instance_size_in_words(const ClassPtr cls)
FunctionPtr LookupDynamicFunctionUnsafe(const String &name) const
bool IsDynamicClass() const
bool IsClosureClass() const
InvocationDispatcherEntry
@ kInvocationDispatcherArgsDesc
@ kInvocationDispatcherName
@ kInvocationDispatcherFunction
@ kInvocationDispatcherEntrySize
static bool IsInFullSnapshot(ClassPtr cls)
static constexpr intptr_t kNoTypeArguments
FunctionPtr LookupStaticFunctionAllowPrivate(const String &name) const
void set_token_pos(TokenPosition value) const
TypePtr DeclarationType() const
FieldPtr LookupStaticFieldAllowPrivate(const String &name) const
bool is_dynamically_extendable() const
FunctionPtr LookupFactory(const String &name) const
TokenPosition token_pos() const
void set_instance_size_in_words(intptr_t host_value, intptr_t target_value) const
ErrorPtr EnsureIsFinalized(Thread *thread) const
void set_is_synthesized_class_unsafe() const
bool FindInstantiationOf(Zone *zone, const Class &cls, GrowableArray< const Type * > *path, bool consider_only_super_classes=false) const
void set_is_base_class() const
static ClassPtr New(IsolateGroup *isolate_group, bool register_class=true)
bool is_prefinalized() const
void RegisterCHACode(const Code &code)
bool IsFutureClass() const
GrowableObjectArrayPtr direct_subclasses_unsafe() const
KernelProgramInfoPtr KernelProgramInfo() const
TokenPosition end_token_pos() const
bool is_future_subtype() const
FieldPtr LookupField(const String &name) const
friend class Intrinsifier
void CopyStaticFieldValues(ProgramReloadContext *reload_context, const Class &old_cls) const
void set_kernel_offset(intptr_t value) const
void set_library(const Library &value) const
void set_end_token_pos(TokenPosition value) const
ErrorPtr EnsureIsAllocateFinalized(Thread *thread) const
void DisableCHAImplementorUsers()
bool is_fields_marked_nullable() const
FunctionPtr LookupFactoryAllowPrivate(const String &name) const
ClassPtr SuperClass(ClassTable *class_table=nullptr) const
void set_is_loaded(bool value) const
static ClassPtr NewStringClass(intptr_t class_id, IsolateGroup *isolate_group)
void set_constants(const Array &value) const
intptr_t FindFieldIndex(const Field &needle) const
StringPtr UserVisibleName() const
void AddInvocationDispatcher(const String &target_name, const Array &args_desc, const Function &dispatcher) const
bool FindInstantiationOf(Zone *zone, const Class &cls, bool consider_only_super_classes=false) const
void AddDirectSubclass(const Class &subclass) const
void set_id(intptr_t value) const
bool FindInstantiationOf(Zone *zone, const Type &type, bool consider_only_super_classes=false) const
static intptr_t GetClassId(ClassPtr cls)
FieldPtr FieldFromIndex(intptr_t idx) const
static int32_t target_instance_size_in_words(const ClassPtr cls)
bool is_enum_class() const
bool IsNeverClass() const
void set_has_dynamically_extendable_subtypes(bool value) const
bool NoteImplementor(const Class &implementor) const
TypeParametersPtr type_parameters() const
void set_is_type_finalized() const
const char * UserVisibleNameCString() const
void MarkFieldBoxedDuringReload(ClassTable *class_table, const Field &field) const
void set_is_final() const
GrowableObjectArrayPtr direct_implementors() const
intptr_t FindFunctionIndex(const Function &needle) const
bool is_implemented() const
TypeParameterPtr TypeParameterAt(intptr_t index, Nullability nullability=Nullability::kNonNullable) const
static ClassPtr NewPointerClass(intptr_t class_id, IsolateGroup *isolate_group)
void set_next_field_offset(intptr_t host_value_in_bytes, intptr_t target_value_in_bytes) const
void set_is_const() const
bool is_allocate_finalized() const
bool is_transformed_mixin_application() const
FunctionPtr ImplicitClosureFunctionFromIndex(intptr_t idx) const
FunctionPtr FunctionFromIndex(intptr_t idx) const
bool IsFutureOrClass() const
UntaggedClass::ClassLoadingState class_loading_state() const
bool is_allocated() const
static ClassPtr NewNativeWrapper(const Library &library, const String &name, int num_fields)
void SetFunctions(const Array &value) const
void set_type_parameters(const TypeParameters &value) const
bool is_synthesized_class() const
static ClassPtr NewUnmodifiableTypedDataViewClass(intptr_t class_id, IsolateGroup *isolate_group)
DART_WARN_UNUSED_RESULT ErrorPtr VerifyEntryPoint() const
void CheckReload(const Class &replacement, ProgramReloadContext *context) const
FieldPtr LookupFieldAllowPrivate(const String &name, bool instance_only=false) const
bool is_isolate_unsendable_due_to_pragma() const
bool is_interface_class() const
void set_direct_implementors(const GrowableObjectArray &implementors) const
intptr_t FindInvocationDispatcherFunctionIndex(const Function &needle) const
static bool IsClosureClass(ClassPtr cls)
bool is_finalized() const
ArrayPtr current_functions() const
ArrayPtr functions() const
FieldPtr LookupStaticField(const String &name) const
void EnsureDeclarationLoaded() const
virtual StringPtr DictionaryName() const
TypeArgumentsPtr GetInstanceTypeArguments(Thread *thread, const TypeArguments &type_arguments, bool canonicalize=true) const
void set_is_isolate_unsendable(bool value) const
void set_is_dynamically_extendable(bool value) const
void set_can_be_future(bool value) const
static intptr_t packed_fields_offset()
static intptr_t InstanceSize()
ObjectPtr RawContext() const
ContextPtr GetContext() const
static intptr_t delayed_type_arguments_offset()
static intptr_t function_offset()
virtual uint32_t CanonicalizeHash() const
void set_delayed_type_arguments(const TypeArguments &args) const
static intptr_t instantiator_type_arguments_offset()
static intptr_t function_type_arguments_offset()
TypeArgumentsPtr instantiator_type_arguments() const
TypeArgumentsPtr delayed_type_arguments() const
TypeArgumentsPtr function_type_arguments() const
static intptr_t hash_offset()
void set_function_type_arguments(const TypeArguments &args) const
static intptr_t InstanceSize()
InstancePtr GetImplicitClosureReceiver() const
static FunctionPtr FunctionOf(ClosurePtr closure)
FunctionPtr function() const
void set_instantiator_type_arguments(const TypeArguments &args) const
static intptr_t context_offset()
static intptr_t InstanceSize()
static intptr_t HeaderSize()
void PrintToJSONObject(JSONObject *jsobj, bool ref) const
static intptr_t InstanceSize(intptr_t len)
static intptr_t UnroundedSize(CodeSourceMapPtr map)
static intptr_t UnroundedSize(intptr_t len)
bool Equals(const CodeSourceMap &other) const
static intptr_t instructions_offset()
void set_exception_handlers(const ExceptionHandlers &handlers) const
FunctionPtr function() const
void GetInlinedFunctionsAtReturnAddress(intptr_t pc_offset, GrowableArray< const Function * > *functions, GrowableArray< TokenPosition > *token_positions) const
LocalVarDescriptorsPtr var_descriptors() const
uword UncheckedEntryPoint() const
ArrayPtr deopt_info_array() const
void set_code_source_map(const CodeSourceMap &code_source_map) const
static uword PayloadSizeOf(const CodePtr code)
static bool IsDisabled(CodePtr code)
static intptr_t owner_offset()
NOT_IN_PRODUCT(void PrintJSONInlineIntervals(JSONObject *object) const)
void set_pc_descriptors(const PcDescriptors &descriptors) const
int32_t GetPointerOffsetAt(int index) const
PcDescriptorsPtr pc_descriptors() const
bool is_optimized() const
classid_t OwnerClassId() const
CodeSourceMapPtr code_source_map() const
static uword EntryPointOf(const CodePtr code)
bool is_force_optimized() const
static bool ContainsInstructionAt(const CodePtr code, uword pc)
ObjectPoolPtr object_pool() const
static intptr_t InstanceSize()
static uword UncheckedEntryPointOf(const CodePtr code)
void set_var_descriptors(const LocalVarDescriptors &value) const
static intptr_t active_instructions_offset()
static InstructionsPtr InstructionsOf(const CodePtr code)
bool ContainsInstructionAt(uword addr) const
static uword PayloadStartOf(const CodePtr code)
uword MonomorphicUncheckedEntryPoint() const
bool HasMonomorphicEntry() const
ArrayPtr static_calls_target_table() const
static bool IsDiscarded(const CodePtr code)
uword MonomorphicEntryPoint() const
void set_object_pool(ObjectPoolPtr object_pool) const
static intptr_t entry_point_offset(EntryKind kind=EntryKind::kNormal)
static intptr_t object_pool_offset()
static bool IsOptimized(CodePtr code)
static intptr_t InstanceSize(intptr_t len)
intptr_t pointer_offsets_length() const
static classid_t OwnerClassIdOf(CodePtr raw)
InstructionsPtr active_instructions() const
ObjectPtr return_address_metadata() const
CompressedStackMapsPtr compressed_stackmaps() const
bool IsUnknownDartCode() const
bool is_discarded() const
InstructionsPtr instructions() const
uword PayloadStart() const
ExceptionHandlersPtr exception_handlers() const
static bool HasMonomorphicEntry(const CodePtr code)
int64_t compile_timestamp() const
Iterator(const Iterator &it)
bool Find(uint32_t pc_offset)
Iterator(const PayloadHandle &maps, const PayloadHandle &global_table)
bool IsObject(intptr_t bit_index) const
intptr_t SpillSlotBitCount() const
uint32_t pc_offset() const
const uint8_t * data() const
bool IsGlobalTable() const
uintptr_t payload_size() const
bool UsesGlobalTable() const
RawPayloadHandle(const RawPayloadHandle &)=default
RawPayloadHandle & operator=(const CompressedStackMaps &maps)
RawPayloadHandle & operator=(CompressedStackMapsPtr maps)
const UntaggedCompressedStackMaps::Payload * payload() const
RawPayloadHandle & operator=(const RawPayloadHandle &)=default
RawPayloadHandle & operator=(const UntaggedCompressedStackMaps::Payload *payload)
bool IsGlobalTable() const
const uint8_t * data() const
static intptr_t UnroundedSize(intptr_t length)
bool Equals(const CompressedStackMaps &other) const
static bool IsGlobalTable(const CompressedStackMapsPtr raw)
static CompressedStackMapsPtr NewUsingTable(const void *payload, intptr_t size)
static CompressedStackMapsPtr NewInlined(const void *payload, intptr_t size)
static CompressedStackMapsPtr NewGlobalTable(const void *payload, intptr_t size)
static intptr_t HeaderSize()
static intptr_t InstanceSize()
uintptr_t payload_size() const
bool UsesGlobalTable() const
static intptr_t UnroundedSize(CompressedStackMapsPtr maps)
static uintptr_t PayloadSizeOf(const CompressedStackMapsPtr raw)
static intptr_t InstanceSize(intptr_t length)
static bool UsesGlobalTable(const CompressedStackMapsPtr raw)
static intptr_t InstanceSize()
static constexpr bool ContainsCompressedPointers()
static intptr_t InstanceSize()
static constexpr bool ContainsCompressedPointers()
static intptr_t InstanceSize()
static intptr_t InstanceSize(intptr_t len)
intptr_t num_variables() const
static intptr_t NumVariables(const ContextPtr context)
static intptr_t num_variables_offset()
static bool IsValidLength(intptr_t len)
static intptr_t variable_offset(intptr_t context_index)
static intptr_t parent_offset()
void set_parent(const Context &parent) const
void SetAt(intptr_t context_index, const Object &value) const
static intptr_t InstanceSize()
static intptr_t InstanceSize(intptr_t len)
ObjectPtr At(intptr_t context_index) const
intptr_t num_variables() const
ContextPtr parent() const
static uword AllocateReadOnlyHandle()
static intptr_t value_offset()
static intptr_t InstanceSize()
static double Value(DoublePtr dbl)
void SetClosed(bool value) const
static bool IsDynamicLibrary(const Instance &obj)
static intptr_t InstanceSize()
void SetCanBeClosed(bool value) const
void SetHandle(void *value) const
static intptr_t InstanceSize(intptr_t len)
static intptr_t InstanceSize()
static intptr_t InstanceSize()
virtual uint8_t * Validate(uint8_t *data) const
void SetData(uint8_t *data) const
void SetLength(intptr_t value) const
static bool IsExternalTypedData(const Instance &obj)
static intptr_t MaxElements(intptr_t class_id)
static intptr_t InstanceSize()
ObjectPtr At(intptr_t index, bool concurrent_use=false) const
uint16_t kind_bits() const
FunctionPtr InitializerFunction() const
bool has_initializer() const
intptr_t kernel_offset() const
void set_has_nontrivial_initializer_unsafe(bool has_nontrivial_initializer) const
void set_is_reflectable(bool value) const
static intptr_t guarded_cid_offset()
static intptr_t static_type_exactness_state_offset()
void set_is_nullable_unsafe(bool val) const
void set_is_late(bool value) const
bool NeedsInitializationCheckOnLoad() const
static intptr_t kind_bits_offset()
void set_is_unboxed(bool b) const
bool is_reflectable() const
void set_is_extension_type_member(bool value) const
void set_has_initializer(bool has_initializer) const
bool needs_length_check() const
intptr_t TargetOffset() const
void set_static_type_exactness_state(StaticTypeExactnessState state) const
void set_is_shared(bool value) const
static intptr_t guarded_list_length_in_object_offset_offset()
void set_is_generic_covariant_impl(bool value) const
StaticTypeExactnessState static_type_exactness_state() const
bool is_extension_member() const
static intptr_t host_offset_or_field_id_offset()
static intptr_t InstanceSize()
void SetOffset(intptr_t host_offset_in_bytes, intptr_t target_offset_in_bytes) const
void set_initializer_changed_after_initialization(bool value) const
void set_is_extension_member(bool value) const
void set_has_pragma(bool value) const
void set_guarded_cid(intptr_t cid) const
void set_guarded_list_length_in_object_offset(intptr_t offset) const
ObjectPtr StaticValue() const
bool needs_load_guard() const
bool has_trivial_initializer() const
bool is_covariant() const
void set_needs_load_guard(bool value) const
void set_has_initializer_unsafe(bool has_initializer) const
void set_is_covariant(bool value) const
bool is_generic_covariant_impl() const
void set_has_nontrivial_initializer(bool has_nontrivial_initializer) const
bool is_nullable_unsafe() const
intptr_t field_id() const
void set_guarded_cid_unsafe(intptr_t cid) const
intptr_t HostOffset() const
void set_is_nullable(bool val) const
void set_field_id(intptr_t field_id) const
static intptr_t initializer_function_offset()
AbstractTypePtr type() const
void set_kernel_offset(intptr_t value) const
static intptr_t TargetOffsetOf(FieldPtr field)
virtual StringPtr DictionaryName() const
bool is_extension_type_member() const
void set_is_unboxed_unsafe(bool b) const
void set_field_id_unsafe(intptr_t field_id) const
void set_guarded_list_length(intptr_t list_length) const
TokenPosition end_token_pos() const
TokenPosition token_pos() const
static intptr_t is_nullable_offset()
bool has_nontrivial_initializer() const
void set_static_type_exactness_state_unsafe(StaticTypeExactnessState state) const
static intptr_t guarded_list_length_offset()
bool initializer_changed_after_initialization() const
FinalizerEntryPtr entries_collected() const
void set_isolate(Isolate *value) const
SetPtr all_entries() const
static intptr_t entries_collected_offset()
static intptr_t all_entries_offset()
Isolate * isolate() const
void set_all_entries(const Set &value) const
static intptr_t detachments_offset()
static intptr_t isolate_offset()
void set_entries_collected(const FinalizerEntry &value) const
void set_value(const Object &value) const
FinalizerBasePtr finalizer() const
static intptr_t external_size_offset()
void set_next(const FinalizerEntry &value) const
void set_token(const Object &value) const
void set_detach(const Object &value) const
static intptr_t InstanceSize()
static intptr_t token_offset()
static intptr_t next_offset()
static intptr_t value_offset()
static intptr_t detach_offset()
FinalizerEntryPtr next() const
void set_external_size(intptr_t value) const
static intptr_t finalizer_offset()
intptr_t external_size() const
static intptr_t callback_offset()
static intptr_t type_arguments_offset()
static intptr_t InstanceSize()
ObjectPtr callback() const
static intptr_t value_offset()
static intptr_t InstanceSize()
static intptr_t InstanceSize()
static intptr_t value_offset()
static intptr_t NumOptionalParametersOf(FunctionTypePtr ptr)
TypeParametersPtr type_parameters() const
intptr_t NumOptionalNamedParameters() const
intptr_t num_implicit_parameters() const
static intptr_t parameter_types_offset()
static bool HasOptionalPositionalParameters(FunctionTypePtr ptr)
AbstractTypePtr result_type() const
intptr_t NumOptionalPositionalParameters() const
static bool HasOptionalParameters(FunctionTypePtr ptr)
static intptr_t packed_parameter_counts_offset()
ArrayPtr named_parameter_names() const
static intptr_t NumFixedParametersOf(FunctionTypePtr ptr)
intptr_t NumParentTypeArguments() const
static intptr_t NumParentTypeArgumentsOf(FunctionTypePtr ptr)
intptr_t NumTypeArguments() const
static intptr_t NumTypeArgumentsOf(FunctionTypePtr ptr)
bool HasOptionalNamedParameters() const
static intptr_t named_parameter_names_offset()
bool HasOptionalParameters() const
bool HasOptionalPositionalParameters() const
bool HasGenericParent() const
static intptr_t NameArrayLengthIncludingFlags(intptr_t num_parameters)
static intptr_t NumParametersOf(FunctionTypePtr ptr)
intptr_t NumParameters() const
static intptr_t NumOptionalNamedParametersOf(FunctionTypePtr ptr)
static bool HasOptionalNamedParameters(FunctionTypePtr ptr)
static bool IsGeneric(FunctionTypePtr ptr)
intptr_t num_fixed_parameters() const
static intptr_t NumTypeParametersOf(FunctionTypePtr ptr)
intptr_t NumTypeParameters() const
virtual classid_t type_class_id() const
static intptr_t InstanceSize()
virtual bool HasTypeClass() const
static intptr_t type_parameters_offset()
uint16_t packed_type_parameter_counts() const
intptr_t NumOptionalParameters() const
ArrayPtr parameter_types() const
uint32_t packed_parameter_counts() const
static intptr_t NumOptionalPositionalParametersOf(FunctionTypePtr ptr)
static intptr_t packed_type_parameter_counts_offset()
bool IsSyncGenerator() const
bool is_unboxed_integer_parameter_at(intptr_t index) const
bool IsRecognized() const
bool has_unboxed_return() const
bool HasUnboxedParameters() const
COMPILE_ASSERT(MethodRecognizer::kNumRecognizedMethods<(1<< kRecognizedTagSize))
CodePtr CurrentCode() const
virtual StringPtr DictionaryName() const
static uword EntryPointOf(const FunctionPtr function)
bool IsDispatcherOrImplicitAccessor() const
bool IsIrregexpFunction() const
COMPILE_ASSERT(kNumTagBits<=(kBitsPerByte *sizeof(decltype(UntaggedFunction::kind_tag_))))
void set_unboxed_integer_return() const
bool has_unboxed_double_return() const
bool IsImplicitInstanceClosureFunction() const
void SetOptimizedInstructionCountClamped(uintptr_t value) const
bool IsImplicitClosureFunction() const
void set_kernel_offset(intptr_t value) const
bool IsNoSuchMethodDispatcher() const
static bool IsFfiCallbackTrampoline(FunctionPtr function)
bool IsRegularFunction() const
bool IsImplicitGetterOrSetter() const
static bool is_visible(FunctionPtr f)
bool has_unboxed_integer_return() const
void set_end_token_pos(TokenPosition value) const
static intptr_t code_offset()
bool IsDynamicClosureCallDispatcher() const
ArrayPtr parameter_types() const
bool MakesCopyOfParameters() const
bool IsFieldInitializer() const
bool NeedsTypeArgumentTypeChecks() const
bool has_unboxed_record_return() const
bool IsStaticFunction() const
bool IsDynamicFunction(bool allow_abstract=false) const
ObjectPtr RawOwner() const
void set_unboxed_double_parameter_at(intptr_t index) const
bool IsSuspendableFunction() const
static intptr_t InstanceSize()
void SetUsageCounter(intptr_t value) const
bool IsImplicitGetterFunction() const
void set_unboxed_integer_parameter_at(intptr_t index) const
static constexpr intptr_t maximum_unboxed_parameter_count()
bool IsGetterFunction() const
bool HasAwaiterLink() const
TokenPosition token_pos() const
static intptr_t kind_tag_offset()
uword entry_point() const
PRECOMPILER_WSR_FIELD_DECLARATION(FunctionType, signature)
uint32_t packed_fields() const
bool IsClosureFunction() const
bool IsFfiCallbackTrampoline() const
bool IsImplicitStaticGetterFunction() const
static bool IsImplicitClosureFunction(FunctionPtr func)
void set_unboxed_record_return() const
intptr_t kernel_offset() const
static CodePtr CurrentCodeOf(const FunctionPtr function)
static intptr_t signature_offset()
bool is_unboxed_parameter_at(intptr_t index) const
void SetOptimizedCallSiteCountClamped(uintptr_t value) const
bool IsRecordFieldGetter() const
bool IsAsyncFunction() const
bool IsInvokeFieldDispatcher() const
void reset_unboxed_parameters_and_return() const
bool IsAsyncGenerator() const
bool IsNonImplicitClosureFunction() const
bool HasSavedArgumentsDescriptor() const
bool IsImplicitStaticClosureFunction() const
bool IsMethodExtractor() const
CodePtr unoptimized_code() const
static intptr_t entry_point_offset(CodeEntryKind entry_kind=CodeEntryKind::kNormal)
bool HasThisParameter() const
bool is_unboxed_double_parameter_at(intptr_t index) const
bool is_optimizable() const
bool HasGenericParent() const
void SetWasExecuted(bool value) const
bool HasUnboxedReturnValue() const
static UntaggedFunction::Kind KindOf(FunctionPtr func)
UntaggedFunction::AsyncModifier modifier() const
TypeParametersPtr type_parameters() const
bool NeedsArgumentTypeChecks() const
bool IsLocalFunction() const
bool IsGenerativeConstructor() const
bool IsDynamicInvocationForwarder() const
UntaggedFunction::Kind kind() const
TokenPosition end_token_pos() const
static intptr_t unchecked_entry_point_offset()
bool IsImplicitSetterFunction() const
static intptr_t data_offset()
bool IsDynamicInvokeFieldDispatcher() const
void set_is_optimizable(bool value) const
void set_unboxed_double_return() const
MethodRecognizer::Kind recognized_kind() const
bool IsConstructor() const
bool HasImplicitClosureFunction() const
bool IsSetterFunction() const
AbstractTypePtr result_type() const
static intptr_t InstanceSize()
static intptr_t type_arguments_offset()
virtual TypeArgumentsPtr GetTypeArguments() const
virtual InstancePtr CanonicalizeLocked(Thread *thread) const
void SetData(const Array &value) const
void SetLength(intptr_t value) const
static SmiPtr NoSafepointLength(const GrowableObjectArrayPtr array)
virtual void SetTypeArguments(const TypeArguments &value) const
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
static ArrayPtr NoSafepointData(const GrowableObjectArrayPtr array)
static intptr_t type_arguments_offset()
virtual TypeArgumentsPtr GetTypeArguments() const
static intptr_t InstanceSize()
static intptr_t data_offset()
ObjectPtr At(intptr_t index) const
virtual bool CanonicalizeEquals(const Instance &other) const
void SetAt(intptr_t index, const Object &value) const
intptr_t Capacity() const
static intptr_t length_offset()
static intptr_t ExactnessIndexFor(intptr_t num_args)
static intptr_t owner_offset()
static intptr_t CodeIndexFor(intptr_t num_args)
static intptr_t TargetIndexFor(intptr_t num_args)
bool receiver_cannot_be_smi() const
static intptr_t NumArgsTestedMask()
intptr_t deopt_id() const
ICDataPtr AsUnaryClassChecks() const
static intptr_t entries_offset()
static intptr_t state_bits_offset()
static intptr_t CountIndexFor(intptr_t num_args)
static intptr_t NumArgsTestedShift()
bool IsValidEntryIndex(intptr_t index) const
static intptr_t InstanceSize()
void Clear(const CallSiteResetter &proof_of_reload) const
bool is_tracking_exactness() const
AbstractTypePtr receivers_static_type() const
void set_receiver_cannot_be_smi(bool value) const
static intptr_t receivers_static_type_offset()
void set_is_megamorphic(bool value) const
bool HasDeoptReasons() const
static intptr_t EntryPointIndexFor(intptr_t num_args)
static intptr_t InstanceSize()
static intptr_t InstanceSize(intptr_t len)
static constexpr bool ContainsCompressedPointers()
static constexpr bool ContainsCompressedPointers()
static intptr_t data_offset()
intptr_t GetNativeField(int index) const
static intptr_t NextFieldOffset()
uint16_t NumNativeFields() const
static intptr_t InstanceSize()
static intptr_t NativeFieldsOffset()
void GetNativeFields(uint16_t num_fields, intptr_t *field_values) const
static intptr_t UnroundedSize()
intptr_t SizeFromClass() const
bool IsValidNativeIndex(int index) const
static intptr_t InstanceSize(intptr_t size)
static intptr_t HeaderSize()
static intptr_t InstanceSize()
static intptr_t Size(const InstructionsSectionPtr instr)
static intptr_t InstanceSize()
bool ContainsPc(uword pc) const
static uword PayloadStartAt(InstructionsTablePtr table, intptr_t index)
uword PayloadStartAt(intptr_t index) const
const UntaggedInstructionsTable::Data * rodata() const
static uword MonomorphicEntryPoint(const InstructionsPtr instr)
static intptr_t InstanceSize()
static InstructionsPtr FromPayloadStart(uword payload_start)
static intptr_t InstanceSize(intptr_t size)
uword MonomorphicEntryPoint() const
uword PayloadStart() const
static uword PayloadStart(const InstructionsPtr instr)
static uint32_t Hash(const InstructionsPtr instr)
static intptr_t HeaderSize()
bool Equals(const Instructions &other) const
static uword EntryPoint(const InstructionsPtr instr)
static constexpr intptr_t kBarePayloadAlignment
static intptr_t Size(const InstructionsPtr instr)
static bool Equals(InstructionsPtr a, InstructionsPtr b)
static intptr_t InstanceSize()
static intptr_t value_offset()
static int64_t GetInt64Value(const IntegerPtr obj)
static IntegerPtr New(const String &str, Heap::Space space=Heap::kNew)
virtual ObjectPtr HashCode() const
virtual bool OperatorEquals(const Instance &other) const
virtual int64_t AsTruncatedInt64Value() const
virtual bool CanonicalizeEquals(const Instance &other) const
static IsolateGroup * Current()
ClassTable * class_table() const
FieldTable * field_table() const
static Isolate * Current()
static intptr_t InstanceSize()
ArrayPtr libraries_cache() const
ArrayPtr constants() const
TypedDataViewPtr constants_table() const
TypedDataPtr string_offsets() const
TypedDataViewPtr string_data() const
ArrayPtr classes_cache() const
TypedDataViewPtr metadata_mappings() const
TypedDataPtr canonical_names() const
TypedDataBasePtr kernel_component() const
TypedDataViewPtr metadata_payloads() const
static intptr_t InstanceSize()
Report::Kind kind() const
virtual StringPtr DictionaryName() const
static intptr_t InstanceSize()
bool is_deferred_load() const
intptr_t num_imports() const
LibraryPtr importer() const
intptr_t num_imports() const
void set_native_entry_symbol_resolver(Dart_NativeEntrySymbol native_symbol_resolver) const
void set_is_dart_scheme(bool value) const
bool LoadRequested() const
GrowableObjectArrayPtr used_scripts() const
ArrayPtr dependencies() const
void set_native_entry_resolver(Dart_NativeEntryResolver value) const
bool LoadNotStarted() const
void set_ffi_native_resolver(Dart_FfiNativeResolver value) const
bool is_in_fullsnapshot() const
ClassPtr toplevel_class() const
static intptr_t InstanceSize()
Dart_NativeEntrySymbol native_entry_symbol_resolver() const
void set_debuggable(bool value) const
void set_is_in_fullsnapshot(bool value) const
bool is_dart_scheme() const
LoadingUnitPtr loading_unit() const
Dart_NativeEntryResolver native_entry_resolver() const
void set_index(intptr_t value) const
bool IsDebuggable() const
void set_kernel_library_index(intptr_t value) const
StringPtr private_key() const
bool LoadInProgress() const
intptr_t kernel_library_index() const
Dart_FfiNativeResolver ffi_native_resolver() const
KernelProgramInfoPtr kernel_program_info() const
static StringPtr UrlOf(LibraryPtr lib)
void set_hash_mask(intptr_t value) const
void set_data(const Array &value) const
static intptr_t IndexSizeToHashMask(intptr_t index_size)
static intptr_t deleted_keys_offset()
TypedDataPtr index() const
SmiPtr deleted_keys() const
static intptr_t data_offset()
virtual void SetTypeArguments(const TypeArguments &value) const
void set_deleted_keys(intptr_t value) const
static intptr_t InstanceSize()
static const LinkedHashBase & Cast(const Object &obj)
static intptr_t type_arguments_offset()
static intptr_t index_offset()
void set_used_data(intptr_t value) const
static intptr_t used_data_offset()
void set_index(const TypedData &value) const
static intptr_t hash_mask_offset()
virtual TypeArgumentsPtr GetTypeArguments() const
const uint8_t * instructions_image() const
LoadingUnitPtr parent() const
COMPILE_ASSERT(kIllegalId==WeakTable::kNoValue)
static intptr_t InstanceSize()
void set_loaded(bool value) const
bool load_outstanding() const
void set_instructions_image(const uint8_t *value) const
bool has_instructions_image() const
ArrayPtr base_objects() const
void set_load_outstanding() const
static intptr_t InstanceSize(intptr_t len)
static intptr_t InstanceSize()
ObjectPtr CurrentValue() const
ObjectPtr CurrentKey() const
static intptr_t InstanceSize()
static intptr_t InstanceSize()
static intptr_t buckets_offset()
static intptr_t arguments_descriptor_offset()
static intptr_t mask_offset()
static intptr_t InstanceSize()
virtual bool IsZero() const
virtual bool IsNegative() const
static int64_t Value(MintPtr mint)
static intptr_t value_offset()
ObjectPtr referent() const
static intptr_t InstanceSize()
void set_referent(const Object &referent) const
static intptr_t entrypoint_offset()
static intptr_t expected_cid_offset()
static MonomorphicSmiableCallPtr New(classid_t expected_cid, const Code &target)
static intptr_t InstanceSize()
classid_t expected_cid() const
ArrayPtr hide_names() const
static intptr_t InstanceSize()
ArrayPtr show_names() const
LibraryPtr target() const
static intptr_t callback_offset()
void set_callback(const Pointer &value) const
static intptr_t InstanceSize()
PointerPtr callback() const
EntryType TypeAt(intptr_t index) const
ObjectPtr ObjectAt(intptr_t index) const
uword RawValueAt(intptr_t index) const
void SetObjectAt(intptr_t index, const Object &obj) const
static uint8_t EncodeBits(EntryType type, Patchability patchable, SnapshotBehavior snapshot_behavior)
SnapshotBehavior SnapshotBehaviorAt(intptr_t index) const
static intptr_t InstanceSize()
void SetRawValueAt(intptr_t index, uword raw_value) const
static intptr_t length_offset()
static intptr_t OffsetFromIndex(intptr_t index)
void SetLength(intptr_t value) const
static intptr_t element_offset(intptr_t index)
Patchability PatchableAt(intptr_t index) const
static intptr_t data_offset()
static intptr_t IndexFromOffset(intptr_t offset)
static intptr_t InstanceSize(intptr_t len)
void SetTypeAt(intptr_t index, EntryType type, Patchability patchable, SnapshotBehavior snapshot_behavior) const
ObjectPtr Decompress(uword heap_base) const
UntaggedObject * untag() const
intptr_t GetClassId() const
static ObjectPtr Clone(const Object &orig, Heap::Space space, bool load_with_relaxed_atomics=false)
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)
static ClassPtr icdata_class()
static ClassPtr pc_descriptors_class()
void setPtr(ObjectPtr value, intptr_t default_cid)
void StoreNonPointer(const FieldType *addr, ValueType value) const
static ClassPtr loadingunit_class()
static ClassPtr type_parameters_class()
type LoadPointer(type const *addr) const
static ClassPtr ffi_trampoline_data_class()
static ClassPtr class_class()
static ClassPtr exception_handlers_class()
static void InitNullAndBool(IsolateGroup *isolate_group)
static ClassPtr namespace_class()
void ClearCanonical() const
void AddCommonObjectProperties(JSONObject *jsobj, const char *protocol_type, bool ref) const
static const ClassId kClassId
void PrintJSON(JSONStream *stream, bool ref=true) const
static ClassPtr instructions_class()
void StoreCompressedPointer(compressed_type const *addr, type value) const
static ClassPtr instructions_table_class()
static ClassPtr weak_serialization_reference_class()
static DART_FORCE_INLINE T::ObjectPtrType AllocateVariant(intptr_t class_id, Heap::Space space, intptr_t elements)
static DART_FORCE_INLINE T::ObjectPtrType AllocateVariant(intptr_t class_id, Heap::Space space)
static Object & Handle(Zone *zone)
static Object & ZoneHandle(ObjectPtr ptr)
intptr_t GetClassId() const
bool Contains(uword addr) const
static ClassPtr type_arguments_class()
FieldType LoadNonPointer(const FieldType *addr) const
static DART_FORCE_INLINE T::ObjectPtrType Allocate(Heap::Space space)
static Object * ReadOnlyHandle()
virtual const char * JSONType() const
void StorePointerUnaligned(type const *addr, type value, Thread *thread) const
static ClassPtr language_error_class()
bool InVMIsolateHeap() const
static ClassPtr megamorphic_cache_class()
virtual StringPtr DictionaryName() const
void set_vtable(cpp_vtable value)
void StorePointer(type const *addr, type value) const
void UnimplementedMethod() const
static ClassPtr unhandled_exception_class()
void StoreSmi(SmiPtr const *addr, SmiPtr value) const
static ClassPtr sentinel_class()
static bool ShouldHaveImmutabilityBitSet(classid_t class_id)
static ClassPtr object_pool_class()
static Object & Handle(Zone *zone, ObjectPtr ptr)
static void FinishInit(IsolateGroup *isolate_group)
static ClassPtr var_descriptors_class()
static ClassPtr weak_array_class()
static DART_FORCE_INLINE uword from_offset()
CLASS_LIST_FOR_HANDLES(DEFINE_CLASS_TESTER)
static void FinalizeVMIsolate(IsolateGroup *isolate_group)
static ClassPtr singletargetcache_class()
void SetImmutable() const
static ClassPtr context_class()
static ClassPtr patch_class_class()
static ClassPtr code_class()
static void InitVtables()
static ClassPtr unlinkedcall_class()
friend class TwoByteString
static void MakeUnusedSpaceTraversable(const Object &obj, intptr_t original_size, intptr_t used_size)
static void set_vm_isolate_snapshot_object_table(const Array &table)
void SetCanonical() const
static void FinalizeReadOnlyObject(ObjectPtr object)
virtual const char * ToCString() const
static constexpr bool ContainsCompressedPointers()
static ClassPtr library_class()
static ClassPtr unwind_error_class()
cpp_vtable vtable() const
CLASS_LIST(STORE_NON_POINTER_ILLEGAL_TYPE)
static ClassPtr field_class()
FieldType * UnsafeMutableNonPointer(const FieldType *addr) const
static DART_NOINLINE Object & HandleImpl(Zone *zone, ObjectPtr ptr, intptr_t default_cid)
static constexpr intptr_t RoundedAllocationSize(intptr_t size)
static ClassPtr script_class()
virtual void PrintImplementationFieldsImpl(const JSONArray &jsarr_fields) const
void StoreNonPointer(const FieldType *addr, ValueType value) const
friend ObjectPtr AllocateObject(intptr_t, intptr_t, intptr_t)
virtual void PrintJSONImpl(JSONStream *stream, bool ref) const
static intptr_t InstanceSize()
static ClassPtr context_scope_class()
static ClassPtr instructions_section_class()
static DART_NOINLINE Object * ReadOnlyHandleImpl(intptr_t cid)
static ObjectPtr RawCast(ObjectPtr obj)
static DART_NOINLINE Object & ZoneHandleImpl(Zone *zone, ObjectPtr ptr, intptr_t default_cid)
static ClassPtr void_class()
static Object & ZoneHandle()
static ClassPtr dynamic_class()
static intptr_t tags_offset()
static ClassPtr function_class()
friend class OneByteString
void operator=(ObjectPtr value)
static ClassPtr code_source_map_class()
FieldType LoadNonPointer(const FieldType *addr) const
static void Init(IsolateGroup *isolate_group)
static void VerifyBuiltinVtable(intptr_t cid)
static ClassPtr monomorphicsmiablecall_class()
static constexpr intptr_t kHashBits
void PrintImplementationFields(JSONStream *stream) const
static DART_FORCE_INLINE uword to_offset(intptr_t length=0)
static ClassPtr closure_data_class()
static ClassPtr api_error_class()
void StoreSimd128(const FieldType *addr, simd128_value_t value) const
static ClassPtr compressed_stackmaps_class()
static ClassPtr kernel_program_info_class()
static ClassPtr subtypetestcache_class()
static void VerifyBuiltinVtables()
static Object & Handle(ObjectPtr ptr)
static Object & ZoneHandle(Zone *zone)
static Object & ZoneHandle(Zone *zone, ObjectPtr ptr)
static DART_FORCE_INLINE T::ObjectPtrType Allocate(Heap::Space space, intptr_t elements)
void ClearImmutable() const
static void SetCharAt(const String &str, intptr_t index, uint8_t code_unit)
static intptr_t UnroundedSize(OneByteStringPtr str)
static intptr_t data_offset()
static intptr_t InstanceSize(intptr_t len)
static OneByteStringPtr New(const char *c_string, Heap::Space space=Heap::kNew)
static intptr_t InstanceSize()
static OneByteStringPtr null()
static intptr_t UnroundedSize(intptr_t len)
static uint16_t CharAt(OneByteStringPtr str, intptr_t index)
static uint16_t CharAt(const String &str, intptr_t index)
static PassiveObject & ZoneHandle(Zone *zone, ObjectPtr ptr)
void operator=(ObjectPtr value)
void operator^=(ObjectPtr value)
static PassiveObject & ZoneHandle(Zone *zone)
static PassiveObject & ZoneHandle(ObjectPtr ptr)
static PassiveObject & Handle(Zone *zone)
static PassiveObject & Handle(Zone *zone, ObjectPtr ptr)
static PassiveObject & ZoneHandle()
static PassiveObject & Handle(ObjectPtr ptr)
static PassiveObject & Handle()
ClassPtr wrapped_class() const
KernelProgramInfoPtr kernel_program_info() const
void set_kernel_program_info(const KernelProgramInfo &info) const
static bool IsInFullSnapshot(PatchClassPtr cls)
void set_kernel_library_index(intptr_t index) const
intptr_t kernel_library_index() const
static intptr_t InstanceSize()
Iterator(const PcDescriptors &descriptors, intptr_t kind_mask)
intptr_t YieldIndex() const
TokenPosition TokenPos() const
intptr_t TryIndex() const
UntaggedPcDescriptors::Kind Kind() const
static intptr_t UnroundedSize(PcDescriptorsPtr desc)
static intptr_t HeaderSize()
bool Equals(const PcDescriptors &other) const
static intptr_t InstanceSize(intptr_t len)
static intptr_t InstanceSize()
static intptr_t UnroundedSize(intptr_t len)
static intptr_t data_offset()
static intptr_t type_arguments_offset()
static constexpr intptr_t kNativeTypeArgPos
size_t NativeAddress() const
void SetNativeAddress(size_t address) const
static intptr_t InstanceSize()
AbstractTypePtr type_argument() const
StringPtr debug_name() const
StackTracePtr allocation_location() const
InstancePtr handler() const
static intptr_t InstanceSize()
void set_handler(const Instance &value) const
void set_keep_isolate_alive(bool value) const
void set_is_open(bool value) const
static intptr_t handler_offset()
static intptr_t send_port_offset()
SendPortPtr send_port() const
bool keep_isolate_alive() const
static RecordShape ForUnnamed(intptr_t num_fields)
bool operator!=(const RecordShape &other) const
RecordShape(SmiPtr smi_value)
RecordShape(intptr_t num_fields, intptr_t field_names_index)
intptr_t field_names_index() const
intptr_t num_fields() const
bool operator==(const RecordShape &other) const
static constexpr intptr_t kMaxNumFields
bool HasNamedFields() const
RecordShape(intptr_t value)
RecordShape shape() const
virtual classid_t type_class_id() const
intptr_t NumFields() const
static intptr_t InstanceSize()
ArrayPtr field_types() const
virtual bool HasTypeClass() const
ArrayPtr GetFieldNames(Thread *thread) const
static intptr_t InstanceSize(intptr_t num_fields)
static intptr_t shape_offset()
RecordShape shape() const
static intptr_t InstanceSize()
static intptr_t NumFields(RecordPtr ptr)
intptr_t num_fields() const
static intptr_t field_index_at_offset(intptr_t offset_in_bytes)
void SetFieldAt(intptr_t field_index, const Object &value) const
static intptr_t field_offset(intptr_t index)
ObjectPtr FieldAt(intptr_t field_index) const
bool NeedsUnicodeCaseEquivalents()
bool operator!=(const RegExpFlags &other) const
bool operator==(const RegExpFlags &other) const
TypedDataPtr bytecode(bool is_one_byte, bool sticky) const
void set_is_simple() const
void set_is_multi_line() const
void set_is_unicode() const
StringPtr pattern() const
void set_num_bracket_expressions(const Smi &value) const
bool is_initialized() const
ArrayPtr capture_name_map() const
void set_is_complex() const
void set_is_dot_all() const
static intptr_t function_offset(intptr_t cid, bool sticky)
void set_num_bracket_expressions(SmiPtr value) const
static intptr_t InstanceSize()
intptr_t num_bracket_expressions() const
void set_is_ignore_case() const
void set_flags(RegExpFlags flags) const
RegExpFlags flags() const
FunctionPtr function(intptr_t cid, bool sticky) const
intptr_t num_registers(bool is_one_byte) const
void set_num_registers(bool is_one_byte, intptr_t value) const
void set_is_global() const
static intptr_t line_starts_offset()
intptr_t kernel_script_index() const
intptr_t col_offset() const
int64_t load_timestamp() const
static intptr_t InstanceSize()
intptr_t line_offset() const
static intptr_t InstanceSize()
Dart_Port origin_id() const
void set_origin_id(Dart_Port id) const
static intptr_t InstanceSize()
ObjectPtr CurrentKey() const
static intptr_t InstanceSize()
static SingleTargetCachePtr New()
void set_target(const Code &target) const
static intptr_t InstanceSize()
DEFINE_NON_POINTER_FIELD_ACCESSORS(intptr_t, lower_limit)
DEFINE_NON_POINTER_FIELD_ACCESSORS(intptr_t, upper_limit)
static intptr_t target_offset()
DEFINE_NON_POINTER_FIELD_ACCESSORS(uword, entry_point)
static bool IsMatch(const Object &a, const Object &b)
static uword Hash(const Object &obj)
static bool ReportStats()
static const char * Name()
static SmiPtr New(intptr_t value)
static intptr_t InstanceSize()
static constexpr intptr_t kMaxValue
static intptr_t RawValue(intptr_t value)
static bool IsValid(int64_t value)
virtual bool IsZero() const
virtual bool IsNegative() const
static intptr_t Value(const SmiPtr raw_smi)
void operator^=(ObjectPtr value)
virtual bool FitsIntoSmi() const
void operator=(SmiPtr value)
TypedDataPtr pc_offset_array() const
static intptr_t InstanceSize()
ArrayPtr code_array() const
StackTracePtr async_link() const
static StaticTypeExactnessState NotTracking()
static StaticTypeExactnessState Decode(int8_t value)
void Add(const uint8_t *code_units, intptr_t len)
void Add(uint16_t code_unit)
void Add(const uint16_t *code_units, intptr_t len)
CodePointIterator(const String &str)
CodePointIterator(const String &str, intptr_t start, intptr_t length)
virtual bool OperatorEquals(const Instance &other) const
static constexpr intptr_t kSizeofRawString
static constexpr intptr_t kMaxElements
static StringPtr NewExternal(const uint8_t *utf8_array, intptr_t array_len, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback, Heap::Space=Heap::kNew)
bool IsOneByteString() const
static uword Hash(const int32_t *characters, intptr_t len)
static uint32_t SetCachedHashIfNotSet(StringPtr obj, uint32_t hash)
virtual ObjectPtr HashCode() const
static uword HashRawSymbol(const StringPtr symbol)
void SetHash(intptr_t value) const
static intptr_t HeaderSize()
virtual uint32_t CanonicalizeHash() const
void SetLength(intptr_t value) const
bool Equals(const String &str) const
static intptr_t length_offset()
static intptr_t InstanceSize()
static intptr_t hash_offset()
bool IsTwoByteString() const
static uint32_t SetCachedHash(StringPtr obj, uint32_t hash)
static StringPtr SubString(const String &str, intptr_t begin_index, intptr_t length, Heap::Space space=Heap::kNew)
uint16_t CharAt(intptr_t index) const
bool StartsWith(const String &other) const
virtual bool CanonicalizeEquals(const Instance &other) const
bool EqualsLatin1(const uint8_t *characters, intptr_t len) const
static StringPtr NewExternal(const uint16_t *utf16_array, intptr_t array_len, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback, Heap::Space=Heap::kNew)
static uint32_t GetCachedHash(const StringPtr obj)
static intptr_t LengthOf(StringPtr obj)
FINAL_HEAP_OBJECT_IMPLEMENTATION(String, Instance)
intptr_t num_occupied() const
static intptr_t num_inputs_offset()
static intptr_t cache_offset()
static constexpr intptr_t MaxEntriesForCacheAllocatedFor(intptr_t count)
intptr_t num_inputs() const
static intptr_t InstanceSize()
static intptr_t frame_size_offset()
static intptr_t error_callback_offset()
static intptr_t function_data_offset()
ClosurePtr error_callback() const
static intptr_t then_callback_offset()
static intptr_t InstanceSize(intptr_t frame_capacity)
static intptr_t FrameSizeGrowthGap()
static intptr_t HeaderSize()
static intptr_t payload_offset()
static intptr_t UnroundedSize(SuspendStatePtr ptr)
ClosurePtr then_callback() const
static intptr_t InstanceSize()
static intptr_t pc_offset()
InstancePtr function_data() const
static intptr_t frame_capacity_offset()
intptr_t frame_size() const
static intptr_t UnroundedSize(intptr_t frame_capacity)
static Thread * Current()
static TokenPosition Deserialize(int32_t value)
~TransferableTypedDataPeer()
void set_handle(FinalizablePersistentHandle *handle)
FinalizablePersistentHandle * handle() const
TransferableTypedDataPeer(uint8_t *data, intptr_t length)
static intptr_t InstanceSize()
static uint16_t CharAt(const String &str, intptr_t index)
static intptr_t UnroundedSize(TwoByteStringPtr str)
static uint16_t CharAt(TwoByteStringPtr str, intptr_t index)
static intptr_t InstanceSize(intptr_t len)
static intptr_t InstanceSize()
static intptr_t data_offset()
static TwoByteStringPtr null()
static intptr_t UnroundedSize(intptr_t len)
static void SetCharAt(const String &str, intptr_t index, uint16_t ch)
KeyLocation FindKeyOrUnused(const TypeArguments &instantiator_tav, const TypeArguments &function_tav) const
@ kInstantiatedTypeArgsIndex
static const Array & EmptyStorage()
intptr_t NumOccupied() const
intptr_t NumEntries() const
bool IsEquivalent(const TypeArguments &other, TypeEquality kind, FunctionTypeMapping *function_type_equivalence=nullptr) const
static intptr_t instantiations_offset()
bool IsInstantiated(Genericity genericity=kAny, intptr_t num_free_fun_type_params=kAllFree) const
virtual uint32_t CanonicalizeHash() const
static intptr_t types_offset()
bool Equals(const TypeArguments &other) const
static intptr_t InstanceSize()
static intptr_t InstanceSize(intptr_t len)
static intptr_t hash_offset()
AbstractTypePtr TypeAtNullSafe(intptr_t index) const
virtual InstancePtr CanonicalizeLocked(Thread *thread) const
static intptr_t type_at_offset(intptr_t index)
bool IsRaw(intptr_t from_index, intptr_t len) const
bool IsRawWhenInstantiatedFromRaw(intptr_t len) const
static intptr_t nullability_offset()
static intptr_t length_offset()
virtual classid_t type_class_id() const
bool IsClassTypeParameter() const
static intptr_t index_offset()
virtual bool HasTypeClass() const
virtual void EnumerateURIs(URIs *uris) const
static intptr_t InstanceSize()
const char * CanonicalNameCString() const
bool IsFunctionTypeParameter() const
static intptr_t defaults_offset()
static intptr_t flags_offset()
static intptr_t names_offset()
static intptr_t InstanceSize()
COMPILE_ASSERT(kFlagsPerSmi< kSmiBits)
static intptr_t bounds_offset()
virtual void EnumerateURIs(URIs *uris) const
TypeArgumentsPtr GetInstanceTypeArguments(Thread *thread, bool canonicalize=true) const
static TypePtr VoidType()
static TypePtr NullableIntType()
virtual classid_t type_class_id() const
virtual void PrintName(NameVisibility visibility, BaseTextBuffer *printer) const
TypePtr ToNullability(Nullability value, Heap::Space space) const
static TypePtr ArrayType()
static TypePtr NullableDouble()
virtual ClassPtr type_class() const
bool IsDeclarationTypeOf(const Class &cls) const
static TypePtr MintType()
static TypePtr NullType()
static intptr_t arguments_offset()
virtual bool IsInstantiated(Genericity genericity=kAny, intptr_t num_free_fun_type_params=kAllFree) const
static intptr_t InstanceSize()
virtual TypeArgumentsPtr arguments() const
static TypePtr StringType()
static TypePtr BoolType()
static TypePtr DartFunctionType()
static TypePtr ObjectType()
virtual bool HasTypeClass() const
virtual AbstractTypePtr UpdateFunctionTypes(intptr_t num_parent_type_args_adjustment, intptr_t num_free_fun_type_params, Heap::Space space, FunctionTypeMapping *function_type_mapping) const
void set_type_class(const Class &value) const
static TypePtr NeverType()
virtual uword ComputeHash() const
void set_arguments(const TypeArguments &value) const
virtual AbstractTypePtr InstantiateFrom(const TypeArguments &instantiator_type_arguments, const TypeArguments &function_type_arguments, intptr_t num_free_fun_type_params, Heap::Space space, FunctionTypeMapping *function_type_mapping=nullptr, intptr_t num_parent_type_args_adjustment=0) const
static TypePtr Float64x2()
static TypePtr DynamicType()
virtual AbstractTypePtr Canonicalize(Thread *thread) const
static TypePtr Float32x4()
static TypePtr New(const Class &clazz, const TypeArguments &arguments, Nullability nullability=Nullability::kNonNullable, Heap::Space space=Heap::kOld)
static TypePtr NullableNumber()
static TypePtr NewNonParameterizedType(const Class &type_class)
static TypePtr DartTypeType()
virtual bool IsEquivalent(const Instance &other, TypeEquality kind, FunctionTypeMapping *function_type_equivalence=nullptr) const
TypedDataElementType ElementType() const
virtual uint8_t * Validate(uint8_t *data) const
intptr_t ElementSizeInBytes() const
static TypedDataElementType ElementType(classid_t cid)
static intptr_t length_offset()
intptr_t LengthInBytes() const
static intptr_t ElementSizeInBytes(classid_t cid)
void SetLength(intptr_t value) const
void * DataAddr(intptr_t byte_offset) const
TypedDataBasePtr typed_data() const
static intptr_t typed_data_offset()
static intptr_t offset_in_bytes_offset()
static SmiPtr OffsetInBytes(const TypedDataView &view)
static intptr_t InstanceSize()
virtual uint8_t * Validate(uint8_t *data) const
static InstancePtr Data(const TypedDataView &view)
void InitializeWith(const TypedDataBase &typed_data, intptr_t offset_in_bytes, intptr_t length)
SmiPtr offset_in_bytes() const
static bool IsExternalTypedDataView(const TypedDataView &view_obj)
static intptr_t payload_offset()
static bool IsTypedData(const Instance &obj)
static intptr_t InstanceSize(intptr_t lengthInBytes)
static intptr_t MaxNewSpaceElements(intptr_t class_id)
static intptr_t MaxElements(intptr_t class_id)
void RecomputeDataField()
static intptr_t InstanceSize()
static intptr_t stacktrace_offset()
InstancePtr exception() const
static intptr_t exception_offset()
static intptr_t InstanceSize()
InstancePtr stacktrace() const
static intptr_t InstanceSize()
bool can_patch_to_monomorphic() const
@ kFinalizedUninstantiated
BitField< decltype(packed_parameter_counts_), uint16_t, PackedHasNamedOptionalParameters::kNextBit, 14 > PackedNumFixedParameters
BitField< decltype(packed_parameter_counts_), bool, PackedNumImplicitParameters::kNextBit, 1 > PackedHasNamedOptionalParameters
BitField< decltype(packed_type_parameter_counts_), uint8_t, PackedNumParentTypeArguments::kNextBit, 8 > PackedNumTypeParameters
BitField< decltype(packed_parameter_counts_), uint8_t, 0, 1 > PackedNumImplicitParameters
BitField< decltype(packed_parameter_counts_), uint16_t, PackedNumFixedParameters::kNextBit, 14 > PackedNumOptionalParameters
BitField< decltype(packed_type_parameter_counts_), uint8_t, 0, 8 > PackedNumParentTypeArguments
static constexpr intptr_t kCapacity
void StoreSmi(type const *addr, type value)
void StorePointer(type const *addr, type value)
void Validate(IsolateGroup *isolate_group) const
void StoreArrayPointer(type const *addr, value_type value)
static uword ToAddr(const UntaggedObject *raw_obj)
bool InVMIsolateHeap() const
type LoadPointer(type const *addr) const
bool Contains(uword addr) const
void StoreCompressedPointer(compressed_type const *addr, type value)
intptr_t GetClassId() const
void StorePointerUnaligned(type const *addr, type value, Thread *thread)
static constexpr bool kContainsCompressedPointers
static intptr_t payload_offset()
static intptr_t payload_offset()
static intptr_t InstanceSize()
bool is_user_initiated() const
StringPtr message() const
static intptr_t tag_offset()
void set_streamable(bool streamable)
void set_tag(uword t) const
static intptr_t InstanceSize()
static constexpr uintptr_t RoundUpToPowerOfTwo(uintptr_t x)
static T AddWithWrapAround(T a, T b)
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
static constexpr size_t BitLength(int64_t value)
static bool IsUint(intptr_t N, T value)
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
static constexpr bool IsPowerOfTwo(T x)
static uword AllocateZoneHandle(Zone *zone)
static uword AllocateHandle(Zone *zone)
void SetAt(intptr_t index, const Object &value) const
static intptr_t InstanceSize()
static intptr_t LengthOf(const WeakArrayPtr array)
static constexpr intptr_t InstanceSize(intptr_t len)
ObjectPtr AtAcquire(intptr_t index) const
static intptr_t element_offset(intptr_t index)
static intptr_t length_offset()
ObjectPtr At(intptr_t index) const
static constexpr bool IsValidLength(intptr_t length)
static intptr_t index_at_offset(intptr_t offset_in_bytes)
static intptr_t data_offset()
void SetAtRelease(intptr_t index, const Object &value) const
static intptr_t key_offset()
void set_key(const Object &key) const
static intptr_t value_offset()
static intptr_t InstanceSize()
void set_value(const Object &value) const
static intptr_t InstanceSize()
static intptr_t type_arguments_offset()
static intptr_t target_offset()
void set_target(const Object &target) const
static ObjectPtr UnwrapIfTarget(const Object &obj)
static ObjectPtr Unwrap(ObjectPtr obj)
static ObjectPtr UnwrapIfTarget(ObjectPtr obj)
static ObjectPtr TargetOf(const WeakSerializationReferencePtr obj)
static intptr_t InstanceSize()
static ObjectPtr Unwrap(const Object &obj)
static constexpr intptr_t kNoValue
static const word kNoTypeArguments
static const word kMaxElements
static word element_offset(intptr_t index)
#define DART_WARN_UNUSED_RESULT
Dart_NativeFunction(* Dart_NativeEntryResolver)(Dart_Handle name, int num_of_arguments, bool *auto_setup_scope)
void(* Dart_HandleFinalizer)(void *isolate_callback_data, void *peer)
const uint8_t *(* Dart_NativeEntrySymbol)(Dart_NativeFunction nf)
void *(* Dart_FfiNativeResolver)(const char *name, uintptr_t args_n)
@ kNormal
Default priority level.
const EmbeddedViewParams * params
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
static void set_value(FlSettingsPortal *portal, const FlSetting *setting, GVariant *value)
void PrintTo(FlValue *v, std::ostream *os)
uint32_t uint32_t * format
Dart_NativeFunction function
static float max(float r, float g, float b)
Optional< SkRect > bounds
SK_SPI size_t ToUTF8(SkUnichar uni, char utf8[kMaxBytesInUTF8Sequence]=nullptr)
void Decompress(const uint8_t *input, intptr_t input_len, uint8_t **output, intptr_t *output_length)
static constexpr word kBitsPerWordLog2
static constexpr intptr_t kWordSize
static constexpr intptr_t kCompressedWordSize
static constexpr intptr_t kObjectAlignment
constexpr intptr_t kSmiBits
bool IsDoubleType(const AbstractType &type)
static constexpr int HeaderSize
def link(from_root, to_root)
static constexpr intptr_t kNullIdentityHash
const intptr_t kOffsetOfPtr
const int kNumTypedDataCidRemainders
static bool Equals(const Object &expected, const Object &actual)
static const ClassId kLastTypedDataCid
bool IsTypedDataViewClassId(intptr_t index)
bool IsTypedDataClassId(intptr_t index)
static void FindICData(const Array &ic_data_array, intptr_t deopt_id, ICData *ic_data)
static constexpr intptr_t kFalseIdentityHash
constexpr intptr_t kBitsPerWordLog2
constexpr intptr_t kBitsPerByteLog2
bool IsFfiDynamicLibraryClassId(intptr_t index)
static const char *const names[]
static constexpr intptr_t kObjectStartAlignment
ZoneGrowableHandlePtrArray< const String > URIs
const int kTypedDataCidRemainderUnmodifiable
static bool EqualsIgnoringPrivateKey(const String &str1, const String &str2)
static constexpr const char * kNone
constexpr intptr_t kBitsPerWord
DART_WARN_UNUSED_RESULT ErrorPtr EntryPointFieldInvocationError(const String &getter_name)
static intptr_t kInitialSize
intptr_t RawSmiValue(const SmiPtr raw_value)
static FieldPtr GetField(const Class &cls, const char *name)
uint32_t CombineHashes(uint32_t hash, uint32_t other_hash)
const char *const class_name
const int kTypedDataCidRemainderInternal
@ kIsolateLocalClosureCallback
@ kIsolateLocalStaticCallback
DART_WARN_UNUSED_RESULT ErrorPtr EntryPointMemberInvocationError(const Object &member)
bool IsUnmodifiableTypedDataViewClassId(intptr_t index)
@ kUnmodifiableByteDataViewCid
void(* callback_)(Dart_Handle)
constexpr uint32_t kMaxUint32
constexpr intptr_t kBitsPerByte
EntryPointPragma FindEntryPointPragma(IsolateGroup *IG, const Array &metadata, Field *reusable_field_handle, Object *pragma)
ObjectPtr Invoke(const Library &lib, const char *name)
unibrow::Mapping< unibrow::Ecma262Canonicalize > Canonicalize
FunctionPtr GetFunction(const Library &lib, const char *name)
constexpr uword kUwordMax
DART_WARN_UNUSED_RESULT ErrorPtr VerifyEntryPoint(const Library &lib, const Object &member, const Object &annotated, std::initializer_list< EntryPointPragma > allowed_kinds)
const int kTypedDataCidRemainderExternal
static const char * Concat(const char *a, const char *b)
static const ClassId kFirstTypedDataCid
const int kTypedDataCidRemainderView
bool IsZero(char *begin, char *end)
static void EvaluateCompiledExpression(Thread *thread, JSONStream *js)
uint32_t HashBytes(const uint8_t *bytes, intptr_t size)
bool FindPragmaInMetadata(Thread *T, const Object &metadata_obj, const String &pragma_name, bool multiple, Object *options)
void Validate(const Table &table)
constexpr intptr_t kBitsPerInt32
static T LoadUnaligned(const T *ptr)
static constexpr intptr_t kTrueIdentityHash
static constexpr intptr_t kCompressedWordSize
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)
uint32_t FinalizeHash(uint32_t hash, intptr_t hashbits=kBitsPerInt32)
static uint32_t Hash(uint32_t key)
void DumpTypeTable(Isolate *isolate)
constexpr int32_t kMaxInt32
static void DumpStackFrame(uword pc, uword fp, const char *name, uword offset)
static void AddClass(const int32_t *elmv, intptr_t elmc, ZoneGrowableArray< CharacterRange > *ranges)
constexpr intptr_t kWordSize
static constexpr intptr_t kObjectAlignment
void DFLRT_ExitSafepoint(NativeArguments __unusable_)
static Dart_TypedData_Type GetType(intptr_t class_id)
const intptr_t kPreferredLoopAlignment
void DumpTypeParameterTable(Isolate *isolate)
const char *const function_name
static int8_t data[kExtLength]
void DumpTypeArgumentsTable(Isolate *isolate)
static FinalizablePersistentHandle * AddFinalizer(const Object &referent, void *peer, Dart_HandleFinalizer callback, intptr_t external_size)
static int NumEntries(const FinalizerEntry &entry, intptr_t acc=0)
static constexpr intptr_t kNewAllocatableSize
bool IsExternalTypedDataClassId(intptr_t index)
COMPILE_ASSERT(kUnreachableReference==WeakTable::kNoValue)
@ kCurrentAndEnclosingFree
ObjectPtr CompressedObjectPtr
static void SetName(Thread *thread, JSONStream *js)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
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 dart
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
struct PathData * Data(SkPath *path)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
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
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
std::function< void()> closure
std::string ToLowerCase(std::string_view string)
static std::string ToString(CompilerBackend::Type type)
std::function< void(MTLRenderPipelineDescriptor *)> Callback
skgpu::graphite::Transform Transform
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
#define SHARED_READONLY_HANDLES_LIST(V)
#define DEFINE_INSTRUCTIONS_FLAG_HANDLING(Name)
#define BASE_OBJECT_IMPLEMENTATION(object, super)
#define ASSERT_FUNCTION_KIND_IN_RANGE(Name)
#define MINT_OBJECT_IMPLEMENTATION(object, rettype, super)
#define REUSABLE_FORWARD_DECLARATION(name)
#define OBJECT_SERVICE_SUPPORT(object)
#define ALLSTATIC_CONTAINS_COMPRESSED_IMPLEMENTATION(object, handle)
#define DEFINE_CLASS_TESTER(clazz)
#define DEFINE_BIT(name, _)
#define DECLARE_FLAG_POS(Name)
#define HEAP_OBJECT_IMPLEMENTATION(object, super)
#define DEFINE_ACCESSORS(name, accessor_name)
#define DECLARE_SHARED_READONLY_HANDLE(Type, name)
#define PRECOMPILER_WSR_FIELD_DECLARATION(Type, Name)
#define DEFINE_FLAG_ACCESSORS(Name)
#define FOR_EACH_FUNCTION_KIND_BIT(V)
#define FOR_EACH_REBIND_RULE(V)
#define DECLARE_FLAG_ACCESSORS(Name)
#define FINAL_HEAP_OBJECT_IMPLEMENTATION(object, super)
#define TYPED_GETTER_SETTER(name, type)
#define DECLARE_BIT(name, _)
#define STORE_NON_POINTER_ILLEGAL_TYPE(type)
#define REBIND_ENUM_DEF(name)
#define DEFINE_GETTERS_AND_SETTERS(return_type, type, name)
#define OBJECT_IMPLEMENTATION(object, super)
#define DEFINE_FLAG_BIT(Name)
#define DEFINE_FORWARD_DECLARATION(clazz)
#define FOR_EACH_FUNCTION_VOLATILE_KIND_BIT(V)
#define DEFINE_ENUM_LIST(name)
#define DEFINE_INSTRUCTIONS_FLAG(Name)
#define INSTRUCTIONS_FLAGS_LIST(V)
#define REUSABLE_FRIEND_DECLARATION(name)
#define DEFINE_SHARED_READONLY_HANDLE_GETTER(Type, name)
#define STATE_BITS_LIST(V)
static DecodeResult decode(std::string path)
#define FOR_EACH_RAW_FUNCTION_KIND(V)
#define JIT_FUNCTION_COUNTERS(F)
#define CONTEXT_SCOPE_VARIABLE_DESC_FLAG_LIST(V)
static intptr_t elements_start_offset()
static intptr_t elements_start_offset()
static intptr_t elements_start_offset()
static intptr_t elements_start_offset()
static intptr_t elements_start_offset()
static intptr_t elements_start_offset()
Entry(uword value, EntryType info)
static intptr_t elements_start_offset()
static intptr_t elements_start_offset()
static intptr_t elements_start_offset()
static intptr_t elements_start_offset()
uint32_t FlagsAndSizeHeader
static intptr_t elements_start_offset()
BitField< uint8_t, Patchability, TypeBits::kNextBit, 1 > PatchableBit
BitField< uint8_t, SnapshotBehavior, PatchableBit::kNextBit, 3 > SnapshotBehaviorBits
BitField< uint8_t, EntryType, 0, 4 > TypeBits
#define REUSABLE_HANDLE_LIST(V)
#define NOT_IN_PRECOMPILED(code)
#define OFFSET_OF(type, field)
#define ONLY_IN_PRECOMPILED(code)
#define OFFSET_OF_RETURNED_VALUE(type, accessor)