< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/aod/jvmti_aod.cpp
Print this page
rev 52185 : 8212148: Remove remaining NSK_CPP_STUBs
Summary: Remove remaining macros
Reviewed-by: amenkov, phh
*** 85,95 ****
/*
* Auxiliary functions
*/
void nsk_jvmti_aod_deallocate(jvmtiEnv *jvmti, unsigned char* mem) {
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, jvmti, mem))) {
NSK_COMPLAIN0("Deallocate failed\n");
/*
* if deallocate fails it isn't critical and test execution can continue without problems,
* just call nsk_aod_internal_error to inform framework about this error
--- 85,95 ----
/*
* Auxiliary functions
*/
void nsk_jvmti_aod_deallocate(jvmtiEnv *jvmti, unsigned char* mem) {
! if (!NSK_JVMTI_VERIFY(jvmti->Deallocate(mem))) {
NSK_COMPLAIN0("Deallocate failed\n");
/*
* if deallocate fails it isn't critical and test execution can continue without problems,
* just call nsk_aod_internal_error to inform framework about this error
*** 99,109 ****
}
int nsk_jvmti_aod_getClassName(jvmtiEnv *jvmti, jclass klass, char classNameBuffer[]) {
char* className;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti, klass, &className, NULL))) {
NSK_COMPLAIN0("Failed to get class name\n");
classNameBuffer[0] = '\0';
return NSK_FALSE;
} else {
strcpy(classNameBuffer, className);
--- 99,109 ----
}
int nsk_jvmti_aod_getClassName(jvmtiEnv *jvmti, jclass klass, char classNameBuffer[]) {
char* className;
! if (!NSK_JVMTI_VERIFY(jvmti->GetClassSignature(klass, &className, NULL))) {
NSK_COMPLAIN0("Failed to get class name\n");
classNameBuffer[0] = '\0';
return NSK_FALSE;
} else {
strcpy(classNameBuffer, className);
*** 114,124 ****
}
}
int nsk_jvmti_aod_getThreadName(jvmtiEnv * jvmti, jthread thread, char threadNameBuffer[]) {
jvmtiThreadInfo info;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti, thread, &info))){
NSK_COMPLAIN0("Failed to get thread info\n");
threadNameBuffer[0] = '\0';
return NSK_FALSE;
} else {
strcpy(threadNameBuffer, info.name);
--- 114,124 ----
}
}
int nsk_jvmti_aod_getThreadName(jvmtiEnv * jvmti, jthread thread, char threadNameBuffer[]) {
jvmtiThreadInfo info;
! if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(thread, &info))){
NSK_COMPLAIN0("Failed to get thread info\n");
threadNameBuffer[0] = '\0';
return NSK_FALSE;
} else {
strcpy(threadNameBuffer, info.name);
*** 159,187 ****
jthread nsk_jvmti_aod_createThread(JNIEnv *jni) {
jclass klass ;
jmethodID threadConstructor;
jthread thread;
! if (!NSK_JNI_VERIFY(jni,
! (klass = NSK_CPP_STUB2(FindClass, jni, "java/lang/Thread")) != NULL )) {
NSK_COMPLAIN0("Failed to get the java.lang.Thread class\n");
return NULL;
}
if (!NSK_JNI_VERIFY(jni,
! (threadConstructor = NSK_CPP_STUB4(GetMethodID, jni, klass, "<init>", "()V") ) != NULL )) {
NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
return NULL;
}
if (!NSK_JNI_VERIFY (jni,
! (thread = NSK_CPP_STUB4(NewObject, jni, klass, threadConstructor, NULL)) != NULL ) ) {
NSK_COMPLAIN0("Failed to create Thread object\n");
return NULL;
}
! if (!NSK_JNI_VERIFY(jni, (thread =
! NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL)) {
NSK_COMPLAIN0("Failed to create global reference\n");
return NULL;
}
return thread;
--- 159,185 ----
jthread nsk_jvmti_aod_createThread(JNIEnv *jni) {
jclass klass ;
jmethodID threadConstructor;
jthread thread;
! if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass("java/lang/Thread")) != NULL )) {
NSK_COMPLAIN0("Failed to get the java.lang.Thread class\n");
return NULL;
}
if (!NSK_JNI_VERIFY(jni,
! (threadConstructor = jni->GetMethodID(klass, "<init>", "()V") ) != NULL )) {
NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
return NULL;
}
if (!NSK_JNI_VERIFY (jni,
! (thread = jni->NewObject(klass, threadConstructor, NULL)) != NULL ) ) {
NSK_COMPLAIN0("Failed to create Thread object\n");
return NULL;
}
! if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL)) {
NSK_COMPLAIN0("Failed to create global reference\n");
return NULL;
}
return thread;
*** 191,223 ****
jclass klass ;
jmethodID threadConstructor;
jthread thread;
jstring threadNameString;
! if (!NSK_JNI_VERIFY(jni, (threadNameString =
! NSK_CPP_STUB2(NewStringUTF, jni, threadName)) != NULL))
return NULL;
! if (!NSK_JNI_VERIFY(jni,
! (klass = NSK_CPP_STUB2(FindClass, jni, "java/lang/Thread")) != NULL )) {
NSK_COMPLAIN0("Failed to get the java.lang.Thread class\n");
return NULL;
}
if (!NSK_JNI_VERIFY(jni,
! (threadConstructor = NSK_CPP_STUB4(GetMethodID, jni, klass, "<init>", "(Ljava/lang/String;)V") ) != NULL )) {
NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
return NULL;
}
if (!NSK_JNI_VERIFY(jni,
! (thread = NSK_CPP_STUB4(NewObject, jni, klass, threadConstructor, threadNameString)) != NULL ) ) {
NSK_COMPLAIN0("Failed to create Thread object\n");
return NULL;
}
! if (!NSK_JNI_VERIFY(jni, (thread =
! NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL)) {
NSK_COMPLAIN0("Failed to create global reference\n");
return NULL;
}
return thread;
--- 189,218 ----
jclass klass ;
jmethodID threadConstructor;
jthread thread;
jstring threadNameString;
! if (!NSK_JNI_VERIFY(jni, (threadNameString = jni->NewStringUTF(threadName)) != NULL))
return NULL;
! if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass("java/lang/Thread")) != NULL )) {
NSK_COMPLAIN0("Failed to get the java.lang.Thread class\n");
return NULL;
}
if (!NSK_JNI_VERIFY(jni,
! (threadConstructor = jni->GetMethodID(klass, "<init>", "(Ljava/lang/String;)V") ) != NULL )) {
NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
return NULL;
}
if (!NSK_JNI_VERIFY(jni,
! (thread = jni->NewObject(klass, threadConstructor, threadNameString)) != NULL ) ) {
NSK_COMPLAIN0("Failed to create Thread object\n");
return NULL;
}
! if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL)) {
NSK_COMPLAIN0("Failed to create global reference\n");
return NULL;
}
return thread;
< prev index next >