Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 4783:023652e49ac0
7121496: G1: do the per-region evacuation failure handling work in parallel
Summary: Parallelize the removal of self forwarding pointers etc. by wrapping in a HeapRegion closure, which is then wrapped inside an AbstractGangTask.
Reviewed-by: tonyp, iveresov
author | johnc |
---|---|
date | Fri, 23 Dec 2011 11:14:18 -0800 |
parents | 776173fc2df9 |
children | 2ace1c4ee8da |
comparison
equal
deleted
inserted
replaced
4782:5fd354a959c5 | 4783:023652e49ac0 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
3078 } | 3078 } |
3079 return false; | 3079 return false; |
3080 } | 3080 } |
3081 }; | 3081 }; |
3082 | 3082 |
3083 class SetClaimValuesInCSetHRClosure: public HeapRegionClosure { | |
3084 jint _claim_value; | |
3085 | |
3086 public: | |
3087 SetClaimValuesInCSetHRClosure(jint claim_value) : | |
3088 _claim_value(claim_value) { } | |
3089 | |
3090 bool doHeapRegion(HeapRegion* hr) { | |
3091 hr->set_claim_value(_claim_value); | |
3092 return false; | |
3093 } | |
3094 }; | |
3095 | |
3096 class G1ParCompleteMarkInCSetTask: public AbstractGangTask { | 3083 class G1ParCompleteMarkInCSetTask: public AbstractGangTask { |
3097 protected: | 3084 protected: |
3098 G1CollectedHeap* _g1h; | 3085 G1CollectedHeap* _g1h; |
3099 ConcurrentMark* _cm; | 3086 ConcurrentMark* _cm; |
3100 | 3087 |
3133 complete_mark_task.work(0); | 3120 complete_mark_task.work(0); |
3134 } | 3121 } |
3135 | 3122 |
3136 assert(g1h->check_cset_heap_region_claim_values(HeapRegion::CompleteMarkCSetClaimValue), "sanity"); | 3123 assert(g1h->check_cset_heap_region_claim_values(HeapRegion::CompleteMarkCSetClaimValue), "sanity"); |
3137 | 3124 |
3138 // Now reset the claim values in the regions in the collection set. | 3125 // Reset the claim values in the regions in the collection set. |
3139 SetClaimValuesInCSetHRClosure set_cv_cl(HeapRegion::InitialClaimValue); | 3126 g1h->reset_cset_heap_region_claim_values(); |
3140 g1h->collection_set_iterate(&set_cv_cl); | |
3141 | 3127 |
3142 assert(g1h->check_cset_heap_region_claim_values(HeapRegion::InitialClaimValue), "sanity"); | 3128 assert(g1h->check_cset_heap_region_claim_values(HeapRegion::InitialClaimValue), "sanity"); |
3143 | 3129 |
3144 double end_time = os::elapsedTime(); | 3130 double end_time = os::elapsedTime(); |
3145 double elapsed_time_ms = (end_time - start) * 1000.0; | 3131 double elapsed_time_ms = (end_time - start) * 1000.0; |