[cost] Add FN tests on enumerator

Summary:
The problem: current enumerator semantics does not work on symbolic enumerator that is given as a
parameter.

Reviewed By: ezgicicek

Differential Revision: D24017059

fbshipit-source-id: 378e75bb0
master
Sungkeun Cho 4 years ago committed by Facebook GitHub Bot
parent df5cf4ccf0
commit 4e7fc51ad2

@ -166,6 +166,17 @@ void nsarray_enumerator_linear(NSArray* array) {
}
}
void nsarray_enumerator_param_linear_FN(NSEnumerator* enumerator) {
id obj;
while (obj = [enumerator nextObject]) {
}
}
void call_nsarray_enumerator_param_linear_FN(NSArray* array) {
NSEnumerator* enumerator = [array objectEnumerator];
nsarray_enumerator_param_linear_FN(enumerator);
}
void nsarray_next_object_linear(NSArray* array) {
for (id item in array) {
}

@ -1,4 +1,5 @@
${XCODE_ISYSROOT}/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h, NSArray.indexOfObject:inSortedRange:options:usingComparator:[objc_blocknsarray_binary_search_log_FN_1], 0, OnUIThread:false, []
codetoanalyze/objc/performance/NSArray.m, call_nsarray_enumerator_param_linear_FN, 12, OnUIThread:false, []
codetoanalyze/objc/performance/NSArray.m, nsarray_access_constant, 50, OnUIThread:false, []
codetoanalyze/objc/performance/NSArray.m, nsarray_access_linear, 3 + 7 ⋅ array->elements.length.ub + 3 ⋅ (array->elements.length.ub + 1), OnUIThread:false, [{array->elements.length.ub + 1},Loop,{array->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSArray.m, nsarray_add_object_constant, 8, OnUIThread:false, []
@ -9,6 +10,7 @@ codetoanalyze/objc/performance/NSArray.m, nsarray_contains_object_linear, 3 + ar
codetoanalyze/objc/performance/NSArray.m, nsarray_count_bounded_linear, 3 + 3 ⋅ array->elements.length.ub + 3 ⋅ (array->elements.length.ub + 1), OnUIThread:false, [{array->elements.length.ub + 1},Loop,{array->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSArray.m, nsarray_empty_array_constant, 8, OnUIThread:false, []
codetoanalyze/objc/performance/NSArray.m, nsarray_enumerator_linear, 6 + 4 ⋅ array->elements.length.ub + 4 ⋅ (array->elements.length.ub + 1), OnUIThread:false, [{array->elements.length.ub + 1},Loop,{array->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSArray.m, nsarray_enumerator_param_linear_FN, 7, OnUIThread:false, []
codetoanalyze/objc/performance/NSArray.m, nsarray_find_linear, 4 + 9 ⋅ array->elements.length.ub + 3 ⋅ (array->elements.length.ub + 1), OnUIThread:false, [{array->elements.length.ub + 1},Loop,{array->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSArray.m, nsarray_first_object_constant, 4, OnUIThread:false, []
codetoanalyze/objc/performance/NSArray.m, nsarray_get_first_constant, 27, OnUIThread:false, []

Loading…
Cancel
Save