Skip to content

Commit

Permalink
Android: Decrease cost of reflection
Browse files Browse the repository at this point in the history
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 911c05a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -354,6 +355,7 @@ public class SyncJavaHook implements SyncNativeHook {

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

Expand Down

0 comments on commit 911c05a

Please sign in to comment.