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());
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)