src/share/vm/runtime/safepoint.cpp

Print this page




 518     CompilationPolicy::policy()->do_safepoint_work();
 519   }
 520 
 521   {
 522     TraceTime t4("mark nmethods", TraceSafepointCleanupTime);
 523     NMethodSweeper::mark_active_nmethods();
 524   }
 525 
 526   if (SymbolTable::needs_rehashing()) {
 527     TraceTime t5("rehashing symbol table", TraceSafepointCleanupTime);
 528     SymbolTable::rehash_table();
 529   }
 530 
 531   if (StringTable::needs_rehashing()) {
 532     TraceTime t6("rehashing string table", TraceSafepointCleanupTime);
 533     StringTable::rehash_table();
 534   }
 535 
 536   // rotate log files?
 537   if (UseGCLogFileRotation) {
 538     gclog_or_tty->rotate_log();
 539   }
 540 
 541   if (MemTracker::is_on()) {
 542     MemTracker::sync();
 543   }
 544 }
 545 
 546 
 547 bool SafepointSynchronize::safepoint_safe(JavaThread *thread, JavaThreadState state) {
 548   switch(state) {
 549   case _thread_in_native:
 550     // native threads are safe if they have no java stack or have walkable stack
 551     return !thread->has_last_Java_frame() || thread->frame_anchor()->walkable();
 552 
 553    // blocked threads should have already have walkable stack
 554   case _thread_blocked:
 555     assert(!thread->has_last_Java_frame() || thread->frame_anchor()->walkable(), "blocked and not walkable");
 556     return true;
 557 
 558   default:




 518     CompilationPolicy::policy()->do_safepoint_work();
 519   }
 520 
 521   {
 522     TraceTime t4("mark nmethods", TraceSafepointCleanupTime);
 523     NMethodSweeper::mark_active_nmethods();
 524   }
 525 
 526   if (SymbolTable::needs_rehashing()) {
 527     TraceTime t5("rehashing symbol table", TraceSafepointCleanupTime);
 528     SymbolTable::rehash_table();
 529   }
 530 
 531   if (StringTable::needs_rehashing()) {
 532     TraceTime t6("rehashing string table", TraceSafepointCleanupTime);
 533     StringTable::rehash_table();
 534   }
 535 
 536   // rotate log files?
 537   if (UseGCLogFileRotation) {
 538     gclog_or_tty->rotate_log(false);
 539   }
 540 
 541   if (MemTracker::is_on()) {
 542     MemTracker::sync();
 543   }
 544 }
 545 
 546 
 547 bool SafepointSynchronize::safepoint_safe(JavaThread *thread, JavaThreadState state) {
 548   switch(state) {
 549   case _thread_in_native:
 550     // native threads are safe if they have no java stack or have walkable stack
 551     return !thread->has_last_Java_frame() || thread->frame_anchor()->walkable();
 552 
 553    // blocked threads should have already have walkable stack
 554   case _thread_blocked:
 555     assert(!thread->has_last_Java_frame() || thread->frame_anchor()->walkable(), "blocked and not walkable");
 556     return true;
 557 
 558   default: