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
4 files changed