[inferbo] Add model for NSDictionary.dictionary

Reviewed By: roro47

Differential Revision: D23396825

fbshipit-source-id: 3d99c5e74
master
Ezgi Çiçek 4 years ago committed by Facebook GitHub Bot
parent 1d908ff327
commit 2b1e036a15

@ -1690,6 +1690,8 @@ module Call = struct
&:: "removeAllObjects:" <>$ capt_var_exn $--> NSCollection.remove_all &:: "removeAllObjects:" <>$ capt_var_exn $--> NSCollection.remove_all
; +PatternMatch.ObjectiveC.implements "NSMutableArray" ; +PatternMatch.ObjectiveC.implements "NSMutableArray"
&:: "addObjectsFromArray:" <>$ capt_var_exn $+ capt_exp $--> NSCollection.addAll &:: "addObjectsFromArray:" <>$ capt_var_exn $+ capt_exp $--> NSCollection.addAll
; +PatternMatch.ObjectiveC.implements "NSDictionary"
&:: "dictionary" <>--> NSCollection.new_collection
; +PatternMatch.ObjectiveC.implements "NSDictionary" ; +PatternMatch.ObjectiveC.implements "NSDictionary"
&:: "dictionaryWithObjects:forKeys:count:" <>$ any_arg $+ capt_exp $+ capt_exp &:: "dictionaryWithObjects:forKeys:count:" <>$ any_arg $+ capt_exp $+ capt_exp
$--> NSCollection.create_from_array $--> NSCollection.create_from_array

@ -107,3 +107,8 @@ void nsdictionary_enumerate_call_constant_FP() {
nsdictionary_all_values_linear(dict); nsdictionary_all_values_linear(dict);
} }
void nsdictionary_dictionary_constant() {
NSDictionary* dict = nsdictionary_init_dictionary_constant();
nsdictionary_all_values_linear(dict);
}

@ -26,6 +26,7 @@ codetoanalyze/objc/performance/NSArray.m, nsarray_sort_using_descriptors_nlogn,
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_keys_linear1, 3 + 3 ⋅ dict->elements.length.ub + 4 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop] codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_keys_linear1, 3 + 3 ⋅ dict->elements.length.ub + 4 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_keys_linear2, 6 + 3 ⋅ dict->elements.length.ub + 3 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop] codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_keys_linear2, 6 + 3 ⋅ dict->elements.length.ub + 3 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_values_linear, 3 + 3 ⋅ dict->elements.length.ub + 4 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop] codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_values_linear, 3 + 3 ⋅ dict->elements.length.ub + 4 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_dictionary_constant, 13, OnUIThread:false, []
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_dictionary_with_objects_linear, 14 + 15 ⋅ n_entries + 3 ⋅ n_entries + 2 ⋅ (1+max(0, n_entries)) + 4 ⋅ (1+max(0, n_entries)), OnUIThread:false, [{1+max(0, n_entries)},Loop,{1+max(0, n_entries)},Loop,{n_entries},Loop,{n_entries},Loop] codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_dictionary_with_objects_linear, 14 + 15 ⋅ n_entries + 3 ⋅ n_entries + 2 ⋅ (1+max(0, n_entries)) + 4 ⋅ (1+max(0, n_entries)), OnUIThread:false, [{1+max(0, n_entries)},Loop,{1+max(0, n_entries)},Loop,{n_entries},Loop,{n_entries},Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerate_call_constant_FP, , OnUIThread:false, [Unbounded value dict->elements.length.ub,Call to nsdictionary_all_values_linear,Loop] codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerate_call_constant_FP, , OnUIThread:false, [Unbounded value dict->elements.length.ub,Call to nsdictionary_all_values_linear,Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerate_constant, 52, OnUIThread:false, [] codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerate_constant, 52, OnUIThread:false, []

Loading…
Cancel
Save