@@ -1393,6 +1393,9 @@ SetForceEarlyReturn::doit(Thread *target, bool self) {
1393
1393
Thread* current_thread = Thread::current ();
1394
1394
HandleMark hm (current_thread);
1395
1395
1396
+ if (java_thread->is_exiting ()) {
1397
+ return ; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1398
+ }
1396
1399
if (!self) {
1397
1400
if (!java_thread->is_suspended ()) {
1398
1401
_result = JVMTI_ERROR_THREAD_NOT_SUSPENDED;
@@ -1523,6 +1526,10 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) {
1523
1526
Thread* current_thread = Thread::current ();
1524
1527
HandleMark hm (current_thread);
1525
1528
JavaThread* java_thread = JavaThread::cast (target);
1529
+
1530
+ if (java_thread->is_exiting ()) {
1531
+ return ; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1532
+ }
1526
1533
assert (java_thread == _state->get_thread (), " Must be" );
1527
1534
1528
1535
if (!self && !java_thread->is_suspended ()) {
@@ -1599,21 +1606,22 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) {
1599
1606
// It's fine to update the thread state here because no JVMTI events
1600
1607
// shall be posted for this PopFrame.
1601
1608
1602
- if (!java_thread->is_exiting () && java_thread->threadObj () != NULL ) {
1603
- _state->update_for_pop_top_frame ();
1604
- java_thread->set_popframe_condition (JavaThread::popframe_pending_bit);
1605
- // Set pending step flag for this popframe and it is cleared when next
1606
- // step event is posted.
1607
- _state->set_pending_step_for_popframe ();
1608
- _result = JVMTI_ERROR_NONE;
1609
- }
1609
+ _state->update_for_pop_top_frame ();
1610
+ java_thread->set_popframe_condition (JavaThread::popframe_pending_bit);
1611
+ // Set pending step flag for this popframe and it is cleared when next
1612
+ // step event is posted.
1613
+ _state->set_pending_step_for_popframe ();
1614
+ _result = JVMTI_ERROR_NONE;
1610
1615
}
1611
1616
1612
1617
void
1613
1618
SetFramePopClosure::doit (Thread *target, bool self) {
1614
1619
ResourceMark rm;
1615
1620
JavaThread* java_thread = JavaThread::cast (target);
1616
1621
1622
+ if (java_thread->is_exiting ()) {
1623
+ return ; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1624
+ }
1617
1625
assert (_state->get_thread () == java_thread, " Must be" );
1618
1626
1619
1627
if (!self && !java_thread->is_suspended ()) {
@@ -1633,9 +1641,6 @@ SetFramePopClosure::doit(Thread *target, bool self) {
1633
1641
}
1634
1642
1635
1643
assert (vf->frame_pointer () != NULL , " frame pointer mustn't be NULL" );
1636
- if (java_thread->is_exiting () || java_thread->threadObj () == NULL ) {
1637
- return ; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1638
- }
1639
1644
int frame_number = _state->count_frames () - _depth;
1640
1645
_state->env_thread_state ((JvmtiEnvBase*)_env)->set_frame_pop (frame_number);
1641
1646
_result = JVMTI_ERROR_NONE;
0 commit comments