ART: aarch64 jni compiler needs to extend small return types

As aarch64 calling convention does not mandate extension on return
values anymore and leaves the upper bits undefined, the jni compiler
needs to sign- or zero-extend the returned values when necessary.

As three architectures need extension now, refactor this fact into a
flag into a virtual method.

Add tests to JniTest that exercise the required extension.

Change-Id: Idebb7c4dedebb852e58ade63e1c2b1eeced23104
diff --git a/compiler/jni/quick/calling_convention.h b/compiler/jni/quick/calling_convention.h
index 4d25d1c..18afd58 100644
--- a/compiler/jni/quick/calling_convention.h
+++ b/compiler/jni/quick/calling_convention.h
@@ -287,6 +287,8 @@
   FrameOffset ReturnValueSaveLocation() const;
   // Register that holds result if it is integer.
   virtual ManagedRegister IntReturnRegister() = 0;
+  // Whether the compiler needs to ensure zero-/sign-extension of a small result type
+  virtual bool RequiresSmallResultTypeExtension() const = 0;
 
   // Callee save registers to spill prior to native code (which may clobber)
   virtual const std::vector<ManagedRegister>& CalleeSaveRegisters() const = 0;