Prevent segvs in JNI.

A segv in JNI code (without CheckJNI) is hard to debug as we fail to see
stacks, pending exceptions.. Make JNI code robust to null arguments, but don't
go to the lengths that CheckJNI does in also sanity checking arguments, the
priority here is just to stop the VM from crashing.

Bug 10305723

Also, allow an unknown throw location not to crash exception dumping.

Found/useful for debugging bug 10331039.

(cherry picked from commit bc939663ccfbe0c648dd6a3670041510aca82420)

Change-Id: Id0203db7d9e320d45ae5ba25d2b63939c79e5c16
diff --git a/runtime/jni_internal.h b/runtime/jni_internal.h
index e3ffc84..f7caa0f 100644
--- a/runtime/jni_internal.h
+++ b/runtime/jni_internal.h
@@ -51,7 +51,7 @@
 void JniAbortF(const char* jni_function_name, const char* fmt, ...)
     __attribute__((__format__(__printf__, 2, 3)));
 void RegisterNativeMethods(JNIEnv* env, const char* jni_class_name, const JNINativeMethod* methods,
-                           size_t method_count);
+                           jint method_count);
 
 JValue InvokeWithJValues(const ScopedObjectAccess&, jobject obj, jmethodID mid, jvalue* args)
     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);