< prev index next >
src/share/vm/runtime/thread.cpp
Print this page
rev 13526 : [mq]: 13512.patch
*** 335,344 ****
--- 335,347 ----
p2i(stack_base()), stack_size()/1024);
}
Thread::~Thread() {
+ // Reclaim the objectmonitors from the omFreeList of the moribund thread.
+ ObjectSynchronizer::omFlush(this);
+
EVENT_THREAD_DESTRUCT(this);
// stack_base can be NULL if the thread is never started or exited before
// record_stack_base_and_size called. Although, we would like to ensure
// that all started threads do call record_stack_base_and_size(), there is
*** 788,805 ****
void Thread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
active_handles()->oops_do(f);
// Do oop for ThreadShadow
f->do_oop((oop*)&_pending_exception);
handle_area()->oops_do(f);
- if (MonitorInUseLists) {
- VM_Operation* op = VMThread::vm_operation();
- if (op != NULL && op->deflates_idle_monitors()) {
- ObjectSynchronizer::deflate_idle_monitors_and_oops_do(this, f);
- } else {
- ObjectSynchronizer::thread_local_used_oops_do(this, f);
- }
- }
}
void Thread::metadata_handles_do(void f(Metadata*)) {
// Only walk the Handles in Thread.
if (metadata_handles() != NULL) {
--- 791,800 ----
*** 3410,3428 ****
}
// If CompilerThreads ever become non-JavaThreads, add them here
}
- void Threads::parallel_java_threads_do(ThreadClosure* tc) {
- int cp = Threads::thread_claim_parity();
- ALL_JAVA_THREADS(p) {
- if (p->claim_oops_do(true, cp)) {
- tc->do_thread(p);
- }
- }
- }
-
// The system initialization in the library has three phases.
//
// Phase 1: java.lang.System class initialization
// java.lang.System is a primordial class loaded and initialized
// by the VM early during startup. java.lang.System.<clinit>
--- 3405,3414 ----
*** 4296,4309 ****
// Possible GC point.
Events::log(p, "Thread added: " INTPTR_FORMAT, p2i(p));
}
void Threads::remove(JavaThread* p) {
-
- // Reclaim the objectmonitors from the omInUseList and omFreeList of the moribund thread.
- ObjectSynchronizer::omFlush(p);
-
// Extra scope needed for Thread_lock, so we can check
// that we do not remove thread without safepoint code notice
{ MutexLocker ml(Threads_lock);
assert(includes(p), "p must be present");
--- 4282,4291 ----
*** 4390,4407 ****
"Thread " PTR_FORMAT " has incorrect parity %d != %d", p2i(p), thread_parity, _thread_claim_parity);
}
}
#endif // ASSERT
! void Threads::possibly_parallel_oops_do(bool is_par, OopClosure* f, CodeBlobClosure* cf, CodeBlobClosure* nmethods_cl) {
int cp = Threads::thread_claim_parity();
ALL_JAVA_THREADS(p) {
if (p->claim_oops_do(is_par, cp)) {
p->oops_do(f, cf);
- if (nmethods_cl != NULL && ! p->is_Code_cache_sweeper_thread()) {
- p->nmethods_do(nmethods_cl);
- }
}
}
VMThread* vmt = VMThread::vm_thread();
if (vmt->claim_oops_do(is_par, cp)) {
vmt->oops_do(f, cf);
--- 4372,4386 ----
"Thread " PTR_FORMAT " has incorrect parity %d != %d", p2i(p), thread_parity, _thread_claim_parity);
}
}
#endif // ASSERT
! void Threads::possibly_parallel_oops_do(bool is_par, OopClosure* f, CodeBlobClosure* cf) {
int cp = Threads::thread_claim_parity();
ALL_JAVA_THREADS(p) {
if (p->claim_oops_do(is_par, cp)) {
p->oops_do(f, cf);
}
}
VMThread* vmt = VMThread::vm_thread();
if (vmt->claim_oops_do(is_par, cp)) {
vmt->oops_do(f, cf);
< prev index next >