summaryrefslogtreecommitdiffstats
path: root/runtime/reflection.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-03-21 11:21:29 -0700
committerIan Rogers <irogers@google.com>2014-03-21 11:25:56 -0700
commit62f0512bf6d9bc6141358bf22e93afa70dc58b1a (patch)
tree7fdc0b9be0df2da5ff2575862a24db5c10eae9dc /runtime/reflection.cc
parent215f3e60cd97471c0843eae22a041c335e89071c (diff)
downloadandroid_art-62f0512bf6d9bc6141358bf22e93afa70dc58b1a.tar.gz
android_art-62f0512bf6d9bc6141358bf22e93afa70dc58b1a.tar.bz2
android_art-62f0512bf6d9bc6141358bf22e93afa70dc58b1a.zip
Improvements to Field.get/set.
Avoid unnecessary repeated computation in Field.get/set. Refactor FromReflectedField and FromReflectedMethod into common helpers in mirror::ArtField and mirror::ArtMethod, and make use of thereby avoiding transitions through JNI. Avoid JNI use from within FromReflectedField and FromReflectedMethod. Tidy up Field.get/set wrt moving collector support. Bug: 12189533 Change-Id: I643ab3474bade4abac3a3ae2b6e373b2bb0891c8
Diffstat (limited to 'runtime/reflection.cc')
-rw-r--r--runtime/reflection.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/reflection.cc b/runtime/reflection.cc
index dde9a942ff..f5670551e8 100644
--- a/runtime/reflection.cc
+++ b/runtime/reflection.cc
@@ -462,8 +462,7 @@ void InvokeWithShadowFrame(Thread* self, ShadowFrame* shadow_frame, uint16_t arg
jobject InvokeMethod(const ScopedObjectAccess& soa, jobject javaMethod,
jobject javaReceiver, jobject javaArgs) {
- jmethodID mid = soa.Env()->FromReflectedMethod(javaMethod);
- mirror::ArtMethod* m = soa.DecodeMethod(mid);
+ mirror::ArtMethod* m = mirror::ArtMethod::FromReflectedMethod(soa, javaMethod);
mirror::Class* declaring_class = m->GetDeclaringClass();
if (UNLIKELY(!declaring_class->IsInitialized())) {