diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/fakejvm/jvm.c | 475 |
2 files changed, 243 insertions, 234 deletions
@@ -40,7 +40,7 @@ runtime/liblog.so: runtime src/liblog.c linker.a: CFLAGS += -D_GNU_SOURCE -DANDROID_X86_LINKER -DLINKER_DEBUG=1 linker.a: CFLAGS += -Wno-pedantic -Wno-variadic-macros -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast linker.a: src/linker/dlfcn.o src/linker/linker.o src/linker/linker_environ.o src/linker/rt.o src/linker/strlcpy.o -jvm.a: private CFLAGS += -Wno-unused-variable +jvm.a: CFLAGS += -Wno-unused-variable -Wno-pedantic jvm.a: src/fakejvm/jvm.o app: private LDLIBS += -ldl -Wl,-rpath,runtime diff --git a/src/fakejvm/jvm.c b/src/fakejvm/jvm.c index 3ce783b..f7ba629 100644 --- a/src/fakejvm/jvm.c +++ b/src/fakejvm/jvm.c @@ -1489,237 +1489,246 @@ JNIEnv_ReleaseStringUTFChars(JNIEnv *env, jstring string, const char *utf) } static void +trace(const char *const symbol) +{ + printf("trace: %s\n", symbol); +} + +extern void* create_wrapper(const char *const symbol, void *function); +#define WRAP(x) create_wrapper(#x, x) + +static void env_init(JNIEnv *env, struct JNINativeInterface *native) { assert(env && native); - native->GetStringUTFChars = JNIEnv_GetStringUTFChars; - native->ReleaseStringUTFChars = JNIEnv_ReleaseStringUTFChars; - native->GetVersion = JNIEnv_GetVersion; - native->DefineClass = JNIEnv_DefineClass; - native->FindClass = JNIEnv_FindClass; - native->FromReflectedMethod = JNIEnv_FromReflectedMethod; - native->FromReflectedField = JNIEnv_FromReflectedField; - native->ToReflectedMethod = JNIEnv_ToReflectedMethod; - native->GetSuperclass = JNIEnv_GetSuperclass; - native->IsAssignableFrom = JNIEnv_IsAssignableFrom; - native->ToReflectedField = JNIEnv_ToReflectedField; - native->Throw = JNIEnv_Throw; - native->ThrowNew = JNIEnv_ThrowNew; - native->ExceptionOccurred = JNIEnv_ExceptionOccurred; - native->ExceptionDescribe = JNIEnv_ExceptionDescribe; - native->ExceptionClear = JNIEnv_ExceptionClear; - native->FatalError = JNIEnv_FatalError; - native->PushLocalFrame = JNIEnv_PushLocalFrame; - native->PopLocalFrame = JNIEnv_PopLocalFrame; - native->NewGlobalRef = JNIEnv_NewGlobalRef; - native->DeleteGlobalRef = JNIEnv_DeleteGlobalRef; - native->DeleteLocalRef = JNIEnv_DeleteLocalRef; - native->IsSameObject = JNIEnv_IsSameObject; - native->NewLocalRef = JNIEnv_NewLocalRef; - native->EnsureLocalCapacity = JNIEnv_EnsureLocalCapacity; - native->AllocObject = JNIEnv_AllocObject; - native->NewObject = JNIEnv_NewObject; - native->NewObjectV = JNIEnv_NewObjectV; - native->NewObjectA = JNIEnv_NewObjectA; - native->GetObjectClass = JNIEnv_GetObjectClass; - native->IsInstanceOf = JNIEnv_IsInstanceOf; - native->GetMethodID = JNIEnv_GetMethodID; - native->CallObjectMethod = JNIEnv_CallObjectMethod; - native->CallObjectMethodV = JNIEnv_CallObjectMethodV; - native->CallObjectMethodA = JNIEnv_CallObjectMethodA; - native->CallBooleanMethod = JNIEnv_CallBooleanMethod; - native->CallBooleanMethodV = JNIEnv_CallBooleanMethodV; - native->CallBooleanMethodA = JNIEnv_CallBooleanMethodA; - native->CallByteMethod = JNIEnv_CallByteMethod; - native->CallByteMethodV = JNIEnv_CallByteMethodV; - native->CallByteMethodA = JNIEnv_CallByteMethodA; - native->CallCharMethod = JNIEnv_CallCharMethod; - native->CallCharMethodV = JNIEnv_CallCharMethodV; - native->CallCharMethodA = JNIEnv_CallCharMethodA; - native->CallShortMethod = JNIEnv_CallShortMethod; - native->CallShortMethodV = JNIEnv_CallShortMethodV; - native->CallShortMethodA = JNIEnv_CallShortMethodA; - native->CallIntMethod = JNIEnv_CallIntMethod; - native->CallIntMethodV = JNIEnv_CallIntMethodV; - native->CallIntMethodA = JNIEnv_CallIntMethodA; - native->CallLongMethod = JNIEnv_CallLongMethod; - native->CallLongMethodV = JNIEnv_CallLongMethodV; - native->CallLongMethodA = JNIEnv_CallLongMethodA; - native->CallFloatMethod = JNIEnv_CallFloatMethod; - native->CallFloatMethodV = JNIEnv_CallFloatMethodV; - native->CallFloatMethodA = JNIEnv_CallFloatMethodA; - native->CallDoubleMethod = JNIEnv_CallDoubleMethod; - native->CallDoubleMethodV = JNIEnv_CallDoubleMethodV; - native->CallDoubleMethodA = JNIEnv_CallDoubleMethodA; - native->CallVoidMethod = JNIEnv_CallVoidMethod; - native->CallVoidMethodV = JNIEnv_CallVoidMethodV; - native->CallVoidMethodA = JNIEnv_CallVoidMethodA; - native->CallNonvirtualObjectMethod = JNIEnv_CallNonvirtualObjectMethod; - native->CallNonvirtualObjectMethodV = JNIEnv_CallNonvirtualObjectMethodV; - native->CallNonvirtualObjectMethodA = JNIEnv_CallNonvirtualObjectMethodA; - native->CallNonvirtualBooleanMethod = JNIEnv_CallNonvirtualBooleanMethod; - native->CallNonvirtualBooleanMethodV = JNIEnv_CallNonvirtualBooleanMethodV; - native->CallNonvirtualBooleanMethodA = JNIEnv_CallNonvirtualBooleanMethodA; - native->CallNonvirtualByteMethod = JNIEnv_CallNonvirtualByteMethod; - native->CallNonvirtualByteMethodV = JNIEnv_CallNonvirtualByteMethodV; - native->CallNonvirtualByteMethodA = JNIEnv_CallNonvirtualByteMethodA; - native->CallNonvirtualCharMethod = JNIEnv_CallNonvirtualCharMethod; - native->CallNonvirtualCharMethodV = JNIEnv_CallNonvirtualCharMethodV; - native->CallNonvirtualCharMethodA = JNIEnv_CallNonvirtualCharMethodA; - native->CallNonvirtualShortMethod = JNIEnv_CallNonvirtualShortMethod; - native->CallNonvirtualShortMethodV = JNIEnv_CallNonvirtualShortMethodV; - native->CallNonvirtualShortMethodA = JNIEnv_CallNonvirtualShortMethodA; - native->CallNonvirtualIntMethod = JNIEnv_CallNonvirtualIntMethod; - native->CallNonvirtualIntMethodV = JNIEnv_CallNonvirtualIntMethodV; - native->CallNonvirtualIntMethodA = JNIEnv_CallNonvirtualIntMethodA; - native->CallNonvirtualLongMethod = JNIEnv_CallNonvirtualLongMethod; - native->CallNonvirtualLongMethodV = JNIEnv_CallNonvirtualLongMethodV; - native->CallNonvirtualLongMethodA = JNIEnv_CallNonvirtualLongMethodA; - native->CallNonvirtualFloatMethod = JNIEnv_CallNonvirtualFloatMethod; - native->CallNonvirtualFloatMethodV = JNIEnv_CallNonvirtualFloatMethodV; - native->CallNonvirtualFloatMethodA = JNIEnv_CallNonvirtualFloatMethodA; - native->CallNonvirtualDoubleMethod = JNIEnv_CallNonvirtualDoubleMethod; - native->CallNonvirtualDoubleMethodV = JNIEnv_CallNonvirtualDoubleMethodV; - native->CallNonvirtualDoubleMethodA = JNIEnv_CallNonvirtualDoubleMethodA; - native->CallNonvirtualVoidMethod = JNIEnv_CallNonvirtualVoidMethod; - native->CallNonvirtualVoidMethodV = JNIEnv_CallNonvirtualVoidMethodV; - native->CallNonvirtualVoidMethodA = JNIEnv_CallNonvirtualVoidMethodA; - native->GetFieldID = JNIEnv_GetFieldID; - native->GetObjectField = JNIEnv_GetObjectField; - native->GetBooleanField = JNIEnv_GetBooleanField; - native->GetByteField = JNIEnv_GetByteField; - native->GetCharField = JNIEnv_GetCharField; - native->GetShortField = JNIEnv_GetShortField; - native->GetIntField = JNIEnv_GetIntField; - native->GetLongField = JNIEnv_GetLongField; - native->GetFloatField = JNIEnv_GetFloatField; - native->GetDoubleField = JNIEnv_GetDoubleField; - native->SetObjectField = JNIEnv_SetObjectField; - native->SetBooleanField = JNIEnv_SetBooleanField; - native->SetByteField = JNIEnv_SetByteField; - native->SetCharField = JNIEnv_SetCharField; - native->SetShortField = JNIEnv_SetShortField; - native->SetIntField = JNIEnv_SetIntField; - native->SetLongField = JNIEnv_SetLongField; - native->SetFloatField = JNIEnv_SetFloatField; - native->SetDoubleField = JNIEnv_SetDoubleField; - native->GetStaticMethodID = JNIEnv_GetStaticMethodID; - native->CallStaticObjectMethod = JNIEnv_CallStaticObjectMethod; - native->CallStaticObjectMethodV = JNIEnv_CallStaticObjectMethodV; - native->CallStaticObjectMethodA = JNIEnv_CallStaticObjectMethodA; - native->CallStaticBooleanMethod = JNIEnv_CallStaticBooleanMethod; - native->CallStaticBooleanMethodV = JNIEnv_CallStaticBooleanMethodV; - native->CallStaticBooleanMethodA = JNIEnv_CallStaticBooleanMethodA; - native->CallStaticByteMethod = JNIEnv_CallStaticByteMethod; - native->CallStaticByteMethodV = JNIEnv_CallStaticByteMethodV; - native->CallStaticByteMethodA = JNIEnv_CallStaticByteMethodA; - native->CallStaticCharMethod = JNIEnv_CallStaticCharMethod; - native->CallStaticCharMethodV = JNIEnv_CallStaticCharMethodV; - native->CallStaticCharMethodA = JNIEnv_CallStaticCharMethodA; - native->CallStaticShortMethod = JNIEnv_CallStaticShortMethod; - native->CallStaticShortMethodV = JNIEnv_CallStaticShortMethodV; - native->CallStaticShortMethodA = JNIEnv_CallStaticShortMethodA; - native->CallStaticIntMethod = JNIEnv_CallStaticIntMethod; - native->CallStaticIntMethodV = JNIEnv_CallStaticIntMethodV; - native->CallStaticIntMethodA = JNIEnv_CallStaticIntMethodA; - native->CallStaticLongMethod = JNIEnv_CallStaticLongMethod; - native->CallStaticLongMethodV = JNIEnv_CallStaticLongMethodV; - native->CallStaticLongMethodA = JNIEnv_CallStaticLongMethodA; - native->CallStaticFloatMethod = JNIEnv_CallStaticFloatMethod; - native->CallStaticFloatMethodV = JNIEnv_CallStaticFloatMethodV; - native->CallStaticFloatMethodA = JNIEnv_CallStaticFloatMethodA; - native->CallStaticDoubleMethod = JNIEnv_CallStaticDoubleMethod; - native->CallStaticDoubleMethodV = JNIEnv_CallStaticDoubleMethodV; - native->CallStaticDoubleMethodA = JNIEnv_CallStaticDoubleMethodA; - native->CallStaticVoidMethod = JNIEnv_CallStaticVoidMethod; - native->CallStaticVoidMethodV = JNIEnv_CallStaticVoidMethodV; - native->CallStaticVoidMethodA = JNIEnv_CallStaticVoidMethodA; - native->GetStaticFieldID = JNIEnv_GetStaticFieldID; - native->GetStaticObjectField = JNIEnv_GetStaticObjectField; - native->GetStaticBooleanField = JNIEnv_GetStaticBooleanField; - native->GetStaticByteField = JNIEnv_GetStaticByteField; - native->GetStaticCharField = JNIEnv_GetStaticCharField; - native->GetStaticShortField = JNIEnv_GetStaticShortField; - native->GetStaticIntField = JNIEnv_GetStaticIntField; - native->GetStaticLongField = JNIEnv_GetStaticLongField; - native->GetStaticFloatField = JNIEnv_GetStaticFloatField; - native->GetStaticDoubleField = JNIEnv_GetStaticDoubleField; - native->SetStaticObjectField = JNIEnv_SetStaticObjectField; - native->SetStaticBooleanField = JNIEnv_SetStaticBooleanField; - native->SetStaticByteField = JNIEnv_SetStaticByteField; - native->SetStaticCharField = JNIEnv_SetStaticCharField; - native->SetStaticShortField = JNIEnv_SetStaticShortField; - native->SetStaticIntField = JNIEnv_SetStaticIntField; - native->SetStaticLongField = JNIEnv_SetStaticLongField; - native->SetStaticFloatField = JNIEnv_SetStaticFloatField; - native->SetStaticDoubleField = JNIEnv_SetStaticDoubleField; - native->NewString = JNIEnv_NewString; - native->GetStringLength = JNIEnv_GetStringLength; - native->GetStringChars = JNIEnv_GetStringChars; - native->ReleaseStringChars = JNIEnv_ReleaseStringChars; - native->NewStringUTF = JNIEnv_NewStringUTF; - native->GetStringUTFLength = JNIEnv_GetStringUTFLength; - native->GetArrayLength = JNIEnv_GetArrayLength; - native->NewObjectArray = JNIEnv_NewObjectArray; - native->GetObjectArrayElement = JNIEnv_GetObjectArrayElement; - native->SetObjectArrayElement = JNIEnv_SetObjectArrayElement; - native->NewBooleanArray = JNIEnv_NewBooleanArray; - native->NewByteArray = JNIEnv_NewByteArray; - native->NewCharArray = JNIEnv_NewCharArray; - native->NewShortArray = JNIEnv_NewShortArray; - native->NewIntArray = JNIEnv_NewIntArray; - native->NewLongArray = JNIEnv_NewLongArray; - native->NewFloatArray = JNIEnv_NewFloatArray; - native->NewDoubleArray = JNIEnv_NewDoubleArray; - native->GetBooleanArrayElements = JNIEnv_GetBooleanArrayElements; - native->GetByteArrayElements = JNIEnv_GetByteArrayElements; - native->GetCharArrayElements = JNIEnv_GetCharArrayElements; - native->GetShortArrayElements = JNIEnv_GetShortArrayElements; - native->GetIntArrayElements = JNIEnv_GetIntArrayElements; - native->GetLongArrayElements = JNIEnv_GetLongArrayElements; - native->GetFloatArrayElements = JNIEnv_GetFloatArrayElements; - native->GetDoubleArrayElements = JNIEnv_GetDoubleArrayElements; - native->ReleaseBooleanArrayElements = JNIEnv_ReleaseBooleanArrayElements; - native->ReleaseByteArrayElements = JNIEnv_ReleaseByteArrayElements; - native->ReleaseCharArrayElements = JNIEnv_ReleaseCharArrayElements; - native->ReleaseShortArrayElements = JNIEnv_ReleaseShortArrayElements; - native->ReleaseIntArrayElements = JNIEnv_ReleaseIntArrayElements; - native->ReleaseLongArrayElements = JNIEnv_ReleaseLongArrayElements; - native->ReleaseFloatArrayElements = JNIEnv_ReleaseFloatArrayElements; - native->ReleaseDoubleArrayElements = JNIEnv_ReleaseDoubleArrayElements; - native->GetBooleanArrayRegion = JNIEnv_GetBooleanArrayRegion; - native->GetByteArrayRegion = JNIEnv_GetByteArrayRegion; - native->GetCharArrayRegion = JNIEnv_GetCharArrayRegion; - native->GetShortArrayRegion = JNIEnv_GetShortArrayRegion; - native->GetIntArrayRegion = JNIEnv_GetIntArrayRegion; - native->GetLongArrayRegion = JNIEnv_GetLongArrayRegion; - native->GetFloatArrayRegion = JNIEnv_GetFloatArrayRegion; - native->GetDoubleArrayRegion = JNIEnv_GetDoubleArrayRegion; - native->SetBooleanArrayRegion = JNIEnv_SetBooleanArrayRegion; - native->SetByteArrayRegion = JNIEnv_SetByteArrayRegion; - native->SetCharArrayRegion = JNIEnv_SetCharArrayRegion; - native->SetShortArrayRegion = JNIEnv_SetShortArrayRegion; - native->SetIntArrayRegion = JNIEnv_SetIntArrayRegion; - native->SetLongArrayRegion = JNIEnv_SetLongArrayRegion; - native->SetFloatArrayRegion = JNIEnv_SetFloatArrayRegion; - native->SetDoubleArrayRegion = JNIEnv_SetDoubleArrayRegion; - native->RegisterNatives = JNIEnv_RegisterNatives; - native->UnregisterNatives = JNIEnv_UnregisterNatives; - native->MonitorEnter = JNIEnv_MonitorEnter; - native->MonitorExit = JNIEnv_MonitorExit; - native->GetJavaVM = JNIEnv_GetJavaVM; - native->GetStringRegion = JNIEnv_GetStringRegion; - native->GetStringUTFRegion = JNIEnv_GetStringUTFRegion; - native->GetPrimitiveArrayCritical = JNIEnv_GetPrimitiveArrayCritical; - native->ReleasePrimitiveArrayCritical = JNIEnv_ReleasePrimitiveArrayCritical; - native->GetStringCritical = JNIEnv_GetStringCritical; - native->ReleaseStringCritical = JNIEnv_ReleaseStringCritical; - native->NewWeakGlobalRef = JNIEnv_NewWeakGlobalRef; - native->DeleteWeakGlobalRef = JNIEnv_DeleteWeakGlobalRef; - native->ExceptionCheck = JNIEnv_ExceptionCheck; - native->NewDirectByteBuffer = JNIEnv_NewDirectByteBuffer; - native->GetDirectBufferAddress = JNIEnv_GetDirectBufferAddress; - native->GetDirectBufferCapacity = JNIEnv_GetDirectBufferCapacity; + native->GetStringUTFChars = WRAP(JNIEnv_GetStringUTFChars); + native->ReleaseStringUTFChars = WRAP(JNIEnv_ReleaseStringUTFChars); + native->GetVersion = WRAP(JNIEnv_GetVersion); + native->DefineClass = WRAP(JNIEnv_DefineClass); + native->FindClass = WRAP(JNIEnv_FindClass); + native->FromReflectedMethod = WRAP(JNIEnv_FromReflectedMethod); + native->FromReflectedField = WRAP(JNIEnv_FromReflectedField); + native->ToReflectedMethod = WRAP(JNIEnv_ToReflectedMethod); + native->GetSuperclass = WRAP(JNIEnv_GetSuperclass); + native->IsAssignableFrom = WRAP(JNIEnv_IsAssignableFrom); + native->ToReflectedField = WRAP(JNIEnv_ToReflectedField); + native->Throw = WRAP(JNIEnv_Throw); + native->ThrowNew = WRAP(JNIEnv_ThrowNew); + native->ExceptionOccurred = WRAP(JNIEnv_ExceptionOccurred); + native->ExceptionDescribe = WRAP(JNIEnv_ExceptionDescribe); + native->ExceptionClear = WRAP(JNIEnv_ExceptionClear); + native->FatalError = WRAP(JNIEnv_FatalError); + native->PushLocalFrame = WRAP(JNIEnv_PushLocalFrame); + native->PopLocalFrame = WRAP(JNIEnv_PopLocalFrame); + native->NewGlobalRef = WRAP(JNIEnv_NewGlobalRef); + native->DeleteGlobalRef = WRAP(JNIEnv_DeleteGlobalRef); + native->DeleteLocalRef = WRAP(JNIEnv_DeleteLocalRef); + native->IsSameObject = WRAP(JNIEnv_IsSameObject); + native->NewLocalRef = WRAP(JNIEnv_NewLocalRef); + native->EnsureLocalCapacity = WRAP(JNIEnv_EnsureLocalCapacity); + native->AllocObject = WRAP(JNIEnv_AllocObject); + native->NewObject = WRAP(JNIEnv_NewObject); + native->NewObjectV = WRAP(JNIEnv_NewObjectV); + native->NewObjectA = WRAP(JNIEnv_NewObjectA); + native->GetObjectClass = WRAP(JNIEnv_GetObjectClass); + native->IsInstanceOf = WRAP(JNIEnv_IsInstanceOf); + native->GetMethodID = WRAP(JNIEnv_GetMethodID); + native->CallObjectMethod = WRAP(JNIEnv_CallObjectMethod); + native->CallObjectMethodV = WRAP(JNIEnv_CallObjectMethodV); + native->CallObjectMethodA = WRAP(JNIEnv_CallObjectMethodA); + native->CallBooleanMethod = WRAP(JNIEnv_CallBooleanMethod); + native->CallBooleanMethodV = WRAP(JNIEnv_CallBooleanMethodV); + native->CallBooleanMethodA = WRAP(JNIEnv_CallBooleanMethodA); + native->CallByteMethod = WRAP(JNIEnv_CallByteMethod); + native->CallByteMethodV = WRAP(JNIEnv_CallByteMethodV); + native->CallByteMethodA = WRAP(JNIEnv_CallByteMethodA); + native->CallCharMethod = WRAP(JNIEnv_CallCharMethod); + native->CallCharMethodV = WRAP(JNIEnv_CallCharMethodV); + native->CallCharMethodA = WRAP(JNIEnv_CallCharMethodA); + native->CallShortMethod = WRAP(JNIEnv_CallShortMethod); + native->CallShortMethodV = WRAP(JNIEnv_CallShortMethodV); + native->CallShortMethodA = WRAP(JNIEnv_CallShortMethodA); + native->CallIntMethod = WRAP(JNIEnv_CallIntMethod); + native->CallIntMethodV = WRAP(JNIEnv_CallIntMethodV); + native->CallIntMethodA = WRAP(JNIEnv_CallIntMethodA); + native->CallLongMethod = WRAP(JNIEnv_CallLongMethod); + native->CallLongMethodV = WRAP(JNIEnv_CallLongMethodV); + native->CallLongMethodA = WRAP(JNIEnv_CallLongMethodA); + native->CallFloatMethod = WRAP(JNIEnv_CallFloatMethod); + native->CallFloatMethodV = WRAP(JNIEnv_CallFloatMethodV); + native->CallFloatMethodA = WRAP(JNIEnv_CallFloatMethodA); + native->CallDoubleMethod = WRAP(JNIEnv_CallDoubleMethod); + native->CallDoubleMethodV = WRAP(JNIEnv_CallDoubleMethodV); + native->CallDoubleMethodA = WRAP(JNIEnv_CallDoubleMethodA); + native->CallVoidMethod = WRAP(JNIEnv_CallVoidMethod); + native->CallVoidMethodV = WRAP(JNIEnv_CallVoidMethodV); + native->CallVoidMethodA = WRAP(JNIEnv_CallVoidMethodA); + native->CallNonvirtualObjectMethod = WRAP(JNIEnv_CallNonvirtualObjectMethod); + native->CallNonvirtualObjectMethodV = WRAP(JNIEnv_CallNonvirtualObjectMethodV); + native->CallNonvirtualObjectMethodA = WRAP(JNIEnv_CallNonvirtualObjectMethodA); + native->CallNonvirtualBooleanMethod = WRAP(JNIEnv_CallNonvirtualBooleanMethod); + native->CallNonvirtualBooleanMethodV = WRAP(JNIEnv_CallNonvirtualBooleanMethodV); + native->CallNonvirtualBooleanMethodA = WRAP(JNIEnv_CallNonvirtualBooleanMethodA); + native->CallNonvirtualByteMethod = WRAP(JNIEnv_CallNonvirtualByteMethod); + native->CallNonvirtualByteMethodV = WRAP(JNIEnv_CallNonvirtualByteMethodV); + native->CallNonvirtualByteMethodA = WRAP(JNIEnv_CallNonvirtualByteMethodA); + native->CallNonvirtualCharMethod = WRAP(JNIEnv_CallNonvirtualCharMethod); + native->CallNonvirtualCharMethodV = WRAP(JNIEnv_CallNonvirtualCharMethodV); + native->CallNonvirtualCharMethodA = WRAP(JNIEnv_CallNonvirtualCharMethodA); + native->CallNonvirtualShortMethod = WRAP(JNIEnv_CallNonvirtualShortMethod); + native->CallNonvirtualShortMethodV = WRAP(JNIEnv_CallNonvirtualShortMethodV); + native->CallNonvirtualShortMethodA = WRAP(JNIEnv_CallNonvirtualShortMethodA); + native->CallNonvirtualIntMethod = WRAP(JNIEnv_CallNonvirtualIntMethod); + native->CallNonvirtualIntMethodV = WRAP(JNIEnv_CallNonvirtualIntMethodV); + native->CallNonvirtualIntMethodA = WRAP(JNIEnv_CallNonvirtualIntMethodA); + native->CallNonvirtualLongMethod = WRAP(JNIEnv_CallNonvirtualLongMethod); + native->CallNonvirtualLongMethodV = WRAP(JNIEnv_CallNonvirtualLongMethodV); + native->CallNonvirtualLongMethodA = WRAP(JNIEnv_CallNonvirtualLongMethodA); + native->CallNonvirtualFloatMethod = WRAP(JNIEnv_CallNonvirtualFloatMethod); + native->CallNonvirtualFloatMethodV = WRAP(JNIEnv_CallNonvirtualFloatMethodV); + native->CallNonvirtualFloatMethodA = WRAP(JNIEnv_CallNonvirtualFloatMethodA); + native->CallNonvirtualDoubleMethod = WRAP(JNIEnv_CallNonvirtualDoubleMethod); + native->CallNonvirtualDoubleMethodV = WRAP(JNIEnv_CallNonvirtualDoubleMethodV); + native->CallNonvirtualDoubleMethodA = WRAP(JNIEnv_CallNonvirtualDoubleMethodA); + native->CallNonvirtualVoidMethod = WRAP(JNIEnv_CallNonvirtualVoidMethod); + native->CallNonvirtualVoidMethodV = WRAP(JNIEnv_CallNonvirtualVoidMethodV); + native->CallNonvirtualVoidMethodA = WRAP(JNIEnv_CallNonvirtualVoidMethodA); + native->GetFieldID = WRAP(JNIEnv_GetFieldID); + native->GetObjectField = WRAP(JNIEnv_GetObjectField); + native->GetBooleanField = WRAP(JNIEnv_GetBooleanField); + native->GetByteField = WRAP(JNIEnv_GetByteField); + native->GetCharField = WRAP(JNIEnv_GetCharField); + native->GetShortField = WRAP(JNIEnv_GetShortField); + native->GetIntField = WRAP(JNIEnv_GetIntField); + native->GetLongField = WRAP(JNIEnv_GetLongField); + native->GetFloatField = WRAP(JNIEnv_GetFloatField); + native->GetDoubleField = WRAP(JNIEnv_GetDoubleField); + native->SetObjectField = WRAP(JNIEnv_SetObjectField); + native->SetBooleanField = WRAP(JNIEnv_SetBooleanField); + native->SetByteField = WRAP(JNIEnv_SetByteField); + native->SetCharField = WRAP(JNIEnv_SetCharField); + native->SetShortField = WRAP(JNIEnv_SetShortField); + native->SetIntField = WRAP(JNIEnv_SetIntField); + native->SetLongField = WRAP(JNIEnv_SetLongField); + native->SetFloatField = WRAP(JNIEnv_SetFloatField); + native->SetDoubleField = WRAP(JNIEnv_SetDoubleField); + native->GetStaticMethodID = WRAP(JNIEnv_GetStaticMethodID); + native->CallStaticObjectMethod = WRAP(JNIEnv_CallStaticObjectMethod); + native->CallStaticObjectMethodV = WRAP(JNIEnv_CallStaticObjectMethodV); + native->CallStaticObjectMethodA = WRAP(JNIEnv_CallStaticObjectMethodA); + native->CallStaticBooleanMethod = WRAP(JNIEnv_CallStaticBooleanMethod); + native->CallStaticBooleanMethodV = WRAP(JNIEnv_CallStaticBooleanMethodV); + native->CallStaticBooleanMethodA = WRAP(JNIEnv_CallStaticBooleanMethodA); + native->CallStaticByteMethod = WRAP(JNIEnv_CallStaticByteMethod); + native->CallStaticByteMethodV = WRAP(JNIEnv_CallStaticByteMethodV); + native->CallStaticByteMethodA = WRAP(JNIEnv_CallStaticByteMethodA); + native->CallStaticCharMethod = WRAP(JNIEnv_CallStaticCharMethod); + native->CallStaticCharMethodV = WRAP(JNIEnv_CallStaticCharMethodV); + native->CallStaticCharMethodA = WRAP(JNIEnv_CallStaticCharMethodA); + native->CallStaticShortMethod = WRAP(JNIEnv_CallStaticShortMethod); + native->CallStaticShortMethodV = WRAP(JNIEnv_CallStaticShortMethodV); + native->CallStaticShortMethodA = WRAP(JNIEnv_CallStaticShortMethodA); + native->CallStaticIntMethod = WRAP(JNIEnv_CallStaticIntMethod); + native->CallStaticIntMethodV = WRAP(JNIEnv_CallStaticIntMethodV); + native->CallStaticIntMethodA = WRAP(JNIEnv_CallStaticIntMethodA); + native->CallStaticLongMethod = WRAP(JNIEnv_CallStaticLongMethod); + native->CallStaticLongMethodV = WRAP(JNIEnv_CallStaticLongMethodV); + native->CallStaticLongMethodA = WRAP(JNIEnv_CallStaticLongMethodA); + native->CallStaticFloatMethod = WRAP(JNIEnv_CallStaticFloatMethod); + native->CallStaticFloatMethodV = WRAP(JNIEnv_CallStaticFloatMethodV); + native->CallStaticFloatMethodA = WRAP(JNIEnv_CallStaticFloatMethodA); + native->CallStaticDoubleMethod = WRAP(JNIEnv_CallStaticDoubleMethod); + native->CallStaticDoubleMethodV = WRAP(JNIEnv_CallStaticDoubleMethodV); + native->CallStaticDoubleMethodA = WRAP(JNIEnv_CallStaticDoubleMethodA); + native->CallStaticVoidMethod = WRAP(JNIEnv_CallStaticVoidMethod); + native->CallStaticVoidMethodV = WRAP(JNIEnv_CallStaticVoidMethodV); + native->CallStaticVoidMethodA = WRAP(JNIEnv_CallStaticVoidMethodA); + native->GetStaticFieldID = WRAP(JNIEnv_GetStaticFieldID); + native->GetStaticObjectField = WRAP(JNIEnv_GetStaticObjectField); + native->GetStaticBooleanField = WRAP(JNIEnv_GetStaticBooleanField); + native->GetStaticByteField = WRAP(JNIEnv_GetStaticByteField); + native->GetStaticCharField = WRAP(JNIEnv_GetStaticCharField); + native->GetStaticShortField = WRAP(JNIEnv_GetStaticShortField); + native->GetStaticIntField = WRAP(JNIEnv_GetStaticIntField); + native->GetStaticLongField = WRAP(JNIEnv_GetStaticLongField); + native->GetStaticFloatField = WRAP(JNIEnv_GetStaticFloatField); + native->GetStaticDoubleField = WRAP(JNIEnv_GetStaticDoubleField); + native->SetStaticObjectField = WRAP(JNIEnv_SetStaticObjectField); + native->SetStaticBooleanField = WRAP(JNIEnv_SetStaticBooleanField); + native->SetStaticByteField = WRAP(JNIEnv_SetStaticByteField); + native->SetStaticCharField = WRAP(JNIEnv_SetStaticCharField); + native->SetStaticShortField = WRAP(JNIEnv_SetStaticShortField); + native->SetStaticIntField = WRAP(JNIEnv_SetStaticIntField); + native->SetStaticLongField = WRAP(JNIEnv_SetStaticLongField); + native->SetStaticFloatField = WRAP(JNIEnv_SetStaticFloatField); + native->SetStaticDoubleField = WRAP(JNIEnv_SetStaticDoubleField); + native->NewString = WRAP(JNIEnv_NewString); + native->GetStringLength = WRAP(JNIEnv_GetStringLength); + native->GetStringChars = WRAP(JNIEnv_GetStringChars); + native->ReleaseStringChars = WRAP(JNIEnv_ReleaseStringChars); + native->NewStringUTF = WRAP(JNIEnv_NewStringUTF); + native->GetStringUTFLength = WRAP(JNIEnv_GetStringUTFLength); + native->GetArrayLength = WRAP(JNIEnv_GetArrayLength); + native->NewObjectArray = WRAP(JNIEnv_NewObjectArray); + native->GetObjectArrayElement = WRAP(JNIEnv_GetObjectArrayElement); + native->SetObjectArrayElement = WRAP(JNIEnv_SetObjectArrayElement); + native->NewBooleanArray = WRAP(JNIEnv_NewBooleanArray); + native->NewByteArray = WRAP(JNIEnv_NewByteArray); + native->NewCharArray = WRAP(JNIEnv_NewCharArray); + native->NewShortArray = WRAP(JNIEnv_NewShortArray); + native->NewIntArray = WRAP(JNIEnv_NewIntArray); + native->NewLongArray = WRAP(JNIEnv_NewLongArray); + native->NewFloatArray = WRAP(JNIEnv_NewFloatArray); + native->NewDoubleArray = WRAP(JNIEnv_NewDoubleArray); + native->GetBooleanArrayElements = WRAP(JNIEnv_GetBooleanArrayElements); + native->GetByteArrayElements = WRAP(JNIEnv_GetByteArrayElements); + native->GetCharArrayElements = WRAP(JNIEnv_GetCharArrayElements); + native->GetShortArrayElements = WRAP(JNIEnv_GetShortArrayElements); + native->GetIntArrayElements = WRAP(JNIEnv_GetIntArrayElements); + native->GetLongArrayElements = WRAP(JNIEnv_GetLongArrayElements); + native->GetFloatArrayElements = WRAP(JNIEnv_GetFloatArrayElements); + native->GetDoubleArrayElements = WRAP(JNIEnv_GetDoubleArrayElements); + native->ReleaseBooleanArrayElements = WRAP(JNIEnv_ReleaseBooleanArrayElements); + native->ReleaseByteArrayElements = WRAP(JNIEnv_ReleaseByteArrayElements); + native->ReleaseCharArrayElements = WRAP(JNIEnv_ReleaseCharArrayElements); + native->ReleaseShortArrayElements = WRAP(JNIEnv_ReleaseShortArrayElements); + native->ReleaseIntArrayElements = WRAP(JNIEnv_ReleaseIntArrayElements); + native->ReleaseLongArrayElements = WRAP(JNIEnv_ReleaseLongArrayElements); + native->ReleaseFloatArrayElements = WRAP(JNIEnv_ReleaseFloatArrayElements); + native->ReleaseDoubleArrayElements = WRAP(JNIEnv_ReleaseDoubleArrayElements); + native->GetBooleanArrayRegion = WRAP(JNIEnv_GetBooleanArrayRegion); + native->GetByteArrayRegion = WRAP(JNIEnv_GetByteArrayRegion); + native->GetCharArrayRegion = WRAP(JNIEnv_GetCharArrayRegion); + native->GetShortArrayRegion = WRAP(JNIEnv_GetShortArrayRegion); + native->GetIntArrayRegion = WRAP(JNIEnv_GetIntArrayRegion); + native->GetLongArrayRegion = WRAP(JNIEnv_GetLongArrayRegion); + native->GetFloatArrayRegion = WRAP(JNIEnv_GetFloatArrayRegion); + native->GetDoubleArrayRegion = WRAP(JNIEnv_GetDoubleArrayRegion); + native->SetBooleanArrayRegion = WRAP(JNIEnv_SetBooleanArrayRegion); + native->SetByteArrayRegion = WRAP(JNIEnv_SetByteArrayRegion); + native->SetCharArrayRegion = WRAP(JNIEnv_SetCharArrayRegion); + native->SetShortArrayRegion = WRAP(JNIEnv_SetShortArrayRegion); + native->SetIntArrayRegion = WRAP(JNIEnv_SetIntArrayRegion); + native->SetLongArrayRegion = WRAP(JNIEnv_SetLongArrayRegion); + native->SetFloatArrayRegion = WRAP(JNIEnv_SetFloatArrayRegion); + native->SetDoubleArrayRegion = WRAP(JNIEnv_SetDoubleArrayRegion); + native->RegisterNatives = WRAP(JNIEnv_RegisterNatives); + native->UnregisterNatives = WRAP(JNIEnv_UnregisterNatives); + native->MonitorEnter = WRAP(JNIEnv_MonitorEnter); + native->MonitorExit = WRAP(JNIEnv_MonitorExit); + native->GetJavaVM = WRAP(JNIEnv_GetJavaVM); + native->GetStringRegion = WRAP(JNIEnv_GetStringRegion); + native->GetStringUTFRegion = WRAP(JNIEnv_GetStringUTFRegion); + native->GetPrimitiveArrayCritical = WRAP(JNIEnv_GetPrimitiveArrayCritical); + native->ReleasePrimitiveArrayCritical = WRAP(JNIEnv_ReleasePrimitiveArrayCritical); + native->GetStringCritical = WRAP(JNIEnv_GetStringCritical); + native->ReleaseStringCritical = WRAP(JNIEnv_ReleaseStringCritical); + native->NewWeakGlobalRef = WRAP(JNIEnv_NewWeakGlobalRef); + native->DeleteWeakGlobalRef = WRAP(JNIEnv_DeleteWeakGlobalRef); + native->ExceptionCheck = WRAP(JNIEnv_ExceptionCheck); + native->NewDirectByteBuffer = WRAP(JNIEnv_NewDirectByteBuffer); + native->GetDirectBufferAddress = WRAP(JNIEnv_GetDirectBufferAddress); + native->GetDirectBufferCapacity = WRAP(JNIEnv_GetDirectBufferCapacity); *env = native; } @@ -1760,11 +1769,11 @@ static void vm_init(JavaVM *vm, struct JNIInvokeInterface *invoke) { assert(vm && invoke); - invoke->DestroyJavaVM = JavaVM_DestroyJavaVM; - invoke->AttachCurrentThread = JavaVM_AttachCurrentThread; - invoke->DetachCurrentThread = JavaVM_DetachCurrentThread; - invoke->GetEnv = JavaVM_GetEnv; - invoke->AttachCurrentThreadAsDaemon = JavaVM_AttachCurrentThreadAsDaemon; + invoke->DestroyJavaVM = WRAP(JavaVM_DestroyJavaVM); + invoke->AttachCurrentThread = WRAP(JavaVM_AttachCurrentThread); + invoke->DetachCurrentThread = WRAP(JavaVM_DetachCurrentThread); + invoke->GetEnv = WRAP(JavaVM_GetEnv); + invoke->AttachCurrentThreadAsDaemon = WRAP(JavaVM_AttachCurrentThreadAsDaemon); *vm = invoke; } |