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:
Adam Comella 2016-11-30 03:57:58 -08:00 committed by Facebook Github Bot
parent 528a3c776a
commit 911c05a89b

View File

@ -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);
}