24 return Symbols::FfiAsyncCallback();
26 return Symbols::FfiIsolateLocalCallback();
60 false, owner_class, TokenPosition::kNoSource);
65 function.SetFfiCSignature(c_signature);
66 function.SetFfiCallbackTarget(dart_target);
76 ASSERT(exceptional_return.
IsNull() || exceptional_return.IsNumber() ||
77 exceptional_return.IsBool());
78 if (!exceptional_return.IsSmi() && exceptional_return.
IsNew()) {
82 function.SetFfiCallbackExceptionalReturn(exceptional_return);
90 signature.set_result_type(Object::dynamic_type());
101 auto object_store = isolate_group->object_store();
102 if (object_store->ffi_callback_functions() ==
Array::null()) {
104 HashTables::New<FfiCallbackFunctionSet>(4));
105 object_store->set_ffi_callback_functions(
set.
Release());
109 const intptr_t entry_count_before =
set.NumOccupied();
111 const intptr_t entry_count_after =
set.NumOccupied();
113 object_store->set_ffi_callback_functions(
set.
Release());
115 if (entry_count_before != entry_count_after) {
116 function.AssignFfiCallbackId(entry_count_before);
126 static constexpr intptr_t kInitialCallbackIdsReserved = 16;
129 auto zone = thread->
zone();
133 if (code_array.IsNull()) {
136 object_store->set_ffi_callback_code(code_array);
138 if (code_array.Length() <= callback_id) {
140 while (!(callback_id < code_array.Length())) {
141 code_array.Add(Code::null_object());
145 ASSERT(callback_id < code_array.Length());
151 auto zone = thread->
zone();
157 const auto& code_array =
159 code_array.SetAt(callback_id,
code);
static AbstractTypePtr FinalizeType(const AbstractType &type, FinalizationKind finalization=kCanonicalize)
static FunctionTypePtr New(intptr_t num_parent_type_arguments=0, Nullability nullability=Nullability::kNonNullable, Heap::Space space=Heap::kOld)
int32_t FfiCallbackId() const
static FunctionPtr New(const FunctionType &signature, const String &name, UntaggedFunction::Kind kind, bool is_static, bool is_const, bool is_abstract, bool is_external, bool is_native, const Object &owner, TokenPosition token_pos, Heap::Space space=Heap::kOld)
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
InstancePtr CopyShallowToOldSpace(Thread *thread) const
ObjectStore * object_store() const
ClassPtr toplevel_class() const
static LibraryPtr FfiLibrary()
static StringPtr FromConcat(Thread *thread, const String &str1, const String &str2)
static Thread * Current()
IsolateGroup * isolate_group() const
Dart_NativeFunction function
const String & NativeCallbackFunctionName(Thread *thread, Zone *zone, const Function &dart_target, FfiCallbackKind kind)
void SetFfiCallbackCode(Thread *thread, const Function &ffi_trampoline, const Code &code)
static void EnsureFfiCallbackMetadata(Thread *thread, intptr_t callback_id)
FunctionPtr NativeCallbackFunction(const FunctionType &c_signature, const Function &dart_target, const Instance &exceptional_return, FfiCallbackKind kind)
@ kIsolateLocalClosureCallback
@ kIsolateLocalStaticCallback
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set