16 static const char*
Name() {
return "FunctionMapTraits"; }
19 return a.ptr() ==
b.ptr();
28 intptr_t kernel_offset) {
36 intptr_t kernel_offset) {
38 auto zone = thread->zone();
39 auto object_store = thread->isolate_group()->object_store();
42 thread->isolate_group()->program_lock()->IsCurrentThreadReader());
46 if (map_array.IsNull()) {
51 map_array ^=
map.GetOrNull(member_function);
54 if (map_array.IsNull()) {
68 bool allow_implicit_closure_functions ) {
72 auto zone = thread->zone();
73 auto object_store = thread->isolate_group()->object_store();
76 thread->isolate_group()->program_lock()->IsCurrentThreadWriter());
80 if (closures.IsNull()) {
82 object_store->set_closure_functions(closures);
85 ASSERT(allow_implicit_closure_functions ||
86 function.IsNonImplicitClosureFunction());
89 if (allow_implicit_closure_functions) {
99 if (map_array.IsNull()) {
100 map_array = HashTables::New<FunctionHashMap>(16,
Heap::kOld);
103 map_array ^=
map.GetOrNull(member_function);
104 if (map_array.IsNull()) {
105 map_array = HashTables::New<IntHashMap>(4,
Heap::kOld);
110 map.UpdateOrInsert(member_function, map2.
Release());
111 object_store->set_closure_functions_table(
map.Release());
116 auto zone = thread->zone();
117 auto object_store = thread->isolate_group()->object_store();
121 const auto& closures_array =
123 if (!closures_array.IsNull()) {
124 intptr_t num_closures = closures_array.Length();
125 for (intptr_t
i = 0;
i < num_closures;
i++) {
126 if (closures_array.At(
i) == needle.
ptr()) {
136 auto zone = thread->zone();
137 auto object_store = thread->isolate_group()->object_store();
141 const auto& closures_array =
143 if (idx < 0 || closures_array.IsNull() || idx >= closures_array.Length()) {
152 auto zone = thread->zone();
153 auto object_store = thread->isolate_group()->object_store();
168 const auto& closures =
170 if (closures.IsNull()) {
174 if (!thread->IsInStoppedMutatorsScope()) {
185 intptr_t current_length = closures.Length();
186 if (
i == current_length)
break;
188 current_data = closures.data();
189 if (current_data.Length() < current_length) {
190 current_length = current_data.Length();
193 for (;
i < current_length; ++
i) {
194 entry ^= current_data.At(
i);
#define DEBUG_ASSERT(cond)
static intptr_t FindClosureIndex(const Function &needle)
static void AddClosureFunctionLocked(const Function &function, bool allow_implicit_closure_functions=false)
static FunctionPtr ClosureFunctionFromIndex(intptr_t idx)
static FunctionPtr LookupClosureFunctionLocked(const Function &member_function, intptr_t kernel_offset)
static void ForAllClosureFunctions(std::function< bool(const Function &)> callback)
static FunctionPtr LookupClosureFunction(const Function &member_function, intptr_t kernel_offset)
static bool IsBackgroundCompilation()
static bool ReportStats()
static bool IsMatch(const Object &a, const Object &b)
static const char * Name()
static uword Hash(const Object &key)
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
ObjectPtr GetOrNull(const Key &key, bool *present=nullptr) const
bool UpdateOrInsert(const Object &key, const Object &value) const
StorageTraits::ArrayHandle & Release()
static ObjectPtr RawCast(ObjectPtr obj)
static SmiPtr New(intptr_t value)
static Thread * Current()
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Dart_NativeFunction function
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>