< prev index next >

src/hotspot/share/prims/jvmtiTagMap.cpp

Print this page
rev 47287 : Port 09.17.Thread_SMR_logging_update from JDK9 to JDK10
rev 47289 : eosterlund, stefank CR - refactor code into threadSMR.cpp and threadSMR.hpp
rev 47290 : eosterlund CR - need more inline fixes.
rev 47292 : stefank, coleenp CR - refactor most JavaThreadIterator usage to use JavaThreadIteratorWithHandle.


3160         }
3161       }
3162 
3163       vf = vf->sender();
3164       is_top_frame = false;
3165     }
3166   } else {
3167     // no last java frame but there may be JNI locals
3168     blk->set_context(thread_tag, tid, 0, (jmethodID)NULL);
3169     java_thread->active_handles()->oops_do(blk);
3170   }
3171   return true;
3172 }
3173 
3174 
3175 // Collects the simple roots for all threads and collects all
3176 // stack roots - for each thread it walks the execution
3177 // stack to find all references and local JNI refs.
3178 inline bool VM_HeapWalkOperation::collect_stack_roots() {
3179   JNILocalRootsClosure blk;
3180   ThreadsListHandle tlh;
3181   JavaThreadIterator jti(tlh.list());
3182   for (JavaThread* thread = jti.first(); thread != NULL; thread = jti.next()) {
3183     oop threadObj = thread->threadObj();
3184     if (threadObj != NULL && !thread->is_exiting() && !thread->is_hidden_from_external_view()) {
3185       // Collect the simple root for this thread before we
3186       // collect its stack roots
3187       if (!CallbackInvoker::report_simple_root(JVMTI_HEAP_REFERENCE_THREAD,
3188                                                threadObj)) {
3189         return false;
3190       }
3191       if (!collect_stack_roots(thread, &blk)) {
3192         return false;
3193       }
3194     }
3195   }
3196   return true;
3197 }
3198 
3199 // visit an object
3200 // first mark the object as visited
3201 // second get all the outbound references from this object (in other words, all
3202 // the objects referenced by this object).




3160         }
3161       }
3162 
3163       vf = vf->sender();
3164       is_top_frame = false;
3165     }
3166   } else {
3167     // no last java frame but there may be JNI locals
3168     blk->set_context(thread_tag, tid, 0, (jmethodID)NULL);
3169     java_thread->active_handles()->oops_do(blk);
3170   }
3171   return true;
3172 }
3173 
3174 
3175 // Collects the simple roots for all threads and collects all
3176 // stack roots - for each thread it walks the execution
3177 // stack to find all references and local JNI refs.
3178 inline bool VM_HeapWalkOperation::collect_stack_roots() {
3179   JNILocalRootsClosure blk;
3180   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {


3181     oop threadObj = thread->threadObj();
3182     if (threadObj != NULL && !thread->is_exiting() && !thread->is_hidden_from_external_view()) {
3183       // Collect the simple root for this thread before we
3184       // collect its stack roots
3185       if (!CallbackInvoker::report_simple_root(JVMTI_HEAP_REFERENCE_THREAD,
3186                                                threadObj)) {
3187         return false;
3188       }
3189       if (!collect_stack_roots(thread, &blk)) {
3190         return false;
3191       }
3192     }
3193   }
3194   return true;
3195 }
3196 
3197 // visit an object
3198 // first mark the object as visited
3199 // second get all the outbound references from this object (in other words, all
3200 // the objects referenced by this object).


< prev index next >