mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 20:15:11 +00:00
Prevent the profiler from hooking into stret methods
Summary: public In order to handle methods that returns struct in i386 and x86_64 we'd need to implement special methods (like objc_msgSend_stret), but we'll just bail out for now, since there's very few usages. Reviewed By: jspahrsummers Differential Revision: D2754732 fb-gh-sync-id: d3585d244633d918770ef79a52dee9cdf87a53da
This commit is contained in:
parent
c8108bdbe1
commit
b6fce4ad52
@ -232,7 +232,20 @@ void RCTProfileHookModules(RCTBridge *bridge)
|
|||||||
for (NSUInteger i = 0; i < methodCount; i++) {
|
for (NSUInteger i = 0; i < methodCount; i++) {
|
||||||
Method method = methods[i];
|
Method method = methods[i];
|
||||||
SEL selector = method_getName(method);
|
SEL selector = method_getName(method);
|
||||||
if ([NSStringFromSelector(selector) hasPrefix:@"rct"] || [NSObject instancesRespondToSelector:selector]) {
|
|
||||||
|
/**
|
||||||
|
* Bail out on struct returns (except arm64) - we don't use it enough
|
||||||
|
* to justify writing a stret version
|
||||||
|
*/
|
||||||
|
#ifdef __arm64__
|
||||||
|
BOOL returnsStruct = NO;
|
||||||
|
#else
|
||||||
|
const char *typeEncoding = method_getTypeEncoding(method);
|
||||||
|
// bail out on structs and unions (since they might contain structs)
|
||||||
|
BOOL returnsStruct = typeEncoding[0] == '{' || typeEncoding[0] == '(';
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ([NSStringFromSelector(selector) hasPrefix:@"rct"] || [NSObject instancesRespondToSelector:selector] || returnsStruct) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const char *types = method_getTypeEncoding(method);
|
const char *types = method_getTypeEncoding(method);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user