1 /*
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.
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 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
27
28 #include "gc_implementation/g1/g1AllocationContext.hpp"
29 #include "gc_implementation/g1/g1BlockOffsetTable.hpp"
30 #include "gc_implementation/g1/heapRegionType.hpp"
31 #include "gc_implementation/g1/survRateGroup.hpp"
32 #include "gc_implementation/shared/ageTable.hpp"
33 #include "gc_implementation/shared/spaceDecorator.hpp"
34 #include "memory/watermark.hpp"
35 #include "utilities/macros.hpp"
36
37 // A HeapRegion is the smallest piece of a G1CollectedHeap that
38 // can be collected independently.
39
40 // NOTE: Although a HeapRegion is a Space, its
41 // Space::initDirtyCardClosure method must not be called.
42 // The problem is that the existence of this method breaks
43 // the independence of barrier sets from remembered sets.
44 // The solution is to remove this method from the definition
45 // of a Space.
46
47 class G1CollectedHeap;
48 class HeapRegionRemSet;
49 class HeapRegionRemSetIterator;
50 class HeapRegion;
51 class HeapRegionSetBase;
52 class nmethod;
53
54 #define HR_FORMAT "%u:(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]"
773 // HeapRegionClosure is used for iterating over regions.
774 // Terminates the iteration when the "doHeapRegion" method returns "true".
775 class HeapRegionClosure : public StackObj {
776 friend class HeapRegionManager;
777 friend class G1CollectedHeap;
778
779 bool _complete;
780 void incomplete() { _complete = false; }
781
782 public:
783 HeapRegionClosure(): _complete(true) {}
784
785 // Typically called on each region until it returns true.
786 virtual bool doHeapRegion(HeapRegion* r) = 0;
787
788 // True after iteration if the closure was applied to all heap regions
789 // and returned "false" in all cases.
790 bool complete() { return _complete; }
791 };
792
793 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
|
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 *
23 */
24
25 #ifndef SHARE_VM_GC_G1_HEAPREGION_HPP
26 #define SHARE_VM_GC_G1_HEAPREGION_HPP
27
28 #include "gc/g1/g1AllocationContext.hpp"
29 #include "gc/g1/g1BlockOffsetTable.hpp"
30 #include "gc/g1/heapRegionType.hpp"
31 #include "gc/g1/survRateGroup.hpp"
32 #include "gc/shared/ageTable.hpp"
33 #include "gc/shared/spaceDecorator.hpp"
34 #include "gc/shared/watermark.hpp"
35 #include "utilities/macros.hpp"
36
37 // A HeapRegion is the smallest piece of a G1CollectedHeap that
38 // can be collected independently.
39
40 // NOTE: Although a HeapRegion is a Space, its
41 // Space::initDirtyCardClosure method must not be called.
42 // The problem is that the existence of this method breaks
43 // the independence of barrier sets from remembered sets.
44 // The solution is to remove this method from the definition
45 // of a Space.
46
47 class G1CollectedHeap;
48 class HeapRegionRemSet;
49 class HeapRegionRemSetIterator;
50 class HeapRegion;
51 class HeapRegionSetBase;
52 class nmethod;
53
54 #define HR_FORMAT "%u:(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]"
773 // HeapRegionClosure is used for iterating over regions.
774 // Terminates the iteration when the "doHeapRegion" method returns "true".
775 class HeapRegionClosure : public StackObj {
776 friend class HeapRegionManager;
777 friend class G1CollectedHeap;
778
779 bool _complete;
780 void incomplete() { _complete = false; }
781
782 public:
783 HeapRegionClosure(): _complete(true) {}
784
785 // Typically called on each region until it returns true.
786 virtual bool doHeapRegion(HeapRegion* r) = 0;
787
788 // True after iteration if the closure was applied to all heap regions
789 // and returned "false" in all cases.
790 bool complete() { return _complete; }
791 };
792
793 #endif // SHARE_VM_GC_G1_HEAPREGION_HPP
|