< prev index next >

src/hotspot/share/runtime/thread.cpp

Print this page
rev 54213 : [mq]: 8220774-handshakealot-v3


2931   // written
2932   GrowableArray<jvmtiDeferredLocalVariableSet*>* list = deferred_locals();
2933   if (list != NULL) {
2934     for (int i = 0; i < list->length(); i++) {
2935       list->at(i)->oops_do(f);
2936     }
2937   }
2938 
2939   // Traverse instance variables at the end since the GC may be moving things
2940   // around using this function
2941   f->do_oop((oop*) &_threadObj);
2942   f->do_oop((oop*) &_vm_result);
2943   f->do_oop((oop*) &_exception_oop);
2944   f->do_oop((oop*) &_pending_async_exception);
2945 
2946   if (jvmti_thread_state() != NULL) {
2947     jvmti_thread_state()->oops_do(f);
2948   }
2949 }
2950 








2951 void JavaThread::nmethods_do(CodeBlobClosure* cf) {
2952   assert((!has_last_Java_frame() && java_call_counter() == 0) ||
2953          (has_last_Java_frame() && java_call_counter() > 0), "wrong java_sp info!");
2954 
2955   if (has_last_Java_frame()) {
2956     // Traverse the execution stack
2957     for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
2958       fst.current()->nmethods_do(cf);
2959     }
2960   }
2961 }
2962 
2963 void JavaThread::metadata_do(MetadataClosure* f) {
2964   if (has_last_Java_frame()) {
2965     // Traverse the execution stack to call f() on the methods in the stack
2966     for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
2967       fst.current()->metadata_do(f);
2968     }
2969   } else if (is_Compiler_thread()) {
2970     // need to walk ciMetadata in current compile tasks to keep alive.




2931   // written
2932   GrowableArray<jvmtiDeferredLocalVariableSet*>* list = deferred_locals();
2933   if (list != NULL) {
2934     for (int i = 0; i < list->length(); i++) {
2935       list->at(i)->oops_do(f);
2936     }
2937   }
2938 
2939   // Traverse instance variables at the end since the GC may be moving things
2940   // around using this function
2941   f->do_oop((oop*) &_threadObj);
2942   f->do_oop((oop*) &_vm_result);
2943   f->do_oop((oop*) &_exception_oop);
2944   f->do_oop((oop*) &_pending_async_exception);
2945 
2946   if (jvmti_thread_state() != NULL) {
2947     jvmti_thread_state()->oops_do(f);
2948   }
2949 }
2950 
2951 #ifdef ASSERT
2952 void JavaThread::verify_states_for_handshake() {
2953   // This checks that the thread has a correct frame state during a handshake.
2954   assert((!has_last_Java_frame() && java_call_counter() == 0) ||
2955          (has_last_Java_frame() && java_call_counter() > 0), "wrong java_sp info!");
2956 }
2957 #endif
2958 
2959 void JavaThread::nmethods_do(CodeBlobClosure* cf) {
2960   assert((!has_last_Java_frame() && java_call_counter() == 0) ||
2961          (has_last_Java_frame() && java_call_counter() > 0), "wrong java_sp info!");
2962 
2963   if (has_last_Java_frame()) {
2964     // Traverse the execution stack
2965     for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
2966       fst.current()->nmethods_do(cf);
2967     }
2968   }
2969 }
2970 
2971 void JavaThread::metadata_do(MetadataClosure* f) {
2972   if (has_last_Java_frame()) {
2973     // Traverse the execution stack to call f() on the methods in the stack
2974     for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
2975       fst.current()->metadata_do(f);
2976     }
2977   } else if (is_Compiler_thread()) {
2978     // need to walk ciMetadata in current compile tasks to keep alive.


< prev index next >