< prev index next >

src/hotspot/share/prims/jvmtiExport.cpp

Print this page




1572     return;
1573   }
1574 
1575   // return a flag when a method terminates by throwing an exception
1576   // i.e. if an exception is thrown and it's not caught by the current method
1577   bool exception_exit = state->is_exception_detected() && !state->is_exception_caught();
1578 
1579 
1580   if (state->is_enabled(JVMTI_EVENT_METHOD_EXIT)) {
1581     Handle result;
1582     jvalue value;
1583     value.j = 0L;
1584 
1585     // if the method hasn't been popped because of an exception then we populate
1586     // the return_value parameter for the callback. At this point we only have
1587     // the address of a "raw result" and we just call into the interpreter to
1588     // convert this into a jvalue.
1589     if (!exception_exit) {
1590       oop oop_result;
1591       BasicType type = current_frame.interpreter_frame_result(&oop_result, &value);
1592       if (type == T_OBJECT || type == T_ARRAY) {
1593         result = Handle(thread, oop_result);
1594       }
1595     }
1596 
1597     JvmtiEnvThreadStateIterator it(state);
1598     for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
1599       if (ets->is_enabled(JVMTI_EVENT_METHOD_EXIT)) {
1600         EVT_TRACE(JVMTI_EVENT_METHOD_EXIT, ("[%s] Evt Method Exit sent %s.%s",
1601                                             JvmtiTrace::safe_get_thread_name(thread),
1602                                             (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
1603                                             (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
1604 
1605         JvmtiEnv *env = ets->get_env();
1606         JvmtiMethodEventMark jem(thread, mh);
1607         if (result.not_null()) {
1608           value.l = JNIHandles::make_local(thread, result());
1609         }
1610         JvmtiJavaThreadEventTransition jet(thread);
1611         jvmtiEventMethodExit callback = env->callbacks()->MethodExit;
1612         if (callback != NULL) {




1572     return;
1573   }
1574 
1575   // return a flag when a method terminates by throwing an exception
1576   // i.e. if an exception is thrown and it's not caught by the current method
1577   bool exception_exit = state->is_exception_detected() && !state->is_exception_caught();
1578 
1579 
1580   if (state->is_enabled(JVMTI_EVENT_METHOD_EXIT)) {
1581     Handle result;
1582     jvalue value;
1583     value.j = 0L;
1584 
1585     // if the method hasn't been popped because of an exception then we populate
1586     // the return_value parameter for the callback. At this point we only have
1587     // the address of a "raw result" and we just call into the interpreter to
1588     // convert this into a jvalue.
1589     if (!exception_exit) {
1590       oop oop_result;
1591       BasicType type = current_frame.interpreter_frame_result(&oop_result, &value);
1592       if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) {
1593         result = Handle(thread, oop_result);
1594       }
1595     }
1596 
1597     JvmtiEnvThreadStateIterator it(state);
1598     for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
1599       if (ets->is_enabled(JVMTI_EVENT_METHOD_EXIT)) {
1600         EVT_TRACE(JVMTI_EVENT_METHOD_EXIT, ("[%s] Evt Method Exit sent %s.%s",
1601                                             JvmtiTrace::safe_get_thread_name(thread),
1602                                             (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
1603                                             (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
1604 
1605         JvmtiEnv *env = ets->get_env();
1606         JvmtiMethodEventMark jem(thread, mh);
1607         if (result.not_null()) {
1608           value.l = JNIHandles::make_local(thread, result());
1609         }
1610         JvmtiJavaThreadEventTransition jet(thread);
1611         jvmtiEventMethodExit callback = env->callbacks()->MethodExit;
1612         if (callback != NULL) {


< prev index next >