59#if !defined(DART_PRECOMPILED_RUNTIME)
70#if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
72 check_function_fingerprints,
74 "Check function fingerprints");
79 "Verify correct API acquire/release of typed data.");
83 "Dump common hash tables before snapshotting.");
85 enable_deprecated_wait_for,
87 "Enable deprecated dart:cli waitFor. "
88 "This feature will be fully removed in Dart 3.4 release. "
89 "See https://dartbug.com/52121.");
91#define CHECK_ERROR_HANDLE(error) \
93 ErrorPtr err = (error); \
94 if (err != Error::null()) { \
95 return Api::NewHandle(T, err); \
104Dart_Handle Api::no_callbacks_error_handle_ =
nullptr;
105Dart_Handle Api::unwind_in_progress_error_handle_ =
nullptr;
108 if (strncmp(func,
"dart::", 6) == 0) {
119class CheckFunctionTypesVisitor :
public ObjectVisitor {
121 explicit CheckFunctionTypesVisitor(Thread* thread)
122 : classHandle_(Class::Handle(thread->zone())),
123 funcHandle_(Function::Handle(thread->zone())),
124 typeHandle_(AbstractType::Handle(thread->zone())) {}
126 void VisitObject(ObjectPtr obj)
override {
127 if (obj->IsFunction()) {
129 classHandle_ ^= funcHandle_.Owner();
132 typeHandle_ ^= funcHandle_.result_type();
133 ASSERT(typeHandle_.IsTypeParameter() || typeHandle_.IsCanonical());
136 const intptr_t num_parameters = funcHandle_.NumParameters();
137 for (intptr_t
i = 0;
i < num_parameters;
i++) {
138 typeHandle_ = funcHandle_.ParameterTypeAt(
i);
139 ASSERT(typeHandle_.IsTypeParameter() || typeHandle_.IsCanonical());
146 Function& funcHandle_;
147 AbstractType& typeHandle_;
152 if (obj.IsInstance()) {
154 const Type& list_rare_type =
155 Type::Handle(zone, object_store->non_nullable_list_rare_type());
169 if (obj.IsInstance()) {
171 const Type& map_rare_type =
172 Type::Handle(zone, object_store->non_nullable_map_rare_type());
186#if defined(DART_PRECOMPILED_RUNTIME)
193 zone, isolate_group->object_store()->compiletime_error_class());
212 Object& obj = thread->ObjectHandle();
237 int64_t arg_value = 0;
239 *
value =
static_cast<uint64_t
>(arg_value);
255 intptr_t* field_values,
256 const char* current_func) {
257 ASSERT(field_values !=
nullptr);
265 Object& obj = thread->ObjectHandle();
268 memset(field_values, 0, (num_fields *
sizeof(field_values[0])));
273 if (!obj.IsInstance()) {
275 "%s expects argument at index '%d' to be of"
277 current_func, arg_index);
280 int field_count =
instance.NumNativeFields();
281 ASSERT(num_fields != field_count);
282 return Api::NewError(
"%s: expected %d 'num_fields' but was passed in %d.",
283 current_func, field_count, num_fields);
298 const intptr_t kNumArgs = 1;
310 const intptr_t kNumArgs = 2;
324 const intptr_t kNumArgs = 3;
339 const char* str =
error.ToErrorCString();
340 intptr_t
len = strlen(str) + 1;
342 strncpy(str_copy, str,
len);
344 if ((
len > 1) && (str_copy[
len - 2] ==
'\n')) {
345 str_copy[
len - 2] =
'\0';
353Dart_Handle Api::InitNewHandle(Thread* thread, ObjectPtr raw) {
355 ASSERT(local_handles !=
nullptr);
356 LocalHandle* ref = local_handles->AllocateHandle();
358 return ref->apiHandle();
372 return InitNewHandle(thread, raw);
384 return (
reinterpret_cast<LocalHandle*
>(
object))->ptr();
387#define DEFINE_UNWRAP(type) \
388 const type& Api::Unwrap##type##Handle(Zone* zone, Dart_Handle dart_handle) { \
389 const Object& obj = Object::Handle(zone, Api::UnwrapHandle(dart_handle)); \
390 if (obj.Is##type()) { \
391 return type::Cast(obj); \
393 return type::Handle(zone); \
402 if (ref.IsString()) {
403 return String::Cast(ref);
405 return Object::null_string();
409 const ReusableObjectHandleScope& reuse,
413 if (ref.IsInstance()) {
414 return Instance::Cast(ref);
416 return Object::null_instance();
479 if (!
error.IsError()) {
503 ASSERT(thread !=
nullptr);
525 ASSERT(isolate !=
nullptr);
530 ASSERT(true_handle_ ==
nullptr);
533 ASSERT(false_handle_ ==
nullptr);
536 ASSERT(null_handle_ ==
nullptr);
539 ASSERT(empty_string_handle_ ==
nullptr);
542 ASSERT(no_callbacks_error_handle_ ==
nullptr);
543 no_callbacks_error_handle_ =
546 ASSERT(unwind_in_progress_error_handle_ ==
nullptr);
547 unwind_in_progress_error_handle_ =
552 true_handle_ =
nullptr;
553 false_handle_ =
nullptr;
554 null_handle_ =
nullptr;
555 empty_string_handle_ =
nullptr;
556 no_callbacks_error_handle_ =
nullptr;
557 unwind_in_progress_error_handle_ =
nullptr;
565 if (!raw_obj->IsHeapObject()) {
569 if (
cid == kOneByteStringCid ||
cid == kTwoByteStringCid) {
572 return (*peer !=
nullptr);
580 if (raw_obj->IsHeapObject()) {
584 TypedDataPtr native_fields =
585 reinterpret_cast<CompressedTypedDataPtr*
>(
591 *
value = *bit_cast<intptr_t*, uint8_t*>(native_fields->untag()->data());
604 if (raw_obj->IsHeapObject()) {
606 if (
cid == kBoolCid) {
607 *
value = (raw_obj == Object::bool_true().ptr());
623 if (raw_obj->IsHeapObject()) {
625 if (
cid == kMintCid) {
626 *
value =
static_cast<MintPtr
>(raw_obj)->
untag()->value_;
640 if (raw_obj->IsHeapObject()) {
642 if (
cid == kDoubleCid) {
643 *
value =
static_cast<DoublePtr
>(raw_obj)->
untag()->value_;
646 if (
cid == kMintCid) {
648 static_cast<double>(
static_cast<MintPtr
>(raw_obj)->
untag()->value_);
653 *
value =
static_cast<double>(
Smi::Value(
static_cast<SmiPtr
>(raw_obj)));
660 intptr_t* field_values) {
664 int class_num_fields = arguments->
thread()
669 ->num_native_fields_;
670 if (num_fields != class_num_fields) {
674 TypedDataPtr native_fields =
675 reinterpret_cast<CompressedTypedDataPtr*
>(
680 memset(field_values, 0, (num_fields *
sizeof(field_values[0])));
684 intptr_t* native_values =
685 reinterpret_cast<intptr_t*
>(native_fields->untag()->data());
686 memmove(field_values, native_values, (num_fields *
sizeof(field_values[0])));
704 ASSERT(
state->IsValidWeakPersistentHandle(handle));
717void FinalizablePersistentHandle::Finalize(
720 if (!handle->
ptr()->IsHeapObject()) {
731 state->ClearWeakPersistentHandle(handle);
737 state->FreeWeakPersistentHandle(handle);
797 return obj.IsUnhandledException();
803 if (obj.IsUnhandledException()) {
806 }
else if (obj.IsError()) {
807 return Api::NewError(
"This error is not an unhandled exception error.");
809 return Api::NewError(
"Can only get exceptions from error handles.");
816 if (obj.IsUnhandledException()) {
819 }
else if (obj.IsError()) {
820 return Api::NewError(
"This error is not an unhandled exception error.");
822 return Api::NewError(
"Can only get stacktraces from error handles.");
848 if ((class_id == kApiErrorCid) || (class_id == kLanguageErrorCid)) {
866 if (!obj.IsError()) {
868 "%s expects argument 'handle' to be an error handle. "
869 "Did you forget to check Dart_IsError first?",
875 FATAL(
"No Dart frames on stack, cannot propagate error.");
885 ErrorPtr raw_error = Api::UnwrapErrorHandle(thread->
zone(), handle).ptr();
898 if (obj.IsString()) {
900 }
else if (obj.IsInstance()) {
902 const Instance& receiver = Instance::Cast(obj);
921 if (object1.IsInstance() && object2.IsInstance()) {
922 return Instance::Cast(object1).IsIdenticalTo(Instance::Cast(object2));
1002 if (super_klass.IsNull()) {
1006 if (super_klass.Name() != Symbols::Struct().ptr() &&
1011 return library.url() == Symbols::DartFfi().ptr();
1018 intptr_t external_allocation_size,
1020 if (!ref.
ptr()->IsHeapObject()) {
1023 if (ref.IsPointer()) {
1032 callback, external_allocation_size,
1034 return finalizable_ref ==
nullptr
1043 intptr_t external_allocation_size,
1054 intptr_t external_allocation_size,
1056 if (!ref.
ptr()->IsHeapObject()) {
1059 if (ref.IsPointer()) {
1068 callback, external_allocation_size,
1070 return finalizable_ref ==
nullptr ? nullptr
1078 intptr_t external_allocation_size,
1088 intptr_t external_allocation_size,
1102 intptr_t external_allocation_size,
1124 state->FreePersistentHandle(ref);
1136 ASSERT(
state->IsActiveWeakPersistentHandle(
object));
1138 weak_ref->EnsureFreedExternal(isolate_group);
1139 state->FreeWeakPersistentHandle(weak_ref);
1148 "%s expects arguments 'object' and 'strong_ref_to_object' to point to "
1168 "Dart_InitializeParams is null.");
1174 "Invalid Dart_InitializeParams version.");
1193#define ISOLATE_GROUP_METRIC_API(type, variable, name, unit) \
1194 DART_EXPORT int64_t Dart_IsolateGroup##variable##Metric( \
1195 Dart_IsolateGroup isolate_group) { \
1196 if (isolate_group == nullptr) { \
1197 FATAL("%s expects argument 'isolate_group' to be non-null.", \
1200 IsolateGroup* group = reinterpret_cast<IsolateGroup*>(isolate_group); \
1201 return group->Get##variable##Metric()->Value(); \
1204#undef ISOLATE_GROUP_METRIC_API
1206#if !defined(PRODUCT)
1207#define ISOLATE_METRIC_API(type, variable, name, unit) \
1208 DART_EXPORT int64_t Dart_Isolate##variable##Metric(Dart_Isolate isolate) { \
1209 if (isolate == nullptr) { \
1210 FATAL("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); \
1212 Isolate* iso = reinterpret_cast<Isolate*>(isolate); \
1213 return iso->Get##variable##Metric()->Value(); \
1216#undef ISOLATE_METRIC_API
1218#define ISOLATE_METRIC_API(type, variable, name, unit) \
1219 DART_EXPORT int64_t Dart_Isolate##variable##Metric(Dart_Isolate isolate) { \
1223#undef ISOLATE_METRIC_API
1238 if (
error !=
nullptr) {
1245 bool success =
false;
1250#if defined(SUPPORT_TIMELINE)
1251 TimelineBeginEndScope tbes(
T, Timeline::GetIsolateStream(),
1252 "InitializeIsolate");
1253 tbes.SetNumArguments(1);
1254 tbes.CopyArgument(0,
"isolateName",
I->name());
1267 if (error_obj.IsNull()) {
1270 if (error_obj.IsNull()) {
1271#if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
1272 if (FLAG_check_function_fingerprints && !FLAG_precompiled_mode) {
1273 Library::CheckFunctionFingerprints();
1277 }
else if (
error !=
nullptr) {
1290 T->EnterSafepoint();
1291 if (
error !=
nullptr) {
1307 auto spawning_group =
group;
1312 if (isolate ==
nullptr)
return nullptr;
1314 auto source = spawning_group->source();
1327 const uint8_t* snapshot_data,
1328 const uint8_t* snapshot_instructions,
1330 void* isolate_group_data,
1336 if (
flags ==
nullptr) {
1341 const char* non_null_name =
name ==
nullptr ?
"isolate" :
name;
1342 std::unique_ptr<IsolateGroupSource>
source(
1344 snapshot_instructions,
nullptr, -1, *
flags));
1349 flags->is_service_isolate ||
flags->is_kernel_isolate);
1352 non_null_name, isolate_data,
error);
1353 if (isolate !=
nullptr) {
1354 group->set_initial_spawn_successful();
1362 const uint8_t* kernel_buffer,
1363 intptr_t kernel_buffer_size,
1365 void* isolate_group_data,
1371 if (
flags ==
nullptr) {
1376 const char* non_null_name =
name ==
nullptr ?
"isolate" :
name;
1377 std::shared_ptr<IsolateGroupSource>
source(
1379 kernel_buffer, kernel_buffer_size, *
flags));
1385 flags->is_service_isolate ||
flags->is_kernel_isolate);
1387 non_null_name, isolate_data,
error);
1388 if (isolate !=
nullptr) {
1389 group->set_initial_spawn_successful();
1399 void* child_isolate_data,
1402 auto member =
reinterpret_cast<Isolate*
>(group_member);
1403 if (member->IsScheduled()) {
1404 FATAL(
"The given member isolate (%s) must not have been entered.",
1412 if (isolate !=
nullptr) {
1424 auto I =
T->isolate();
1435 I->WaitForOutstandingSpawns();
1439 while (scope !=
nullptr) {
1444 T->set_api_top_scope(
nullptr);
1466 if (isolate ==
nullptr) {
1470 return reinterpret_cast<Isolate*
>(isolate)->init_callback_data();
1487 return isolate_group->
id();
1491 if (isolate ==
nullptr) {
1495 return reinterpret_cast<Isolate*
>(isolate)->
group()->embedder_data();
1503 static_cast<int64_t
>(
I->main_port()),
I->name()));
1508 if (thread ==
nullptr) {
1515 int64_t main_port =
static_cast<int64_t
>(
I->main_port());
1516 const char*
fmt =
"%s (%" Pd64 ")";
1517 int length = snprintf(
nullptr, 0,
fmt,
I->name(), main_port) + 1;
1519 snprintf(res,
length,
fmt,
I->name(), main_port);
1524 if (isolate ==
nullptr) {
1529 int64_t main_port =
static_cast<int64_t
>(
I->main_port());
1539 "Isolate %s is already scheduled on mutator thread %p, "
1540 "failed to schedule from os thread 0x%" Px "\n",
1551 T->EnterSafepoint();
1555#if !defined(PRODUCT)
1556 if (!FLAG_profiler) {
1557 FLAG_profiler =
true;
1564#if !defined(PRODUCT)
1565 if (FLAG_profiler) {
1567 FLAG_profiler =
false;
1573#if !defined(PRODUCT)
1575 if (os_thread ==
nullptr) {
1583#if !defined(PRODUCT)
1585 if (os_thread ==
nullptr) {
1603 if (!FLAG_profiler) {
1604 if (
error !=
nullptr) {
1610 const intptr_t kBufferLength = 512;
1611 char method[kBufferLength];
1614 intptr_t method_length = snprintf(method, kBufferLength,
"{"
1615 "\"jsonrpc\": \"2.0\","
1616 "\"method\": \"_writeCpuProfileTimeline\","
1619 " \"isolateId\": \"isolates/%" Pd64 "\","
1620 " \"tags\": \"None\""
1624 ASSERT(method_length <= kBufferLength);
1626 char* response =
nullptr;
1627 intptr_t response_length;
1629 reinterpret_cast<uint8_t*
>(method), method_length,
1630 reinterpret_cast<uint8_t**
>(&response), &response_length,
error);
1657 FATAL(
"%s expects the current isolate to not be runnable yet.",
1746 const Error& error_handle = Api::UnwrapErrorHandle(
Z,
error);
1751 if (!error_handle.IsUnhandledException() &&
1753 FATAL(
"%s expects the error to be an unhandled exception error or null.",
1786 T->isolate()->group()->idle_time_handler()->NotifyIdle(deadline);
1794 T->heap()->NotifyDestroyed();
1798#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
1804#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
1812#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
1821#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
1829 group->heap()->ReportSurvivingAllocations(
callback, context);
1836#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
1860 return T->heap()->SetMode(
mode);
1878 intptr_t* vm_snapshot_data_size,
1879 uint8_t** isolate_snapshot_data_buffer,
1880 intptr_t* isolate_snapshot_data_size,
1882#if defined(DART_PRECOMPILED_RUNTIME)
1883 return Api::NewError(
"Cannot create snapshots on an AOT runtime.");
1887 if (vm_snapshot_data_buffer !=
nullptr) {
1903 CheckFunctionTypesVisitor check_canonical(
T);
1916 nullptr ,
nullptr );
1918 if (vm_snapshot_data_buffer !=
nullptr) {
1939 if (isolate ==
nullptr) {
1943 const char*
error =
reinterpret_cast<Isolate*
>(isolate)->MakeRunnable();
1944 if (
error !=
nullptr) {
2012 data.monitor = &monitor;
2015 I->message_handler()->Run(
I->group()->thread_pool(),
nullptr,
2018 while (!
data.done) {
2027 return Api::NewError(
"Run method in isolate message handler failed");
2033 if (FLAG_print_class_table) {
2035 I->group()->class_table()->Print();
2045 auto isolate = thread->isolate();
2049 if (thread->api_top_scope() !=
nullptr) {
2054 if (!isolate->is_runnable()) {
2055 const char* error_msg = isolate->MakeRunnable();
2056 if (error_msg !=
nullptr) {
2062 isolate->SetErrorsFatal(errors_are_fatal);
2072 isolate->AddErrorListener(
port);
2077 isolate->AddExitListener(
port, Instance::null_instance());
2109 ASSERT(
I->GetAndClearResumeRequest() ==
false);
2111 I->message_handler()->HandleOOBMessages();
2112 bool resume =
I->GetAndClearResumeRequest();
2175 const SendPort& send_port = Api::UnwrapSendPortHandle(
Z,
port);
2176 if (send_port.
IsNull()) {
2179 if (port_id ==
nullptr) {
2182 *port_id = send_port.
Id();
2191 const SendPort& send_port = Api::UnwrapSendPortHandle(
Z,
port);
2192 if (send_port.
IsNull()) {
2195 if (portex_id ==
nullptr) {
2229 if (thread !=
nullptr) {
2231 zone = scope->
zone();
2234 if (scope ==
nullptr)
return nullptr;
2235 zone = scope->
zone();
2291 }
else if (
result.IsError()) {
2304 return instance.IsInstanceOf(
type, Object::null_type_arguments(),
2305 Object::null_type_arguments());
2313 const Type& type_obj = Api::UnwrapTypeHandle(
Z,
type);
2320 "%s expects argument 'type' to be a fully resolved type.",
2341 Object& ref = thread->ObjectHandle();
2343 return ref.IsInstance();
2450 if (obj.IsClosure()) {
2478 if (obj.IsInstance()) {
2490 auto isolate_group =
T->isolate_group();
2495 if (!obj.IsInstance()) {
2514 const Type& type_obj = Api::UnwrapTypeHandle(
Z, cls_type);
2521 "cls_type must be a Type object which represents a Class.");
2557 if (is_static ==
nullptr) {
2564 *is_static = func.is_static();
2571 if (closure_obj.
IsNull() || !closure_obj.IsClosure()) {
2577 FunctionPtr rf = Closure::Cast(closure_obj).function();
2583 const Type& type_obj = Api::UnwrapTypeHandle(
Z, cls_type);
2587 "cls_type must be a Type object which represents a Class.");
2615 const Integer& int_obj = Api::UnwrapIntegerHandle(
Z, integer);
2633 const Integer& int_obj = Api::UnwrapIntegerHandle(
Z, integer);
2637 ASSERT(int_obj.IsMint());
2671 return Api::NewError(
"%s: Cannot create Dart integer from string %s",
2689 const Integer& int_obj = Api::UnwrapIntegerHandle(
Z, integer);
2693 ASSERT(int_obj.IsMint());
2706 if (smi_value >= 0) {
2713 const Integer& int_obj = Api::UnwrapIntegerHandle(
Z, integer);
2717 if (int_obj.IsSmi()) {
2720 ASSERT(int_obj.IsMint());
2726 return Api::NewError(
"%s: Integer %s cannot be represented as a uint64_t.",
2731 const char**
value) {
2734 const Integer& int_obj = Api::UnwrapIntegerHandle(
Z, integer);
2752 const Double& obj = Api::UnwrapDoubleHandle(
Z, double_obj);
2764 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
2769 const Type& type_obj = Api::UnwrapTypeHandle(
Z, cls_type);
2777 "cls_type must be a Type object which represents a Class");
2786 if (func_name.
IsNull()) {
2796 if (!func.is_static()) {
2797 return Api::NewError(
"function_name must refer to a static method.");
2800 if (func.
kind() != UntaggedFunction::kRegularFunction) {
2802 "function_name must be the name of a regular function.");
2833 const Bool& obj = Api::UnwrapBoolHandle(
Z, boolean_obj);
2847 ReusableObjectHandleScope reused_obj_handle(thread);
2861 ReusableObjectHandleScope reused_obj_handle(thread);
2874 if (str ==
nullptr) {
2885 if (utf8_array ==
nullptr &&
length != 0) {
2890 return Api::NewError(
"%s expects argument 'str' to be valid UTF-8.",
2900 if (utf16_array ==
nullptr &&
length != 0) {
2912 if (utf32_array ==
nullptr &&
length != 0) {
2921 const char** cstr) {
2924 if (cstr ==
nullptr) {
2933 if (res ==
nullptr) {
2936 const char* string_value = str_obj.
ToCString();
2937 memmove(res, string_value, string_length + 1);
2938 ASSERT(res[string_length] ==
'\0');
2944 uint8_t** utf8_array,
2948 if (utf8_array ==
nullptr) {
2960 if (*utf8_array ==
nullptr) {
2963 str_obj.
ToUTF8(*utf8_array, str_len);
2969 uint8_t* utf8_array,
2973 if (utf8_array ==
nullptr) {
2983 "Provided buffer is not large enough to hold "
2984 "the UTF-8 representation of the string");
2986 str_obj.
ToUTF8(utf8_array, str_len);
2991 uint8_t* latin1_array,
2995 if (latin1_array ==
nullptr) {
3005 intptr_t str_len = str_obj.
Length();
3006 intptr_t copy_len = (str_len > *
length) ? *
length : str_len;
3010 for (intptr_t
i = 0;
i < copy_len;
i++) {
3011 latin1_array[
i] = str_obj.
CharAt(
i);
3018 uint16_t* utf16_array,
3026 intptr_t str_len = str_obj.
Length();
3027 intptr_t copy_len = (str_len > *
length) ? *
length : str_len;
3028 for (intptr_t
i = 0;
i < copy_len;
i++) {
3029 utf16_array[
i] = str_obj.
CharAt(
i);
3040 if (
size ==
nullptr) {
3044 ReusableObjectHandleScope reused_obj_handle(thread);
3055 intptr_t* char_size,
3062 ReusableObjectHandleScope reused_obj_handle(thread);
3094 const Type&
type = Api::UnwrapTypeHandle(
Z, element_type);
3095 if (
type.IsNull()) {
3098 if (!
type.IsFinalized()) {
3100 "%s expects argument 'type' to be a fully resolved type.",
3104 return Api::NewError(
"%s expects argument 'type' to be a nullable type.",
3116 const Type&
type = Api::UnwrapTypeHandle(
Z, element_type);
3117 if (
type.IsNull()) {
3120 if (!
type.IsFinalized()) {
3122 "%s expects argument 'type' to be a fully resolved type.",
3128 "%s expects argument 'fill_object' to have the same type as "
3134 "%s expects argument 'fill_object' to be non-null for a non-nullable "
3139 for (intptr_t
i = 0;
i < arr.
Length(); ++
i) {
3145#define GET_LIST_LENGTH(zone, type, obj, len) \
3146 type& array = type::Handle(zone); \
3147 array ^= obj.ptr(); \
3148 *len = array.Length(); \
3149 return Api::Success();
3154 if (obj.IsError()) {
3158 if (obj.IsTypedDataBase()) {
3161 if (obj.IsArray()) {
3164 if (obj.IsGrowableObjectArray()) {
3173 "Object does not implement the List interface");
3177 if (retval.IsSmi()) {
3178 *
len = Smi::Cast(retval).Value();
3180 }
else if (retval.IsMint()) {
3181 int64_t mint_value = Mint::Cast(retval).value();
3183 *
len =
static_cast<intptr_t
>(mint_value);
3187 "Length of List object is greater than the "
3188 "maximum value that 'len' parameter can hold");
3189 }
else if (retval.IsError()) {
3192 return Api::NewError(
"Length of List object is not an integer");
3196#define GET_LIST_ELEMENT(thread, type, obj, index) \
3197 const type& array_obj = type::Cast(obj); \
3198 if ((index >= 0) && (index < array_obj.Length())) { \
3199 return Api::NewHandle(thread, array_obj.At(index)); \
3201 return Api::NewError("Invalid index passed into access list element");
3206 if (obj.IsArray()) {
3208 }
else if (obj.IsGrowableObjectArray()) {
3210 }
else if (obj.IsError()) {
3222 "Object does not implement the 'List' interface");
3226#define GET_LIST_RANGE(thread, type, obj, offset, length) \
3227 const type& array_obj = type::Cast(obj); \
3228 if ((offset >= 0) && (offset + length <= array_obj.Length())) { \
3229 for (intptr_t index = 0; index < length; ++index) { \
3230 result[index] = Api::NewHandle(thread, array_obj.At(index + offset)); \
3232 return Api::Success(); \
3234 return Api::NewError("Invalid offset/length passed into access list");
3245 if (obj.IsArray()) {
3247 }
else if (obj.IsGrowableObjectArray()) {
3249 }
else if (obj.IsError()) {
3256 const intptr_t kNumArgs = 2;
3264 args.SetAt(1, index);
3273 "Object does not implement the 'List' interface");
3277#define SET_LIST_ELEMENT(type, obj, index, value) \
3278 const type& array = type::Cast(obj); \
3279 const Object& value_obj = Object::Handle(Z, Api::UnwrapHandle(value)); \
3280 if (!value_obj.IsNull() && !value_obj.IsInstance()) { \
3281 RETURN_TYPE_ERROR(Z, value, Instance); \
3283 if ((index >= 0) && (index < array.Length())) { \
3284 array.SetAt(index, value_obj); \
3285 return Api::Success(); \
3287 return Api::NewError("Invalid index passed into set list element");
3296 if (obj.IsArray() && !Array::Cast(obj).
IsImmutable()) {
3298 }
else if (obj.IsGrowableObjectArray()) {
3300 }
else if (obj.IsError()) {
3310 if (!value_obj.
IsNull() && !value_obj.IsInstance()) {
3315 Instance::Cast(value_obj)));
3318 "Object does not implement the 'List' interface");
3325 const String& dotted_name,
3339 return ApiError::New(
message);
3351 constructor ^=
result.ptr();
3356 return ApiError::New(
message);
3361 args.SetAt(0, exception);
3371 String::New(
"No Dart frames on stack, cannot throw exception"));
3372 return ApiError::New(
message);
3379 InstancePtr raw_exception = exception.
ptr();
3386 return ApiError::New(
message);
3390#define GET_LIST_ELEMENT_AS_BYTES(type, obj, native_array, offset, length) \
3391 const type& array = type::Cast(obj); \
3392 if (Utils::RangeCheck(offset, length, array.Length())) { \
3393 Object& element = Object::Handle(Z); \
3394 for (int i = 0; i < length; i++) { \
3395 element = array.At(offset + i); \
3396 if (!element.IsInteger()) { \
3397 return Api::NewHandle( \
3398 T, ThrowArgumentError("List contains non-int elements")); \
3400 const Integer& integer = Integer::Cast(element); \
3401 native_array[i] = static_cast<uint8_t>(integer.AsInt64Value() & 0xff); \
3402 ASSERT(integer.AsInt64Value() <= 0xff); \
3404 return Api::Success(); \
3406 return Api::NewError("Invalid length passed into access array elements");
3410 uint8_t* native_array,
3414 if (obj.IsTypedDataBase()) {
3419 memmove(native_array,
3423 return Api::NewError(
"Invalid length passed into access list elements");
3426 if (obj.IsArray()) {
3429 if (obj.IsGrowableObjectArray()) {
3433 if (obj.IsError()) {
3441 const int kNumArgs = 2;
3451 args.SetAt(1, intobj);
3456 if (!
result.IsInteger()) {
3458 "%s expects the argument 'list' to be "
3467 static_cast<uint8_t
>(integer_result.
AsInt64Value() & 0xff);
3472 "Object does not implement the 'List' interface");
3475#define SET_LIST_ELEMENT_AS_BYTES(type, obj, native_array, offset, length) \
3476 const type& array = type::Cast(obj); \
3477 Integer& integer = Integer::Handle(Z); \
3478 if (Utils::RangeCheck(offset, length, array.Length())) { \
3479 for (int i = 0; i < length; i++) { \
3480 integer = Integer::New(native_array[i]); \
3481 array.SetAt(offset + i, integer); \
3483 return Api::Success(); \
3485 return Api::NewError("Invalid length passed into set array elements");
3489 const uint8_t* native_array,
3493 if (obj.IsTypedDataBase()) {
3502 return Api::NewError(
"Invalid length passed into access list elements");
3505 if (obj.IsArray() && !Array::Cast(obj).
IsImmutable()) {
3510 if (obj.IsGrowableObjectArray()) {
3514 if (obj.IsError()) {
3522 const int kNumArgs = 3;
3532 args.SetAt(1, indexobj);
3533 args.SetAt(2, valueobj);
3543 "Object does not implement the 'List' interface");
3555 if (!(key_obj.IsInstance() || key_obj.
IsNull())) {
3559 Instance::Cast(key_obj)));
3571 if (!(key_obj.IsInstance() || key_obj.
IsNull())) {
3576 Instance::Cast(key_obj)));
3602 case kTypedDataInt8ArrayCid:
3603 case kTypedDataInt8ArrayViewCid:
3604 case kUnmodifiableTypedDataInt8ArrayViewCid:
3605 case kExternalTypedDataInt8ArrayCid:
3608 case kTypedDataUint8ArrayCid:
3609 case kTypedDataUint8ArrayViewCid:
3610 case kUnmodifiableTypedDataUint8ArrayViewCid:
3611 case kExternalTypedDataUint8ArrayCid:
3614 case kTypedDataUint8ClampedArrayCid:
3615 case kTypedDataUint8ClampedArrayViewCid:
3616 case kUnmodifiableTypedDataUint8ClampedArrayViewCid:
3617 case kExternalTypedDataUint8ClampedArrayCid:
3620 case kTypedDataInt16ArrayCid:
3621 case kTypedDataInt16ArrayViewCid:
3622 case kUnmodifiableTypedDataInt16ArrayViewCid:
3623 case kExternalTypedDataInt16ArrayCid:
3626 case kTypedDataUint16ArrayCid:
3627 case kTypedDataUint16ArrayViewCid:
3628 case kUnmodifiableTypedDataUint16ArrayViewCid:
3629 case kExternalTypedDataUint16ArrayCid:
3632 case kTypedDataInt32ArrayCid:
3633 case kTypedDataInt32ArrayViewCid:
3634 case kUnmodifiableTypedDataInt32ArrayViewCid:
3635 case kExternalTypedDataInt32ArrayCid:
3638 case kTypedDataUint32ArrayCid:
3639 case kTypedDataUint32ArrayViewCid:
3640 case kUnmodifiableTypedDataUint32ArrayViewCid:
3641 case kExternalTypedDataUint32ArrayCid:
3644 case kTypedDataInt64ArrayCid:
3645 case kTypedDataInt64ArrayViewCid:
3646 case kUnmodifiableTypedDataInt64ArrayViewCid:
3647 case kExternalTypedDataInt64ArrayCid:
3650 case kTypedDataUint64ArrayCid:
3651 case kTypedDataUint64ArrayViewCid:
3652 case kUnmodifiableTypedDataUint64ArrayViewCid:
3653 case kExternalTypedDataUint64ArrayCid:
3656 case kTypedDataFloat32ArrayCid:
3657 case kTypedDataFloat32ArrayViewCid:
3658 case kUnmodifiableTypedDataFloat32ArrayViewCid:
3659 case kExternalTypedDataFloat32ArrayCid:
3662 case kTypedDataFloat64ArrayCid:
3663 case kTypedDataFloat64ArrayViewCid:
3664 case kUnmodifiableTypedDataFloat64ArrayViewCid:
3665 case kExternalTypedDataFloat64ArrayCid:
3668 case kTypedDataInt32x4ArrayCid:
3669 case kTypedDataInt32x4ArrayViewCid:
3670 case kUnmodifiableTypedDataInt32x4ArrayViewCid:
3671 case kExternalTypedDataInt32x4ArrayCid:
3674 case kTypedDataFloat32x4ArrayCid:
3675 case kTypedDataFloat32x4ArrayViewCid:
3676 case kUnmodifiableTypedDataFloat32x4ArrayViewCid:
3677 case kExternalTypedDataFloat32x4ArrayCid:
3680 case kTypedDataFloat64x2ArrayCid:
3681 case kTypedDataFloat64x2ArrayViewCid:
3682 case kUnmodifiableTypedDataFloat64x2ArrayViewCid:
3683 case kExternalTypedDataFloat64x2ArrayCid:
3718 const auto& view_obj = Api::UnwrapTypedDataViewHandle(zone,
object);
3719 ASSERT(!view_obj.IsNull());
3746 intptr_t external_allocation_size,
3748 bool unmodifiable) {
3774 intptr_t external_allocation_size,
3776 bool unmodifiable) {
3779 thread, kExternalTypedDataUint8ArrayCid,
data,
length, peer,
3780 external_allocation_size,
callback,
false);
3785 Api::UnwrapExternalTypedDataHandle(zone, ext_data);
3831 return Api::NewError(
"%s expects argument 'type' to be of 'TypedData'",
3843 intptr_t external_allocation_size,
3845 bool unmodifiable) {
3854 external_allocation_size,
callback,
3858 length, peer, external_allocation_size,
3862 length, peer, external_allocation_size,
3866 data,
length, peer, external_allocation_size,
3870 length, peer, external_allocation_size,
3874 length, peer, external_allocation_size,
3878 length, peer, external_allocation_size,
3882 length, peer, external_allocation_size,
3886 length, peer, external_allocation_size,
3890 length, peer, external_allocation_size,
3894 length, peer, external_allocation_size,
3898 length, peer, external_allocation_size,
3902 length, peer, external_allocation_size,
3906 length, peer, external_allocation_size,
3910 length, peer, external_allocation_size,
3914 "%s expects argument 'type' to be of"
3915 " 'external TypedData'",
3934 intptr_t external_allocation_size,
3945 intptr_t external_allocation_size,
3948 type,
const_cast<void*
>(
data),
length, peer, external_allocation_size,
3954 const String& constructor_name,
3955 intptr_t num_args) {
3975 Symbols::_ByteBufferDot_New(), 1);
3984 args.SetAt(0, Object::null_type_arguments());
3998 : size_in_bytes_(size_in_bytes), data_(
data), data_copy_(nullptr) {
4000 data_copy_ =
malloc(size_in_bytes_);
4001 memmove(data_copy_, data_, size_in_bytes_);
4006 void*
GetData()
const {
return data_copy_ !=
nullptr ? data_copy_ : data_; }
4010 if (data_copy_ !=
nullptr) {
4011 memmove(data_, data_copy_, size_in_bytes_);
4012 memset(data_copy_, kZapReleasedByte, size_in_bytes_);
4018 static constexpr uint8_t kZapReleasedByte = 0xda;
4019 intptr_t size_in_bytes_;
4038 if (
type ==
nullptr) {
4041 if (
data ==
nullptr) {
4044 if (
len ==
nullptr) {
4050 intptr_t size_in_bytes = 0;
4051 void* data_tmp =
nullptr;
4052 bool external =
false;
4053 T->IncrementNoSafepointScopeDepth();
4057 Api::UnwrapExternalTypedDataHandle(
Z,
object);
4064 const TypedData& obj = Api::UnwrapTypedDataHandle(
Z,
object);
4072 const auto& view_obj = Api::UnwrapTypedDataViewHandle(
Z,
object);
4073 ASSERT(!view_obj.IsNull());
4075 val = view_obj.length();
4078 val = view_obj.offset_in_bytes();
4079 intptr_t offset_in_bytes = val.
Value();
4082 const TypedData& data_obj = TypedData::Cast(obj);
4083 data_tmp = data_obj.
DataAddr(offset_in_bytes);
4087 data_tmp = data_obj.
DataAddr(offset_in_bytes);
4091 if (FLAG_verify_acquired_data) {
4094 bool sweep_in_progress;
4096 PageSpace* old_space =
T->heap()->old_space();
4101 if (!sweep_in_progress) {
4103 ASSERT(!
T->heap()->Contains(
reinterpret_cast<uword>(data_tmp)));
4105 ASSERT(
T->heap()->Contains(
reinterpret_cast<uword>(data_tmp)));
4111 intptr_t current =
table->GetValue(obj.
ptr());
4113 return Api::NewError(
"Data was already acquired for this object.");
4119 table->SetValue(obj.
ptr(),
reinterpret_cast<intptr_t
>(ad));
4136 if (FLAG_verify_acquired_data) {
4139 intptr_t current =
table->GetValue(obj.
ptr());
4141 return Api::NewError(
"Data was not acquired for this object.");
4147 T->DecrementNoSafepointScopeDepth();
4172 const String& constr_name,
4179 if (constructor.
IsNull() ||
4189 "%s: could not find factory '%s' in class '%s'.", current_func,
4191 return ApiError::New(
message);
4195 current_func, constr_name.
ToCString()));
4196 return ApiError::New(
message);
4199 const int kTypeArgsLen = 0;
4200 const int extra_args = 1;
4203 0, &error_message)) {
4205 "%s: wrong argument count for "
4206 "constructor '%s': %s.",
4208 return ApiError::New(
message);
4212 return constructor.
ptr();
4217 int number_of_arguments,
4223 if (number_of_arguments < 0) {
4225 "%s expects argument 'number_of_arguments' to be non-negative.",
4231 if (unchecked_type.
IsNull() || !unchecked_type.IsType()) {
4235 type_obj ^= unchecked_type.
ptr();
4238 "%s expects argument 'type' to be a fully resolved type.",
4254 }
else if (
result.IsString()) {
4264 constr_name, number_of_arguments);
4270 constructor ^=
result.ptr();
4286 intptr_t arg_index = 0;
4292 if (!type_arguments.
IsNull()) {
4298 args.SetAt(arg_index++, new_object);
4301 args.SetAt(arg_index++, type_arguments);
4304 for (
int i = 0;
i < number_of_arguments;
i++) {
4306 if (!argument.
IsNull() && !argument.IsInstance()) {
4307 if (argument.IsError()) {
4311 "%s expects arguments[%d] to be an Instance handle.",
CURRENT_FUNC,
4315 args.SetAt(arg_index++, argument);
4318 const int kTypeArgsLen = 0;
4324 args, args_descriptor, type_arguments, Object::empty_type_arguments());
4339 new_object ^=
result.ptr();
4353 while (!iterate_cls.
IsNull()) {
4356 fields = iterate_cls.
fields();
4358 for (
int field_num = 0; field_num < fields.
Length(); field_num++) {
4359 field ^= fields.
At(field_num);
4377 const Type& type_obj = Api::UnwrapTypeHandle(
Z,
type);
4385 "%s expects argument 'type' to be a fully resolved type.",
4401 if (!type_arguments.
IsNull()) {
4409 intptr_t num_native_fields,
4410 const intptr_t* native_fields) {
4414 const Type& type_obj = Api::UnwrapTypeHandle(
Z,
type);
4419 if (native_fields ==
nullptr) {
4432 "%s: invalid number of native fields %" Pd " passed in, expected %d",
4436 instance.SetNativeFields(num_native_fields, native_fields);
4449 for (
int i = 0;
i < num_args;
i++) {
4451 if (!arg.
IsNull() && !arg.IsInstance()) {
4453 if (arg.IsError()) {
4457 "%s expects arguments[%d] to be an Instance handle.",
"Dart_Invoke",
4461 args->SetAt((
i + extra_args), arg);
4468 int number_of_arguments,
4474 if (number_of_arguments < 0) {
4476 "%s expects argument 'number_of_arguments' to be non-negative.",
4498 if (constructor_name.
IsNull()) {
4501 strings.
SetAt(2, constructor_name);
4505 if (type_obj.IsType()) {
4506 type_arguments = Type::Cast(type_obj).GetInstanceTypeArguments(
T);
4510 const int kTypeArgsLen = 0;
4511 const int extra_args = 1;
4514 kTypeArgsLen, number_of_arguments + extra_args, 0,
nullptr)) {
4524 const int kTypeArgsLen = 0;
4529 args, args_descriptor, type_arguments);
4536 if (retval.IsError()) {
4544 return Api::NewError(
"%s expects argument 'name' to be a valid constructor.",
4550 int number_of_arguments,
4561 if (number_of_arguments < 0) {
4563 "%s expects argument 'number_of_arguments' to be non-negative.",
4567 if (obj.IsError()) {
4573 const Array& arg_names = Object::empty_array();
4574 const bool respect_reflectable =
false;
4575 const bool check_is_entrypoint = FLAG_verify_entry_points;
4577 if (!Type::Cast(obj).IsFinalized()) {
4579 "%s expects argument 'target' to be a fully resolved type.",
4596 check_is_entrypoint));
4597 }
else if (obj.
IsNull() || obj.IsInstance()) {
4612 check_is_entrypoint));
4613 }
else if (obj.IsLibrary()) {
4615 const Library& lib = Library::Cast(obj);
4619 return Api::NewError(
"%s expects library argument 'target' to be loaded.",
4635 check_is_entrypoint));
4638 "%s expects argument 'target' to be an object, type, or library.",
4644 int number_of_arguments,
4653 if (number_of_arguments < 0) {
4655 "%s expects argument 'number_of_arguments' to be non-negative.",
4662 args.SetAt(0, closure_obj);
4663 for (
int i = 0;
i < number_of_arguments;
i++) {
4665 if (!obj.
IsNull() && !obj.IsInstance()) {
4668 args.SetAt(
i + 1, obj);
4681 if (field_name.
IsNull()) {
4685 const bool throw_nsm_if_absent =
true;
4686 const bool respect_reflectable =
false;
4687 const bool check_is_entrypoint = FLAG_verify_entry_points;
4690 if (!Type::Cast(obj).IsFinalized()) {
4692 "%s expects argument 'container' to be a fully resolved type.",
4702 respect_reflectable, check_is_entrypoint));
4703 }
else if (obj.
IsNull() || obj.IsInstance()) {
4712 instance.InvokeGetter(field_name, respect_reflectable,
4713 check_is_entrypoint));
4714 }
else if (obj.IsLibrary()) {
4715 const Library& lib = Library::Cast(obj);
4719 "%s expects library argument 'container' to be loaded.",
4727 respect_reflectable, check_is_entrypoint));
4728 }
else if (obj.IsError()) {
4732 "%s expects argument 'container' to be an object, type, or library.",
4746 if (field_name.
IsNull()) {
4752 if (!value_obj.
IsNull() && !value_obj.IsInstance()) {
4756 value_instance ^= value_obj.
ptr();
4759 const bool respect_reflectable =
false;
4760 const bool check_is_entrypoint = FLAG_verify_entry_points;
4763 if (!Type::Cast(obj).IsFinalized()) {
4765 "%s expects argument 'container' to be a fully resolved type.",
4777 T, cls.
InvokeSetter(field_name, value_instance, respect_reflectable,
4778 check_is_entrypoint));
4779 }
else if (obj.
IsNull() || obj.IsInstance()) {
4788 T,
instance.InvokeSetter(field_name, value_instance,
4789 respect_reflectable, check_is_entrypoint));
4790 }
else if (obj.IsLibrary()) {
4794 const Library& lib = Library::Cast(obj);
4798 "%s expects library argument 'container' to be loaded.",
4806 T, lib.
InvokeSetter(field_name, value_instance, respect_reflectable,
4807 check_is_entrypoint));
4808 }
else if (obj.IsError()) {
4812 "%s expects argument 'container' to be an object, type, or library.",
4835 return Api::NewError(
"No Dart frames on stack, cannot throw exception");
4842 InstancePtr raw_exception =
4848 return Api::NewError(
"Exception was not thrown, internal error");
4872 return Api::NewError(
"No Dart frames on stack, cannot throw exception");
4880 InstancePtr raw_exception =
4882 StackTracePtr raw_stacktrace =
4883 Api::UnwrapStackTraceHandle(zone, stacktrace).ptr();
4889 return Api::NewError(
"Exception was not re thrown, internal error");
4900 ReusableObjectHandleScope reused_obj_handle(thread);
4917 bool is_null =
false;
4919 ReusableObjectHandleScope reused_obj_handle(thread);
4923 if (
instance.IsValidNativeIndex(index)) {
4935 "%s: invalid index %d passed into access native instance field",
4947 if (!
instance.IsValidNativeIndex(index)) {
4949 "%s: invalid index %d passed into set native instance field",
4971 if (arg_values ==
nullptr) {
4974 for (
int i = 0;
i < num_arguments;
i++) {
4978 int arg_index =
desc.index;
4979 ASSERT(arg_index >= 0 && arg_index < arguments->NativeArgCount());
4986 "%s: expects argument at index %d to be of"
4996 "%s: expects argument at index %d to be of"
5000 if (value < INT32_MIN || value > INT32_MAX) {
5002 "%s: argument value at index %d is out of range",
CURRENT_FUNC,
5013 "%s: expects argument at index %d to be of"
5017 if (value < 0 || value > UINT32_MAX) {
5019 "%s: argument value at index %d is out of range",
CURRENT_FUNC,
5030 "%s: expects argument at index %d to be of"
5042 "%s: expects argument at index %d to be of"
5054 "%s: expects argument at index %d to be of"
5065 "%s: expects argument at index %d to be of"
5102 "%s: argument 'index' out of range. Expected 0..%d but saw %d.",
5118 intptr_t* field_values) {
5120 if ((arg_index < 0) || (arg_index >= arguments->
NativeArgCount())) {
5122 "%s: argument 'arg_index' out of range. Expected 0..%d but saw %d.",
5125 if (field_values ==
nullptr) {
5137 if (
value ==
nullptr) {
5144 "%s expects receiver argument to be non-null and of"
5157 "%s expects argument at %d to be of"
5170 "%s: argument 'index' out of range. Expected 0..%d but saw %d.",
5175 "%s: expects argument at %d to be of"
5188 "%s: argument 'index' out of range. Expected 0..%d but saw %d.",
5193 "%s: expects argument at %d to be of type Boolean.",
CURRENT_FUNC,
5205 "%s: argument 'index' out of range. Expected 0..%d but saw %d.",
5210 "%s: expects argument at %d to be of"
5232 "Return value check failed: saw '%s' expected a dart Instance or "
5236 ASSERT(retval !=
nullptr);
5262 if (!FLAG_enable_mirrors &&
name.Equals(Symbols::DartLibraryMirrors())) {
5270 if (
name.Equals(Symbols::DartVMProduct())) {
5278 if (
name.Equals(Symbols::DartDeveloperTimeline())) {
5279#ifdef SUPPORT_TIMELINE
5288 const String& library_name =
5292 if (!library_name.
IsNull() && library_name.
CharAt(0) !=
'_') {
5293 const String& dart_library_name =
5311StringPtr Api::CallEnvironmentCallback(
Thread* thread,
const String&
name) {
5315 Scope api_scope(thread);
5322 const Object& response =
5324 if (response.IsString()) {
5325 return String::Cast(response).ptr();
5326 }
else if (response.IsError()) {
5329 }
else if (!response.IsNull()) {
5399#if defined(DART_PRECOMPILED_RUNTIME)
5410 return Api::NewError(
"%s: A script has already been loaded from '%s'.",
5418 kExternalTypedDataUint8ArrayCid,
const_cast<uint8_t*
>(
buffer),
5421 const char*
error =
nullptr;
5422 std::unique_ptr<kernel::Program> program =
5424 if (program ==
nullptr) {
5430 if (tmp.IsError()) {
5435 IG->source()->script_kernel_buffer =
buffer;
5442 "Invoked Dart programs must have a 'main' function defined:\n"
5443 "https://dart.dev/guides/language/"
5444 "language-tour#a-basic-dart-program");
5446 library ^= tmp.
ptr();
5447 IG->object_store()->set_root_library(library);
5464 if (obj.
IsNull() || obj.IsLibrary()) {
5467 T->isolate_group()->object_store()->set_root_library(lib);
5476 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
5488 return Api::NewError(
"Class '%s' not found in library '%s'.",
5498 intptr_t number_of_type_arguments,
5503 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
5508 return Api::NewError(
"%s expects library argument 'library' to be loaded.",
5518 return Api::NewError(
"Type '%s' not found in library '%s'.",
5526 if (number_of_type_arguments != 0) {
5528 "Invalid number of type arguments specified, "
5529 "got %" Pd " expected 0",
5530 number_of_type_arguments);
5537 if (number_of_type_arguments > 0) {
5538 if (type_arguments ==
nullptr) {
5541 if (num_expected_type_arguments != number_of_type_arguments) {
5543 "Invalid number of type arguments specified, "
5544 "got %" Pd " expected %" Pd,
5545 number_of_type_arguments, num_expected_type_arguments);
5547 const Array& array = Api::UnwrapArrayHandle(
Z, *type_arguments);
5551 if (array.
Length() != num_expected_type_arguments) {
5553 "Invalid type arguments specified, expected an "
5554 "array of len %" Pd " but got an array of len %" Pd,
5555 number_of_type_arguments, array.
Length());
5560 for (intptr_t
i = 0;
i < number_of_type_arguments;
i++) {
5561 type_arg ^= array.
At(
i);
5575 intptr_t number_of_type_arguments,
5578 "Cannot use legacy types with --sound-null-safety enabled. "
5579 "Use Dart_GetNullableType or Dart_GetNonNullableType instead.");
5584 intptr_t number_of_type_arguments,
5593 intptr_t number_of_type_arguments,
5601 const Type& ty = Api::UnwrapTypeHandle(
Z,
type);
5623 const Type& ty = Api::UnwrapTypeHandle(
Z,
type);
5642 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
5653 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
5668 auto IG =
T->isolate_group();
5672 int num_libs =
libs.Length();
5677 for (
int i = 0;
i < num_libs;
i++) {
5680 library_list.
SetAt(
i, lib);
5705 const Library& lib = Api::UnwrapLibraryHandle(
Z, library_in);
5718#if !defined(DART_PRECOMPILED_RUNTIME)
5720 const char*
error =
nullptr;
5721 std::unique_ptr<kernel::Program> program =
5723 if (program ==
nullptr) {
5731 source->add_loaded_blob(
Z, td);
5739#if defined(DART_PRECOMPILED_RUNTIME)
5751 kExternalTypedDataUint8ArrayCid,
const_cast<uint8_t*
>(
buffer),
5758#if defined(DART_PRECOMPILED_RUNTIME)
5763 Api::UnwrapExternalTypedDataHandle(
Z, kernel_buffer);
5785#if !defined(PRODUCT)
5791 I->debugger()->NotifyDoneLoading();
5798 if (
I->group()->ContainsOnlyOneIsolate()) {
5799 I->group()->heap()->old_space()->EvaluateAfterLoading();
5802#if !defined(DART_PRECOMPILED_RUNTIME)
5803 if (FLAG_enable_mirrors) {
5806 const Field& dirty_bit =
5819 const uint8_t* snapshot_data,
5820 const uint8_t* snapshot_instructions,
5821 const char* error_message,
5822 bool transient_error) {
5825 auto IG =
T->isolate_group();
5828 const Array& loading_units =
5831 (loading_unit_id >= loading_units.
Length())) {
5835 unit ^= loading_units.
At(loading_unit_id);
5846#if defined(SUPPORT_TIMELINE)
5847 TimelineBeginEndScope tbes(
T, Timeline::GetIsolateStream(),
5848 "ReadUnitSnapshot");
5851 if (snapshot ==
nullptr) {
5856 "Incompatible snapshot kinds: vm '%s', isolate '%s'",
5864 if (!
error.IsNull()) {
5874 const uint8_t* snapshot_data,
5875 const uint8_t* snapshot_instructions) {
5877 snapshot_instructions,
nullptr,
false);
5882 const char* error_message,
5885 error_message, transient);
5893 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
5905 if (resolver ==
nullptr) {
5908 *resolver =
nullptr;
5910 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
5920 if (resolver ==
nullptr) {
5923 *resolver =
nullptr;
5925 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
5937 const Library& lib = Api::UnwrapLibraryHandle(
Z, library);
5956 if (peer ==
nullptr) {
5963 Object& obj = thread->ObjectHandle();
5965 if (obj.
IsNull() || obj.IsNumber() || obj.IsBool()) {
5967 "%s: argument 'object' cannot be a subtype of Null, num, or bool";
5983 Object& obj = thread->ObjectHandle();
5985 if (obj.
IsNull() || obj.IsNumber() || obj.IsBool()) {
5987 "%s: argument 'object' cannot be a subtype of Null, num, or bool";
6001#if defined(DART_PRECOMPILED_RUNTIME)
6005 return iso->is_kernel_isolate();
6010#if defined(DART_PRECOMPILED_RUNTIME)
6018#if defined(DART_PRECOMPILED_RUNTIME)
6027 const uint8_t* platform_kernel,
6028 intptr_t platform_kernel_size,
6029 bool incremental_compile,
6032 const char* package_config,
6037#if defined(DART_PRECOMPILED_RUNTIME)
6042 script_uri, platform_kernel, platform_kernel_size, 0,
nullptr,
6043 incremental_compile, for_snapshot, embed_sources, package_config,
nullptr,
6044 nullptr, verbosity);
6045 if (incremental_compile) {
6052 "An error occurred in the CFE while acking the most recent"
6053 " compilation results: %s",
6063#if defined(DART_PRECOMPILED_RUNTIME)
6073 const uint8_t* platform_kernel,
6074 const intptr_t platform_kernel_size) {
6075#if !defined(PRODUCT)
6077 platform_kernel_size);
6082 const char* package_config,
6083 const char* original_working_directory,
6084 const uint8_t* snapshot_data,
6085 const uint8_t* snapshot_instructions,
6086 const uint8_t* kernel_buffer,
6087 intptr_t kernel_buffer_size) {
6095 return iso->is_service_isolate();
6102#if !defined(PRODUCT)
6111#if !defined(PRODUCT)
6118#if !defined(PRODUCT)
6129 if (listen_callback !=
nullptr) {
6132 "Dart_SetServiceStreamCallbacks "
6133 "permits only one listen callback to be registered, please "
6134 "remove the existing callback and then add this callback");
6139 "Dart_SetServiceStreamCallbacks "
6140 "expects 'listen_callback' to be present in the callback set.");
6143 if (cancel_callback !=
nullptr) {
6146 "Dart_SetServiceStreamCallbacks "
6147 "permits only one cancel callback to be registered, please "
6148 "remove the existing callback and then add this callback");
6153 "Dart_SetServiceStreamCallbacks "
6154 "expects 'cancel_callback' to be present in the callback set.");
6163 const char* event_kind,
6164 const uint8_t* bytes,
6165 intptr_t bytes_length) {
6166#if !defined(PRODUCT)
6167 if (stream_id ==
nullptr) {
6169 "Dart_ServiceSendDataEvent expects argument 'stream_id' to be "
6172 if (event_kind ==
nullptr) {
6174 "Dart_ServiceSendDataEvent expects argument 'event_kind' to be "
6177 if (bytes ==
nullptr) {
6179 "Dart_ServiceSendDataEvent expects argument 'bytes' to be non-null.");
6181 if (bytes_length < 0) {
6183 "Dart_ServiceSendDataEvent expects argument 'bytes_length' to be >= "
6187 stream_id, event_kind, bytes, bytes_length);
6199#if !defined(PRODUCT)
6200#if !defined(DART_PRECOMPILED_RUNTIME)
6201 if (file_modified_callback !=
nullptr) {
6204 "Dart_SetFileModifiedCallback permits only one callback to be"
6205 " registered, please remove the existing callback and then add"
6211 "Dart_SetFileModifiedCallback expects 'file_modified_callback' to"
6212 " be set before it is cleared.");
6222#if defined(PRODUCT) || defined(DART_PRECOMPILED_RUNTIME)
6233#if defined(SUPPORT_TIMELINE)
6235 if (categories !=
nullptr) {
6260 int64_t timestamp1_or_id,
6261 intptr_t flow_id_count,
6262 const int64_t* flow_ids,
6265 const char** argument_names,
6266 const char** argument_values) {
6267#if defined(SUPPORT_TIMELINE)
6279 TimelineEvent*
event =
stream->StartEvent();
6280 if (
event !=
nullptr) {
6283 event->Begin(label, timestamp1_or_id, timestamp0);
6286 event->End(label, timestamp1_or_id, timestamp0);
6289 event->Instant(label, timestamp0);
6292 event->Duration(label, timestamp0, timestamp1_or_id);
6295 event->AsyncBegin(label, timestamp1_or_id, timestamp0);
6298 event->AsyncEnd(label, timestamp1_or_id, timestamp0);
6301 event->AsyncInstant(label, timestamp1_or_id, timestamp0);
6304 event->Counter(label, timestamp0);
6307 event->FlowBegin(label, timestamp1_or_id, timestamp0);
6310 event->FlowStep(label, timestamp1_or_id, timestamp0);
6313 event->FlowEnd(label, timestamp1_or_id, timestamp0);
6316 FATAL(
"Unknown Dart_Timeline_Event_Type");
6318 if (flow_id_count > 0 && flow_ids !=
nullptr) {
6319 std::unique_ptr<const int64_t[]> flow_ids_copy;
6320 int64_t* flow_ids_internal =
new int64_t[flow_id_count];
6321 for (intptr_t
i = 0;
i < flow_id_count; ++
i) {
6322 flow_ids_internal[
i] = flow_ids[
i];
6324 flow_ids_copy = std::unique_ptr<const int64_t[]>(flow_ids_internal);
6325 event->SetFlowIds(flow_id_count, flow_ids_copy);
6329 event->CopyArgument(
i, argument_names[
i], argument_values[
i]);
6339#if defined(SUPPORT_TIMELINE)
6346 if (thread ==
nullptr) {
6354#if defined(DART_PRECOMPILED_RUNTIME)
6375#if defined(TARGET_ARCH_IA32)
6376 return Api::NewError(
"AOT compilation is not supported on IA32.");
6377#elif !defined(DART_PRECOMPILER)
6379 "This VM was built without support for AOT compilation.");
6383 if (!FLAG_precompiled_mode) {
6384 return Api::NewError(
"Flag --precompilation was not specified.");
6399#if !defined(TARGET_ARCH_IA32) && defined(DART_PRECOMPILER)
6400static constexpr intptr_t kAssemblyInitialSize = 512 *
KB;
6402static constexpr intptr_t kInitialDebugSize = 1 *
MB;
6404static void CreateAppAOTSnapshot(
6406 void* callback_data,
6409 void* debug_callback_data,
6410 GrowableArray<LoadingUnitSerializationData*>* units,
6411 LoadingUnitSerializationData* unit,
6412 uint32_t program_hash) {
6415 NOT_IN_PRODUCT(TimelineBeginEndScope tbes2(
T, Timeline::GetIsolateStream(),
6416 "WriteAppAOTSnapshot"));
6424 const bool generate_debug = debug_callback_data !=
nullptr;
6426 auto*
const deobfuscation_trie =
6427 (strip && !generate_debug) ?
nullptr
6428 : ImageWriter::CreateReverseObfuscationTrie(
T);
6432 StreamingWriteStream debug_stream(generate_debug ? kInitialDebugSize : 0,
6435 auto const dwarf = strip ? nullptr :
new (
Z) Dwarf(
Z, deobfuscation_trie);
6436 auto const elf =
new (
Z) Elf(
Z, &elf_stream, Elf::Type::Snapshot, dwarf);
6438 auto const debug_elf =
6440 ?
new (
Z) Elf(
Z, &debug_stream, Elf::Type::DebugInfo,
6441 strip ?
new (
Z) Dwarf(
Z, deobfuscation_trie) : dwarf)
6446 deobfuscation_trie, debug_elf, elf);
6452 writer.WriteFullSnapshot(units);
6454 writer.WriteUnitSnapshot(units, unit, program_hash);
6458 if (debug_elf !=
nullptr) {
6459 debug_elf->Finalize();
6462 StreamingWriteStream assembly_stream(kAssemblyInitialSize,
callback,
6464 StreamingWriteStream debug_stream(generate_debug ? kInitialDebugSize : 0,
6467 auto const elf = generate_debug
6468 ?
new (
Z) Elf(
Z, &debug_stream, Elf::Type::DebugInfo,
6469 new (
Z) Dwarf(
Z, deobfuscation_trie))
6472 AssemblyImageWriter image_writer(
T, &assembly_stream, deobfuscation_trie,
6479 writer.WriteFullSnapshot(units);
6481 writer.WriteUnitSnapshot(units, unit, program_hash);
6483 image_writer.Finalize();
6488 void* next_callback_data,
6494 ProgramVisitor::AssignUnits(
T);
6496 const Array& loading_units =
6497 Array::Handle(
T->isolate_group()->object_store()->loading_units());
6500 GrowableArray<LoadingUnitSerializationData*>
data;
6501 data.SetLength(loading_units.Length());
6506 for (intptr_t
id = 1;
id < loading_units.Length();
id++) {
6507 loading_unit ^= loading_units.At(
id);
6508 parent = loading_unit.parent();
6509 LoadingUnitSerializationData* parent_data =
6510 parent.IsNull() ? nullptr :
data[parent.id()];
6511 data[
id] =
new LoadingUnitSerializationData(
id, parent_data);
6514 for (intptr_t
id = 1;
id < loading_units.Length();
id++) {
6515 void* write_callback_data =
nullptr;
6516 void* write_debug_callback_data =
nullptr;
6518 TransitionVMToNative transition(
T);
6519 next_callback(next_callback_data,
id, &write_callback_data,
6520 &write_debug_callback_data);
6522 CreateAppAOTSnapshot(write_callback, write_callback_data, strip, as_elf,
6523 write_debug_callback_data, &
data,
data[
id],
6526 TransitionVMToNative transition(
T);
6527 close_callback(write_callback_data);
6528 if (write_debug_callback_data !=
nullptr) {
6529 close_callback(write_debug_callback_data);
6538 void* callback_data,
6540 void* debug_callback_data) {
6541#if defined(TARGET_ARCH_IA32)
6542 return Api::NewError(
"AOT compilation is not supported on IA32.");
6543#elif defined(DART_TARGET_OS_WINDOWS)
6544 return Api::NewError(
"Assembly generation is not implemented for Windows.");
6545#elif !defined(DART_PRECOMPILER)
6547 "This VM was built without support for AOT compilation.");
6554 T->isolate_group()->object_store()->set_loading_units(Object::null_array());
6556 CreateAppAOTSnapshot(
callback, callback_data, strip,
false,
6557 debug_callback_data,
nullptr,
nullptr, 0);
6565 void* next_callback_data,
6569#if defined(TARGET_ARCH_IA32)
6570 return Api::NewError(
"AOT compilation is not supported on IA32.");
6571#elif defined(DART_TARGET_OS_WINDOWS)
6572 return Api::NewError(
"Assembly generation is not implemented for Windows.");
6573#elif !defined(DART_PRECOMPILER)
6575 "This VM was built without support for AOT compilation.");
6583 Split(next_callback, next_callback_data, strip,
false,
6584 write_callback, close_callback);
6592 void* callback_data) {
6593#if defined(TARGET_ARCH_IA32)
6594 return Api::NewError(
"AOT compilation is not supported on IA32.");
6595#elif defined(DART_TARGET_OS_WINDOWS)
6596 return Api::NewError(
"Assembly generation is not implemented for Windows.");
6597#elif !defined(DART_PRECOMPILER)
6599 "This VM was built without support for AOT compilation.");
6608 AssemblyImageWriter image_writer(
T, &assembly_stream);
6611 &image_writer,
nullptr);
6621 void* callback_data,
6623 void* debug_callback_data) {
6624#if defined(TARGET_ARCH_IA32)
6625 return Api::NewError(
"AOT compilation is not supported on IA32.");
6626#elif !defined(DART_PRECOMPILER)
6628 "This VM was built without support for AOT compilation.");
6635 T->isolate_group()->object_store()->set_loading_units(Object::null_array());
6637 CreateAppAOTSnapshot(
callback, callback_data, strip,
true,
6638 debug_callback_data,
nullptr,
nullptr, 0);
6646 void* next_callback_data,
6650#if defined(TARGET_ARCH_IA32)
6651 return Api::NewError(
"AOT compilation is not supported on IA32.");
6652#elif !defined(DART_PRECOMPILER)
6654 "This VM was built without support for AOT compilation.");
6662 Split(next_callback, next_callback_data, strip,
true,
6663 write_callback, close_callback);
6670#if defined(TARGET_ARCH_IA32)
6671 return Api::NewError(
"AOT compilation is not supported on IA32.");
6672#elif !defined(DART_PRECOMPILER)
6674 "This VM was built without support for AOT compilation.");
6679 const Array& loading_units =
6680 Array::Handle(
Z,
T->isolate_group()->object_store()->loading_unit_uris());
6681 if (loading_unit_id >= 0 && loading_unit_id < loading_units.
Length()) {
6688#if (!defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME))
6697 const String& execute_match_name =
6699 const String& execute_match_sticky_name =
6703 const Class& reg_exp_class =
6716 code.DisableDartCode();
6727 code.DisableDartCode();
6736#if !defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
6740 bool non_main_isolates_alive =
false;
6743 group->ForEachIsolate(
6747 non_main_isolates_alive =
true;
6751 if (!non_main_isolates_alive) {
6762 intptr_t* isolate_snapshot_data_size,
6763 uint8_t** isolate_snapshot_instructions_buffer,
6764 intptr_t* isolate_snapshot_instructions_size) {
6765#if defined(TARGET_ARCH_IA32)
6766 return Api::NewError(
"Snapshots with code are not supported on IA32.");
6767#elif defined(DART_PRECOMPILED_RUNTIME)
6768 return Api::NewError(
"JIT app snapshots cannot be taken from an AOT runtime");
6772 auto I =
T->isolate();
6773 auto IG =
T->isolate_group();
6776 CHECK_NULL(isolate_snapshot_instructions_buffer);
6777 CHECK_NULL(isolate_snapshot_instructions_size);
6793 if (FLAG_dump_tables) {
6808 nullptr, &image_writer);
6813 *isolate_snapshot_instructions_buffer =
6815 *isolate_snapshot_instructions_size =
6823 intptr_t* buffer_length) {
6824#if defined(DART_PRECOMPILED_RUNTIME)
6825 return Api::NewError(
"No obfuscation map to save on an AOT runtime.");
6826#elif !defined(DART_PRECOMPILER)
6827 return Api::NewError(
"Obfuscation is only supported for AOT compiler.");
6836 if (buffer_length ==
nullptr) {
6841 const intptr_t kInitialBufferSize = 1 *
MB;
6857 *buffer_length = text_buffer.
length();
6858 *
reinterpret_cast<char**
>(
buffer) = text_buffer.
buffer();
6864#if defined(DART_PRECOMPILED_RUNTIME)
6872#if !defined(PRODUCT) || defined(DART_PRECOMPILER)
6901 if (label ==
nullptr) {
6903 "Dart_NewUserTag expects argument 'label' to be non-null");
6913 const UserTag& tag = Api::UnwrapUserTagHandle(
Z, user_tag);
6922 const UserTag& tag = Api::UnwrapUserTagHandle(
Z, user_tag);
6933#if defined(DART_ENABLE_HEAP_SNAPSHOT_WRITER)
6935 CallbackHeapSnapshotWriter callback_writer(
T,
write, context);
6936 HeapSnapshotWriter writer(
T, &callback_writer);
6940 return Utils::StrDup(
"VM is built without the heap snapshot writer.");
static uint32_t buffer_size(uint32_t offset, uint32_t maxAlignment)
static void Union(SkRegion *rgn, const SkIRect &rect)
#define CLASS_LIST_FOR_HANDLES(V)
Nullability nullability() const
virtual ClassPtr type_class() const
AcquiredData(void *data, intptr_t size_in_bytes, bool copy)
LocalHandles * local_handles()
ApiLocalScope * previous() const
static ApiNativeScope * Current()
bool IsActivePersistentHandle(Dart_PersistentHandle object)
bool IsValidWeakPersistentHandle(Dart_WeakPersistentHandle object)
bool IsActiveWeakPersistentHandle(Dart_WeakPersistentHandle object)
static Dart_Handle Success()
static void SetDoubleReturnValue(NativeArguments *args, double retval)
static bool IsInstance(Dart_Handle handle)
static Dart_Handle NewHandle(Thread *thread, ObjectPtr raw)
static void SetReturnValue(NativeArguments *args, Dart_Handle retval)
static bool GetNativeFieldsOfArgument(NativeArguments *args, int arg_index, int num_fields, intptr_t *field_values)
static Dart_Isolate CastIsolate(Isolate *isolate)
static ApiLocalScope * TopScope(Thread *thread)
static ObjectPtr UnwrapHandle(Dart_Handle object)
static bool GetNativeBooleanArgument(NativeArguments *args, int arg_index, bool *value)
static StringPtr GetEnvironmentValue(Thread *thread, const String &name)
static Dart_Handle False()
static intptr_t ClassId(Dart_Handle handle)
static Dart_Handle static Dart_Handle NewArgumentError(const char *format,...) PRINTF_ATTRIBUTE(1
static Dart_IsolateGroup CastIsolateGroup(IsolateGroup *isolate_group)
static bool StringGetPeerHelper(NativeArguments *args, int arg_index, void **peer)
static Dart_Handle static Dart_Handle static Dart_Handle Null()
static void InitHandles()
static bool GetNativeDoubleArgument(NativeArguments *args, int arg_index, double *value)
static const Instance & UnwrapInstanceHandle(const ReusableObjectHandleScope &reused, Dart_Handle object)
static bool IsFfiEnabled()
static Dart_Handle EmptyString()
static bool IsProtectedHandle(Dart_Handle object)
static bool GetNativeIntegerArgument(NativeArguments *args, int arg_index, int64_t *value)
static const String & UnwrapStringHandle(const ReusableObjectHandleScope &reused, Dart_Handle object)
static void SetWeakHandleReturnValue(NativeArguments *args, Dart_WeakPersistentHandle retval)
static void SetSmiReturnValue(NativeArguments *args, intptr_t retval)
static Dart_Handle True()
static bool IsValid(Dart_Handle handle)
static intptr_t SmiValue(Dart_Handle handle)
static bool GetNativeReceiver(NativeArguments *args, intptr_t *value)
static bool IsSmi(Dart_Handle handle)
static void SetIntegerReturnValue(NativeArguments *args, int64_t retval)
static bool IsError(Dart_Handle handle)
static Dart_Handle NewError(const char *format,...) PRINTF_ATTRIBUTE(1
static Dart_Handle CheckAndFinalizePendingClasses(Thread *thread)
static ArrayPtr NewBoxed(intptr_t type_args_len, intptr_t num_arguments, const Array &optional_arguments_names, Heap::Space space=Heap::kOld)
static constexpr intptr_t kMaxElements
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
ObjectPtr At(intptr_t index) const
void SetAt(intptr_t index, const Object &value) const
void AddEscapedString(const char *s)
static const Bool & False()
static const Bool & Get(bool value)
static const Bool & True()
static InstancePtr Data(const Instance &view_obj)
static AbstractTypePtr FinalizeType(const AbstractType &type, FinalizationKind finalization=kCanonicalize)
static bool ProcessPendingClasses()
static bool AllClassesFinalized()
static void ClearAllCode(bool including_nonchanging_cids=false)
static void SortClasses()
ClassPtr At(intptr_t cid) 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
LibraryPtr library() const
ObjectPtr Invoke(const String &selector, const Array &arguments, const Array &argument_names, bool respect_reflectable=true, bool check_is_entrypoint=false) const
ObjectPtr InvokeGetter(const String &selector, bool throw_nsm_if_absent, bool respect_reflectable=true, bool check_is_entrypoint=false) const
void set_is_fields_marked_nullable() const
intptr_t NumTypeArguments() const
static bool IsSubtypeOf(const Class &cls, const TypeArguments &type_arguments, Nullability nullability, const AbstractType &other, Heap::Space space, FunctionTypeMapping *function_type_equivalence=nullptr)
uint16_t num_native_fields() const
bool IsDynamicClass() const
FunctionPtr LookupStaticFunctionAllowPrivate(const String &name) const
ErrorPtr EnsureIsFinalized(Thread *thread) const
bool is_future_subtype() const
ErrorPtr EnsureIsAllocateFinalized(Thread *thread) const
bool is_fields_marked_nullable() const
ClassPtr SuperClass(ClassTable *class_table=nullptr) const
StringPtr UserVisibleName() const
bool IsNeverClass() const
bool is_allocated() const
DART_WARN_UNUSED_RESULT ErrorPtr VerifyEntryPoint() const
intptr_t NumTypeParameters(Thread *thread) const
bool is_finalized() const
void EnsureDeclarationLoaded() const
static ObjectPtr InvokeClosure(Thread *thread, const Array &arguments)
static ObjectPtr InvokeFunction(const Function &function, const Array &arguments)
static ObjectPtr InstanceCreate(const Library &library, const String &exception_name, const String &constructor_name, const Array &arguments)
static ObjectPtr Equals(const Instance &left, const Instance &right)
static ObjectPtr ToString(const Instance &receiver)
static ErrorPtr InitializeIsolateGroup(Thread *T, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
static bool IsReadOnlyHandle(uword address)
static void ShutdownIsolate(Thread *T)
static bool SetActiveApiCall()
static Isolate * vm_isolate()
static char * Init(const Dart_InitializeParams *params)
static Isolate * CreateIsolate(const char *name_prefix, const Dart_IsolateFlags &api_flags, IsolateGroup *isolate_group)
static bool IsReadOnlyApiHandle(Dart_Handle handle)
static void ResetActiveApiCall()
static Snapshot::Kind vm_snapshot_kind()
static void RunShutdownCallback()
static LocalHandle * AllocateReadOnlyApiHandle()
static ErrorPtr InitializeIsolate(Thread *T, bool is_first_isolate_in_group, void *isolate_data)
static void set_dwarf_stacktrace_footnote_callback(Dart_DwarfStackTraceFootnoteCallback cb)
static DoublePtr New(double d, Heap::Space space=Heap::kNew)
static DART_NORETURN void Throw(Thread *thread, const Instance &exception)
static DART_NORETURN void ThrowArgumentError(const Instance &arg)
static DART_NORETURN void ReThrow(Thread *thread, const Instance &exception, const Instance &stacktrace, bool bypass_debugger=false)
static DART_NORETURN void PropagateError(const Error &error)
static ExternalTypedDataPtr New(intptr_t class_id, uint8_t *data, intptr_t len, Heap::Space space=Heap::kNew, bool perform_eager_msan_initialization_check=true)
static bool IsExternalTypedData(const Instance &obj)
static intptr_t MaxElements(intptr_t class_id)
void SetStaticValue(const Object &value) const
void RecordStore(const Object &value) const
static FinalizablePersistentHandle * New(IsolateGroup *isolate_group, const Object &object, void *peer, Dart_HandleFinalizer callback, intptr_t external_size, bool auto_delete)
Dart_HandleFinalizer callback() const
Dart_FinalizableHandle ApiFinalizableHandle()
bool IsFinalizedNotFreed() const
static intptr_t ptr_offset()
Dart_WeakPersistentHandle ApiWeakPersistentHandle()
static FinalizablePersistentHandle * Cast(Dart_WeakPersistentHandle handle)
static bool IsSet(const char *name)
static char * ProcessCommandLineFlags(int argc, const char **argv)
ApiErrorPtr ReadUnitSnapshot(const LoadingUnit &unit)
intptr_t VmIsolateSnapshotSize() const
void WriteFullSnapshot(GrowableArray< LoadingUnitSerializationData * > *data=nullptr)
intptr_t IsolateSnapshotSize() const
static constexpr intptr_t kInitialSize
CodePtr CurrentCode() const
StringPtr UserVisibleName() const
ObjectPtr DoArgumentTypesMatch(const Array &args, const ArgumentsDescriptor &arg_names) const
bool IsImplicitClosureFunction() const
FunctionPtr parent_function() const
bool AreValidArgumentCounts(intptr_t num_type_arguments, intptr_t num_arguments, intptr_t num_named_arguments, String *error_message) const
DART_WARN_UNUSED_RESULT ErrorPtr VerifyCallEntryPoint() const
FunctionPtr ImplicitClosureFunction() const
bool IsNonImplicitClosureFunction() const
bool IsGenerativeConstructor() const
UntaggedFunction::Kind kind() const
ClosurePtr ImplicitStaticClosure() const
void ClearICDataArray() const
void IterateObjects(ObjectVisitor *visitor) const
static void SetSamplingCallback(Dart_HeapSamplingCreateCallback create_callback, Dart_HeapSamplingDeleteCallback delete_callback)
static void SetSamplingInterval(intptr_t bytes_interval)
static void Enable(bool enabled)
void * GetPeer(ObjectPtr raw_obj) const
void SetPeer(ObjectPtr raw_obj, void *peer)
void CollectAllGarbage(GCReason reason=GCReason::kFull, bool compact=false)
Space SpaceForExternal(intptr_t size) const
bool IsCallable(Function *function) const
virtual void SetTypeArguments(const TypeArguments &value) const
static InstancePtr New(const Class &cls, Heap::Space space=Heap::kNew)
static IntegerPtr New(const String &str, Heap::Space space=Heap::kNew)
const char * ToHexCString(Zone *zone) const
virtual bool IsNegative() const
static IntegerPtr NewFromUint64(uint64_t value, Heap::Space space=Heap::kNew)
virtual int64_t AsInt64Value() const
static bool IsValueInRange(uint64_t value)
static Dart_FileModifiedCallback file_modified_callback()
static void SetFileModifiedCallback(Dart_FileModifiedCallback callback)
const char ** obfuscation_map() const
void * embedder_data() const
ObjectStore * object_store() const
SafepointRwLock * program_lock()
static IsolateGroup * Current()
ClassTable * class_table() const
void SetNativeAssetsCallbacks(NativeAssetsApi *native_assets_api)
ApiState * api_state() const
void set_library_tag_handler(Dart_LibraryTagHandler handler)
static void RegisterIsolateGroup(IsolateGroup *isolate_group)
static void ForEach(std::function< void(IsolateGroup *)> action)
void set_deferred_load_handler(Dart_DeferredLoadHandler handler)
IsolateGroupSource * source() const
Thread * scheduled_mutator_thread() const
Dart_EnvironmentCallback environment_callback() const
ErrorPtr sticky_error() const
UserTagPtr current_tag() const
static Isolate * Current()
void set_on_shutdown_callback(Dart_IsolateShutdownCallback value)
static void KillIfExists(Isolate *isolate, LibMsgId msg_id)
UserTagPtr default_tag() const
MessageHandler * message_handler() const
static void FlagsInitialize(Dart_IsolateFlags *api_flags)
void set_on_cleanup_callback(Dart_IsolateCleanupCallback value)
bool HasPendingMessages()
void * init_callback_data() const
void set_environment_callback(Dart_EnvironmentCallback value)
IsolateGroup * group() const
void set_init_callback_data(void *value)
Dart_MessageNotifyCallback message_notify_callback() const
bool AllowClassFinalization()
void set_origin_id(Dart_Port id)
void set_message_notify_callback(Dart_MessageNotifyCallback value)
Dart_Port main_port() const
void SetStickyError(ErrorPtr sticky_error)
const char * name() const
static Dart_KernelCompilationResult ListDependencies()
static Dart_KernelCompilationResult CompileToKernel(const char *script_uri, const uint8_t *platform_kernel, intptr_t platform_kernel_size, int source_files_count=0, Dart_SourceFile source_files[]=nullptr, bool incremental_compile=true, bool for_snapshot=false, bool embed_sources=true, const char *package_config=nullptr, const char *multiroot_filepaths=nullptr, const char *multiroot_scheme=nullptr, Dart_KernelCompilationVerbosityLevel verbosity=Dart_KernelCompilationVerbosityLevel_All)
static Dart_KernelCompilationResult RejectCompilation()
static Dart_KernelCompilationResult AcceptCompilation()
static Dart_Port KernelPort()
static LibraryPtr CoreLibrary()
StringPtr PrivateName(const String &name) const
void set_native_entry_symbol_resolver(Dart_NativeEntrySymbol native_symbol_resolver) const
static LibraryPtr MirrorsLibrary()
static bool IsPrivate(const String &name)
ObjectPtr InvokeGetter(const String &selector, bool throw_nsm_if_absent, bool respect_reflectable=true, bool check_is_entrypoint=false) const
void set_native_entry_resolver(Dart_NativeEntryResolver value) const
ObjectPtr InvokeSetter(const String &selector, const Instance &argument, bool respect_reflectable=true, bool check_is_entrypoint=false) const
void set_ffi_native_resolver(Dart_FfiNativeResolver value) const
ClassPtr LookupClassAllowPrivate(const String &name) const
ObjectPtr Invoke(const String &selector, const Array &arguments, const Array &argument_names, bool respect_reflectable=true, bool check_is_entrypoint=false) const
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
ClassPtr toplevel_class() const
Dart_NativeEntrySymbol native_entry_symbol_resolver() const
static LibraryPtr LookupLibrary(Thread *thread, const String &url)
Dart_NativeEntryResolver native_entry_resolver() const
FieldPtr LookupFieldAllowPrivate(const String &name) const
ObjectPtr CompleteLoad(const String &error_message, bool transient_error) const
static constexpr intptr_t kRootId
void set_ptr(ObjectPtr ptr)
static intptr_t ptr_offset()
void PausedOnStart(bool paused)
void PausedOnExit(bool paused)
bool is_paused_on_start() const
void set_should_pause_on_start(bool should_pause_on_start)
void set_should_pause_on_exit(bool should_pause_on_exit)
bool is_paused_on_exit() const
bool should_pause_on_start() const
bool should_pause_on_exit() const
Monitor::WaitResult Wait(int64_t millis=Monitor::kNoTimeout)
int NativeArgCount() const
void SetReturn(const Object &value) const
ObjectPtr NativeArgAt(int index) const
ObjectPtr NativeArg0() const
static void AddSymbols(const char *dso_name, void *buffer, size_t size)
void DisableThreadInterrupts()
void SetName(const char *name)
static ThreadId GetCurrentThreadId()
static ThreadLocalKey CreateThreadLocal(ThreadDestructor destructor=nullptr)
static OSThread * Current()
void EnableThreadInterrupts()
static intptr_t ThreadIdToIntPtr(ThreadId id)
static void SleepMicros(int64_t micros)
static int64_t GetCurrentMonotonicMicros()
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static char static char * VSCreate(Zone *zone, const char *format, va_list args)
static void PrepareToAbort()
static int64_t GetCurrentMonotonicFrequency()
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
static int64_t GetCurrentMonotonicTicks()
UntaggedObject * untag() const
intptr_t GetClassId() const
intptr_t GetClassIdMayBeSmi() const
intptr_t GetClassId() const
void SetImmutable() const
virtual const char * ToCString() const
Monitor * tasks_lock() const
Dart_PersistentHandle apiHandle()
static intptr_t ptr_offset()
void set_ptr(ObjectPtr ref)
static PersistentHandle * Cast(Dart_PersistentHandle handle)
static Dart_Port GetOriginId(Dart_Port id)
static bool PostMessage(std::unique_ptr< Message > message, bool before_events=false)
static ErrorPtr CompileAll()
static void DumpStackTrace(void *context)
static void Dedup(Thread *thread)
static SendPortPtr New(Dart_Port id, Heap::Space space=Heap::kNew)
Dart_Port origin_id() const
static void SendEmbedderEvent(Isolate *isolate, const char *stream_id, const char *event_kind, const uint8_t *bytes, intptr_t bytes_len)
static void SetDartLibraryKernelForSources(const uint8_t *kernel_bytes, intptr_t kernel_length)
static void SetEmbedderStreamCallbacks(Dart_ServiceStreamListenCallback listen_callback, Dart_ServiceStreamCancelCallback cancel_callback)
static void RegisterRootEmbedderCallback(const char *name, Dart_ServiceRequestCallback callback, void *user_data)
static void RegisterIsolateEmbedderCallback(const char *name, Dart_ServiceRequestCallback callback, void *user_data)
static Dart_ServiceStreamCancelCallback stream_cancel_callback()
static Dart_ServiceStreamListenCallback stream_listen_callback()
static void SetEmbedderInformationCallback(Dart_EmbedderInformationCallback callback)
static bool EnableTimelineStreams(char *categories_list)
static SmiPtr New(intptr_t value)
static bool IsValid(int64_t value)
static const Snapshot * SetupFromBuffer(const void *raw_memory)
static const char * KindToCString(Kind kind)
static constexpr intptr_t kMaxElements
static StringPtr NewFormatted(const char *format,...) PRINTF_ATTRIBUTE(1
bool IsOneByteString() const
static StringPtr ConcatAll(const Array &strings, Heap::Space space=Heap::kNew)
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
intptr_t CharSize() const
void ToUTF8(uint8_t *utf8_array, intptr_t array_len) const
uint16_t CharAt(intptr_t index) const
static StringPtr SubString(const String &str, intptr_t begin_index, Heap::Space space=Heap::kNew)
static StringPtr Concat(const String &str1, const String &str2, Heap::Space space=Heap::kNew)
static const char * ToCString(Thread *thread, StringPtr ptr)
static StringPtr FromUTF16(const uint16_t *utf16_array, intptr_t array_len, Heap::Space space=Heap::kNew)
static StringPtr FromUTF32(const int32_t *utf32_array, intptr_t array_len, Heap::Space space=Heap::kNew)
static StringPtr FromUTF8(const uint8_t *utf8_array, intptr_t array_len, Heap::Space space=Heap::kNew)
static const String & True()
static const String & False()
static const String & Empty()
static const String & Dot()
static void DumpTable(IsolateGroup *isolate_group)
void UnwindScopes(uword stack_marker)
ApiLocalScope * api_top_scope() const
static Thread * Current()
bool IsValidHandle(Dart_Handle object) const
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
uword top_exit_frame_info() const
bool IsDartMutatorThread() const
ExecutionState execution_state() const
Isolate * isolate() const
IsolateGroup * isolate_group() const
static void EnterIsolate(Isolate *isolate)
static void ExitIsolate(bool isolate_shutdown=false)
ErrorPtr sticky_error() const
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
void SetTypeAt(intptr_t index, const AbstractType &value) const
static TypeArgumentsPtr New(intptr_t len, Heap::Space space=Heap::kOld)
TypeArgumentsPtr GetInstanceTypeArguments(Thread *thread, bool canonicalize=true) const
static TypePtr VoidType()
TypePtr ToNullability(Nullability value, Heap::Space space) const
virtual ClassPtr type_class() const
static TypePtr NeverType()
static TypePtr DynamicType()
static TypePtr New(const Class &clazz, const TypeArguments &arguments, Nullability nullability=Nullability::kNonNullable, Heap::Space space=Heap::kOld)
static TypePtr NewNonParameterizedType(const Class &type_class)
intptr_t ElementSizeInBytes() const
void * DataAddr(intptr_t byte_offset) const
static TypedDataViewPtr New(intptr_t class_id, Heap::Space space=Heap::kNew)
static bool IsTypedData(const Instance &obj)
static intptr_t MaxElements(intptr_t class_id)
static TypedDataPtr New(intptr_t class_id, intptr_t len, Heap::Space space=Heap::kNew)
static UnhandledExceptionPtr New(const Instance &exception, const Instance &stacktrace, Heap::Space space=Heap::kNew)
static uword ToAddr(const UntaggedObject *raw_obj)
bool InVMIsolateHeap() const
static UserTagPtr New(const String &label, Heap::Space space=Heap::kOld)
UserTagPtr MakeActive() const
static intptr_t Length(int32_t ch)
static bool IsValid(const uint8_t *utf8_array, intptr_t array_len)
static char * StrDup(const char *s)
static bool RangeCheck(intptr_t offset, intptr_t count, intptr_t length)
static char * SCreate(const char *format,...) PRINTF_ATTRIBUTE(1
static const char * String()
void * AllocUnsafe(intptr_t size)
ElementType * Alloc(intptr_t length)
static Object & LoadEntireProgram(Program *program, bool process_pending_classes=true)
static std::unique_ptr< Program > ReadFromTypedData(const ExternalTypedData &typed_data, const char **error=nullptr)
#define DART_INITIALIZE_PARAMS_CURRENT_VERSION
Dart_Handle(* Dart_EnvironmentCallback)(Dart_Handle name)
void(* Dart_StreamingWriteCallback)(void *callback_data, const uint8_t *buffer, intptr_t size)
@ Dart_KernelCompilationStatus_Unknown
@ Dart_KernelCompilationStatus_Ok
void(* Dart_IsolateCleanupCallback)(void *isolate_group_data, void *isolate_data)
void(* Dart_MessageNotifyCallback)(Dart_Isolate destination_isolate)
struct _Dart_Handle * Dart_Handle
struct _Dart_Isolate * Dart_Isolate
Dart_NativeFunction(* Dart_NativeEntryResolver)(Dart_Handle name, int num_of_arguments, bool *auto_setup_scope)
void(* Dart_StreamingCloseCallback)(void *callback_data)
void(* Dart_HandleFinalizer)(void *isolate_callback_data, void *peer)
struct _Dart_IsolateGroup * Dart_IsolateGroup
const uint8_t *(* Dart_NativeEntrySymbol)(Dart_NativeFunction nf)
void *(* Dart_FfiNativeResolver)(const char *name, uintptr_t args_n)
struct _Dart_NativeArguments * Dart_NativeArguments
@ Dart_TypedData_kFloat32x4
@ Dart_TypedData_kInt32x4
@ Dart_TypedData_kFloat64x2
@ Dart_TypedData_kFloat32
@ Dart_TypedData_kFloat64
@ Dart_TypedData_kUint8Clamped
@ Dart_TypedData_kByteData
@ Dart_TypedData_kInvalid
Dart_Handle Dart_PersistentHandle
struct _Dart_FinalizableHandle * Dart_FinalizableHandle
void(* Dart_CreateLoadingUnitCallback)(void *callback_data, intptr_t loading_unit_id, void **write_callback_data, void **write_debug_callback_data)
void(* Dart_IsolateShutdownCallback)(void *isolate_group_data, void *isolate_data)
void *(* Dart_HeapSamplingCreateCallback)(Dart_Isolate isolate, Dart_IsolateGroup isolate_group, const char *cls_name, intptr_t allocation_size)
Dart_Handle(* Dart_LibraryTagHandler)(Dart_LibraryTag tag, Dart_Handle library_or_package_map_url, Dart_Handle url)
@ Dart_NativeArgument_kString
@ Dart_NativeArgument_kInt64
@ Dart_NativeArgument_kNativeFields
@ Dart_NativeArgument_kInstance
@ Dart_NativeArgument_kInt32
@ Dart_NativeArgument_kUint64
@ Dart_NativeArgument_kUint32
@ Dart_NativeArgument_kDouble
@ Dart_NativeArgument_kBool
int64_t Dart_IsolateGroupId
char *(* Dart_DwarfStackTraceFootnoteCallback)(void *addresses[], intptr_t count)
struct _Dart_WeakPersistentHandle * Dart_WeakPersistentHandle
Dart_KernelCompilationVerbosityLevel
Dart_Handle(* Dart_DeferredLoadHandler)(intptr_t loading_unit_id)
void(* Dart_HeapSamplingDeleteCallback)(void *data)
void(* Dart_HeapSamplingReportCallback)(void *context, void *data)
#define ISOLATE_GROUP_METRIC_API(type, variable, name, unit)
#define CHECK_ERROR_HANDLE(error)
#define GET_LIST_ELEMENT(thread, type, obj, index)
#define GET_LIST_RANGE(thread, type, obj, offset, length)
#define SET_LIST_ELEMENT_AS_BYTES(type, obj, native_array, offset, length)
#define GET_LIST_ELEMENT_AS_BYTES(type, obj, native_array, offset, length)
#define GET_LIST_LENGTH(zone, type, obj, len)
#define DEFINE_UNWRAP(type)
#define SET_LIST_ELEMENT(type, obj, index, value)
#define ISOLATE_METRIC_API(type, variable, name, unit)
#define API_TIMELINE_DURATION(thread)
#define CHECK_ISOLATE(isolate)
#define DARTSCOPE(thread)
#define CHECK_ISOLATE_GROUP(isolate_group)
#define RETURN_TYPE_ERROR(zone, dart_handle, type)
#define ASSERT_CALLBACK_STATE(thread)
#define CHECK_LENGTH(length, max_elements)
#define RETURN_NULL_ERROR(parameter)
#define CHECK_NO_ISOLATE(isolate)
#define START_NO_CALLBACK_SCOPE(thread)
#define API_TIMELINE_BEGIN_END(thread)
#define CHECK_API_SCOPE(thread)
#define CHECK_NULL(parameter)
#define END_NO_CALLBACK_SCOPE(thread)
#define CHECK_CALLBACK_STATE(thread)
const EmbeddedViewParams * params
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error
uint32_t uint32_t * format
Dart_NativeFunction function
#define HANDLESCOPE(thread)
#define DART_API_ISOLATE_GROUP_METRIC_LIST(V)
#define ISOLATE_METRIC_LIST(V)
const uint8_t * isolate_snapshot_data
const uint8_t * vm_snapshot_data
const uint8_t * vm_snapshot_instructions
static Dart_Isolate main_isolate
static SnapshotKind snapshot_kind
const uint8_t * isolate_snapshot_instructions
DART_EXPORT bool Dart_HasServiceMessages()
DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str, uint8_t **utf8_array, intptr_t *length)
static bool GetNativeStringArgument(NativeArguments *arguments, int arg_index, Dart_Handle *str, void **peer)
DART_EXPORT bool Dart_IsLibrary(Dart_Handle object)
static bool Equals(const Object &expected, const Object &actual)
DART_EXPORT Dart_Handle Dart_SetFfiNativeResolver(Dart_Handle library, Dart_FfiNativeResolver resolver)
bool IsTypedDataViewClassId(intptr_t index)
static FunctionPtr FindCoreLibPrivateFunction(Zone *zone, const String &name)
DART_EXPORT void Dart_PrepareToAbort()
bool IsTypedDataClassId(intptr_t index)
DART_EXPORT void Dart_ReportSurvivingAllocations(Dart_HeapSamplingReportCallback callback, void *context, bool force_gc)
DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, intptr_t index)
DART_EXPORT Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle(Dart_Handle object, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
DART_EXPORT Dart_Handle Dart_ClassLibrary(Dart_Handle cls_type)
static ObjectPtr ResolveConstructor(const char *current_func, const Class &cls, const String &class_name, const String &dotted_name, int num_args)
DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void *peer)
DART_EXPORT bool Dart_DetectNullSafety(const char *script_uri, const char *package_config, const char *original_working_directory, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
DART_EXPORT bool Dart_IsDouble(Dart_Handle object)
DART_EXPORT bool Dart_IsInstance(Dart_Handle object)
bool IsOneByteStringClassId(intptr_t index)
DART_EXPORT void Dart_DisableHeapSampling()
DART_EXPORT Dart_Handle Dart_IsNonNullableType(Dart_Handle type, bool *result)
static bool GetNativeIntegerArgument(NativeArguments *arguments, int arg_index, int64_t *value)
DART_EXPORT Dart_Handle Dart_SetCurrentUserTag(Dart_Handle user_tag)
DART_EXPORT bool Dart_IsCompilationError(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_CreateAppAOTSnapshotAsElfs(Dart_CreateLoadingUnitCallback next_callback, void *next_callback_data, bool strip, Dart_StreamingWriteCallback write_callback, Dart_StreamingCloseCallback close_callback)
DART_EXPORT Dart_Handle Dart_Allocate(Dart_Handle type)
DART_EXPORT Dart_Handle Dart_GetNativeStringArgument(Dart_NativeArguments args, int arg_index, void **peer)
DART_EXPORT bool Dart_IsBoolean(Dart_Handle object)
DART_EXPORT void Dart_EnterScope()
DART_EXPORT Dart_Handle Dart_GetObfuscationMap(uint8_t **buffer, intptr_t *buffer_length)
DART_EXPORT bool Dart_IsStringLatin1(Dart_Handle object)
DART_EXPORT void Dart_SetPersistentHandle(Dart_PersistentHandle obj1, Dart_Handle obj2)
DART_EXPORT Dart_Port Dart_GetMainPortId()
DART_EXPORT Dart_Handle Dart_FinalizeLoading(bool complete_futures)
DART_EXPORT Dart_Handle Dart_NewUserTag(const char *label)
static Dart_Handle GetNativeFieldsOfArgument(NativeArguments *arguments, int arg_index, int num_fields, intptr_t *field_values, const char *current_func)
DART_EXPORT Dart_Handle Dart_GetStickyError()
static InstancePtr GetMapInstance(Zone *zone, const Object &obj)
DART_EXPORT char * Dart_GetUserTagLabel(Dart_Handle user_tag)
DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_ReThrowException(Dart_Handle exception, Dart_Handle stacktrace)
const int kTypedDataCidRemainderUnmodifiable
static bool GetNativeDoubleArgument(NativeArguments *arguments, int arg_index, double *value)
DART_EXPORT void Dart_StartProfiling()
static bool GetNativeUnsignedIntegerArgument(NativeArguments *arguments, int arg_index, uint64_t *value)
DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate)
DART_EXPORT Dart_Handle Dart_TypeNever()
DART_EXPORT Dart_Handle Dart_DebugName()
DART_EXPORT Dart_Handle Dart_False()
DART_EXPORT bool Dart_ErrorHasException(Dart_Handle handle)
DART_EXPORT Dart_IsolateGroupId Dart_CurrentIsolateGroupId()
DART_EXPORT char * Dart_SetServiceStreamCallbacks(Dart_ServiceStreamListenCallback listen_callback, Dart_ServiceStreamCancelCallback cancel_callback)
DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj, int index, intptr_t *value)
DART_EXPORT Dart_Handle Dart_NewStringFromUTF32(const int32_t *utf32_array, intptr_t length)
DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_NewDouble(double value)
DART_EXPORT const char * Dart_IsolateServiceId(Dart_Isolate isolate)
DART_EXPORT Dart_Handle Dart_CreateAppAOTSnapshotAsAssemblies(Dart_CreateLoadingUnitCallback next_callback, void *next_callback_data, bool strip, Dart_StreamingWriteCallback write_callback, Dart_StreamingCloseCallback close_callback)
DART_EXPORT void Dart_ThreadEnableProfiling()
DART_EXPORT Dart_Handle Dart_ClassName(Dart_Handle cls_type)
DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void **peer)
static Dart_Handle NewExternalByteData(Thread *thread, void *data, intptr_t length, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback, bool unmodifiable)
DART_EXPORT void * Dart_GetNativeIsolateGroupData(Dart_NativeArguments args)
DART_EXPORT bool Dart_IsKernel(const uint8_t *buffer, intptr_t buffer_size)
DART_EXPORT bool Dart_HasStickyError()
DART_EXPORT Dart_Handle Dart_StringToLatin1(Dart_Handle str, uint8_t *latin1_array, intptr_t *length)
DART_EXPORT void Dart_NotifyLowMemory()
DART_EXPORT void Dart_SetThreadName(const char *name)
DART_EXPORT Dart_Handle Dart_True()
DART_EXPORT Dart_Handle Dart_RootLibrary()
DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, Dart_Handle class_name)
DART_EXPORT bool Dart_IsNumber(Dart_Handle object)
static intptr_t kInitialSize
static Dart_Handle NewTypedData(Thread *thread, intptr_t cid, intptr_t length)
DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args, bool retval)
DART_EXPORT void Dart_SetEmbedderInformationCallback(Dart_EmbedderInformationCallback callback)
const char * CanonicalFunction(const char *func)
bool IsNumberClassId(intptr_t index)
DART_EXPORT Dart_Handle Dart_NewStringFromUTF16(const uint16_t *utf16_array, intptr_t length)
bool IsTypeClassId(intptr_t index)
DART_EXPORT Dart_Handle Dart_IntegerFitsIntoUint64(Dart_Handle integer, bool *fits)
DART_EXPORT Dart_Handle Dart_SendPortGetIdEx(Dart_Handle port, Dart_PortEx *portex_id)
DART_EXPORT Dart_Handle Dart_GetNativeInstanceFieldCount(Dart_Handle obj, int *count)
DART_EXPORT Dart_MessageNotifyCallback Dart_GetMessageNotifyCallback()
void * malloc(size_t size)
static bool IsFfiCompound(Thread *T, const Object &obj)
static bool IsCompiletimeErrorObject(Zone *zone, const Object &obj)
DART_EXPORT Dart_Handle Dart_GetDefaultUserTag()
DART_EXPORT Dart_Handle Dart_TypeDynamic()
DART_EXPORT void Dart_SetShouldPauseOnExit(bool should_pause)
const char *const class_name
DART_EXPORT Dart_Handle Dart_Precompile()
DART_EXPORT void Dart_IsolateFlagsInitialize(Dart_IsolateFlags *flags)
DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception)
constexpr intptr_t kIntptrMin
DART_EXPORT Dart_Handle Dart_StringStorageSize(Dart_Handle str, intptr_t *size)
DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value)
DART_EXPORT bool Dart_IsUnhandledExceptionError(Dart_Handle object)
static Dart_Handle NewExternalTypedDataWithFinalizer(Dart_TypedData_Type type, void *data, intptr_t length, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback, bool unmodifiable)
DART_EXPORT Dart_Handle Dart_BooleanValue(Dart_Handle boolean_obj, bool *value)
DART_EXPORT Dart_Handle Dart_NewExternalTypedDataWithFinalizer(Dart_TypedData_Type type, void *data, intptr_t length, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
static Dart_Handle HandleFromFinalizable(Dart_FinalizableHandle object)
DART_EXPORT Dart_Handle Dart_NewStringFromUTF8(const uint8_t *utf8_array, intptr_t length)
DART_EXPORT void Dart_PropagateError(Dart_Handle handle)
static Dart_Handle InitNewReadOnlyApiHandle(ObjectPtr raw)
bool IsUnmodifiableTypedDataViewClassId(intptr_t index)
DART_EXPORT Dart_Handle Dart_GetNativeSymbol(Dart_Handle library, Dart_NativeEntrySymbol *resolver)
static InstancePtr GetListInstance(Zone *zone, const Object &obj)
@ kUnmodifiableByteDataViewCid
DART_EXPORT Dart_Handle Dart_SetDeferredLoadHandler(Dart_DeferredLoadHandler handler)
DART_EXPORT void Dart_SetWeakHandleReturnValue(Dart_NativeArguments args, Dart_WeakPersistentHandle rval)
static void DropRegExpMatchCode(Zone *zone)
DART_EXPORT void Dart_StopProfiling()
DART_EXPORT void * Dart_IsolateGroupData(Dart_Isolate isolate)
DART_EXPORT Dart_Handle Dart_GetNonNullableType(Dart_Handle library, Dart_Handle class_name, intptr_t number_of_type_arguments, Dart_Handle *type_arguments)
DART_EXPORT Dart_FinalizableHandle Dart_NewFinalizableHandle(Dart_Handle object, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
DART_EXPORT const char * Dart_GetError(Dart_Handle handle)
DART_EXPORT bool Dart_IsPausedOnStart()
DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type, intptr_t length)
DART_EXPORT bool Dart_WriteProfileToTimeline(Dart_Port main_port, char **error)
DART_EXPORT Dart_Handle Dart_HandleFromWeakPersistent(Dart_WeakPersistentHandle object)
DART_EXPORT Dart_IsolateGroup Dart_CurrentIsolateGroup()
DART_EXPORT uint8_t * Dart_ScopeAllocate(intptr_t size)
DART_EXPORT void Dart_SetReturnValue(Dart_NativeArguments args, Dart_Handle retval)
DART_EXPORT Dart_Handle Dart_GetStaticMethodClosure(Dart_Handle library, Dart_Handle cls_type, Dart_Handle function_name)
DART_EXPORT void Dart_RecordTimelineEvent(const char *label, int64_t timestamp0, int64_t timestamp1_or_id, intptr_t flow_id_count, const int64_t *flow_ids, Dart_Timeline_Event_Type type, intptr_t argument_count, const char **argument_names, const char **argument_values)
DART_EXPORT char * Dart_SetFileModifiedCallback(Dart_FileModifiedCallback file_modified_callback)
DART_EXPORT Dart_Handle Dart_CreateAppJITSnapshotAsBlobs(uint8_t **isolate_snapshot_data_buffer, intptr_t *isolate_snapshot_data_size, uint8_t **isolate_snapshot_instructions_buffer, intptr_t *isolate_snapshot_instructions_size)
DART_EXPORT void Dart_NotifyDestroyed()
DART_EXPORT Dart_Handle Dart_CreateAppAOTSnapshotAsElf(Dart_StreamingWriteCallback callback, void *callback_data, bool strip, void *debug_callback_data)
DART_EXPORT char * Dart_Initialize(Dart_InitializeParams *params)
DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name)
DART_EXPORT Dart_Handle Dart_GetNativeResolver(Dart_Handle library, Dart_NativeEntryResolver *resolver)
DART_EXPORT Dart_Handle Dart_IsNullableType(Dart_Handle type, bool *result)
DART_EXPORT Dart_Handle Dart_GetCurrentUserTag()
DART_EXPORT Dart_Handle Dart_MapGetAt(Dart_Handle map, Dart_Handle key)
DART_EXPORT void Dart_InitializeNativeAssetsResolver(NativeAssetsApi *native_assets_api)
DART_EXPORT Dart_Handle Dart_DeferredLoadCompleteError(intptr_t loading_unit_id, const char *error_message, bool transient)
DART_EXPORT Dart_Handle Dart_FunctionIsStatic(Dart_Handle function, bool *is_static)
DART_EXPORT Dart_Handle Dart_NewIntegerFromHexCString(const char *str)
static Dart_Handle NewExternalTypedData(Thread *thread, intptr_t cid, void *data, intptr_t length, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback, bool unmodifiable)
DART_EXPORT void Dart_SetHeapSamplingPeriod(intptr_t bytes)
DART_EXPORT int64_t Dart_TimelineGetTicks()
DART_EXPORT bool Dart_IsFuture(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_ToString(Dart_Handle object)
static Dart_WeakPersistentHandle AllocateWeakPersistentHandle(Thread *thread, const Object &ref, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
DART_EXPORT Dart_Handle Dart_ClosureFunction(Dart_Handle closure)
DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object, Dart_TypedData_Type *type, void **data, intptr_t *len)
DART_EXPORT Dart_Handle Dart_GetNullableType(Dart_Handle library, Dart_Handle class_name, intptr_t number_of_type_arguments, Dart_Handle *type_arguments)
DART_EXPORT Dart_Isolate Dart_CurrentIsolate()
DART_EXPORT Dart_Handle Dart_NewListOfTypeFilled(Dart_Handle element_type, Dart_Handle fill_object, intptr_t length)
DART_EXPORT void Dart_RegisterRootServiceRequestCallback(const char *name, Dart_ServiceRequestCallback callback, void *user_data)
DART_EXPORT void Dart_DumpNativeStackTrace(void *context)
DART_EXPORT const char * Dart_VersionString()
DART_EXPORT Dart_Handle Dart_InvokeConstructor(Dart_Handle object, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list, intptr_t index, Dart_Handle value)
DART_EXPORT char * Dart_WriteHeapSnapshot(Dart_HeapSnapshotWriteChunkCallback write, void *context)
DART_EXPORT Dart_Handle Dart_IntegerToHexCString(Dart_Handle integer, const char **value)
DART_EXPORT bool Dart_SetEnabledTimelineCategory(const char *categories)
DART_EXPORT Dart_Handle Dart_FunctionName(Dart_Handle function)
DART_EXPORT Dart_Handle Dart_StringToUTF16(Dart_Handle str, uint16_t *utf16_array, intptr_t *length)
DART_EXPORT bool Dart_IsKernelIsolate(Dart_Isolate isolate)
DART_EXPORT Dart_Handle Dart_NewBoolean(bool value)
DART_EXPORT char * Dart_Cleanup()
static Dart_Handle NewByteData(Thread *thread, intptr_t length)
static Dart_Handle DeferredLoadComplete(intptr_t loading_unit_id, bool error, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions, const char *error_message, bool transient_error)
static Dart_Handle GetTypeCommon(Dart_Handle library, Dart_Handle class_name, intptr_t number_of_type_arguments, Dart_Handle *type_arguments, Nullability nullability)
DART_EXPORT void Dart_DeletePersistentHandle(Dart_PersistentHandle object)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT char * Dart_ServiceSendDataEvent(const char *stream_id, const char *event_kind, const uint8_t *bytes, intptr_t bytes_length)
DART_EXPORT Dart_Handle Dart_CreateAppAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback, void *callback_data, bool strip, void *debug_callback_data)
DART_EXPORT Dart_Handle Dart_LibraryResolvedUrl(Dart_Handle library)
DART_EXPORT Dart_Handle Dart_SetNativeInstanceField(Dart_Handle obj, int index, intptr_t value)
DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, int64_t retval)
DART_EXPORT void Dart_DeleteWeakPersistentHandle(Dart_WeakPersistentHandle object)
DART_EXPORT Dart_KernelCompilationResult Dart_CompileToKernel(const char *script_uri, const uint8_t *platform_kernel, intptr_t platform_kernel_size, bool incremental_compile, bool for_snapshot, bool embed_sources, const char *package_config, Dart_KernelCompilationVerbosityLevel verbosity)
const int kTypedDataCidRemainderExternal
DART_EXPORT Dart_Handle Dart_EmptyString()
DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id)
DART_EXPORT Dart_Handle Dart_ObjectIsType(Dart_Handle object, Dart_Handle type, bool *value)
DART_EXPORT Dart_Handle Dart_CopyUTF8EncodingOfString(Dart_Handle str, uint8_t *utf8_array, intptr_t length)
DART_EXPORT Dart_Handle Dart_ErrorGetStackTrace(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_TypeToNullableType(Dart_Handle type)
DART_EXPORT Dart_Handle Dart_GetNativeFieldsOfArgument(Dart_NativeArguments args, int arg_index, int num_fields, intptr_t *field_values)
DART_EXPORT Dart_PerformanceMode Dart_SetPerformanceMode(Dart_PerformanceMode mode)
static ObjectPtr CallStatic3Args(Zone *zone, const String &name, const Instance &arg0, const Instance &arg1, const Instance &arg2)
DART_EXPORT Dart_Handle Dart_ListSetAsBytes(Dart_Handle list, intptr_t offset, const uint8_t *native_array, intptr_t length)
DART_EXPORT Dart_Handle Dart_NewSendPortEx(Dart_PortEx portex_id)
DART_EXPORT Dart_Isolate Dart_CreateIsolateInGroup(Dart_Isolate group_member, const char *name, Dart_IsolateShutdownCallback shutdown_callback, Dart_IsolateCleanupCallback cleanup_callback, void *child_isolate_data, char **error)
DART_EXPORT bool Dart_RunLoopAsync(bool errors_are_fatal, Dart_Port on_error_port, Dart_Port on_exit_port, char **error)
DART_EXPORT Dart_Handle Dart_NewExternalTypedData(Dart_TypedData_Type type, void *data, intptr_t length)
DART_EXPORT Dart_Handle Dart_TypeToNonNullableType(Dart_Handle type)
DART_EXPORT Dart_Handle Dart_AllocateWithNativeFields(Dart_Handle type, intptr_t num_native_fields, const intptr_t *native_fields)
static bool CanTypeContainNull(const Type &type)
DART_EXPORT Dart_Handle Dart_IntegerToUint64(Dart_Handle integer, uint64_t *value)
DART_EXPORT Dart_TypedData_Type Dart_GetTypeOfTypedData(Dart_Handle object)
DART_EXPORT bool Dart_IsPausedOnExit()
DART_EXPORT bool Dart_InvokeVMServiceMethod(uint8_t *request_json, intptr_t request_json_length, uint8_t **response_json, intptr_t *response_json_length, char **error)
DART_EXPORT Dart_Handle Dart_FunctionOwner(Dart_Handle function)
DART_EXPORT Dart_Handle Dart_StringGetProperties(Dart_Handle object, intptr_t *char_size, intptr_t *str_len, void **peer)
DART_EXPORT Dart_Handle Dart_NewIntegerFromUint64(uint64_t value)
DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate)
DART_EXPORT bool Dart_IsMap(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_SetNativeResolver(Dart_Handle library, Dart_NativeEntryResolver resolver, Dart_NativeEntrySymbol symbol)
static Dart_Handle IsOfTypeNullabilityHelper(Dart_Handle type, Nullability nullability, bool *result)
DART_EXPORT Dart_Handle Dart_DoubleValue(Dart_Handle double_obj, double *value)
DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, int index)
DART_EXPORT void Dart_ExitIsolate()
DART_EXPORT void Dart_SetPausedOnStart(bool paused)
DART_EXPORT bool Dart_IsFunction(Dart_Handle handle)
DART_EXPORT void * Dart_IsolateData(Dart_Isolate isolate)
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
DART_EXPORT void Dart_SetTimelineRecorderCallback(Dart_TimelineRecorderCallback callback)
DART_EXPORT char * Dart_IsolateMakeRunnable(Dart_Isolate isolate)
static const char * GetErrorString(Thread *thread, const Object &obj)
DART_EXPORT Dart_Handle Dart_InstanceGetType(Dart_Handle instance)
DART_EXPORT Dart_Isolate Dart_CreateIsolateGroup(const char *script_uri, const char *name, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions, Dart_IsolateFlags *flags, void *isolate_group_data, void *isolate_data, char **error)
DART_EXPORT Dart_Handle Dart_LibraryHandleError(Dart_Handle library_in, Dart_Handle error_in)
DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data)
DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container, Dart_Handle name, Dart_Handle value)
DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t *len)
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)
DART_EXPORT bool Dart_IsTearOff(Dart_Handle object)
static Dart_Handle TypeToHelper(Dart_Handle type, Nullability nullability)
DART_EXPORT Dart_Handle Dart_ListGetAsBytes(Dart_Handle list, intptr_t offset, uint8_t *native_array, intptr_t length)
DART_EXPORT Dart_Handle Dart_RunLoop()
DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle kernel_buffer)
DART_EXPORT void * Dart_CurrentIsolateGroupData()
DART_EXPORT Dart_Handle Dart_NewListOfType(Dart_Handle element_type, intptr_t length)
static bool InstanceIsType(const Thread *thread, const Instance &instance, const Type &type)
DART_EXPORT bool Dart_IsType(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_MapKeys(Dart_Handle map)
DART_EXPORT void Dart_ThreadDisableProfiling()
static void KillNonMainIsolatesSlow(Thread *thread, Isolate *main_isolate)
DART_EXPORT bool Dart_IsPrecompiledRuntime()
DART_EXPORT Dart_Isolate Dart_CreateIsolateGroupFromKernel(const char *script_uri, const char *name, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size, Dart_IsolateFlags *flags, void *isolate_group_data, void *isolate_data, char **error)
DART_EXPORT Dart_Handle Dart_InvokeClosure(Dart_Handle closure, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT char * Dart_SetVMFlags(int argc, const char **argv)
DART_EXPORT void Dart_NotifyIdle(int64_t deadline)
DART_EXPORT Dart_KernelCompilationResult Dart_KernelListDependencies()
DART_EXPORT Dart_Handle Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback, void *callback_data)
DART_EXPORT Dart_Handle Dart_DeferredLoadComplete(intptr_t loading_unit_id, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions)
static uint32_t Hash(uint32_t key)
DART_EXPORT void Dart_DeleteFinalizableHandle(Dart_FinalizableHandle object, Dart_Handle strong_ref_to_object)
void DumpTypeTable(Isolate *isolate)
DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler(Dart_LibraryTagHandler handler)
DART_EXPORT Dart_Handle Dart_SortClasses()
DART_EXPORT Dart_Handle Dart_TypeVoid()
DART_EXPORT Dart_Handle Dart_MapContainsKey(Dart_Handle map, Dart_Handle key)
DART_EXPORT void Dart_SetPausedOnExit(bool paused)
DART_EXPORT Dart_Handle Dart_TypedDataReleaseData(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_LoadingUnitLibraryUris(intptr_t loading_unit_id)
DART_EXPORT void Dart_ExitScope()
DART_EXPORT int64_t Dart_TimelineGetTicksFrequency()
DART_EXPORT void Dart_RegisterHeapSamplingCallback(Dart_HeapSamplingCreateCallback create_callback, Dart_HeapSamplingDeleteCallback delete_callback)
static void RunLoopDone(uword param)
DART_EXPORT Dart_TypedData_Type Dart_GetTypeOfExternalTypedData(Dart_Handle object)
DART_EXPORT const char * Dart_DebugNameToCString()
std::unique_ptr< Message > WriteMessage(bool same_group, const Object &obj, Dart_Port dest_port, Message::Priority priority)
DART_EXPORT Dart_Handle Dart_IntegerFitsIntoInt64(Dart_Handle integer, bool *fits)
DART_EXPORT Dart_Handle Dart_NewApiError(const char *error)
DART_EXPORT Dart_Handle Dart_ListGetRange(Dart_Handle list, intptr_t offset, intptr_t length, Dart_Handle *result)
DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t *len)
static InstancePtr AllocateObject(Thread *thread, const Class &cls)
DART_EXPORT void Dart_SetMessageNotifyCallback(Dart_MessageNotifyCallback message_notify_callback)
DART_EXPORT Dart_Handle Dart_NewList(intptr_t length)
static ObjectPtr CallStatic1Arg(Zone *zone, const String &name, const Instance &arg0)
const StackTrace & GetCurrentStackTrace(int skip_frames)
DART_EXPORT void Dart_KillIsolate(Dart_Isolate handle)
static bool IsSnapshotCompatible(Snapshot::Kind vm_kind, Snapshot::Kind isolate_kind)
DART_EXPORT Dart_Handle Dart_NewCompilationError(const char *error)
DART_EXPORT bool Dart_ShouldPauseOnStart()
DART_EXPORT void Dart_SetDartLibrarySourcesKernel(const uint8_t *platform_kernel, const intptr_t platform_kernel_size)
DART_EXPORT Dart_Handle Dart_GetNativeDoubleArgument(Dart_NativeArguments args, int index, double *value)
DART_EXPORT Dart_Handle Dart_ErrorGetException(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url)
DART_EXPORT bool Dart_IsList(Dart_Handle object)
DART_EXPORT bool Dart_IsApiError(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_GetLoadedLibraries()
DART_EXPORT void * Dart_CurrentIsolateData()
DART_EXPORT Dart_Handle Dart_ThrowException(Dart_Handle exception)
DART_EXPORT Dart_Handle Dart_GetNativeIntegerArgument(Dart_NativeArguments args, int index, int64_t *value)
DART_EXPORT int Dart_GetNativeArgumentCount(Dart_NativeArguments args)
DART_EXPORT Dart_Port Dart_KernelPort()
DART_EXPORT void Dart_AddSymbols(const char *dso_name, void *buffer, intptr_t buffer_size)
DART_EXPORT Dart_Handle Dart_LoadScriptFromKernel(const uint8_t *buffer, intptr_t buffer_size)
DART_EXPORT bool Dart_IsInteger(Dart_Handle object)
DART_EXPORT int64_t Dart_TimelineGetMicros()
pthread_key_t ThreadLocalKey
DART_EXPORT Dart_Handle Dart_ObjectEquals(Dart_Handle obj1, Dart_Handle obj2, bool *value)
DART_EXPORT bool Dart_IsNull(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library)
DART_EXPORT Dart_Handle Dart_SetEnvironmentCallback(Dart_EnvironmentCallback callback)
static Dart_Handle LoadLibrary(Thread *T, const ExternalTypedData &td)
bool IsIntegerClassId(intptr_t index)
DART_EXPORT bool Dart_IsVariable(Dart_Handle handle)
DART_EXPORT void Dart_SetDwarfStackTraceFootnoteCallback(Dart_DwarfStackTraceFootnoteCallback callback)
DART_EXPORT void Dart_SetDoubleReturnValue(Dart_NativeArguments args, double retval)
DART_EXPORT bool Dart_IsTypedData(Dart_Handle handle)
DART_EXPORT bool Dart_IsVMFlagSet(const char *flag_name)
DART_EXPORT Dart_Handle Dart_Null()
static Dart_TypedData_Type GetType(intptr_t class_id)
static ObjectPtr GetByteBufferConstructor(Thread *thread, const String &class_name, const String &constructor_name, intptr_t num_args)
DART_EXPORT bool Dart_IsReloading()
DART_EXPORT void Dart_SetStickyError(Dart_Handle error)
DART_EXPORT bool Dart_IsString(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_New(Dart_Handle type, Dart_Handle constructor_name, int number_of_arguments, Dart_Handle *arguments)
void DumpTypeParameterTable(Isolate *isolate)
Isolate * CreateWithinExistingIsolateGroup(IsolateGroup *group, const char *name, char **error)
const char *const function_name
static int8_t data[kExtLength]
DART_EXPORT bool Dart_ShouldPauseOnExit()
DART_EXPORT Dart_Handle Dart_SetRootLibrary(Dart_Handle library)
DART_EXPORT Dart_Handle Dart_GetNativeBooleanArgument(Dart_NativeArguments args, int index, bool *value)
DART_EXPORT Dart_Handle Dart_StringToCString(Dart_Handle object, const char **cstr)
DART_EXPORT bool Dart_KernelIsolateIsRunning()
DART_EXPORT Dart_Handle Dart_CreateSnapshot(uint8_t **vm_snapshot_data_buffer, intptr_t *vm_snapshot_data_size, uint8_t **isolate_snapshot_data_buffer, intptr_t *isolate_snapshot_data_size, bool is_core)
DART_EXPORT Dart_Handle Dart_SendPortGetId(Dart_Handle port, Dart_Port *port_id)
static Dart_Isolate CreateIsolate(IsolateGroup *group, bool is_new_group, const char *name, void *isolate_data, char **error)
DART_EXPORT Dart_Handle Dart_HandleFromPersistent(Dart_PersistentHandle object)
DART_EXPORT Dart_Handle Dart_GetType(Dart_Handle library, Dart_Handle class_name, intptr_t number_of_type_arguments, Dart_Handle *type_arguments)
DART_EXPORT void Dart_ShutdownIsolate()
DART_EXPORT bool Dart_IsClosure(Dart_Handle object)
NOT_IN_PRODUCT(LibraryPtr ReloadTestScript(const char *script))
DART_EXPORT bool Dart_HasLivePorts()
DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback(const char *name, Dart_ServiceRequestCallback callback, void *user_data)
DART_EXPORT Dart_Handle Dart_GetNativeReceiver(Dart_NativeArguments args, intptr_t *value)
DART_EXPORT bool Dart_HandleServiceMessages()
void DumpTypeArgumentsTable(Isolate *isolate)
DART_EXPORT Dart_Handle Dart_NewUnmodifiableExternalTypedDataWithFinalizer(Dart_TypedData_Type type, const void *data, intptr_t length, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
DART_EXPORT Dart_Handle Dart_GetDataFromByteBuffer(Dart_Handle object)
static Dart_Handle SetupArguments(Thread *thread, int num_args, Dart_Handle *arguments, int extra_args, Array *args)
static Dart_FinalizableHandle AllocateFinalizableHandle(Thread *thread, const Object &ref, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
static ObjectPtr CallStatic2Args(Zone *zone, const String &name, const Instance &arg0, const Instance &arg1)
DART_EXPORT bool Dart_IsTypeVariable(Dart_Handle handle)
static ObjectPtr ThrowArgumentError(const char *exception_message)
DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char *str)
DART_EXPORT Dart_PersistentHandle Dart_NewPersistentHandle(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_GetNativeArguments(Dart_NativeArguments args, int num_arguments, const Dart_NativeArgument_Descriptor *argument_descriptors, Dart_NativeArgument_Value *arg_values)
static const ThreadLocalKey kUnsetThreadLocalKey
bool IsBuiltinListClassId(intptr_t index)
DART_EXPORT bool Dart_IsByteBuffer(Dart_Handle handle)
bool IsExternalTypedDataClassId(intptr_t index)
DART_EXPORT Dart_Handle Dart_LoadLibraryFromKernel(const uint8_t *buffer, intptr_t buffer_size)
DART_EXPORT bool Dart_IdentityEquals(Dart_Handle obj1, Dart_Handle obj2)
DART_EXPORT bool Dart_IsFatalError(Dart_Handle object)
constexpr intptr_t kIntptrMax
bool IsStringClassId(intptr_t index)
DART_EXPORT Dart_Handle Dart_IntegerToInt64(Dart_Handle integer, int64_t *value)
DART_EXPORT Dart_Handle Dart_StringUTF8Length(Dart_Handle str, intptr_t *len)
DART_EXPORT void Dart_EnableHeapSampling()
DART_EXPORT Dart_Handle Dart_HandleMessage()
DART_EXPORT void Dart_SetShouldPauseOnStart(bool should_pause)
DECLARE_FLAG(bool, show_invisible_frames)
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 port
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 mode
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
std::function< void()> closure
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
static SkString fmt(SkColor4f c)
#define REUSABLE_OBJECT_HANDLESCOPE(thread)
void write(SkWStream *wStream, const T &text)
Dart_KernelCompilationStatus status
#define TIMELINE_DURATION(thread, stream, name)
struct _Dart_NativeArgument_Value::@83 as_string
struct _Dart_NativeArgument_Value::@84 as_native_fields