< prev index next >

src/share/vm/prims/jvmtiExport.cpp

Print this page




1222                                             JvmtiTrace::safe_get_thread_name(thread),
1223                                             (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
1224                                             (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
1225 
1226           // we also need to issue a frame pop event for this frame
1227           JvmtiEnv *env = ets->get_env();
1228           JvmtiMethodEventMark jem(thread, mh);
1229           JvmtiJavaThreadEventTransition jet(thread);
1230           jvmtiEventFramePop callback = env->callbacks()->FramePop;
1231           if (callback != NULL) {
1232             (*callback)(env->jvmti_external(), jem.jni_env(), jem.jni_thread(),
1233                         jem.jni_methodID(), exception_exit);
1234           }
1235         }
1236         // remove the frame's entry
1237         ets->clear_frame_pop(cur_frame_number);
1238       }
1239     }
1240   }
1241 






1242   state->decr_cur_stack_depth();

1243 }
1244 
1245 
1246 // Todo: inline this for optimization
1247 void JvmtiExport::post_single_step(JavaThread *thread, Method* method, address location) {
1248   HandleMark hm(thread);
1249   methodHandle mh(thread, method);
1250 
1251   JvmtiThreadState *state = thread->jvmti_thread_state();
1252   if (state == NULL) {
1253     return;
1254   }
1255   JvmtiEnvThreadStateIterator it(state);
1256   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
1257     ets->compare_and_set_current_location(mh(), location, JVMTI_EVENT_SINGLE_STEP);
1258     if (!ets->single_stepping_posted() && ets->is_enabled(JVMTI_EVENT_SINGLE_STEP)) {
1259       EVT_TRACE(JVMTI_EVENT_SINGLE_STEP, ("JVMTI [%s] Evt Single Step sent %s.%s @ %d",
1260                     JvmtiTrace::safe_get_thread_name(thread),
1261                     (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
1262                     (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),




1222                                             JvmtiTrace::safe_get_thread_name(thread),
1223                                             (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
1224                                             (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
1225 
1226           // we also need to issue a frame pop event for this frame
1227           JvmtiEnv *env = ets->get_env();
1228           JvmtiMethodEventMark jem(thread, mh);
1229           JvmtiJavaThreadEventTransition jet(thread);
1230           jvmtiEventFramePop callback = env->callbacks()->FramePop;
1231           if (callback != NULL) {
1232             (*callback)(env->jvmti_external(), jem.jni_env(), jem.jni_thread(),
1233                         jem.jni_methodID(), exception_exit);
1234           }
1235         }
1236         // remove the frame's entry
1237         ets->clear_frame_pop(cur_frame_number);
1238       }
1239     }
1240   }
1241 
1242 #ifdef AARCH64
1243   // FIXME: this is just a kludge to get JVMTI going.  Compiled
1244   // MethodHandle code doesn't call the JVMTI notify routines, so the
1245   // stack depth we see here is wrong.
1246   state->invalidate_cur_stack_depth();
1247 #else
1248   state->decr_cur_stack_depth();
1249 #endif
1250 }
1251 
1252 
1253 // Todo: inline this for optimization
1254 void JvmtiExport::post_single_step(JavaThread *thread, Method* method, address location) {
1255   HandleMark hm(thread);
1256   methodHandle mh(thread, method);
1257 
1258   JvmtiThreadState *state = thread->jvmti_thread_state();
1259   if (state == NULL) {
1260     return;
1261   }
1262   JvmtiEnvThreadStateIterator it(state);
1263   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
1264     ets->compare_and_set_current_location(mh(), location, JVMTI_EVENT_SINGLE_STEP);
1265     if (!ets->single_stepping_posted() && ets->is_enabled(JVMTI_EVENT_SINGLE_STEP)) {
1266       EVT_TRACE(JVMTI_EVENT_SINGLE_STEP, ("JVMTI [%s] Evt Single Step sent %s.%s @ %d",
1267                     JvmtiTrace::safe_get_thread_name(thread),
1268                     (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
1269                     (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),


< prev index next >