2037N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 2037N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2037N/A * This code is free software; you can redistribute it and/or modify it 2037N/A * under the terms of the GNU General Public License version 2 only, as 2037N/A * published by the Free Software Foundation. 2037N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2037N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2037N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2037N/A * version 2 for more details (a copy is included in the LICENSE file that 2037N/A * You should have received a copy of the GNU General Public License version 2037N/A * 2 along with this work; if not, write to the Free Software Foundation, 2037N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2037N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2910N/A// Note on the check_mt_safety() methods below: 2910N/A// Verification of the "master" heap region sets / lists that are 2910N/A// maintained by G1CollectedHeap is always done during a STW pause and 2910N/A// by the VM thread at the start / end of the pause. The standard 2910N/A// verification methods all assert check_mt_safety(). This is 2910N/A// important as it ensures that verification is done without 2910N/A// concurrent updates taking place at the same time. It follows, that, 2910N/A// for the "master" heap region sets / lists, the check_mt_safety() 2910N/A// method should include the VM thread / STW case. 2037N/A//////////////////// FreeRegionList //////////////////// 2037N/A return "the region should not be young";
2037N/A // The superclass will check that the region is empty and 2037N/A//////////////////// MasterFreeRegionList //////////////////// 2602N/A // We should reset the RSet for parallel iteration before we add it 2602N/A // to the master free list so that it is ready when the region is 2602N/A return "the region's RSet should be ready for parallel iteration";
2037N/A // Master Free List MT safety protocol: 2037N/A // (a) If we're at a safepoint, operations on the master free list 2037N/A // should be invoked by either the VM thread (which will serialize 2037N/A // them) or by the GC workers while holding the 2037N/A // (b) If we're not at a safepoint, operations on the master free 2037N/A // list should be invoked while holding the Heap_lock. 2037N/A//////////////////// SecondaryFreeRegionList //////////////////// 2037N/A // Secondary Free List MT safety protocol: 2037N/A // Operations on the secondary free list should always be invoked 2037N/A // while holding the SecondaryFreeList_lock. 2910N/A//////////////////// OldRegionSet //////////////////// 2910N/A return "the region should not be young";
2910N/A // The superclass will check that the region is not empty and not 2910N/A//////////////////// MasterOldRegionSet //////////////////// 2910N/A // Master Old Set MT safety protocol: 2910N/A // (a) If we're at a safepoint, operations on the master old set 2910N/A // - by the VM thread (which will serialize them), or 2910N/A // - by the GC workers while holding the FreeList_lock, if we're 2910N/A // at a safepoint for an evacuation pause (this lock is taken 2910N/A // anyway when an GC alloc region is retired so that a new one 2910N/A // is allocated from the free list), or 2910N/A // - by the GC workers while holding the OldSets_lock, if we're at a 2910N/A // safepoint for a cleanup pause. 2910N/A // (b) If we're not at a safepoint, operations on the master old set 2910N/A // should be invoked while holding the Heap_lock. 2037N/A//////////////////// HumongousRegionSet //////////////////// 2037N/A return "the region should not be young";
2037N/A // The superclass will check that the region is not empty and 2208N/A//////////////////// MasterHumongousRegionSet //////////////////// 2037N/A // Master Humongous Set MT safety protocol: 2037N/A // (a) If we're at a safepoint, operations on the master humongous 2037N/A // set should be invoked by either the VM thread (which will 2037N/A // serialize them) or by the GC workers while holding the 2037N/A // (b) If we're not at a safepoint, operations on the master 2037N/A // humongous set should be invoked while holding the Heap_lock.