diff options
-rw-r--r-- | src/jni_internal.cc | 1919 | ||||
-rw-r--r-- | src/jni_internal.h | 854 |
2 files changed, 2754 insertions, 19 deletions
diff --git a/src/jni_internal.cc b/src/jni_internal.cc index 6aa5c77..a495d65 100644 --- a/src/jni_internal.cc +++ b/src/jni_internal.cc @@ -5,6 +5,7 @@ #include <vector> #include <utility> +#include "jni.h" #include "logging.h" #include "runtime.h" #include "scoped_ptr.h" @@ -26,6 +27,1897 @@ JniEnvironment::JniEnvironment() { monitor_exit_ = &JniMonitorExit; } +// JNI Native interface. + +jint JniNativeInterface::GetVersion(JNIEnv* env) { + return JNI_VERSION_1_6; +} + +jclass JniNativeInterface::DefineClass(JNIEnv *env, + const char *name, + jobject loader, + const jbyte *buf, + jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jclass JniNativeInterface::FindClass(JNIEnv *env, const char *name) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jmethodID JniNativeInterface::FromReflectedMethod(JNIEnv* env, jobject method) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jfieldID JniNativeInterface::FromReflectedField(JNIEnv* env, jobject field) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::ToReflectedMethod(JNIEnv* env, + jclass cls, + jmethodID methodID, + jboolean isStatic) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jclass JniNativeInterface::GetSuperclass(JNIEnv* env, jclass sub) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jboolean JniNativeInterface::IsAssignableFrom(JNIEnv* env, + jclass sub, + jclass sup) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jobject JniNativeInterface::ToReflectedField(JNIEnv* env, + jclass cls, + jfieldID fieldID, + jboolean isStatic) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jint JniNativeInterface::Throw(JNIEnv* env, jthrowable obj) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::ThrowNew(JNIEnv* env, jclass clazz, const char* msg) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jthrowable JniNativeInterface::ExceptionOccurred(JNIEnv* env) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::ExceptionDescribe(JNIEnv* env) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::ExceptionClear(JNIEnv* env) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::FatalError(JNIEnv* env, const char* msg) { + LOG(FATAL) << "Unimplemented"; +} + +jint JniNativeInterface::PushLocalFrame(JNIEnv* env, jint cap) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jobject JniNativeInterface::PopLocalFrame(JNIEnv* env, jobject res) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::NewGlobalRef(JNIEnv* env, jobject lobj) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::DeleteGlobalRef(JNIEnv* env, jobject gref) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::DeleteLocalRef(JNIEnv* env, jobject obj) { + LOG(FATAL) << "Unimplemented"; +} + +jboolean JniNativeInterface::IsSameObject(JNIEnv* env, + jobject obj1, + jobject obj2) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jobject JniNativeInterface::NewLocalRef(JNIEnv* env, jobject ref) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jint JniNativeInterface::EnsureLocalCapacity(JNIEnv* env, jint) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jobject JniNativeInterface::AllocObject(JNIEnv* env, jclass clazz) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::NewObject(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::NewObjectV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::NewObjectA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jclass JniNativeInterface::GetObjectClass(JNIEnv* env, jobject obj) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jboolean JniNativeInterface::IsInstanceOf(JNIEnv* env, + jobject obj, + jclass clazz) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jmethodID JniNativeInterface::GetMethodID(JNIEnv* env, + jclass clazz, + const char* name, + const char* sig) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::CallObjectMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::CallObjectMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::CallObjectMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jboolean JniNativeInterface::CallBooleanMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jboolean JniNativeInterface::CallBooleanMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jboolean JniNativeInterface::CallBooleanMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jbyte JniNativeInterface::CallByteMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jbyte JniNativeInterface::CallByteMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jbyte JniNativeInterface::CallByteMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallCharMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallCharMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallCharMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallShortMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallShortMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallShortMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallIntMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallIntMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallIntMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallLongMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallLongMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallLongMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallFloatMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallFloatMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallFloatMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallDoubleMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallDoubleMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallDoubleMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +void JniNativeInterface::CallVoidMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::CallVoidMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::CallVoidMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; +} + +jobject JniNativeInterface::CallNonvirtualObjectMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::CallNonvirtualObjectMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::CallNonvirtualObjectMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jboolean JniNativeInterface::CallNonvirtualBooleanMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jboolean JniNativeInterface::CallNonvirtualBooleanMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jboolean JniNativeInterface::CallNonvirtualBooleanMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jbyte JniNativeInterface::CallNonvirtualByteMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jbyte JniNativeInterface::CallNonvirtualByteMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jbyte JniNativeInterface::CallNonvirtualByteMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallNonvirtualCharMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallNonvirtualCharMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallNonvirtualCharMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallNonvirtualShortMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallNonvirtualShortMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallNonvirtualShortMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallNonvirtualIntMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallNonvirtualIntMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallNonvirtualIntMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallNonvirtualLongMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallNonvirtualLongMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallNonvirtualLongMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallNonvirtualFloatMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallNonvirtualFloatMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallNonvirtualFloatMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallNonvirtualDoubleMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallNonvirtualDoubleMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallNonvirtualDoubleMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +void JniNativeInterface::CallNonvirtualVoidMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::CallNonvirtualVoidMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::CallNonvirtualVoidMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; +} + +jfieldID JniNativeInterface::GetFieldID(JNIEnv* env, + jclass clazz, + const char* name, + const char* sig) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::GetObjectField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jboolean JniNativeInterface::GetBooleanField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jbyte JniNativeInterface::GetByteField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::GetCharField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::GetShortField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::GetIntField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::GetLongField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::GetFloatField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::GetDoubleField(JNIEnv* env, + jobject obj, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +void JniNativeInterface::SetObjectField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jobject val) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetBooleanField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jboolean val) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetByteField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jbyte val) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetCharField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jchar val) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetShortField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jshort val) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetIntField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jint val) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetLongField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jlong val) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetFloatField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jfloat val) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetDoubleField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jdouble val) { + LOG(FATAL) << "Unimplemented"; +} + +jmethodID JniNativeInterface::GetStaticMethodID(JNIEnv* env, + jclass clazz, + const char* name, + const char* sig) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::CallStaticObjectMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::CallStaticObjectMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::CallStaticObjectMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jboolean JniNativeInterface::CallStaticBooleanMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jboolean JniNativeInterface::CallStaticBooleanMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jboolean JniNativeInterface::CallStaticBooleanMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jbyte JniNativeInterface::CallStaticByteMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jbyte JniNativeInterface::CallStaticByteMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jbyte JniNativeInterface::CallStaticByteMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallStaticCharMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallStaticCharMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::CallStaticCharMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallStaticShortMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallStaticShortMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::CallStaticShortMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallStaticIntMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallStaticIntMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::CallStaticIntMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallStaticLongMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallStaticLongMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::CallStaticLongMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallStaticFloatMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallStaticFloatMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::CallStaticFloatMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallStaticDoubleMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallStaticDoubleMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::CallStaticDoubleMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +void JniNativeInterface::CallStaticVoidMethod(JNIEnv* env, + jclass cls, + jmethodID methodID, + ...) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::CallStaticVoidMethodV(JNIEnv* env, + jclass cls, + jmethodID methodID, + va_list args) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::CallStaticVoidMethodA(JNIEnv* env, + jclass cls, + jmethodID methodID, + jvalue* args) { + LOG(FATAL) << "Unimplemented"; +} + +jfieldID JniNativeInterface::GetStaticFieldID(JNIEnv* env, + jclass clazz, + const char* name, + const char* sig) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jobject JniNativeInterface::GetStaticObjectField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jboolean JniNativeInterface::GetStaticBooleanField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jbyte JniNativeInterface::GetStaticByteField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jchar JniNativeInterface::GetStaticCharField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jshort JniNativeInterface::GetStaticShortField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::GetStaticIntField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jlong JniNativeInterface::GetStaticLongField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jfloat JniNativeInterface::GetStaticFloatField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jdouble JniNativeInterface::GetStaticDoubleField(JNIEnv* env, + jclass clazz, + jfieldID fieldID) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +void JniNativeInterface::SetStaticObjectField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jobject value) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetStaticBooleanField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jboolean value) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetStaticByteField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jbyte value) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetStaticCharField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jchar value) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetStaticShortField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jshort value) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetStaticIntField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jint value) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetStaticLongField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jlong value) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetStaticFloatField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jfloat value) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetStaticDoubleField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jdouble value) { + LOG(FATAL) << "Unimplemented"; +} + +jstring JniNativeInterface::NewString(JNIEnv* env, + const jchar* unicode, + jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jsize JniNativeInterface::GetStringLength(JNIEnv* env, jstring str) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +const jchar* JniNativeInterface::GetStringChars(JNIEnv* env, + jstring str, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::ReleaseStringChars(JNIEnv* env, + jstring str, + const jchar* chars) { + LOG(FATAL) << "Unimplemented"; +} + +jstring JniNativeInterface::NewStringUTF(JNIEnv* env, const char* utf) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jsize JniNativeInterface::GetStringUTFLength(JNIEnv* env, jstring str) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +const char* JniNativeInterface::GetStringUTFChars(JNIEnv* env, + jstring str, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::ReleaseStringUTFChars(JNIEnv* env, + jstring str, + const char* chars) { + LOG(FATAL) << "Unimplemented"; +} + +jsize JniNativeInterface::GetArrayLength(JNIEnv* env, jarray array) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jobjectArray JniNativeInterface::NewObjectArray(JNIEnv* env, + jsize len, + jclass clazz, + jobject init) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jobject JniNativeInterface::GetObjectArrayElement(JNIEnv* env, + jobjectArray array, + jsize index) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::SetObjectArrayElement(JNIEnv* env, + jobjectArray array, + jsize index, + jobject val) { + LOG(FATAL) << "Unimplemented"; +} + +jbooleanArray JniNativeInterface::NewBooleanArray(JNIEnv* env, jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jbyteArray JniNativeInterface::NewByteArray(JNIEnv* env, jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jcharArray JniNativeInterface::NewCharArray(JNIEnv* env, jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jshortArray JniNativeInterface::NewShortArray(JNIEnv* env, jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jintArray JniNativeInterface::NewIntArray(JNIEnv* env, jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jlongArray JniNativeInterface::NewLongArray(JNIEnv* env, jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jfloatArray JniNativeInterface::NewFloatArray(JNIEnv* env, jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jdoubleArray JniNativeInterface::NewDoubleArray(JNIEnv* env, jsize len) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jboolean* JniNativeInterface::GetBooleanArrayElements(JNIEnv* env, + jbooleanArray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jbyte* JniNativeInterface::GetByteArrayElements(JNIEnv* env, + jbyteArray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jchar* JniNativeInterface::GetCharArrayElements(JNIEnv* env, + jcharArray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jshort* JniNativeInterface::GetShortArrayElements(JNIEnv* env, + jshortArray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jint* JniNativeInterface::GetIntArrayElements(JNIEnv* env, + jintArray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jlong* JniNativeInterface::GetLongArrayElements(JNIEnv* env, + jlongArray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jfloat* JniNativeInterface::GetFloatArrayElements(JNIEnv* env, + jfloatArray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jdouble* JniNativeInterface::GetDoubleArrayElements(JNIEnv* env, + jdoubleArray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::ReleaseBooleanArrayElements(JNIEnv* env, + jbooleanArray array, + jboolean* elems, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::ReleaseByteArrayElements(JNIEnv* env, + jbyteArray array, + jbyte* elems, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::ReleaseCharArrayElements(JNIEnv* env, + jcharArray array, + jchar* elems, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::ReleaseShortArrayElements(JNIEnv* env, + jshortArray array, + jshort* elems, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::ReleaseIntArrayElements(JNIEnv* env, + jintArray array, + jint* elems, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::ReleaseLongArrayElements(JNIEnv* env, + jlongArray array, + jlong* elems, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::ReleaseFloatArrayElements(JNIEnv* env, + jfloatArray array, + jfloat* elems, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::ReleaseDoubleArrayElements(JNIEnv* env, + jdoubleArray array, + jdouble* elems, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetBooleanArrayRegion(JNIEnv* env, + jbooleanArray array, + jsize start, + jsize l, + jboolean* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetByteArrayRegion(JNIEnv* env, + jbyteArray array, + jsize start, + jsize len, + jbyte* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetCharArrayRegion(JNIEnv* env, + jcharArray array, + jsize start, + jsize len, + jchar* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetShortArrayRegion(JNIEnv* env, + jshortArray array, + jsize start, + jsize len, + jshort* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetIntArrayRegion(JNIEnv* env, + jintArray array, + jsize start, + jsize len, + jint* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetLongArrayRegion(JNIEnv* env, + jlongArray array, + jsize start, + jsize len, + jlong* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetFloatArrayRegion(JNIEnv* env, + jfloatArray array, + jsize start, + jsize len, + jfloat* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetDoubleArrayRegion(JNIEnv* env, + jdoubleArray array, + jsize start, + jsize len, + jdouble* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetBooleanArrayRegion(JNIEnv* env, + jbooleanArray array, + jsize start, + jsize l, + const jboolean* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetByteArrayRegion(JNIEnv* env, + jbyteArray array, + jsize start, + jsize len, + const jbyte* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetCharArrayRegion(JNIEnv* env, + jcharArray array, + jsize start, + jsize len, + const jchar* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetShortArrayRegion(JNIEnv* env, + jshortArray array, + jsize start, + jsize len, + const jshort* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetIntArrayRegion(JNIEnv* env, + jintArray array, + jsize start, + jsize len, + const jint* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetLongArrayRegion(JNIEnv* env, + jlongArray array, + jsize start, + jsize len, + const jlong* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetFloatArrayRegion(JNIEnv* env, + jfloatArray array, + jsize start, + jsize len, + const jfloat* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::SetDoubleArrayRegion(JNIEnv* env, + jdoubleArray array, + jsize start, + jsize len, + const jdouble* buf) { + LOG(FATAL) << "Unimplemented"; +} + +jint JniNativeInterface::RegisterNatives(JNIEnv* env, + jclass clazz, + const JNINativeMethod* methods, + jint nMethods) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::UnregisterNatives(JNIEnv* env, jclass clazz) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::MonitorEnter(JNIEnv* env, jobject obj) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::MonitorExit(JNIEnv* env, jobject obj) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jint JniNativeInterface::GetJavaVM(JNIEnv* env, JavaVM* *vm) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +void JniNativeInterface::GetStringRegion(JNIEnv* env, + jstring str, + jsize start, + jsize len, + jchar* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void JniNativeInterface::GetStringUTFRegion(JNIEnv* env, + jstring str, + jsize start, + jsize len, + char* buf) { + LOG(FATAL) << "Unimplemented"; +} + +void* JniNativeInterface::GetPrimitiveArrayCritical(JNIEnv* env, + jarray array, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::ReleasePrimitiveArrayCritical(JNIEnv* env, + jarray array, + void* carray, + jint mode) { + LOG(FATAL) << "Unimplemented"; +} + +const jchar* JniNativeInterface::GetStringCritical(JNIEnv* env, + jstring s, + jboolean* isCopy) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::ReleaseStringCritical(JNIEnv* env, + jstring s, + const jchar* cstr) { + LOG(FATAL) << "Unimplemented"; +} + +jweak JniNativeInterface::NewWeakGlobalRef(JNIEnv* env, jobject obj) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +void JniNativeInterface::DeleteWeakGlobalRef(JNIEnv* env, jweak obj) { + LOG(FATAL) << "Unimplemented"; +} + +jboolean JniNativeInterface::ExceptionCheck(JNIEnv* env) { + LOG(FATAL) << "Unimplemented"; + return JNI_FALSE; +} + +jobject JniNativeInterface::NewDirectByteBuffer(JNIEnv* env, + void* address, + jlong capacity) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + + +void* JniNativeInterface::GetDirectBufferAddress(JNIEnv* env, jobject buf) { + LOG(FATAL) << "Unimplemented"; + return NULL; +} + +jlong JniNativeInterface::GetDirectBufferCapacity(JNIEnv* env, jobject buf) { + LOG(FATAL) << "Unimplemented"; + return 0; +} + +jobjectRefType JniNativeInterface::GetObjectRefType(JNIEnv* env, jobject jobj) { + LOG(FATAL) << "Unimplemented"; + return JNIInvalidRefType; +} + +struct JNINativeInterface JniNativeInterface::native_interface_ = { + NULL, // reserved0. + NULL, // reserved1. + NULL, // reserved2. + NULL, // reserved3. + GetVersion, + DefineClass, + FindClass, + FromReflectedMethod, + FromReflectedField, + ToReflectedMethod, + GetSuperclass, + IsAssignableFrom, + ToReflectedField, + Throw, + ThrowNew, + ExceptionOccurred, + ExceptionDescribe, + ExceptionClear, + FatalError, + PushLocalFrame, + PopLocalFrame, + NewGlobalRef, + DeleteGlobalRef, + DeleteLocalRef, + IsSameObject, + NewLocalRef, + EnsureLocalCapacity, + AllocObject, + NewObject, + NewObjectV, + NewObjectA, + GetObjectClass, + IsInstanceOf, + GetMethodID, + CallObjectMethod, + CallObjectMethodV, + CallObjectMethodA, + CallBooleanMethod, + CallBooleanMethodV, + CallBooleanMethodA, + CallByteMethod, + CallByteMethodV, + CallByteMethodA, + CallCharMethod, + CallCharMethodV, + CallCharMethodA, + CallShortMethod, + CallShortMethodV, + CallShortMethodA, + CallIntMethod, + CallIntMethodV, + CallIntMethodA, + CallLongMethod, + CallLongMethodV, + CallLongMethodA, + CallFloatMethod, + CallFloatMethodV, + CallFloatMethodA, + CallDoubleMethod, + CallDoubleMethodV, + CallDoubleMethodA, + CallVoidMethod, + CallVoidMethodV, + CallVoidMethodA, + CallNonvirtualObjectMethod, + CallNonvirtualObjectMethodV, + CallNonvirtualObjectMethodA, + CallNonvirtualBooleanMethod, + CallNonvirtualBooleanMethodV, + CallNonvirtualBooleanMethodA, + CallNonvirtualByteMethod, + CallNonvirtualByteMethodV, + CallNonvirtualByteMethodA, + CallNonvirtualCharMethod, + CallNonvirtualCharMethodV, + CallNonvirtualCharMethodA, + CallNonvirtualShortMethod, + CallNonvirtualShortMethodV, + CallNonvirtualShortMethodA, + CallNonvirtualIntMethod, + CallNonvirtualIntMethodV, + CallNonvirtualIntMethodA, + CallNonvirtualLongMethod, + CallNonvirtualLongMethodV, + CallNonvirtualLongMethodA, + CallNonvirtualFloatMethod, + CallNonvirtualFloatMethodV, + CallNonvirtualFloatMethodA, + CallNonvirtualDoubleMethod, + CallNonvirtualDoubleMethodV, + CallNonvirtualDoubleMethodA, + CallNonvirtualVoidMethod, + CallNonvirtualVoidMethodV, + CallNonvirtualVoidMethodA, + GetFieldID, + GetObjectField, + GetBooleanField, + GetByteField, + GetCharField, + GetShortField, + GetIntField, + GetLongField, + GetFloatField, + GetDoubleField, + SetObjectField, + SetBooleanField, + SetByteField, + SetCharField, + SetShortField, + SetIntField, + SetLongField, + SetFloatField, + SetDoubleField, + GetStaticMethodID, + CallStaticObjectMethod, + CallStaticObjectMethodV, + CallStaticObjectMethodA, + CallStaticBooleanMethod, + CallStaticBooleanMethodV, + CallStaticBooleanMethodA, + CallStaticByteMethod, + CallStaticByteMethodV, + CallStaticByteMethodA, + CallStaticCharMethod, + CallStaticCharMethodV, + CallStaticCharMethodA, + CallStaticShortMethod, + CallStaticShortMethodV, + CallStaticShortMethodA, + CallStaticIntMethod, + CallStaticIntMethodV, + CallStaticIntMethodA, + CallStaticLongMethod, + CallStaticLongMethodV, + CallStaticLongMethodA, + CallStaticFloatMethod, + CallStaticFloatMethodV, + CallStaticFloatMethodA, + CallStaticDoubleMethod, + CallStaticDoubleMethodV, + CallStaticDoubleMethodA, + CallStaticVoidMethod, + CallStaticVoidMethodV, + CallStaticVoidMethodA, + GetStaticFieldID, + GetStaticObjectField, + GetStaticBooleanField, + GetStaticByteField, + GetStaticCharField, + GetStaticShortField, + GetStaticIntField, + GetStaticLongField, + GetStaticFloatField, + GetStaticDoubleField, + SetStaticObjectField, + SetStaticBooleanField, + SetStaticByteField, + SetStaticCharField, + SetStaticShortField, + SetStaticIntField, + SetStaticLongField, + SetStaticFloatField, + SetStaticDoubleField, + NewString, + GetStringLength, + GetStringChars, + ReleaseStringChars, + NewStringUTF, + GetStringUTFLength, + GetStringUTFChars, + ReleaseStringUTFChars, + GetArrayLength, + NewObjectArray, + GetObjectArrayElement, + SetObjectArrayElement, + NewBooleanArray, + NewByteArray, + NewCharArray, + NewShortArray, + NewIntArray, + NewLongArray, + NewFloatArray, + NewDoubleArray, + GetBooleanArrayElements, + GetByteArrayElements, + GetCharArrayElements, + GetShortArrayElements, + GetIntArrayElements, + GetLongArrayElements, + GetFloatArrayElements, + GetDoubleArrayElements, + ReleaseBooleanArrayElements, + ReleaseByteArrayElements, + ReleaseCharArrayElements, + ReleaseShortArrayElements, + ReleaseIntArrayElements, + ReleaseLongArrayElements, + ReleaseFloatArrayElements, + ReleaseDoubleArrayElements, + GetBooleanArrayRegion, + GetByteArrayRegion, + GetCharArrayRegion, + GetShortArrayRegion, + GetIntArrayRegion, + GetLongArrayRegion, + GetFloatArrayRegion, + GetDoubleArrayRegion, + SetBooleanArrayRegion, + SetByteArrayRegion, + SetCharArrayRegion, + SetShortArrayRegion, + SetIntArrayRegion, + SetLongArrayRegion, + SetFloatArrayRegion, + SetDoubleArrayRegion, + RegisterNatives, + UnregisterNatives, + MonitorEnter, + MonitorExit, + GetJavaVM, + GetStringRegion, + GetStringUTFRegion, + GetPrimitiveArrayCritical, + ReleasePrimitiveArrayCritical, + GetStringCritical, + ReleaseStringCritical, + NewWeakGlobalRef, + DeleteWeakGlobalRef, + ExceptionCheck, + NewDirectByteBuffer, + GetDirectBufferAddress, + GetDirectBufferCapacity, + GetObjectRefType, +}; + +// JNI Invocation interface. + extern "C" jint JNI_CreateJavaVM(JavaVM** p_vm, void** p_env, void* vm_args) { const JavaVMInitArgs* args = static_cast<JavaVMInitArgs*>(vm_args); if (args->version < JNI_VERSION_1_2) { @@ -65,7 +1957,7 @@ extern "C" jint JNI_GetDefaultJavaVMInitArgs(void* vm_args) { return JNI_ERR; } -jint JniInvoke::DestroyJavaVM(JavaVM* vm) { +jint JniInvokeInterface::DestroyJavaVM(JavaVM* vm) { if (vm == NULL) { return JNI_ERR; } else { @@ -75,8 +1967,9 @@ jint JniInvoke::DestroyJavaVM(JavaVM* vm) { } } -jint JniInvoke::AttachCurrentThread(JavaVM* vm, JNIEnv** p_env, - void* thr_args) { +jint JniInvokeInterface::AttachCurrentThread(JavaVM* vm, + JNIEnv** p_env, + void* thr_args) { if (vm == NULL || p_env == NULL) { return JNI_ERR; } @@ -96,7 +1989,7 @@ jint JniInvoke::AttachCurrentThread(JavaVM* vm, JNIEnv** p_env, } } -jint JniInvoke::DetachCurrentThread(JavaVM* vm) { +jint JniInvokeInterface::DetachCurrentThread(JavaVM* vm) { if (vm == NULL) { return JNI_ERR; } else { @@ -106,7 +1999,7 @@ jint JniInvoke::DetachCurrentThread(JavaVM* vm) { } } -jint JniInvoke::GetEnv(JavaVM *vm, void **env, jint version) { +jint JniInvokeInterface::GetEnv(JavaVM *vm, void **env, jint version) { if (version < JNI_VERSION_1_1 || version > JNI_VERSION_1_6) { return JNI_EVERSION; } @@ -122,8 +2015,9 @@ jint JniInvoke::GetEnv(JavaVM *vm, void **env, jint version) { return JNI_OK; } -jint JniInvoke::AttachCurrentThreadAsDaemon(JavaVM* vm, JNIEnv** p_env, - void* thr_args) { +jint JniInvokeInterface::AttachCurrentThreadAsDaemon(JavaVM* vm, + JNIEnv** p_env, + void* thr_args) { if (vm == NULL || p_env == NULL) { return JNI_ERR; } @@ -143,4 +2037,15 @@ jint JniInvoke::AttachCurrentThreadAsDaemon(JavaVM* vm, JNIEnv** p_env, } } +struct JNIInvokeInterface JniInvokeInterface::invoke_interface_ = { + NULL, // reserved0 + NULL, // reserved1 + NULL, // reserved2 + DestroyJavaVM, + AttachCurrentThread, + DetachCurrentThread, + GetEnv, + AttachCurrentThreadAsDaemon +}; + } // namespace art diff --git a/src/jni_internal.h b/src/jni_internal.h index 16bf96e..ceaeb96 100644 --- a/src/jni_internal.h +++ b/src/jni_internal.h @@ -25,32 +25,862 @@ class JniEnvironment { } private: + struct JNINativeInterface_* functions_; + void (*monitor_enter_)(JniEnvironment*, jobject); void (*monitor_exit_)(JniEnvironment*, jobject); DISALLOW_COPY_AND_ASSIGN(JniEnvironment); }; -class JniInvoke { +class JniNativeInterface { public: - // Index 3 - int DestroyJavaVM(JavaVM* vm); + static struct JNINativeInterface* GetInterface() { + return &native_interface_; + } + private: + static jint GetVersion(JNIEnv* env); + + static jclass DefineClass(JNIEnv* env, + const char* name, + jobject loader, + const jbyte* buf, + jsize len); + static jclass FindClass(JNIEnv* env, const char* name); + + static jmethodID FromReflectedMethod(JNIEnv* env, jobject method); + static jfieldID FromReflectedField(JNIEnv* env, jobject field); + static jobject ToReflectedMethod(JNIEnv* env, + jclass cls, + jmethodID methodID, + jboolean isStatic); + + static jclass GetSuperclass(JNIEnv* env, jclass sub); + static jboolean IsAssignableFrom(JNIEnv* env, jclass sub, jclass sup); + static jobject ToReflectedField(JNIEnv* env, + jclass cls, + jfieldID fieldID, + jboolean isStatic); + + static jint Throw(JNIEnv* env, jthrowable obj); + static jint ThrowNew(JNIEnv* env, jclass clazz, const char* msg); + static jthrowable ExceptionOccurred(JNIEnv* env); + static void ExceptionDescribe(JNIEnv* env); + static void ExceptionClear(JNIEnv* env); + static void FatalError(JNIEnv* env, const char* msg); + + static jint PushLocalFrame(JNIEnv* env, jint cap); + static jobject PopLocalFrame(JNIEnv* env, jobject res); + + static jobject NewGlobalRef(JNIEnv* env, jobject lobj); + static void DeleteGlobalRef(JNIEnv* env, jobject gref); + static void DeleteLocalRef(JNIEnv* env, jobject obj); + static jboolean IsSameObject(JNIEnv* env, jobject obj1, jobject obj2); + + static jobject NewLocalRef(JNIEnv* env, jobject ref); + static jint EnsureLocalCapacity(JNIEnv* env, jint); + + static jobject AllocObject(JNIEnv* env, jclass clazz); + static jobject NewObject(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + static jobject NewObjectV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jobject NewObjectA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jclass GetObjectClass(JNIEnv* env, jobject obj); + static jboolean IsInstanceOf(JNIEnv* env, jobject obj, jclass clazz); + + static jmethodID GetMethodID(JNIEnv* env, + jclass clazz, + const char* name, + const char* sig); + + static jobject CallObjectMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jobject CallObjectMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jobject CallObjectMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jboolean CallBooleanMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jboolean CallBooleanMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jboolean CallBooleanMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jbyte CallByteMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jbyte CallByteMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jbyte CallByteMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jchar CallCharMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jchar CallCharMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jchar CallCharMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jshort CallShortMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jshort CallShortMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jshort CallShortMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jint CallIntMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jint CallIntMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jint CallIntMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jlong CallLongMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jlong CallLongMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jlong CallLongMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jfloat CallFloatMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jfloat CallFloatMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jfloat CallFloatMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jdouble CallDoubleMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static jdouble CallDoubleMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static jdouble CallDoubleMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static void CallVoidMethod(JNIEnv* env, + jobject obj, + jmethodID methodID, + ...); + static void CallVoidMethodV(JNIEnv* env, + jobject obj, + jmethodID methodID, + va_list args); + static void CallVoidMethodA(JNIEnv* env, + jobject obj, + jmethodID methodID, + jvalue* args); + + static jobject CallNonvirtualObjectMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jobject CallNonvirtualObjectMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jobject CallNonvirtualObjectMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jboolean CallNonvirtualBooleanMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jboolean CallNonvirtualBooleanMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jboolean CallNonvirtualBooleanMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jbyte CallNonvirtualByteMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jbyte CallNonvirtualByteMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jbyte CallNonvirtualByteMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jchar CallNonvirtualCharMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jchar CallNonvirtualCharMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jchar CallNonvirtualCharMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jshort CallNonvirtualShortMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jshort CallNonvirtualShortMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jshort CallNonvirtualShortMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jint CallNonvirtualIntMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jint CallNonvirtualIntMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jint CallNonvirtualIntMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jlong CallNonvirtualLongMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jlong CallNonvirtualLongMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jlong CallNonvirtualLongMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jfloat CallNonvirtualFloatMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jfloat CallNonvirtualFloatMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jfloat CallNonvirtualFloatMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jdouble CallNonvirtualDoubleMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static jdouble CallNonvirtualDoubleMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static jdouble CallNonvirtualDoubleMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static void CallNonvirtualVoidMethod(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + ...); + static void CallNonvirtualVoidMethodV(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + va_list args); + static void CallNonvirtualVoidMethodA(JNIEnv* env, + jobject obj, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jfieldID GetFieldID(JNIEnv* env, + jclass clazz, + const char* name, + const char* sig); - // Index 4 - int AttachCurrentThread(JavaVM* vm, JNIEnv** penv, void* thr_args); + static jobject GetObjectField(JNIEnv* env, jobject obj, jfieldID fieldID); + static jboolean GetBooleanField(JNIEnv* env, jobject obj, jfieldID fieldID); + static jbyte GetByteField(JNIEnv* env, jobject obj, jfieldID fieldID); + static jchar GetCharField(JNIEnv* env, jobject obj, jfieldID fieldID); + static jshort GetShortField(JNIEnv* env, jobject obj, jfieldID fieldID); + static jint GetIntField(JNIEnv* env, jobject obj, jfieldID fieldID); + static jlong GetLongField(JNIEnv* env, jobject obj, jfieldID fieldID); + static jfloat GetFloatField(JNIEnv* env, jobject obj, jfieldID fieldID); + static jdouble GetDoubleField(JNIEnv* env, jobject obj, jfieldID fieldID); - // Index 5 - int DetachCurrentThread(JavaVM* vm); + static void SetObjectField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jobject val); + static void SetBooleanField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jboolean val); + static void SetByteField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jbyte val); + static void SetCharField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jchar val); + static void SetShortField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jshort val); + static void SetIntField(JNIEnv* env, jobject obj, jfieldID fieldID, jint val); + static void SetLongField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jlong val); + static void SetFloatField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jfloat val); + static void SetDoubleField(JNIEnv* env, + jobject obj, + jfieldID fieldID, + jdouble val); - // Index 6 - int GetEnv(JavaVM* vm, void** penv, int version); + static jmethodID GetStaticMethodID(JNIEnv* env, + jclass clazz, + const char* name, + const char* sig); - // Index 7 - int AttachCurrentThreadAsDaemon(JavaVM* vm, JNIEnv** penv, void* thr_args); + static jobject CallStaticObjectMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jobject CallStaticObjectMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jobject CallStaticObjectMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + static jboolean CallStaticBooleanMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jboolean CallStaticBooleanMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jboolean CallStaticBooleanMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jbyte CallStaticByteMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jbyte CallStaticByteMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jbyte CallStaticByteMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jchar CallStaticCharMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jchar CallStaticCharMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jchar CallStaticCharMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jshort CallStaticShortMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jshort CallStaticShortMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jshort CallStaticShortMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jint CallStaticIntMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jint CallStaticIntMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jint CallStaticIntMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jlong CallStaticLongMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jlong CallStaticLongMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jlong CallStaticLongMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jfloat CallStaticFloatMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jfloat CallStaticFloatMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jfloat CallStaticFloatMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static jdouble CallStaticDoubleMethod(JNIEnv* env, + jclass clazz, + jmethodID methodID, + ...); + static jdouble CallStaticDoubleMethodV(JNIEnv* env, + jclass clazz, + jmethodID methodID, + va_list args); + static jdouble CallStaticDoubleMethodA(JNIEnv* env, + jclass clazz, + jmethodID methodID, + jvalue* args); + + static void CallStaticVoidMethod(JNIEnv* env, + jclass cls, + jmethodID methodID, + ...); + static void CallStaticVoidMethodV(JNIEnv* env, + jclass cls, + jmethodID methodID, + va_list args); + static void CallStaticVoidMethodA(JNIEnv* env, + jclass cls, + jmethodID methodID, + jvalue* args); + + static jfieldID GetStaticFieldID(JNIEnv* env, + jclass clazz, + const char* name, + const char* sig); + static jobject GetStaticObjectField(JNIEnv* env, + jclass clazz, + jfieldID fieldID); + static jboolean GetStaticBooleanField(JNIEnv* env, + jclass clazz, + jfieldID fieldID); + static jbyte GetStaticByteField(JNIEnv* env, jclass clazz, jfieldID fieldID); + static jchar GetStaticCharField(JNIEnv* env, jclass clazz, jfieldID fieldID); + static jshort GetStaticShortField(JNIEnv* env, + jclass clazz, + jfieldID fieldID); + static jint GetStaticIntField(JNIEnv* env, jclass clazz, jfieldID fieldID); + static jlong GetStaticLongField(JNIEnv* env, jclass clazz, jfieldID fieldID); + static jfloat GetStaticFloatField(JNIEnv* env, + jclass clazz, + jfieldID fieldID); + static jdouble GetStaticDoubleField(JNIEnv* env, + jclass clazz, + jfieldID fieldID); + + static void SetStaticObjectField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jobject value); + static void SetStaticBooleanField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jboolean value); + static void SetStaticByteField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jbyte value); + static void SetStaticCharField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jchar value); + static void SetStaticShortField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jshort value); + static void SetStaticIntField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jint value); + static void SetStaticLongField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jlong value); + static void SetStaticFloatField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jfloat value); + static void SetStaticDoubleField(JNIEnv* env, + jclass clazz, + jfieldID fieldID, + jdouble value); + + static jstring NewString(JNIEnv* env, const jchar* unicode, jsize len); + static jsize GetStringLength(JNIEnv* env, jstring str); + static const jchar* GetStringChars(JNIEnv* env, + jstring str, + jboolean* isCopy); + static void ReleaseStringChars(JNIEnv* env, jstring str, const jchar* chars); + static jstring NewStringUTF(JNIEnv* env, const char* utf); + static jsize GetStringUTFLength(JNIEnv* env, jstring str); + static const char* GetStringUTFChars(JNIEnv* env, + jstring str, + jboolean* isCopy); + static void ReleaseStringUTFChars(JNIEnv* env, + jstring str, + const char* chars); + + static jsize GetArrayLength(JNIEnv* env, jarray array); + + static jobjectArray NewObjectArray(JNIEnv* env, + jsize len, + jclass clazz, + jobject init); + static jobject GetObjectArrayElement(JNIEnv* env, + jobjectArray array, + jsize index); + static void SetObjectArrayElement(JNIEnv* env, + jobjectArray array, + jsize index, + jobject val); + + static jbooleanArray NewBooleanArray(JNIEnv* env, jsize len); + static jbyteArray NewByteArray(JNIEnv* env, jsize len); + static jcharArray NewCharArray(JNIEnv* env, jsize len); + static jshortArray NewShortArray(JNIEnv* env, jsize len); + static jintArray NewIntArray(JNIEnv* env, jsize len); + static jlongArray NewLongArray(JNIEnv* env, jsize len); + static jfloatArray NewFloatArray(JNIEnv* env, jsize len); + static jdoubleArray NewDoubleArray(JNIEnv* env, jsize len); + + static jboolean* GetBooleanArrayElements(JNIEnv* env, + jbooleanArray array, + jboolean* isCopy); + static jbyte* GetByteArrayElements(JNIEnv* env, + jbyteArray array, + jboolean* isCopy); + static jchar* GetCharArrayElements(JNIEnv* env, + jcharArray array, + jboolean* isCopy); + static jshort* GetShortArrayElements(JNIEnv* env, + jshortArray array, + jboolean* isCopy); + static jint* GetIntArrayElements(JNIEnv* env, + jintArray array, + jboolean* isCopy); + static jlong* GetLongArrayElements(JNIEnv* env, + jlongArray array, + jboolean* isCopy); + static jfloat* GetFloatArrayElements(JNIEnv* env, + jfloatArray array, + jboolean* isCopy); + static jdouble* GetDoubleArrayElements(JNIEnv* env, + jdoubleArray array, + jboolean* isCopy); + + static void ReleaseBooleanArrayElements(JNIEnv* env, + jbooleanArray array, + jboolean* elems, + jint mode); + static void ReleaseByteArrayElements(JNIEnv* env, + jbyteArray array, + jbyte* elems, + jint mode); + static void ReleaseCharArrayElements(JNIEnv* env, + jcharArray array, + jchar* elems, + jint mode); + static void ReleaseShortArrayElements(JNIEnv* env, + jshortArray array, + jshort* elems, + jint mode); + static void ReleaseIntArrayElements(JNIEnv* env, + jintArray array, + jint* elems, + jint mode); + static void ReleaseLongArrayElements(JNIEnv* env, + jlongArray array, + jlong* elems, + jint mode); + static void ReleaseFloatArrayElements(JNIEnv* env, + jfloatArray array, + jfloat* elems, + jint mode); + static void ReleaseDoubleArrayElements(JNIEnv* env, + jdoubleArray array, + jdouble* elems, + jint mode); + + static void GetBooleanArrayRegion(JNIEnv* env, + jbooleanArray array, + jsize start, + jsize l, + jboolean* buf); + static void GetByteArrayRegion(JNIEnv* env, + jbyteArray array, + jsize start, + jsize len, + jbyte* buf); + static void GetCharArrayRegion(JNIEnv* env, + jcharArray array, + jsize start, + jsize len, + jchar* buf); + static void GetShortArrayRegion(JNIEnv* env, + jshortArray array, + jsize start, + jsize len, + jshort* buf); + static void GetIntArrayRegion(JNIEnv* env, + jintArray array, + jsize start, + jsize len, + jint* buf); + static void GetLongArrayRegion(JNIEnv* env, + jlongArray array, + jsize start, + jsize len, + jlong* buf); + static void GetFloatArrayRegion(JNIEnv* env, + jfloatArray array, + jsize start, + jsize len, + jfloat* buf); + static void GetDoubleArrayRegion(JNIEnv* env, + jdoubleArray array, + jsize start, + jsize len, + jdouble* buf); + + static void SetBooleanArrayRegion(JNIEnv* env, + jbooleanArray array, + jsize start, + jsize l, + const jboolean* buf); + static void SetByteArrayRegion(JNIEnv* env, + jbyteArray array, + jsize start, + jsize len, + const jbyte* buf); + static void SetCharArrayRegion(JNIEnv* env, + jcharArray array, + jsize start, + jsize len, + const jchar* buf); + static void SetShortArrayRegion(JNIEnv* env, + jshortArray array, + jsize start, + jsize len, + const jshort* buf); + static void SetIntArrayRegion(JNIEnv* env, + jintArray array, + jsize start, + jsize len, + const jint* buf); + static void SetLongArrayRegion(JNIEnv* env, + jlongArray array, + jsize start, + jsize len, + const jlong* buf); + static void SetFloatArrayRegion(JNIEnv* env, + jfloatArray array, + jsize start, + jsize len, + const jfloat* buf); + static void SetDoubleArrayRegion(JNIEnv* env, + jdoubleArray array, + jsize start, + jsize len, + const jdouble* buf); + + static jint RegisterNatives(JNIEnv* env, + jclass clazz, + const JNINativeMethod* methods, + jint nMethods); + static jint UnregisterNatives(JNIEnv* env, jclass clazz); + + static jint MonitorEnter(JNIEnv* env, jobject obj); + static jint MonitorExit(JNIEnv* env, jobject obj); + + static jint GetJavaVM(JNIEnv* env, JavaVM* *vm); + + static void GetStringRegion(JNIEnv* env, + jstring str, + jsize start, + jsize len, + jchar* buf); + static void GetStringUTFRegion(JNIEnv* env, + jstring str, + jsize start, + jsize len, + char* buf); + + static void* GetPrimitiveArrayCritical(JNIEnv* env, + jarray array, + jboolean* isCopy); + static void ReleasePrimitiveArrayCritical(JNIEnv* env, + jarray array, + void* carray, + jint mode); + + static const jchar* GetStringCritical(JNIEnv* env, + jstring s, + jboolean* isCopy); + static void ReleaseStringCritical(JNIEnv* env, jstring s, const jchar* cstr); + + static jweak NewWeakGlobalRef(JNIEnv* env, jobject obj); + static void DeleteWeakGlobalRef(JNIEnv* env, jweak obj); + + static jboolean ExceptionCheck(JNIEnv* env); + + static jobject NewDirectByteBuffer(JNIEnv* env, + void* address, + jlong capacity); + static void* GetDirectBufferAddress(JNIEnv* env, jobject buf); + static jlong GetDirectBufferCapacity(JNIEnv* env, jobject buf); + + static jobjectRefType GetObjectRefType(JNIEnv* env, jobject obj); + + static struct JNINativeInterface native_interface_; + DISALLOW_IMPLICIT_CONSTRUCTORS(JniNativeInterface); +}; + +class JniInvokeInterface { + public: + static struct JNIInvokeInterface* GetInterface() { + return &invoke_interface_; + } private: - DISALLOW_IMPLICIT_CONSTRUCTORS(JniInvoke); + static jint DestroyJavaVM(JavaVM* vm); + static jint AttachCurrentThread(JavaVM* vm, JNIEnv** penv, void* thr_args); + static jint DetachCurrentThread(JavaVM* vm); + static jint GetEnv(JavaVM* vm, void** penv, int version); + static jint AttachCurrentThreadAsDaemon(JavaVM* vm, + JNIEnv** penv, + void* thr_args); + static struct JNIInvokeInterface invoke_interface_; + DISALLOW_IMPLICIT_CONSTRUCTORS(JniInvokeInterface); }; } // namespace art + #endif // ART_SRC_JNI_INTERNAL_H_ |