Avoid useless EncodeArtMethod followed by DecodeArtMethod
In a handful of places we would perform an EncodeArtMethod to call a
reflection invoke function which would immediately Decode the method.
This could cause issues when using opaque-jni-ids:true since the
Encode can cause an OOM exception.
To avoid this (and because Encode and Decode are perfect inverses) we
changed the Invoke* reflection functions to also accept ArtMethod*s
directly and changed callers to use these functions when appropriate.
Test: (with child CL) ./test.py --host --jit --debuggable
Bug: 134162467
Change-Id: Id2f5b0f49a99405e238ce5b61a22ef9245e523a5
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 12fda43..f0d0538 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -772,7 +772,7 @@
JValue result = InvokeWithJValues(soa,
nullptr,
- jni::EncodeArtMethod(getSystemClassLoader),
+ getSystemClassLoader,
nullptr);
JNIEnv* env = soa.Self()->GetJniEnv();
ScopedLocalRef<jobject> system_class_loader(env, soa.AddLocalReference<jobject>(result.GetL()));