Skip to content
Permalink
Browse files
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 #11204

Differential Revision: D4250790

Pulled By: astreet

fbshipit-source-id: 0ee2f40dcadccc695980fcae14fafe1050acb52f
  • Loading branch information
Adam Comella authored and Facebook Github Bot committed Nov 30, 2016
1 parent 528a3c7 commit 911c05a89bbe86e9c805d7eee58cdfd66b80a64c
Showing 1 changed file with 2 additions and 0 deletions.
@@ -169,6 +169,7 @@ public class JavaMethod implements NativeMethod {

public JavaMethod(Method method) {
mMethod = method;
mMethod.setAccessible(true);
Class[] parameterTypes = method.getParameterTypes();
mArgumentExtractors = buildArgumentExtractors(parameterTypes);
mSignature = buildSignature(parameterTypes);
@@ -354,6 +355,7 @@ public class SyncJavaHook implements SyncNativeHook {

public SyncJavaHook(Method method) {
mMethod = method;
mMethod.setAccessible(true);
mSignature = buildSignature(method);
}

0 comments on commit 911c05a

Please sign in to comment.