< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/share/JVMTIagent.cpp

Print this page
rev 52185 : [mq]: refactor


 698         unlock(jni_env);
 699         display(0, "#### JVMTIagent: findAndHotSwap: <<<<<<<< exited from the raw monitor \"eventLock\" ####\n\n");
 700     }
 701 
 702     return ret_code;
 703 }
 704 
 705 static int doHotSwap(JNIEnv *jni_env, jclass redefCls, jint bCount,
 706         jbyte *classBytes) {
 707     jvmtiClassDefinition classDef;
 708 
 709     /* fill the structure jvmtiClassDefinition */
 710     classDef.klass = redefCls;
 711     classDef.class_byte_count = bCount;
 712     classDef.class_bytes = (unsigned char*) classBytes;
 713 
 714     display(0,
 715             "#### JVMTIagent: >>>>>>>> Invoke RedefineClasses():\n"
 716             "<JVMTIagent>\tnew class byte count=%d\n",
 717             classDef.class_byte_count);
 718     if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(jvmti->RedefineClasses(1, &classDef)))
 719         return 1;
 720 
 721     display(0, "#### JVMTIagent: <<<<<<<< RedefineClasses() is successfully done ####\n");
 722 
 723     return 0;
 724 }
 725 
 726 static int addStressEvents() {
 727     static int stepEventSet = JNI_FALSE;
 728     static int methodsEventSet = JNI_FALSE;
 729     static int excCatchEventSet = JNI_FALSE;
 730 
 731     if (stress_lev >= 3) {
 732         /* SingleStep events */
 733         if (stepEventSet == JNI_FALSE) { /* don't set the event twice */
 734             display(0, "#### JVMTIagent: setting SingleStep events ...\n");
 735 
 736             callbacks.SingleStep = &SingleStep;
 737 
 738             if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))




 698         unlock(jni_env);
 699         display(0, "#### JVMTIagent: findAndHotSwap: <<<<<<<< exited from the raw monitor \"eventLock\" ####\n\n");
 700     }
 701 
 702     return ret_code;
 703 }
 704 
 705 static int doHotSwap(JNIEnv *jni_env, jclass redefCls, jint bCount,
 706         jbyte *classBytes) {
 707     jvmtiClassDefinition classDef;
 708 
 709     /* fill the structure jvmtiClassDefinition */
 710     classDef.klass = redefCls;
 711     classDef.class_byte_count = bCount;
 712     classDef.class_bytes = (unsigned char*) classBytes;
 713 
 714     display(0,
 715             "#### JVMTIagent: >>>>>>>> Invoke RedefineClasses():\n"
 716             "<JVMTIagent>\tnew class byte count=%d\n",
 717             classDef.class_byte_count);
 718     if (!NSK_JVMTI_VERIFY(jvmti->RedefineClasses(1, &classDef)))
 719         return 1;
 720 
 721     display(0, "#### JVMTIagent: <<<<<<<< RedefineClasses() is successfully done ####\n");
 722 
 723     return 0;
 724 }
 725 
 726 static int addStressEvents() {
 727     static int stepEventSet = JNI_FALSE;
 728     static int methodsEventSet = JNI_FALSE;
 729     static int excCatchEventSet = JNI_FALSE;
 730 
 731     if (stress_lev >= 3) {
 732         /* SingleStep events */
 733         if (stepEventSet == JNI_FALSE) { /* don't set the event twice */
 734             display(0, "#### JVMTIagent: setting SingleStep events ...\n");
 735 
 736             callbacks.SingleStep = &SingleStep;
 737 
 738             if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))


< prev index next >