1 /*
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
2254 uint active_workers = g1h->workers()->active_workers();
2255 set_concurrency_and_phase(active_workers, false /* concurrent */);
2256 // Leave _parallel_marking_threads at it's
2257 // value originally calculated in the G1ConcurrentMark
2258 // constructor and pass values of the active workers
2259 // through the gang in the task.
2260
2261 {
2262 StrongRootsScope srs(active_workers);
2263
2264 G1CMRemarkTask remarkTask(this, active_workers);
2265 // We will start all available threads, even if we decide that the
2266 // active_workers will be fewer. The extra ones will just bail out
2267 // immediately.
2268 g1h->workers()->run_task(&remarkTask);
2269 }
2270
2271 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
2272 guarantee(has_overflown() ||
2273 satb_mq_set.completed_buffers_num() == 0,
2274 "Invariant: has_overflown = %s, num buffers = %d",
2275 BOOL_TO_STR(has_overflown()),
2276 satb_mq_set.completed_buffers_num());
2277
2278 print_stats();
2279 }
2280
2281 void G1ConcurrentMark::clearRangePrevBitmap(MemRegion mr) {
2282 // Note we are overriding the read-only view of the prev map here, via
2283 // the cast.
2284 ((G1CMBitMap*)_prevMarkBitMap)->clearRange(mr);
2285 }
2286
2287 HeapRegion*
2288 G1ConcurrentMark::claim_region(uint worker_id) {
2289 // "checkpoint" the finger
2290 HeapWord* finger = _finger;
2291
2292 // _heap_end will not change underneath our feet; it only changes at
2293 // yield points.
2294 while (finger < _heap_end) {
|
1 /*
2 * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
2254 uint active_workers = g1h->workers()->active_workers();
2255 set_concurrency_and_phase(active_workers, false /* concurrent */);
2256 // Leave _parallel_marking_threads at it's
2257 // value originally calculated in the G1ConcurrentMark
2258 // constructor and pass values of the active workers
2259 // through the gang in the task.
2260
2261 {
2262 StrongRootsScope srs(active_workers);
2263
2264 G1CMRemarkTask remarkTask(this, active_workers);
2265 // We will start all available threads, even if we decide that the
2266 // active_workers will be fewer. The extra ones will just bail out
2267 // immediately.
2268 g1h->workers()->run_task(&remarkTask);
2269 }
2270
2271 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
2272 guarantee(has_overflown() ||
2273 satb_mq_set.completed_buffers_num() == 0,
2274 "Invariant: has_overflown = %s, num buffers = " SIZE_FORMAT,
2275 BOOL_TO_STR(has_overflown()),
2276 satb_mq_set.completed_buffers_num());
2277
2278 print_stats();
2279 }
2280
2281 void G1ConcurrentMark::clearRangePrevBitmap(MemRegion mr) {
2282 // Note we are overriding the read-only view of the prev map here, via
2283 // the cast.
2284 ((G1CMBitMap*)_prevMarkBitMap)->clearRange(mr);
2285 }
2286
2287 HeapRegion*
2288 G1ConcurrentMark::claim_region(uint worker_id) {
2289 // "checkpoint" the finger
2290 HeapWord* finger = _finger;
2291
2292 // _heap_end will not change underneath our feet; it only changes at
2293 // yield points.
2294 while (finger < _heap_end) {
|