Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/thread.cpp @ 3979:4dfb2df418f2
6484982: G1: process references during evacuation pauses
Summary: G1 now uses two reference processors - one is used by concurrent marking and the other is used by STW GCs (both full and incremental evacuation pauses). In an evacuation pause, the reference processor is embedded into the closures used to scan objects. Doing so causes causes reference objects to be 'discovered' by the reference processor. At the end of the evacuation pause, these discovered reference objects are processed - preserving (and copying) referent objects (and their reachable graphs) as appropriate.
Reviewed-by: ysr, jwilhelm, brutisso, stefank, tonyp
author | johnc |
---|---|
date | Thu, 22 Sep 2011 10:57:37 -0700 |
parents | e6b1331a51d2 |
children | fd65bc7c09b6 |
comparison
equal
deleted
inserted
replaced
3978:f0ecbe78fc7b | 3979:4dfb2df418f2 |
---|---|
747 // GC Support | 747 // GC Support |
748 bool Thread::claim_oops_do_par_case(int strong_roots_parity) { | 748 bool Thread::claim_oops_do_par_case(int strong_roots_parity) { |
749 jint thread_parity = _oops_do_parity; | 749 jint thread_parity = _oops_do_parity; |
750 if (thread_parity != strong_roots_parity) { | 750 if (thread_parity != strong_roots_parity) { |
751 jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity); | 751 jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity); |
752 if (res == thread_parity) return true; | 752 if (res == thread_parity) { |
753 else { | 753 return true; |
754 } else { | |
754 guarantee(res == strong_roots_parity, "Or else what?"); | 755 guarantee(res == strong_roots_parity, "Or else what?"); |
755 assert(SharedHeap::heap()->n_par_threads() > 0, | 756 assert(SharedHeap::heap()->n_par_threads() > 0, |
756 "Should only fail when parallel."); | 757 "Should only fail when parallel."); |
757 return false; | 758 return false; |
758 } | 759 } |
3903 if (p->claim_oops_do(is_par, cp)) { | 3904 if (p->claim_oops_do(is_par, cp)) { |
3904 p->oops_do(f, cf); | 3905 p->oops_do(f, cf); |
3905 } | 3906 } |
3906 } | 3907 } |
3907 VMThread* vmt = VMThread::vm_thread(); | 3908 VMThread* vmt = VMThread::vm_thread(); |
3908 if (vmt->claim_oops_do(is_par, cp)) | 3909 if (vmt->claim_oops_do(is_par, cp)) { |
3909 vmt->oops_do(f, cf); | 3910 vmt->oops_do(f, cf); |
3911 } | |
3910 } | 3912 } |
3911 | 3913 |
3912 #ifndef SERIALGC | 3914 #ifndef SERIALGC |
3913 // Used by ParallelScavenge | 3915 // Used by ParallelScavenge |
3914 void Threads::create_thread_roots_tasks(GCTaskQueue* q) { | 3916 void Threads::create_thread_roots_tasks(GCTaskQueue* q) { |