< prev index next >

src/hotspot/share/runtime/thread.cpp

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


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.
2979     CompilerThread* ct = (CompilerThread*)this;
2980     if (ct->env() != NULL) {
2981       ct->env()->metadata_do(f);




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),
2956          "unexpected frame info: has_last_frame=%d, java_call_counter=%d",
2957          has_last_Java_frame(), java_call_counter());
2958 }
2959 #endif
2960 
2961 void JavaThread::nmethods_do(CodeBlobClosure* cf) {
2962   assert((!has_last_Java_frame() && java_call_counter() == 0) ||
2963          (has_last_Java_frame() && java_call_counter() > 0),
2964          "unexpected frame info: has_last_frame=%d, java_call_counter=%d",
2965          has_last_Java_frame(), java_call_counter());
2966 
2967   if (has_last_Java_frame()) {
2968     // Traverse the execution stack
2969     for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
2970       fst.current()->nmethods_do(cf);
2971     }
2972   }
2973 }
2974 
2975 void JavaThread::metadata_do(MetadataClosure* f) {
2976   if (has_last_Java_frame()) {
2977     // Traverse the execution stack to call f() on the methods in the stack
2978     for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
2979       fst.current()->metadata_do(f);
2980     }
2981   } else if (is_Compiler_thread()) {
2982     // need to walk ciMetadata in current compile tasks to keep alive.
2983     CompilerThread* ct = (CompilerThread*)this;
2984     if (ct->env() != NULL) {
2985       ct->env()->metadata_do(f);


< prev index next >