comparison src/share/vm/prims/jvmtiEnvBase.hpp @ 14321:e4062d6c5f22

8032223: nsk/regression/b4663146 gets assert(SafepointSynchronize::is_at_safepoint() || JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits)) Summary: It is better to calculate frame count for suspended threads at a safepoint Reviewed-by: twisti, dsamersoff, sla, dholmes, dcubed Contributed-by: serguei.spitsyn@oracle.com
author sspitsyn
date Tue, 04 Feb 2014 19:41:46 -0800
parents de6a9e811145
children 402677ca28ed
comparison
equal deleted inserted replaced
14320:602e80a36dfb 14321:e4062d6c5f22
531 _count_ptr = count_ptr; 531 _count_ptr = count_ptr;
532 } 532 }
533 VMOp_Type type() const { return VMOp_GetFrameCount; } 533 VMOp_Type type() const { return VMOp_GetFrameCount; }
534 jvmtiError result() { return _result; } 534 jvmtiError result() { return _result; }
535 void doit() { 535 void doit() {
536 _result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr); 536 _result = JVMTI_ERROR_THREAD_NOT_ALIVE;
537 JavaThread* jt = _state->get_thread();
538 if (Threads::includes(jt) && !jt->is_exiting() && jt->threadObj() != NULL) {
539 _result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr);
540 }
537 } 541 }
538 }; 542 };
539 543
540 // VM operation to frame location at safepoint. 544 // VM operation to frame location at safepoint.
541 class VM_GetFrameLocation : public VM_Operation { 545 class VM_GetFrameLocation : public VM_Operation {
557 _location_ptr = location_ptr; 561 _location_ptr = location_ptr;
558 } 562 }
559 VMOp_Type type() const { return VMOp_GetFrameLocation; } 563 VMOp_Type type() const { return VMOp_GetFrameLocation; }
560 jvmtiError result() { return _result; } 564 jvmtiError result() { return _result; }
561 void doit() { 565 void doit() {
562 _result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth, 566 _result = JVMTI_ERROR_THREAD_NOT_ALIVE;
563 _method_ptr, _location_ptr); 567 if (Threads::includes(_java_thread) && !_java_thread->is_exiting() &&
568 _java_thread->threadObj() != NULL) {
569 _result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth,
570 _method_ptr, _location_ptr);
571 }
564 } 572 }
565 }; 573 };
566 574
567 575
568 // ResourceTracker 576 // ResourceTracker