Skip to content

Commit cf70cb7

Browse files
author
Thomas Schatzl
committed
8365024: G1: Make G1CollectionSet::_inc_build_state assert-only
Reviewed-by: ayang, kbarrett
1 parent fb651fd commit cf70cb7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/hotspot/share/gc/g1/g1CollectionSet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ G1CollectionSet::G1CollectionSet(G1CollectedHeap* g1h, G1Policy* policy) :
6767
_survivor_region_length(0),
6868
_initial_old_region_length(0),
6969
_optional_groups(),
70-
_inc_build_state(CSetBuildType::Inactive),
70+
DEBUG_ONLY(_inc_build_state(CSetBuildType::Inactive) COMMA)
7171
_regions_inc_part_start(0),
7272
_groups_inc_part_start(0) {
7373
}
@@ -142,11 +142,11 @@ void G1CollectionSet::continue_incremental_building() {
142142
_regions_inc_part_start = _regions_cur_length;
143143
_groups_inc_part_start = groups_cur_length();
144144

145-
_inc_build_state = CSetBuildType::Active;
145+
DEBUG_ONLY(_inc_build_state = CSetBuildType::Active;)
146146
}
147147

148148
void G1CollectionSet::stop_incremental_building() {
149-
_inc_build_state = CSetBuildType::Inactive;
149+
DEBUG_ONLY(_inc_build_state = CSetBuildType::Inactive;)
150150
}
151151

152152
void G1CollectionSet::clear() {

src/hotspot/share/gc/g1/g1CollectionSet.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,14 @@ class G1CollectionSet {
165165
// groups. Regions are reachable via this list as well.
166166
G1CSetCandidateGroupList _optional_groups;
167167

168+
#ifdef ASSERT
168169
enum class CSetBuildType {
169170
Active, // We are actively building the collection set
170171
Inactive // We are not actively building the collection set
171172
};
172173

173174
CSetBuildType _inc_build_state;
175+
#endif
174176
// Index into the _regions indicating the start of the current collection set increment.
175177
size_t _regions_inc_part_start;
176178
// Index into the _groups indicating the start of the current collection set increment.

0 commit comments

Comments
 (0)