Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 989:148e5441d916
6863023: need non-perm oops in code cache for JSR 292
Summary: Make a special root-list for those few nmethods which might contain non-perm oops.
Reviewed-by: twisti, kvn, never, jmasa, ysr
author | jrose |
---|---|
date | Tue, 15 Sep 2009 21:53:47 -0700 |
parents | 6cb8e9df7174 |
children | 54b3b351d6f9 |
comparison
equal
deleted
inserted
replaced
987:00977607da34 | 989:148e5441d916 |
---|---|
2297 bool silent, | 2297 bool silent, |
2298 bool use_prev_marking) { | 2298 bool use_prev_marking) { |
2299 if (SafepointSynchronize::is_at_safepoint() || ! UseTLAB) { | 2299 if (SafepointSynchronize::is_at_safepoint() || ! UseTLAB) { |
2300 if (!silent) { gclog_or_tty->print("roots "); } | 2300 if (!silent) { gclog_or_tty->print("roots "); } |
2301 VerifyRootsClosure rootsCl(use_prev_marking); | 2301 VerifyRootsClosure rootsCl(use_prev_marking); |
2302 process_strong_roots(false, | 2302 CodeBlobToOopClosure blobsCl(&rootsCl, /*do_marking=*/ false); |
2303 process_strong_roots(true, // activate StrongRootsScope | |
2304 false, | |
2303 SharedHeap::SO_AllClasses, | 2305 SharedHeap::SO_AllClasses, |
2304 &rootsCl, | 2306 &rootsCl, |
2307 &blobsCl, | |
2305 &rootsCl); | 2308 &rootsCl); |
2306 rem_set()->invalidate(perm_gen()->used_region(), false); | 2309 rem_set()->invalidate(perm_gen()->used_region(), false); |
2307 if (!silent) { gclog_or_tty->print("heapRegions "); } | 2310 if (!silent) { gclog_or_tty->print("heapRegions "); } |
2308 if (GCParallelVerificationEnabled && ParallelGCThreads > 1) { | 2311 if (GCParallelVerificationEnabled && ParallelGCThreads > 1) { |
2309 assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue), | 2312 assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue), |
3990 | 3993 |
3991 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); | 3994 BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); |
3992 BufferingOopsInGenClosure buf_scan_perm(scan_perm); | 3995 BufferingOopsInGenClosure buf_scan_perm(scan_perm); |
3993 buf_scan_perm.set_generation(perm_gen()); | 3996 buf_scan_perm.set_generation(perm_gen()); |
3994 | 3997 |
3995 process_strong_roots(collecting_perm_gen, so, | 3998 // Walk the code cache w/o buffering, because StarTask cannot handle |
3999 // unaligned oop locations. | |
4000 CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, /*do_marking=*/ true); | |
4001 | |
4002 process_strong_roots(false, // no scoping; this is parallel code | |
4003 collecting_perm_gen, so, | |
3996 &buf_scan_non_heap_roots, | 4004 &buf_scan_non_heap_roots, |
4005 &eager_scan_code_roots, | |
3997 &buf_scan_perm); | 4006 &buf_scan_perm); |
3998 // Finish up any enqueued closure apps. | 4007 // Finish up any enqueued closure apps. |
3999 buf_scan_non_heap_roots.done(); | 4008 buf_scan_non_heap_roots.done(); |
4000 buf_scan_perm.done(); | 4009 buf_scan_perm.done(); |
4001 double ext_roots_end = os::elapsedTime(); | 4010 double ext_roots_end = os::elapsedTime(); |
4081 } | 4090 } |
4082 | 4091 |
4083 void | 4092 void |
4084 G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure, | 4093 G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure, |
4085 OopClosure* non_root_closure) { | 4094 OopClosure* non_root_closure) { |
4086 SharedHeap::process_weak_roots(root_closure, non_root_closure); | 4095 CodeBlobToOopClosure roots_in_blobs(root_closure, /*do_marking=*/ false); |
4096 SharedHeap::process_weak_roots(root_closure, &roots_in_blobs, non_root_closure); | |
4087 } | 4097 } |
4088 | 4098 |
4089 | 4099 |
4090 class SaveMarksClosure: public HeapRegionClosure { | 4100 class SaveMarksClosure: public HeapRegionClosure { |
4091 public: | 4101 public: |
4115 set_par_threads(n_workers); | 4125 set_par_threads(n_workers); |
4116 G1ParTask g1_par_task(this, n_workers, _task_queues); | 4126 G1ParTask g1_par_task(this, n_workers, _task_queues); |
4117 | 4127 |
4118 init_for_evac_failure(NULL); | 4128 init_for_evac_failure(NULL); |
4119 | 4129 |
4120 change_strong_roots_parity(); // In preparation for parallel strong roots. | |
4121 rem_set()->prepare_for_younger_refs_iterate(true); | 4130 rem_set()->prepare_for_younger_refs_iterate(true); |
4122 | 4131 |
4123 assert(dirty_card_queue_set().completed_buffers_num() == 0, "Should be empty"); | 4132 assert(dirty_card_queue_set().completed_buffers_num() == 0, "Should be empty"); |
4124 double start_par = os::elapsedTime(); | 4133 double start_par = os::elapsedTime(); |
4125 if (ParallelGCThreads > 0) { | 4134 if (ParallelGCThreads > 0) { |
4126 // The individual threads will set their evac-failure closures. | 4135 // The individual threads will set their evac-failure closures. |
4136 StrongRootsScope srs(this); | |
4127 workers()->run_task(&g1_par_task); | 4137 workers()->run_task(&g1_par_task); |
4128 } else { | 4138 } else { |
4139 StrongRootsScope srs(this); | |
4129 g1_par_task.work(0); | 4140 g1_par_task.work(0); |
4130 } | 4141 } |
4131 | 4142 |
4132 double par_time = (os::elapsedTime() - start_par) * 1000.0; | 4143 double par_time = (os::elapsedTime() - start_par) * 1000.0; |
4133 g1_policy()->record_par_time(par_time); | 4144 g1_policy()->record_par_time(par_time); |