mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 16:40:38 +00:00
Android: Decrease cost of reflection
Summary: This change suppresses access checking during reflection which makes reflection faster by decreasing its overhead. **Test plan (required)** My team uses this change in our app. Adam Comella Microsoft Corp. Closes https://github.com/facebook/react-native/pull/11204 Differential Revision: D4250790 Pulled By: astreet fbshipit-source-id: 0ee2f40dcadccc695980fcae14fafe1050acb52f
This commit is contained in:
parent
528a3c776a
commit
911c05a89b
@ -169,6 +169,7 @@ public abstract class BaseJavaModule implements NativeModule {
|
||||
|
||||
public JavaMethod(Method method) {
|
||||
mMethod = method;
|
||||
mMethod.setAccessible(true);
|
||||
Class[] parameterTypes = method.getParameterTypes();
|
||||
mArgumentExtractors = buildArgumentExtractors(parameterTypes);
|
||||
mSignature = buildSignature(parameterTypes);
|
||||
@ -354,6 +355,7 @@ public abstract class BaseJavaModule implements NativeModule {
|
||||
|
||||
public SyncJavaHook(Method method) {
|
||||
mMethod = method;
|
||||
mMethod.setAccessible(true);
|
||||
mSignature = buildSignature(method);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user