@@ -221,35 +221,60 @@ static String[] exceptionToString(Throwable o, boolean toString, boolean stackTr
221221 */
222222 static final Map <String , Object > options = new HashMap <>();
223223
224+ /**
225+ * Sentinel help value to denote options that are not printed by -XX:+JVMCIPrintProperties.
226+ * Javadoc is used instead to document these options.
227+ */
228+ private static final String [] NO_HELP = null ;
229+
224230 /**
225231 * A list of all supported JVMCI options.
226232 */
227233 public enum Option {
228234 // @formatter:off
229- Compiler (String .class , null , "Selects the system compiler. This must match the getCompilerName() value returned " +
230- "by a jdk.vm.ci.runtime.JVMCICompilerFactory provider. " +
231- "An empty string or the value \" null\" selects a compiler " +
232- "that will raise an exception upon receiving a compilation request." ),
233- // Note: The following one is not used (see InitTimer.ENABLED). It is added here
234- // so that -XX:+JVMCIPrintProperties shows the option.
235- InitTimer (Boolean .class , false , "Specifies if initialization timing is enabled." ),
236- CodeSerializationTypeInfo (Boolean .class , false , "Prepend the size and label of each element to the stream when " +
237- "serializing HotSpotCompiledCode to verify both ends of the protocol agree on the format. " +
238- "Defaults to true in non-product builds." ),
239- DumpSerializedCode (String .class , null , "Dump serialized code during code installation for code whose simple " +
240- "name (a stub) or fully qualified name (an nmethod) contains this option's value as a substring." ),
241- ForceTranslateFailure (String .class , null , "Forces HotSpotJVMCIRuntime.translate to throw an exception in the context " +
242- "of the peer runtime. The value is a filter that can restrict the forced failure to matching translated " +
243- "objects. See HotSpotJVMCIRuntime.postTranslation for more details. This option exists solely to test " +
244- "correct handling of translation failures." ),
245- PrintConfig (Boolean .class , false , "Prints VM configuration available via JVMCI." ),
246- AuditHandles (Boolean .class , false , "Record stack trace along with scoped foreign object reference wrappers " +
247- "to debug issue with a wrapper being used after its scope has closed." ),
248- TraceMethodDataFilter (String .class , null ,
249- "Enables tracing of profiling info when read by JVMCI." ,
250- "Empty value: trace all methods" ,
251- "Non-empty value: trace methods whose fully qualified name contains the value." ),
252- UseProfilingInformation (Boolean .class , true , "" );
235+ Compiler (String .class , null ,
236+ "Selects the system compiler. This must match the getCompilerName() value" ,
237+ "returned by a jdk.vm.ci.runtime.JVMCICompilerFactory provider. " ,
238+ "An empty string or the value \" null\" selects a compiler " ,
239+ "that raises an exception upon receiving a compilation request." ),
240+
241+ PrintConfig (Boolean .class , false , "Prints VM values (e.g. flags, constants, field offsets etc) exposed to JVMCI." ),
242+
243+ InitTimer (Boolean .class , false , NO_HELP ),
244+
245+ /**
246+ * Prepends the size and label of each element to the stream when serializing {@link HotSpotCompiledCode}
247+ * to verify both ends of the protocol agree on the format. Defaults to true in non-product builds.
248+ */
249+ CodeSerializationTypeInfo (Boolean .class , false , NO_HELP ),
250+
251+ /**
252+ * Dumps serialized code during code installation for code whose qualified form (e.g.
253+ * {@code java.lang.String.hashCode()}) contains this option's value as a substring.
254+ */
255+ DumpSerializedCode (String .class , null , NO_HELP ),
256+
257+ /**
258+ * Forces {@link #translate} to throw an exception in the context of the peer runtime for
259+ * translated objects that match this value. See {@link #postTranslation} for more details.
260+ * This option exists solely to test correct handling of translation failures.
261+ */
262+ ForceTranslateFailure (String .class , null , NO_HELP ),
263+
264+ /**
265+ * Captures a stack trace along with scoped foreign object reference wrappers
266+ * to debug an issue with a wrapper being used after its scope has closed.
267+ */
268+ AuditHandles (Boolean .class , false , NO_HELP ),
269+
270+ /**
271+ * Enables tracing of profiling info when read by JVMCI.
272+ * Empty value: trace all methods
273+ * Non-empty value: trace methods whose fully qualified name contains the value
274+ */
275+ TraceMethodDataFilter (String .class , null , NO_HELP ),
276+
277+ UseProfilingInformation (Boolean .class , true , NO_HELP );
253278 // @formatter:on
254279
255280 /**
@@ -343,6 +368,9 @@ public static void printProperties(PrintStream out) {
343368 out .println ("[JVMCI properties]" );
344369 Option [] values = values ();
345370 for (Option option : values ) {
371+ if (option .helpLines == null ) {
372+ continue ;
373+ }
346374 Object value = option .getValue ();
347375 if (value instanceof String ) {
348376 value = '"' + String .valueOf (value ) + '"' ;
@@ -362,6 +390,7 @@ public static void printProperties(PrintStream out) {
362390 for (String line : option .helpLines ) {
363391 out .printf ("%" + PROPERTY_HELP_INDENT + "s%s%n" , "" , line );
364392 }
393+ out .println ();
365394 }
366395 }
367396
0 commit comments