diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-04-24 17:17:21 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-04-24 17:30:00 -0700 |
commit | 3b60fea8458f0bf65ef4530e1c4ee6fdd4b199e9 (patch) | |
tree | 8f08fe83b1a2ee414b4d01611729e7ef4b1fb200 /runtime/jni_internal.cc | |
parent | 81d79dc3e2a5e92c65bad955f2bea7ee161f66aa (diff) | |
download | art-3b60fea8458f0bf65ef4530e1c4ee6fdd4b199e9.zip art-3b60fea8458f0bf65ef4530e1c4ee6fdd4b199e9.tar.gz art-3b60fea8458f0bf65ef4530e1c4ee6fdd4b199e9.tar.bz2 |
Use __FUNCTION__ in CHECK_NON_NULL_*ARGUMENT.
Prevents naming errors and reduces code maintenance requirements.
Change-Id: I14aba05f0d5dab8009f472b3af0b698551ac2a7e
Diffstat (limited to 'runtime/jni_internal.cc')
-rw-r--r-- | runtime/jni_internal.cc | 458 |
1 files changed, 230 insertions, 228 deletions
diff --git a/runtime/jni_internal.cc b/runtime/jni_internal.cc index 5decca7..fd9c40b 100644 --- a/runtime/jni_internal.cc +++ b/runtime/jni_internal.cc @@ -513,14 +513,16 @@ class Libraries { SafeMap<std::string, SharedLibrary*> libraries_; }; -#define CHECK_NON_NULL_ARGUMENT(fn, value) \ +#define CHECK_NON_NULL_ARGUMENT(value) CHECK_NON_NULL_ARGUMENT_FN_NAME(__FUNCTION__, value) + +#define CHECK_NON_NULL_ARGUMENT_FN_NAME(name, value) \ if (UNLIKELY(value == nullptr)) { \ - JniAbortF(#fn, #value " == null"); \ + JniAbortF(name, #value " == null"); \ } -#define CHECK_NON_NULL_MEMCPY_ARGUMENT(fn, length, value) \ +#define CHECK_NON_NULL_MEMCPY_ARGUMENT(length, value) \ if (UNLIKELY(length != 0 && value == nullptr)) { \ - JniAbortF(#fn, #value " == null"); \ + JniAbortF(__FUNCTION__, #value " == null"); \ } class JNI { @@ -535,7 +537,7 @@ class JNI { } static jclass FindClass(JNIEnv* env, const char* name) { - CHECK_NON_NULL_ARGUMENT(FindClass, name); + CHECK_NON_NULL_ARGUMENT(name); Runtime* runtime = Runtime::Current(); ClassLinker* class_linker = runtime->GetClassLinker(); std::string descriptor(NormalizeJniClassDescriptor(name)); @@ -551,19 +553,19 @@ class JNI { } static jmethodID FromReflectedMethod(JNIEnv* env, jobject jlr_method) { - CHECK_NON_NULL_ARGUMENT(FromReflectedMethod, jlr_method); + CHECK_NON_NULL_ARGUMENT(jlr_method); ScopedObjectAccess soa(env); return soa.EncodeMethod(mirror::ArtMethod::FromReflectedMethod(soa, jlr_method)); } static jfieldID FromReflectedField(JNIEnv* env, jobject jlr_field) { - CHECK_NON_NULL_ARGUMENT(FromReflectedField, jlr_field); + CHECK_NON_NULL_ARGUMENT(jlr_field); ScopedObjectAccess soa(env); return soa.EncodeField(mirror::ArtField::FromReflectedField(soa, jlr_field)); } static jobject ToReflectedMethod(JNIEnv* env, jclass, jmethodID mid, jboolean) { - CHECK_NON_NULL_ARGUMENT(ToReflectedMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); mirror::ArtMethod* m = soa.DecodeMethod(mid); CHECK(!kMovingMethods); @@ -578,7 +580,7 @@ class JNI { } static jobject ToReflectedField(JNIEnv* env, jclass, jfieldID fid, jboolean) { - CHECK_NON_NULL_ARGUMENT(ToReflectedField, fid); + CHECK_NON_NULL_ARGUMENT(fid); ScopedObjectAccess soa(env); mirror::ArtField* f = soa.DecodeField(fid); jobject art_field = soa.AddLocalReference<jobject>(f); @@ -592,22 +594,22 @@ class JNI { } static jclass GetObjectClass(JNIEnv* env, jobject java_object) { - CHECK_NON_NULL_ARGUMENT(GetObjectClass, java_object); + CHECK_NON_NULL_ARGUMENT(java_object); ScopedObjectAccess soa(env); mirror::Object* o = soa.Decode<mirror::Object*>(java_object); return soa.AddLocalReference<jclass>(o->GetClass()); } static jclass GetSuperclass(JNIEnv* env, jclass java_class) { - CHECK_NON_NULL_ARGUMENT(GetSuperclass, java_class); + CHECK_NON_NULL_ARGUMENT(java_class); ScopedObjectAccess soa(env); mirror::Class* c = soa.Decode<mirror::Class*>(java_class); return soa.AddLocalReference<jclass>(c->GetSuperClass()); } static jboolean IsAssignableFrom(JNIEnv* env, jclass java_class1, jclass java_class2) { - CHECK_NON_NULL_ARGUMENT(IsAssignableFrom, java_class1); - CHECK_NON_NULL_ARGUMENT(IsAssignableFrom, java_class2); + CHECK_NON_NULL_ARGUMENT(java_class1); + CHECK_NON_NULL_ARGUMENT(java_class2); ScopedObjectAccess soa(env); mirror::Class* c1 = soa.Decode<mirror::Class*>(java_class1); mirror::Class* c2 = soa.Decode<mirror::Class*>(java_class2); @@ -615,7 +617,7 @@ class JNI { } static jboolean IsInstanceOf(JNIEnv* env, jobject jobj, jclass java_class) { - CHECK_NON_NULL_ARGUMENT(IsInstanceOf, java_class); + CHECK_NON_NULL_ARGUMENT(java_class); if (jobj == nullptr) { // Note: JNI is different from regular Java instanceof in this respect return JNI_TRUE; @@ -639,7 +641,7 @@ class JNI { } static jint ThrowNew(JNIEnv* env, jclass c, const char* msg) { - CHECK_NON_NULL_ARGUMENT(ThrowNew, c); + CHECK_NON_NULL_ARGUMENT(c); return ThrowNewException(env, c, msg, nullptr); } @@ -797,7 +799,7 @@ class JNI { } static jobject AllocObject(JNIEnv* env, jclass java_class) { - CHECK_NON_NULL_ARGUMENT(AllocObject, java_class); + CHECK_NON_NULL_ARGUMENT(java_class); ScopedObjectAccess soa(env); mirror::Class* c = EnsureInitialized(soa.Self(), soa.Decode<mirror::Class*>(java_class)); if (c == nullptr) { @@ -809,16 +811,16 @@ class JNI { static jobject NewObject(JNIEnv* env, jclass java_class, jmethodID mid, ...) { va_list args; va_start(args, mid); - CHECK_NON_NULL_ARGUMENT(NewObject, java_class); - CHECK_NON_NULL_ARGUMENT(NewObject, mid); + CHECK_NON_NULL_ARGUMENT(java_class); + CHECK_NON_NULL_ARGUMENT(mid); jobject result = NewObjectV(env, java_class, mid, args); va_end(args); return result; } static jobject NewObjectV(JNIEnv* env, jclass java_class, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(NewObjectV, java_class); - CHECK_NON_NULL_ARGUMENT(NewObjectV, mid); + CHECK_NON_NULL_ARGUMENT(java_class); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); mirror::Class* c = EnsureInitialized(soa.Self(), soa.Decode<mirror::Class*>(java_class)); if (c == nullptr) { @@ -837,8 +839,8 @@ class JNI { } static jobject NewObjectA(JNIEnv* env, jclass java_class, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(NewObjectA, java_class); - CHECK_NON_NULL_ARGUMENT(NewObjectA, mid); + CHECK_NON_NULL_ARGUMENT(java_class); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); mirror::Class* c = EnsureInitialized(soa.Self(), soa.Decode<mirror::Class*>(java_class)); if (c == nullptr) { @@ -857,18 +859,18 @@ class JNI { } static jmethodID GetMethodID(JNIEnv* env, jclass java_class, const char* name, const char* sig) { - CHECK_NON_NULL_ARGUMENT(GetMethodID, java_class); - CHECK_NON_NULL_ARGUMENT(GetMethodID, name); - CHECK_NON_NULL_ARGUMENT(GetMethodID, sig); + CHECK_NON_NULL_ARGUMENT(java_class); + CHECK_NON_NULL_ARGUMENT(name); + CHECK_NON_NULL_ARGUMENT(sig); ScopedObjectAccess soa(env); return FindMethodID(soa, java_class, name, sig, false); } static jmethodID GetStaticMethodID(JNIEnv* env, jclass java_class, const char* name, const char* sig) { - CHECK_NON_NULL_ARGUMENT(GetStaticMethodID, java_class); - CHECK_NON_NULL_ARGUMENT(GetStaticMethodID, name); - CHECK_NON_NULL_ARGUMENT(GetStaticMethodID, sig); + CHECK_NON_NULL_ARGUMENT(java_class); + CHECK_NON_NULL_ARGUMENT(name); + CHECK_NON_NULL_ARGUMENT(sig); ScopedObjectAccess soa(env); return FindMethodID(soa, java_class, name, sig, true); } @@ -876,8 +878,8 @@ class JNI { static jobject CallObjectMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallObjectMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallObjectMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -885,16 +887,16 @@ class JNI { } static jobject CallObjectMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallObjectMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallObjectMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args)); return soa.AddLocalReference<jobject>(result.GetL()); } static jobject CallObjectMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallObjectMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallObjectMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args)); @@ -904,8 +906,8 @@ class JNI { static jboolean CallBooleanMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallBooleanMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallBooleanMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -913,15 +915,15 @@ class JNI { } static jboolean CallBooleanMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallBooleanMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallBooleanMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args).GetZ(); } static jboolean CallBooleanMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallBooleanMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallBooleanMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetZ(); @@ -930,8 +932,8 @@ class JNI { static jbyte CallByteMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallByteMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallByteMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -939,15 +941,15 @@ class JNI { } static jbyte CallByteMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallByteMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallByteMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args).GetB(); } static jbyte CallByteMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallByteMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallByteMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetB(); @@ -956,8 +958,8 @@ class JNI { static jchar CallCharMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallCharMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallCharMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -965,15 +967,15 @@ class JNI { } static jchar CallCharMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallCharMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallCharMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args).GetC(); } static jchar CallCharMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallCharMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallCharMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetC(); @@ -982,8 +984,8 @@ class JNI { static jdouble CallDoubleMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallDoubleMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallDoubleMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -991,15 +993,15 @@ class JNI { } static jdouble CallDoubleMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallDoubleMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallDoubleMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args).GetD(); } static jdouble CallDoubleMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallDoubleMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallDoubleMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetD(); @@ -1008,8 +1010,8 @@ class JNI { static jfloat CallFloatMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallFloatMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallFloatMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1017,15 +1019,15 @@ class JNI { } static jfloat CallFloatMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallFloatMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallFloatMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args).GetF(); } static jfloat CallFloatMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallFloatMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallFloatMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetF(); @@ -1034,8 +1036,8 @@ class JNI { static jint CallIntMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallIntMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallIntMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1043,15 +1045,15 @@ class JNI { } static jint CallIntMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallIntMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallIntMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args).GetI(); } static jint CallIntMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallIntMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallIntMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetI(); @@ -1060,8 +1062,8 @@ class JNI { static jlong CallLongMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallLongMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallLongMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1069,15 +1071,15 @@ class JNI { } static jlong CallLongMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallLongMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallLongMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args).GetJ(); } static jlong CallLongMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallLongMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallLongMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetJ(); @@ -1086,8 +1088,8 @@ class JNI { static jshort CallShortMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallShortMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallShortMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1095,15 +1097,15 @@ class JNI { } static jshort CallShortMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallShortMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallShortMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args).GetS(); } static jshort CallShortMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallShortMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallShortMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetS(); @@ -1112,23 +1114,23 @@ class JNI { static void CallVoidMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallVoidMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallVoidMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap); va_end(ap); } static void CallVoidMethodV(JNIEnv* env, jobject obj, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallVoidMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallVoidMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, args); } static void CallVoidMethodA(JNIEnv* env, jobject obj, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallVoidMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallVoidMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeVirtualOrInterfaceWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args); } @@ -1136,8 +1138,8 @@ class JNI { static jobject CallNonvirtualObjectMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualObjectMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualObjectMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); jobject local_result = soa.AddLocalReference<jobject>(result.GetL()); @@ -1147,8 +1149,8 @@ class JNI { static jobject CallNonvirtualObjectMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualObjectMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualObjectMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, args)); return soa.AddLocalReference<jobject>(result.GetL()); @@ -1156,8 +1158,8 @@ class JNI { static jobject CallNonvirtualObjectMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualObjectMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualObjectMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args)); return soa.AddLocalReference<jobject>(result.GetL()); @@ -1167,8 +1169,8 @@ class JNI { ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualBooleanMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualBooleanMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1177,16 +1179,16 @@ class JNI { static jboolean CallNonvirtualBooleanMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualBooleanMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualBooleanMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, obj, mid, args).GetZ(); } static jboolean CallNonvirtualBooleanMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualBooleanMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualBooleanMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetZ(); } @@ -1194,8 +1196,8 @@ class JNI { static jbyte CallNonvirtualByteMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualByteMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualByteMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1204,16 +1206,16 @@ class JNI { static jbyte CallNonvirtualByteMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualByteMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualByteMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, obj, mid, args).GetB(); } static jbyte CallNonvirtualByteMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualByteMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualByteMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetB(); } @@ -1221,8 +1223,8 @@ class JNI { static jchar CallNonvirtualCharMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualCharMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualCharMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1231,16 +1233,16 @@ class JNI { static jchar CallNonvirtualCharMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualCharMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualCharMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, obj, mid, args).GetC(); } static jchar CallNonvirtualCharMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualCharMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualCharMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetC(); } @@ -1248,8 +1250,8 @@ class JNI { static jshort CallNonvirtualShortMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualShortMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualShortMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1258,16 +1260,16 @@ class JNI { static jshort CallNonvirtualShortMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualShortMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualShortMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, obj, mid, args).GetS(); } static jshort CallNonvirtualShortMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualShortMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualShortMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetS(); } @@ -1275,8 +1277,8 @@ class JNI { static jint CallNonvirtualIntMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualIntMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualIntMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1285,16 +1287,16 @@ class JNI { static jint CallNonvirtualIntMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualIntMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualIntMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, obj, mid, args).GetI(); } static jint CallNonvirtualIntMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualIntMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualIntMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetI(); } @@ -1302,8 +1304,8 @@ class JNI { static jlong CallNonvirtualLongMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualLongMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualLongMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1312,16 +1314,16 @@ class JNI { static jlong CallNonvirtualLongMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualLongMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualLongMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, obj, mid, args).GetJ(); } static jlong CallNonvirtualLongMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualLongMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualLongMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetJ(); } @@ -1329,8 +1331,8 @@ class JNI { static jfloat CallNonvirtualFloatMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualFloatMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualFloatMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1339,16 +1341,16 @@ class JNI { static jfloat CallNonvirtualFloatMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualFloatMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualFloatMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, obj, mid, args).GetF(); } static jfloat CallNonvirtualFloatMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualFloatMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualFloatMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetF(); } @@ -1356,8 +1358,8 @@ class JNI { static jdouble CallNonvirtualDoubleMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualDoubleMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualDoubleMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, obj, mid, ap)); va_end(ap); @@ -1366,16 +1368,16 @@ class JNI { static jdouble CallNonvirtualDoubleMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualDoubleMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualDoubleMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, obj, mid, args).GetD(); } static jdouble CallNonvirtualDoubleMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualDoubleMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualDoubleMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args).GetD(); } @@ -1383,8 +1385,8 @@ class JNI { static void CallNonvirtualVoidMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualVoidMethod, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualVoidMethod, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeWithVarArgs(soa, obj, mid, ap); va_end(ap); @@ -1392,40 +1394,40 @@ class JNI { static void CallNonvirtualVoidMethodV(JNIEnv* env, jobject obj, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualVoidMethodV, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualVoidMethodV, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeWithVarArgs(soa, obj, mid, args); } static void CallNonvirtualVoidMethodA(JNIEnv* env, jobject obj, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallNonvirtualVoidMethodA, obj); - CHECK_NON_NULL_ARGUMENT(CallNonvirtualVoidMethodA, mid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeWithJValues(soa, soa.Decode<mirror::Object*>(obj), mid, args); } static jfieldID GetFieldID(JNIEnv* env, jclass java_class, const char* name, const char* sig) { - CHECK_NON_NULL_ARGUMENT(GetFieldID, java_class); - CHECK_NON_NULL_ARGUMENT(GetFieldID, name); - CHECK_NON_NULL_ARGUMENT(GetFieldID, sig); + CHECK_NON_NULL_ARGUMENT(java_class); + CHECK_NON_NULL_ARGUMENT(name); + CHECK_NON_NULL_ARGUMENT(sig); ScopedObjectAccess soa(env); return FindFieldID(soa, java_class, name, sig, false); } static jfieldID GetStaticFieldID(JNIEnv* env, jclass java_class, const char* name, const char* sig) { - CHECK_NON_NULL_ARGUMENT(GetStaticFieldID, java_class); - CHECK_NON_NULL_ARGUMENT(GetStaticFieldID, name); - CHECK_NON_NULL_ARGUMENT(GetFieldID, sig); + CHECK_NON_NULL_ARGUMENT(java_class); + CHECK_NON_NULL_ARGUMENT(name); + CHECK_NON_NULL_ARGUMENT(sig); ScopedObjectAccess soa(env); return FindFieldID(soa, java_class, name, sig, true); } static jobject GetObjectField(JNIEnv* env, jobject obj, jfieldID fid) { - CHECK_NON_NULL_ARGUMENT(GetObjectField, obj); - CHECK_NON_NULL_ARGUMENT(GetObjectField, fid); + CHECK_NON_NULL_ARGUMENT(obj); + CHECK_NON_NULL_ARGUMENT(fid); ScopedObjectAccess soa(env); mirror::Object* o = soa.Decode<mirror::Object*>(obj); mirror::ArtField* f = soa.DecodeField(fid); @@ -1433,15 +1435,15 @@ class JNI { } static jobject GetStaticObjectField(JNIEnv* env, jclass, jfieldID fid) { - CHECK_NON_NULL_ARGUMENT(GetStaticObjectField, fid); + CHECK_NON_NULL_ARGUMENT(fid); ScopedObjectAccess soa(env); mirror::ArtField* f = soa.DecodeField(fid); return soa.AddLocalReference<jobject>(f->GetObject(f->GetDeclaringClass())); } static void SetObjectField(JNIEnv* env, jobject java_object, jfieldID fid, jobject java_value) { - CHECK_NON_NULL_ARGUMENT(SetObjectField, java_object); - CHECK_NON_NULL_ARGUMENT(SetObjectField, fid); + CHECK_NON_NULL_ARGUMENT(java_object); + CHECK_NON_NULL_ARGUMENT(fid); ScopedObjectAccess soa(env); mirror::Object* o = soa.Decode<mirror::Object*>(java_object); mirror::Object* v = soa.Decode<mirror::Object*>(java_value); @@ -1450,7 +1452,7 @@ class JNI { } static void SetStaticObjectField(JNIEnv* env, jclass, jfieldID fid, jobject java_value) { - CHECK_NON_NULL_ARGUMENT(SetStaticObjectField, fid); + CHECK_NON_NULL_ARGUMENT(fid); ScopedObjectAccess soa(env); mirror::Object* v = soa.Decode<mirror::Object*>(java_value); mirror::ArtField* f = soa.DecodeField(fid); @@ -1458,29 +1460,29 @@ class JNI { } #define GET_PRIMITIVE_FIELD(fn, instance) \ - CHECK_NON_NULL_ARGUMENT(Get #fn Field, instance); \ - CHECK_NON_NULL_ARGUMENT(Get #fn Field, fid); \ + CHECK_NON_NULL_ARGUMENT(instance); \ + CHECK_NON_NULL_ARGUMENT(fid); \ ScopedObjectAccess soa(env); \ mirror::Object* o = soa.Decode<mirror::Object*>(instance); \ mirror::ArtField* f = soa.DecodeField(fid); \ return f->Get ##fn (o) #define GET_STATIC_PRIMITIVE_FIELD(fn) \ - CHECK_NON_NULL_ARGUMENT(GetStatic #fn Field, fid); \ + CHECK_NON_NULL_ARGUMENT(fid); \ ScopedObjectAccess soa(env); \ mirror::ArtField* f = soa.DecodeField(fid); \ return f->Get ##fn (f->GetDeclaringClass()) #define SET_PRIMITIVE_FIELD(fn, instance, value) \ - CHECK_NON_NULL_ARGUMENT(Set #fn Field, instance); \ - CHECK_NON_NULL_ARGUMENT(Set #fn Field, fid); \ + CHECK_NON_NULL_ARGUMENT(instance); \ + CHECK_NON_NULL_ARGUMENT(fid); \ ScopedObjectAccess soa(env); \ mirror::Object* o = soa.Decode<mirror::Object*>(instance); \ mirror::ArtField* f = soa.DecodeField(fid); \ f->Set ##fn <false>(o, value) #define SET_STATIC_PRIMITIVE_FIELD(fn, value) \ - CHECK_NON_NULL_ARGUMENT(SetStatic #fn Field, fid); \ + CHECK_NON_NULL_ARGUMENT(fid); \ ScopedObjectAccess soa(env); \ mirror::ArtField* f = soa.DecodeField(fid); \ f->Set ##fn <false>(f->GetDeclaringClass(), value) @@ -1616,7 +1618,7 @@ class JNI { static jobject CallStaticObjectMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticObjectMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); jobject local_result = soa.AddLocalReference<jobject>(result.GetL()); @@ -1625,14 +1627,14 @@ class JNI { } static jobject CallStaticObjectMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticObjectMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, args)); return soa.AddLocalReference<jobject>(result.GetL()); } static jobject CallStaticObjectMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticObjectMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithJValues(soa, nullptr, mid, args)); return soa.AddLocalReference<jobject>(result.GetL()); @@ -1641,7 +1643,7 @@ class JNI { static jboolean CallStaticBooleanMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticBooleanMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); va_end(ap); @@ -1649,13 +1651,13 @@ class JNI { } static jboolean CallStaticBooleanMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticBooleanMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, nullptr, mid, args).GetZ(); } static jboolean CallStaticBooleanMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticBooleanMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, nullptr, mid, args).GetZ(); } @@ -1663,7 +1665,7 @@ class JNI { static jbyte CallStaticByteMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticByteMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); va_end(ap); @@ -1671,13 +1673,13 @@ class JNI { } static jbyte CallStaticByteMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticByteMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, nullptr, mid, args).GetB(); } static jbyte CallStaticByteMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticByteMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, nullptr, mid, args).GetB(); } @@ -1685,7 +1687,7 @@ class JNI { static jchar CallStaticCharMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticCharMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); va_end(ap); @@ -1693,13 +1695,13 @@ class JNI { } static jchar CallStaticCharMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticCharMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, nullptr, mid, args).GetC(); } static jchar CallStaticCharMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticCharMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, nullptr, mid, args).GetC(); } @@ -1707,7 +1709,7 @@ class JNI { static jshort CallStaticShortMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticShortMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); va_end(ap); @@ -1715,13 +1717,13 @@ class JNI { } static jshort CallStaticShortMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticShortMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, nullptr, mid, args).GetS(); } static jshort CallStaticShortMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticShortMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, nullptr, mid, args).GetS(); } @@ -1729,7 +1731,7 @@ class JNI { static jint CallStaticIntMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticIntMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); va_end(ap); @@ -1737,13 +1739,13 @@ class JNI { } static jint CallStaticIntMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticIntMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, nullptr, mid, args).GetI(); } static jint CallStaticIntMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticIntMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, nullptr, mid, args).GetI(); } @@ -1751,7 +1753,7 @@ class JNI { static jlong CallStaticLongMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticLongMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); va_end(ap); @@ -1759,13 +1761,13 @@ class JNI { } static jlong CallStaticLongMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticLongMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, nullptr, mid, args).GetJ(); } static jlong CallStaticLongMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticLongMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, nullptr, mid, args).GetJ(); } @@ -1773,7 +1775,7 @@ class JNI { static jfloat CallStaticFloatMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticFloatMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); va_end(ap); @@ -1781,13 +1783,13 @@ class JNI { } static jfloat CallStaticFloatMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticFloatMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, nullptr, mid, args).GetF(); } static jfloat CallStaticFloatMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticFloatMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, nullptr, mid, args).GetF(); } @@ -1795,7 +1797,7 @@ class JNI { static jdouble CallStaticDoubleMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticDoubleMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); JValue result(InvokeWithVarArgs(soa, nullptr, mid, ap)); va_end(ap); @@ -1803,13 +1805,13 @@ class JNI { } static jdouble CallStaticDoubleMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticDoubleMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithVarArgs(soa, nullptr, mid, args).GetD(); } static jdouble CallStaticDoubleMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticDoubleMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); return InvokeWithJValues(soa, nullptr, mid, args).GetD(); } @@ -1817,20 +1819,20 @@ class JNI { static void CallStaticVoidMethod(JNIEnv* env, jclass, jmethodID mid, ...) { va_list ap; va_start(ap, mid); - CHECK_NON_NULL_ARGUMENT(CallStaticVoidMethod, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeWithVarArgs(soa, nullptr, mid, ap); va_end(ap); } static void CallStaticVoidMethodV(JNIEnv* env, jclass, jmethodID mid, va_list args) { - CHECK_NON_NULL_ARGUMENT(CallStaticVoidMethodV, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeWithVarArgs(soa, nullptr, mid, args); } static void CallStaticVoidMethodA(JNIEnv* env, jclass, jmethodID mid, jvalue* args) { - CHECK_NON_NULL_ARGUMENT(CallStaticVoidMethodA, mid); + CHECK_NON_NULL_ARGUMENT(mid); ScopedObjectAccess soa(env); InvokeWithJValues(soa, nullptr, mid, args); } @@ -1859,26 +1861,26 @@ class JNI { } static jsize GetStringLength(JNIEnv* env, jstring java_string) { - CHECK_NON_NULL_ARGUMENT(GetStringLength, java_string); + CHECK_NON_NULL_ARGUMENT(java_string); ScopedObjectAccess soa(env); return soa.Decode<mirror::String*>(java_string)->GetLength(); } static jsize GetStringUTFLength(JNIEnv* env, jstring java_string) { - CHECK_NON_NULL_ARGUMENT(GetStringLength, java_string); + CHECK_NON_NULL_ARGUMENT(java_string); ScopedObjectAccess soa(env); return soa.Decode<mirror::String*>(java_string)->GetUtfLength(); } static void GetStringRegion(JNIEnv* env, jstring java_string, jsize start, jsize length, jchar* buf) { - CHECK_NON_NULL_ARGUMENT(GetStringRegion, java_string); + CHECK_NON_NULL_ARGUMENT(java_string); ScopedObjectAccess soa(env); mirror::String* s = soa.Decode<mirror::String*>(java_string); if (start < 0 || length < 0 || start + length > s->GetLength()) { ThrowSIOOBE(soa, start, length, s->GetLength()); } else { - CHECK_NON_NULL_MEMCPY_ARGUMENT(GetStringRegion, length, buf); + CHECK_NON_NULL_MEMCPY_ARGUMENT(length, buf); const jchar* chars = s->GetCharArray()->GetData() + s->GetOffset(); memcpy(buf, chars + start, length * sizeof(jchar)); } @@ -1886,20 +1888,20 @@ class JNI { static void GetStringUTFRegion(JNIEnv* env, jstring java_string, jsize start, jsize length, char* buf) { - CHECK_NON_NULL_ARGUMENT(GetStringUTFRegion, java_string); + CHECK_NON_NULL_ARGUMENT(java_string); ScopedObjectAccess soa(env); mirror::String* s = soa.Decode<mirror::String*>(java_string); if (start < 0 || length < 0 || start + length > s->GetLength()) { ThrowSIOOBE(soa, start, length, s->GetLength()); } else { - CHECK_NON_NULL_MEMCPY_ARGUMENT(GetStringUTFRegion, length, buf); + CHECK_NON_NULL_MEMCPY_ARGUMENT(length, buf); const jchar* chars = s->GetCharArray()->GetData() + s->GetOffset(); ConvertUtf16ToModifiedUtf8(buf, chars + start, length); } } static const jchar* GetStringChars(JNIEnv* env, jstring java_string, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetStringChars, java_string); + CHECK_NON_NULL_ARGUMENT(java_string); ScopedObjectAccess soa(env); mirror::String* s = soa.Decode<mirror::String*>(java_string); mirror::CharArray* chars = s->GetCharArray(); @@ -1918,7 +1920,7 @@ class JNI { } static void ReleaseStringChars(JNIEnv* env, jstring java_string, const jchar* chars) { - CHECK_NON_NULL_ARGUMENT(ReleaseStringChars, java_string); + CHECK_NON_NULL_ARGUMENT(java_string); delete[] chars; ScopedObjectAccess soa(env); UnpinPrimitiveArray(soa, soa.Decode<mirror::String*>(java_string)->GetCharArray()); @@ -1955,7 +1957,7 @@ class JNI { } static jsize GetArrayLength(JNIEnv* env, jarray java_array) { - CHECK_NON_NULL_ARGUMENT(GetArrayLength, java_array); + CHECK_NON_NULL_ARGUMENT(java_array); ScopedObjectAccess soa(env); mirror::Object* obj = soa.Decode<mirror::Object*>(java_array); if (UNLIKELY(!obj->IsArrayInstance())) { @@ -1966,7 +1968,7 @@ class JNI { } static jobject GetObjectArrayElement(JNIEnv* env, jobjectArray java_array, jsize index) { - CHECK_NON_NULL_ARGUMENT(GetObjectArrayElement, java_array); + CHECK_NON_NULL_ARGUMENT(java_array); ScopedObjectAccess soa(env); mirror::ObjectArray<mirror::Object>* array = soa.Decode<mirror::ObjectArray<mirror::Object>*>(java_array); @@ -1975,7 +1977,7 @@ class JNI { static void SetObjectArrayElement(JNIEnv* env, jobjectArray java_array, jsize index, jobject java_value) { - CHECK_NON_NULL_ARGUMENT(SetObjectArrayElement, java_array); + CHECK_NON_NULL_ARGUMENT(java_array); ScopedObjectAccess soa(env); mirror::ObjectArray<mirror::Object>* array = soa.Decode<mirror::ObjectArray<mirror::Object>*>(java_array); @@ -2070,7 +2072,7 @@ class JNI { } static void* GetPrimitiveArrayCritical(JNIEnv* env, jarray java_array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetPrimitiveArrayCritical, java_array); + CHECK_NON_NULL_ARGUMENT(java_array); ScopedObjectAccess soa(env); mirror::Array* array = soa.Decode<mirror::Array*>(java_array); gc::Heap* heap = Runtime::Current()->GetHeap(); @@ -2087,54 +2089,54 @@ class JNI { } static void ReleasePrimitiveArrayCritical(JNIEnv* env, jarray array, void* elements, jint mode) { - CHECK_NON_NULL_ARGUMENT(ReleasePrimitiveArrayCritical, array); + CHECK_NON_NULL_ARGUMENT(array); ReleasePrimitiveArray(env, array, elements, mode); } static jboolean* GetBooleanArrayElements(JNIEnv* env, jbooleanArray array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetBooleanArrayElements, array); + CHECK_NON_NULL_ARGUMENT(array); ScopedObjectAccess soa(env); return GetPrimitiveArray<jbooleanArray, jboolean*, mirror::BooleanArray>(soa, array, is_copy); } static jbyte* GetByteArrayElements(JNIEnv* env, jbyteArray array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetByteArrayElements, array); + CHECK_NON_NULL_ARGUMENT(array); ScopedObjectAccess soa(env); return GetPrimitiveArray<jbyteArray, jbyte*, mirror::ByteArray>(soa, array, is_copy); } static jchar* GetCharArrayElements(JNIEnv* env, jcharArray array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetCharArrayElements, array); + CHECK_NON_NULL_ARGUMENT(array); ScopedObjectAccess soa(env); return GetPrimitiveArray<jcharArray, jchar*, mirror::CharArray>(soa, array, is_copy); } static jdouble* GetDoubleArrayElements(JNIEnv* env, jdoubleArray array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetDoubleArrayElements, array); + CHECK_NON_NULL_ARGUMENT(array); ScopedObjectAccess soa(env); return GetPrimitiveArray<jdoubleArray, jdouble*, mirror::DoubleArray>(soa, array, is_copy); } static jfloat* GetFloatArrayElements(JNIEnv* env, jfloatArray array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetFloatArrayElements, array); + CHECK_NON_NULL_ARGUMENT(array); ScopedObjectAccess soa(env); return GetPrimitiveArray<jfloatArray, jfloat*, mirror::FloatArray>(soa, array, is_copy); } static jint* GetIntArrayElements(JNIEnv* env, jintArray array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetIntArrayElements, array); + CHECK_NON_NULL_ARGUMENT(array); ScopedObjectAccess soa(env); return GetPrimitiveArray<jintArray, jint*, mirror::IntArray>(soa, array, is_copy); } static jlong* GetLongArrayElements(JNIEnv* env, jlongArray array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetLongArrayElements, array); + CHECK_NON_NULL_ARGUMENT(array); ScopedObjectAccess soa(env); return GetPrimitiveArray<jlongArray, jlong*, mirror::LongArray>(soa, array, is_copy); } static jshort* GetShortArrayElements(JNIEnv* env, jshortArray array, jboolean* is_copy) { - CHECK_NON_NULL_ARGUMENT(GetShortArrayElements, array); + CHECK_NON_NULL_ARGUMENT(array); ScopedObjectAccess soa(env); return GetPrimitiveArray<jshortArray, jshort*, mirror::ShortArray>(soa, array, is_copy); } @@ -2290,7 +2292,7 @@ class JNI { JniAbortF("RegisterNatives", "negative method count: %d", method_count); return JNI_ERR; // Not reached. } - CHECK_NON_NULL_ARGUMENT(RegisterNatives, java_class); + CHECK_NON_NULL_ARGUMENT_FN_NAME("RegisterNatives", java_class); ScopedObjectAccess soa(env); mirror::Class* c = soa.Decode<mirror::Class*>(java_class); if (UNLIKELY(method_count == 0)) { @@ -2298,7 +2300,7 @@ class JNI { << PrettyDescriptor(c); return JNI_OK; } - CHECK_NON_NULL_ARGUMENT(RegisterNatives, methods); + CHECK_NON_NULL_ARGUMENT_FN_NAME("RegisterNatives", methods); for (jint i = 0; i < method_count; ++i) { const char* name = methods[i].name; const char* sig = methods[i].signature; @@ -2335,7 +2337,7 @@ class JNI { } static jint UnregisterNatives(JNIEnv* env, jclass java_class) { - CHECK_NON_NULL_ARGUMENT(UnregisterNatives, java_class); + CHECK_NON_NULL_ARGUMENT(java_class); ScopedObjectAccess soa(env); mirror::Class* c = soa.Decode<mirror::Class*>(java_class); @@ -2358,7 +2360,7 @@ class JNI { } static jint MonitorEnter(JNIEnv* env, jobject java_object) NO_THREAD_SAFETY_ANALYSIS { - CHECK_NON_NULL_ARGUMENT(MonitorEnter, java_object); + CHECK_NON_NULL_ARGUMENT(java_object); ScopedObjectAccess soa(env); mirror::Object* o = soa.Decode<mirror::Object*>(java_object); o = o->MonitorEnter(soa.Self()); @@ -2370,7 +2372,7 @@ class JNI { } static jint MonitorExit(JNIEnv* env, jobject java_object) NO_THREAD_SAFETY_ANALYSIS { - CHECK_NON_NULL_ARGUMENT(MonitorExit, java_object); + CHECK_NON_NULL_ARGUMENT(java_object); ScopedObjectAccess soa(env); mirror::Object* o = soa.Decode<mirror::Object*>(java_object); o->MonitorExit(soa.Self()); @@ -2382,7 +2384,7 @@ class JNI { } static jint GetJavaVM(JNIEnv* env, JavaVM** vm) { - CHECK_NON_NULL_ARGUMENT(GetJavaVM, vm); + CHECK_NON_NULL_ARGUMENT(vm); Runtime* runtime = Runtime::Current(); if (runtime != nullptr) { *vm = runtime->GetJavaVM(); @@ -2422,7 +2424,7 @@ class JNI { } static jobjectRefType GetObjectRefType(JNIEnv* env, jobject java_object) { - CHECK_NON_NULL_ARGUMENT(GetObjectRefType, java_object); + CHECK_NON_NULL_ARGUMENT(java_object); // Do we definitely know what kind of reference this is? IndirectRef ref = reinterpret_cast<IndirectRef>(java_object); @@ -2543,12 +2545,12 @@ class JNI { static void GetPrimitiveArrayRegion(ScopedObjectAccess& soa, JavaArrayT java_array, jsize start, jsize length, JavaT* buf) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - CHECK_NON_NULL_ARGUMENT(GetPrimitiveArrayRegion, java_array); + CHECK_NON_NULL_ARGUMENT(java_array); ArrayT* array = soa.Decode<ArrayT*>(java_array); if (start < 0 || length < 0 || start + length > array->GetLength()) { ThrowAIOOBE(soa, array, start, length, "src"); } else { - CHECK_NON_NULL_MEMCPY_ARGUMENT(GetPrimitiveArrayRegion, length, buf); + CHECK_NON_NULL_MEMCPY_ARGUMENT(length, buf); JavaT* data = array->GetData(); memcpy(buf, data + start, length * sizeof(JavaT)); } @@ -2558,12 +2560,12 @@ class JNI { static void SetPrimitiveArrayRegion(ScopedObjectAccess& soa, JavaArrayT java_array, jsize start, jsize length, const JavaT* buf) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - CHECK_NON_NULL_ARGUMENT(SetPrimitiveArrayRegion, java_array); + CHECK_NON_NULL_ARGUMENT(java_array); ArrayT* array = soa.Decode<ArrayT*>(java_array); if (start < 0 || length < 0 || start + length > array->GetLength()) { ThrowAIOOBE(soa, array, start, length, "dst"); } else { - CHECK_NON_NULL_MEMCPY_ARGUMENT(SetPrimitiveArrayRegion, length, buf); + CHECK_NON_NULL_MEMCPY_ARGUMENT(length, buf); JavaT* data = array->GetData(); memcpy(data + start, buf, length * sizeof(JavaT)); } |