1 /*
 2  * Copyright (c) 2021, 2023, 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_GC_G1_G1YOUNGGCPOSTEVACUATETASKS_HPP
26 #define SHARE_GC_G1_G1YOUNGGCPOSTEVACUATETASKS_HPP
27 
28 #include "gc/g1/g1BatchedTask.hpp"
29 
30 class FreeCSetStats;
31 
32 class G1CollectedHeap;
33 class G1EvacFailureRegions;
34 class G1EvacInfo;
35 class G1ParScanThreadStateSet;
36 
37 // First set of post evacuate collection set tasks containing ("s" means serial):
38 // - Merge PSS (s)
39 // - Recalculate Used (s)
40 // - Sample Collection Set Candidates (s)
41 // - Clear Card Table
42 // - Restore evac failure regions (on evacuation failure)
43 class G1PostEvacuateCollectionSetCleanupTask1 : public G1BatchedTask {
44   class MergePssTask;
45   class RecalculateUsedTask;
46   class SampleCollectionSetCandidatesTask;
47   class RestoreEvacFailureRegionsTask;
48 
49 public:
50   G1PostEvacuateCollectionSetCleanupTask1(G1ParScanThreadStateSet* per_thread_states,
51                                           G1EvacFailureRegions* evac_failure_regions);
52 };
53 
54 // Second set of post evacuate collection set tasks containing (s means serial):
55 // - Eagerly Reclaim Humongous Objects (s)
56 // - Update Derived Pointers (s)
57 // - Clear Retained Region Data (on evacuation failure)
58 // - Redirty Logged Cards
59 // - Restore Preserved Marks (on evacuation failure)
60 // - Free Collection Set
61 // - Resize TLABs
62 class G1PostEvacuateCollectionSetCleanupTask2 : public G1BatchedTask {
63   class EagerlyReclaimHumongousObjectsTask;
64 #if COMPILER2_OR_JVMCI
65   class UpdateDerivedPointersTask;
66 #endif
67 
68   class ProcessEvacuationFailedRegionsTask;
69   class RedirtyLoggedCardsTask;
70   class RestorePreservedMarksTask;
71   class FreeCollectionSetTask;
72   class ResizeTLABsTask;
73 
74 public:
75   G1PostEvacuateCollectionSetCleanupTask2(G1ParScanThreadStateSet* per_thread_states,
76                                           G1EvacInfo* evacuation_info,
77                                           G1EvacFailureRegions* evac_failure_regions);
78 };
79 
80 #endif // SHARE_GC_G1_G1YOUNGGCPOSTEVACUATETASKS_HPP