Skip to content
This repository was archived by the owner on Sep 29, 2021. It is now read-only.

Commit 170f045

Browse files
author
gziemski
committed
8202150: [REDO] Split globals.hpp to factor out the Flag class
Summary: Factored out Flag out go globals, renamed to JVMFlag Reviewed-by: coleenp, dholmes, kvn
1 parent 7911709 commit 170f045

File tree

66 files changed

+3060
-2964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3060
-2964
lines changed

src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "interpreter/interpreterRuntime.hpp"
3131
#include "memory/allocation.inline.hpp"
3232
#include "prims/methodHandles.hpp"
33+
#include "runtime/flags/flagSetting.hpp"
3334
#include "runtime/frame.inline.hpp"
3435

3536
#define __ _masm->

src/hotspot/cpu/sparc/macroAssembler_sparc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "oops/klass.inline.hpp"
3636
#include "prims/methodHandles.hpp"
3737
#include "runtime/biasedLocking.hpp"
38+
#include "runtime/flags/flagSetting.hpp"
3839
#include "runtime/interfaceSupport.inline.hpp"
3940
#include "runtime/jniHandles.inline.hpp"
4041
#include "runtime/objectMonitor.hpp"

src/hotspot/cpu/sparc/methodHandles_sparc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "memory/allocation.inline.hpp"
3232
#include "memory/resourceArea.hpp"
3333
#include "prims/methodHandles.hpp"
34+
#include "runtime/flags/flagSetting.hpp"
3435
#include "runtime/frame.inline.hpp"
3536
#include "utilities/preserveException.hpp"
3637

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "oops/klass.inline.hpp"
3838
#include "prims/methodHandles.hpp"
3939
#include "runtime/biasedLocking.hpp"
40+
#include "runtime/flags/flagSetting.hpp"
4041
#include "runtime/interfaceSupport.inline.hpp"
4142
#include "runtime/objectMonitor.hpp"
4243
#include "runtime/os.hpp"

src/hotspot/cpu/x86/methodHandles_x86.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "memory/allocation.inline.hpp"
3232
#include "memory/resourceArea.hpp"
3333
#include "prims/methodHandles.hpp"
34+
#include "runtime/flags/flagSetting.hpp"
3435
#include "runtime/frame.inline.hpp"
3536
#include "utilities/preserveException.hpp"
3637

src/hotspot/share/code/dependencies.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "memory/resourceArea.hpp"
3636
#include "oops/oop.inline.hpp"
3737
#include "oops/objArrayKlass.hpp"
38+
#include "runtime/flags/flagSetting.hpp"
3839
#include "runtime/handles.hpp"
3940
#include "runtime/handles.inline.hpp"
4041
#include "runtime/jniHandles.inline.hpp"

src/hotspot/share/code/nmethod.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "oops/oop.inline.hpp"
4848
#include "prims/jvmtiImpl.hpp"
4949
#include "runtime/atomic.hpp"
50+
#include "runtime/flags/flagSetting.hpp"
5051
#include "runtime/frame.inline.hpp"
5152
#include "runtime/handles.inline.hpp"
5253
#include "runtime/jniHandles.inline.hpp"

src/hotspot/share/code/relocInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
2929
#include "code/relocInfo.hpp"
3030
#include "memory/resourceArea.hpp"
3131
#include "oops/compressedOops.inline.hpp"
32+
#include "runtime/flags/flagSetting.hpp"
3233
#include "runtime/stubCodeGenerator.hpp"
3334
#include "utilities/copy.hpp"
3435
#include "oops/oop.inline.hpp"

src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#include "oops/oop.inline.hpp"
6969
#include "prims/jvmtiExport.hpp"
7070
#include "runtime/atomic.hpp"
71+
#include "runtime/flags/flagSetting.hpp"
7172
#include "runtime/globals_extension.hpp"
7273
#include "runtime/handles.inline.hpp"
7374
#include "runtime/java.hpp"

src/hotspot/share/gc/cms/commandLineFlagConstraintsCMS.cpp renamed to src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -23,52 +23,52 @@
2323
*/
2424

2525
#include "precompiled.hpp"
26-
#include "gc/cms/commandLineFlagConstraintsCMS.hpp"
26+
#include "gc/cms/jvmFlagConstraintsCMS.hpp"
2727
#include "gc/cms/concurrentMarkSweepGeneration.inline.hpp"
2828
#include "gc/shared/cardTableRS.hpp"
2929
#include "gc/shared/collectedHeap.hpp"
3030
#include "gc/shared/genCollectedHeap.hpp"
31-
#include "gc/shared/commandLineFlagConstraintsGC.hpp"
31+
#include "gc/shared/jvmFlagConstraintsGC.hpp"
3232
#include "memory/universe.hpp"
33-
#include "runtime/commandLineFlagRangeList.hpp"
33+
#include "runtime/flags/jvmFlagRangeList.hpp"
3434
#include "runtime/globals_extension.hpp"
3535
#include "utilities/globalDefinitions.hpp"
3636

37-
static Flag::Error ParallelGCThreadsAndCMSWorkQueueDrainThreshold(uint threads, uintx threshold, bool verbose) {
37+
static JVMFlag::Error ParallelGCThreadsAndCMSWorkQueueDrainThreshold(uint threads, uintx threshold, bool verbose) {
3838
// CMSWorkQueueDrainThreshold is verified to be less than max_juint
3939
if (UseConcMarkSweepGC && (threads > (uint)(max_jint / (uint)threshold))) {
4040
CommandLineError::print(verbose,
4141
"ParallelGCThreads (" UINT32_FORMAT ") or CMSWorkQueueDrainThreshold ("
4242
UINTX_FORMAT ") is too large\n",
4343
threads, threshold);
44-
return Flag::VIOLATES_CONSTRAINT;
44+
return JVMFlag::VIOLATES_CONSTRAINT;
4545
}
46-
return Flag::SUCCESS;
46+
return JVMFlag::SUCCESS;
4747
}
4848

49-
Flag::Error ParallelGCThreadsConstraintFuncCMS(uint value, bool verbose) {
49+
JVMFlag::Error ParallelGCThreadsConstraintFuncCMS(uint value, bool verbose) {
5050
// To avoid overflow at ParScanClosure::do_oop_work.
5151
if (UseConcMarkSweepGC && (value > (max_jint / 10))) {
5252
CommandLineError::print(verbose,
5353
"ParallelGCThreads (" UINT32_FORMAT ") must be "
5454
"less than or equal to " UINT32_FORMAT " for CMS GC\n",
5555
value, (max_jint / 10));
56-
return Flag::VIOLATES_CONSTRAINT;
56+
return JVMFlag::VIOLATES_CONSTRAINT;
5757
}
5858
return ParallelGCThreadsAndCMSWorkQueueDrainThreshold(value, CMSWorkQueueDrainThreshold, verbose);
5959
}
60-
Flag::Error ParGCStridesPerThreadConstraintFunc(uintx value, bool verbose) {
60+
JVMFlag::Error ParGCStridesPerThreadConstraintFunc(uintx value, bool verbose) {
6161
if (UseConcMarkSweepGC && (value > ((uintx)max_jint / (uintx)ParallelGCThreads))) {
6262
CommandLineError::print(verbose,
6363
"ParGCStridesPerThread (" UINTX_FORMAT ") must be "
6464
"less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n",
6565
value, ((uintx)max_jint / (uintx)ParallelGCThreads));
66-
return Flag::VIOLATES_CONSTRAINT;
66+
return JVMFlag::VIOLATES_CONSTRAINT;
6767
}
68-
return Flag::SUCCESS;
68+
return JVMFlag::SUCCESS;
6969
}
7070

71-
Flag::Error ParGCCardsPerStrideChunkConstraintFunc(intx value, bool verbose) {
71+
JVMFlag::Error ParGCCardsPerStrideChunkConstraintFunc(intx value, bool verbose) {
7272
if (UseConcMarkSweepGC) {
7373
// ParGCCardsPerStrideChunk should be compared with card table size.
7474
size_t heap_size = Universe::heap()->reserved_region().word_size();
@@ -80,7 +80,7 @@ Flag::Error ParGCCardsPerStrideChunkConstraintFunc(intx value, bool verbose) {
8080
"ParGCCardsPerStrideChunk (" INTX_FORMAT ") is too large for the heap size and "
8181
"must be less than or equal to card table size (" SIZE_FORMAT ")\n",
8282
value, card_table_size);
83-
return Flag::VIOLATES_CONSTRAINT;
83+
return JVMFlag::VIOLATES_CONSTRAINT;
8484
}
8585

8686
// ParGCCardsPerStrideChunk is used with n_strides(ParallelGCThreads*ParGCStridesPerThread)
@@ -93,38 +93,38 @@ Flag::Error ParGCCardsPerStrideChunkConstraintFunc(intx value, bool verbose) {
9393
"ParGCCardsPerStrideChunk (" INTX_FORMAT ") must be "
9494
"less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n",
9595
value, ergo_max);
96-
return Flag::VIOLATES_CONSTRAINT;
96+
return JVMFlag::VIOLATES_CONSTRAINT;
9797
}
9898
}
99-
return Flag::SUCCESS;
99+
return JVMFlag::SUCCESS;
100100
}
101101

102-
Flag::Error CMSOldPLABMinConstraintFunc(size_t value, bool verbose) {
103-
Flag::Error status = Flag::SUCCESS;
102+
JVMFlag::Error CMSOldPLABMinConstraintFunc(size_t value, bool verbose) {
103+
JVMFlag::Error status = JVMFlag::SUCCESS;
104104

105105
if (UseConcMarkSweepGC) {
106106
if (value > CMSOldPLABMax) {
107107
CommandLineError::print(verbose,
108108
"CMSOldPLABMin (" SIZE_FORMAT ") must be "
109109
"less than or equal to CMSOldPLABMax (" SIZE_FORMAT ")\n",
110110
value, CMSOldPLABMax);
111-
return Flag::VIOLATES_CONSTRAINT;
111+
return JVMFlag::VIOLATES_CONSTRAINT;
112112
}
113113
status = MaxPLABSizeBounds("CMSOldPLABMin", value, verbose);
114114
}
115115
return status;
116116
}
117117

118-
Flag::Error CMSOldPLABMaxConstraintFunc(size_t value, bool verbose) {
119-
Flag::Error status = Flag::SUCCESS;
118+
JVMFlag::Error CMSOldPLABMaxConstraintFunc(size_t value, bool verbose) {
119+
JVMFlag::Error status = JVMFlag::SUCCESS;
120120

121121
if (UseConcMarkSweepGC) {
122122
status = MaxPLABSizeBounds("CMSOldPLABMax", value, verbose);
123123
}
124124
return status;
125125
}
126126

127-
static Flag::Error CMSReservedAreaConstraintFunc(const char* name, size_t value, bool verbose) {
127+
static JVMFlag::Error CMSReservedAreaConstraintFunc(const char* name, size_t value, bool verbose) {
128128
if (UseConcMarkSweepGC) {
129129
ConcurrentMarkSweepGeneration* cms = (ConcurrentMarkSweepGeneration*)GenCollectedHeap::heap()->old_gen();
130130
const size_t ergo_max = cms->cmsSpace()->max_flag_size_for_task_size();
@@ -134,17 +134,17 @@ static Flag::Error CMSReservedAreaConstraintFunc(const char* name, size_t value,
134134
"less than or equal to ergonomic maximum (" SIZE_FORMAT ") "
135135
"which is based on the maximum size of the old generation of the Java heap\n",
136136
name, value, ergo_max);
137-
return Flag::VIOLATES_CONSTRAINT;
137+
return JVMFlag::VIOLATES_CONSTRAINT;
138138
}
139139
}
140140

141-
return Flag::SUCCESS;
141+
return JVMFlag::SUCCESS;
142142
}
143143

144-
Flag::Error CMSRescanMultipleConstraintFunc(size_t value, bool verbose) {
145-
Flag::Error status = CMSReservedAreaConstraintFunc("CMSRescanMultiple", value, verbose);
144+
JVMFlag::Error CMSRescanMultipleConstraintFunc(size_t value, bool verbose) {
145+
JVMFlag::Error status = CMSReservedAreaConstraintFunc("CMSRescanMultiple", value, verbose);
146146

147-
if (status == Flag::SUCCESS && UseConcMarkSweepGC) {
147+
if (status == JVMFlag::SUCCESS && UseConcMarkSweepGC) {
148148
// CMSParRemarkTask::do_dirty_card_rescan_tasks requires CompactibleFreeListSpace::rescan_task_size()
149149
// to be aligned to CardTable::card_size * BitsPerWord.
150150
// Note that rescan_task_size() will be aligned if CMSRescanMultiple is a multiple of 'HeapWordSize'
@@ -154,61 +154,61 @@ Flag::Error CMSRescanMultipleConstraintFunc(size_t value, bool verbose) {
154154
"CMSRescanMultiple (" SIZE_FORMAT ") must be "
155155
"a multiple of " SIZE_FORMAT "\n",
156156
value, HeapWordSize);
157-
status = Flag::VIOLATES_CONSTRAINT;
157+
status = JVMFlag::VIOLATES_CONSTRAINT;
158158
}
159159
}
160160

161161
return status;
162162
}
163163

164-
Flag::Error CMSConcMarkMultipleConstraintFunc(size_t value, bool verbose) {
164+
JVMFlag::Error CMSConcMarkMultipleConstraintFunc(size_t value, bool verbose) {
165165
return CMSReservedAreaConstraintFunc("CMSConcMarkMultiple", value, verbose);
166166
}
167167

168-
Flag::Error CMSPrecleanDenominatorConstraintFunc(uintx value, bool verbose) {
168+
JVMFlag::Error CMSPrecleanDenominatorConstraintFunc(uintx value, bool verbose) {
169169
if (UseConcMarkSweepGC && (value <= CMSPrecleanNumerator)) {
170170
CommandLineError::print(verbose,
171171
"CMSPrecleanDenominator (" UINTX_FORMAT ") must be "
172172
"strickly greater than CMSPrecleanNumerator (" UINTX_FORMAT ")\n",
173173
value, CMSPrecleanNumerator);
174-
return Flag::VIOLATES_CONSTRAINT;
174+
return JVMFlag::VIOLATES_CONSTRAINT;
175175
}
176-
return Flag::SUCCESS;
176+
return JVMFlag::SUCCESS;
177177
}
178178

179-
Flag::Error CMSPrecleanNumeratorConstraintFunc(uintx value, bool verbose) {
179+
JVMFlag::Error CMSPrecleanNumeratorConstraintFunc(uintx value, bool verbose) {
180180
if (UseConcMarkSweepGC && (value >= CMSPrecleanDenominator)) {
181181
CommandLineError::print(verbose,
182182
"CMSPrecleanNumerator (" UINTX_FORMAT ") must be "
183183
"less than CMSPrecleanDenominator (" UINTX_FORMAT ")\n",
184184
value, CMSPrecleanDenominator);
185-
return Flag::VIOLATES_CONSTRAINT;
185+
return JVMFlag::VIOLATES_CONSTRAINT;
186186
}
187-
return Flag::SUCCESS;
187+
return JVMFlag::SUCCESS;
188188
}
189189

190-
Flag::Error CMSSamplingGrainConstraintFunc(uintx value, bool verbose) {
190+
JVMFlag::Error CMSSamplingGrainConstraintFunc(uintx value, bool verbose) {
191191
if (UseConcMarkSweepGC) {
192192
size_t max_capacity = GenCollectedHeap::heap()->young_gen()->max_capacity();
193193
if (value > max_uintx - max_capacity) {
194194
CommandLineError::print(verbose,
195195
"CMSSamplingGrain (" UINTX_FORMAT ") must be "
196196
"less than or equal to ergonomic maximum (" SIZE_FORMAT ")\n",
197197
value, max_uintx - max_capacity);
198-
return Flag::VIOLATES_CONSTRAINT;
198+
return JVMFlag::VIOLATES_CONSTRAINT;
199199
}
200200
}
201-
return Flag::SUCCESS;
201+
return JVMFlag::SUCCESS;
202202
}
203203

204-
Flag::Error CMSWorkQueueDrainThresholdConstraintFunc(uintx value, bool verbose) {
204+
JVMFlag::Error CMSWorkQueueDrainThresholdConstraintFunc(uintx value, bool verbose) {
205205
if (UseConcMarkSweepGC) {
206206
return ParallelGCThreadsAndCMSWorkQueueDrainThreshold(ParallelGCThreads, value, verbose);
207207
}
208-
return Flag::SUCCESS;
208+
return JVMFlag::SUCCESS;
209209
}
210210

211-
Flag::Error CMSBitMapYieldQuantumConstraintFunc(size_t value, bool verbose) {
211+
JVMFlag::Error CMSBitMapYieldQuantumConstraintFunc(size_t value, bool verbose) {
212212
// Skip for current default value.
213213
if (UseConcMarkSweepGC && FLAG_IS_CMDLINE(CMSBitMapYieldQuantum)) {
214214
// CMSBitMapYieldQuantum should be compared with mark bitmap size.
@@ -221,18 +221,18 @@ Flag::Error CMSBitMapYieldQuantumConstraintFunc(size_t value, bool verbose) {
221221
"be less than or equal to bitmap size (" SIZE_FORMAT ") "
222222
"whose size corresponds to the size of old generation of the Java heap\n",
223223
value, bitmap_size);
224-
return Flag::VIOLATES_CONSTRAINT;
224+
return JVMFlag::VIOLATES_CONSTRAINT;
225225
}
226226
}
227-
return Flag::SUCCESS;
227+
return JVMFlag::SUCCESS;
228228
}
229229

230-
Flag::Error OldPLABSizeConstraintFuncCMS(size_t value, bool verbose) {
230+
JVMFlag::Error OldPLABSizeConstraintFuncCMS(size_t value, bool verbose) {
231231
if (value == 0) {
232232
CommandLineError::print(verbose,
233233
"OldPLABSize (" SIZE_FORMAT ") must be greater than 0",
234234
value);
235-
return Flag::VIOLATES_CONSTRAINT;
235+
return JVMFlag::VIOLATES_CONSTRAINT;
236236
}
237237
// For CMS, OldPLABSize is the number of free blocks of a given size that are used when
238238
// replenishing the local per-worker free list caches.

0 commit comments

Comments
 (0)