comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 17755:96b1c2e06e25

8027295: Free CSet takes ~50% of young pause time Summary: Improve fast card cache iteration and avoid taking locks when freeing the collection set. Reviewed-by: brutisso
author tschatzl
date Mon, 24 Mar 2014 15:30:36 +0100
parents 191174b49bec
children 8ee855b4e667
comparison
equal deleted inserted replaced
17754:d7070f371770 17755:96b1c2e06e25
1 /* 1 /*
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2014, 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.
203 // treat all objects as being inside the unmarked area. 203 // treat all objects as being inside the unmarked area.
204 zero_marked_bytes(); 204 zero_marked_bytes();
205 init_top_at_mark_start(); 205 init_top_at_mark_start();
206 } 206 }
207 207
208 void HeapRegion::hr_clear(bool par, bool clear_space) { 208 void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
209 assert(_humongous_type == NotHumongous, 209 assert(_humongous_type == NotHumongous,
210 "we should have already filtered out humongous regions"); 210 "we should have already filtered out humongous regions");
211 assert(_humongous_start_region == NULL, 211 assert(_humongous_start_region == NULL,
212 "we should have already filtered out humongous regions"); 212 "we should have already filtered out humongous regions");
213 assert(_end == _orig_end, 213 assert(_end == _orig_end,
221 reset_pre_dummy_top(); 221 reset_pre_dummy_top();
222 222
223 if (!par) { 223 if (!par) {
224 // If this is parallel, this will be done later. 224 // If this is parallel, this will be done later.
225 HeapRegionRemSet* hrrs = rem_set(); 225 HeapRegionRemSet* hrrs = rem_set();
226 hrrs->clear(); 226 if (locked) {
227 hrrs->clear_locked();
228 } else {
229 hrrs->clear();
230 }
227 _claimed = InitialClaimValue; 231 _claimed = InitialClaimValue;
228 } 232 }
229 zero_marked_bytes(); 233 zero_marked_bytes();
230 234
231 _offsets.resize(HeapRegion::GrainWords); 235 _offsets.resize(HeapRegion::GrainWords);