Fix the jni compiler's handling of byte and short return values in x86.
gcc uses byte/short operations to populate return values of these types,
so the sign extension is lost. The jni compiler needs to manually sign
extend the values again since they're treated like words in the system.
With this change, all the run_test tests are working.
Change-Id: If691087ebd79b0d608e44ff8273ed25d46dd6b4a
diff --git a/src/oat/jni/calling_convention.h b/src/oat/jni/calling_convention.h
index 7e42904..6feff0f 100644
--- a/src/oat/jni/calling_convention.h
+++ b/src/oat/jni/calling_convention.h
@@ -29,6 +29,10 @@
public:
bool IsReturnAReference() const { return shorty_[0] == 'L'; }
+ Primitive::Type GetReturnType() const {
+ return Primitive::GetType(shorty_[0]);
+ }
+
size_t SizeOfReturnValue() const {
size_t result = Primitive::ComponentSize(Primitive::GetType(shorty_[0]));
if (result >= 1 && result < 4) {