337 return false; |
337 return false; |
338 #endif |
338 #endif |
339 } |
339 } |
340 |
340 |
341 bool JVMFlag::is_unlocker() const { |
341 bool JVMFlag::is_unlocker() const { |
342 return strcmp(_name, "UnlockDiagnosticVMOptions") == 0 || |
342 return strcmp(_name, "UnlockDiagnosticVMOptions") == 0 || |
343 strcmp(_name, "UnlockExperimentalVMOptions") == 0 || |
343 strcmp(_name, "UnlockExperimentalVMOptions") == 0; |
344 is_unlocker_ext(); |
|
345 } |
344 } |
346 |
345 |
347 bool JVMFlag::is_unlocked() const { |
346 bool JVMFlag::is_unlocked() const { |
348 if (is_diagnostic()) { |
347 if (is_diagnostic()) { |
349 return UnlockDiagnosticVMOptions; |
348 return UnlockDiagnosticVMOptions; |
350 } |
349 } |
351 if (is_experimental()) { |
350 if (is_experimental()) { |
352 return UnlockExperimentalVMOptions; |
351 return UnlockExperimentalVMOptions; |
353 } |
352 } |
354 return is_unlocked_ext(); |
353 return true; |
355 } |
354 } |
356 |
355 |
357 void JVMFlag::clear_diagnostic() { |
356 void JVMFlag::clear_diagnostic() { |
358 assert(is_diagnostic(), "sanity"); |
357 assert(is_diagnostic(), "sanity"); |
359 _flags = Flags(_flags & ~KIND_DIAGNOSTIC); |
358 _flags = Flags(_flags & ~KIND_DIAGNOSTIC); |
386 if (is_notproduct() && is_product_build()) { |
385 if (is_notproduct() && is_product_build()) { |
387 jio_snprintf(buf, buflen, "Error: VM option '%s' is notproduct and is available only in debug version of VM.\n", |
386 jio_snprintf(buf, buflen, "Error: VM option '%s' is notproduct and is available only in debug version of VM.\n", |
388 _name); |
387 _name); |
389 return JVMFlag::NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD; |
388 return JVMFlag::NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD; |
390 } |
389 } |
391 return get_locked_message_ext(buf, buflen); |
390 return JVMFlag::NONE; |
392 } |
391 } |
393 |
392 |
394 bool JVMFlag::is_writeable() const { |
393 bool JVMFlag::is_writeable() const { |
395 return is_manageable() || (is_product() && is_read_write()) || is_writeable_ext(); |
394 return is_manageable() || (is_product() && is_read_write()); |
396 } |
395 } |
397 |
396 |
398 // All flags except "manageable" are assumed to be internal flags. |
397 // All flags except "manageable" are assumed to be internal flags. |
399 // Long term, we need to define a mechanism to specify which flags |
398 // Long term, we need to define a mechanism to specify which flags |
400 // are external/stable and change this function accordingly. |
399 // are external/stable and change this function accordingly. |
401 bool JVMFlag::is_external() const { |
400 bool JVMFlag::is_external() const { |
402 return is_manageable() || is_external_ext(); |
401 return is_manageable(); |
403 } |
402 } |
404 |
403 |
405 // Helper function for JVMFlag::print_on(). |
404 // Helper function for JVMFlag::print_on(). |
406 // Fills current line up to requested position. |
405 // Fills current line up to requested position. |
407 // Should the current position already be past the requested position, |
406 // Should the current position already be past the requested position, |
879 ARCH_EXPERIMENTAL_FLAG_STRUCT, \ |
878 ARCH_EXPERIMENTAL_FLAG_STRUCT, \ |
880 ARCH_NOTPRODUCT_FLAG_STRUCT, \ |
879 ARCH_NOTPRODUCT_FLAG_STRUCT, \ |
881 IGNORE_RANGE, \ |
880 IGNORE_RANGE, \ |
882 IGNORE_CONSTRAINT, \ |
881 IGNORE_CONSTRAINT, \ |
883 IGNORE_WRITEABLE) |
882 IGNORE_WRITEABLE) |
884 FLAGTABLE_EXT |
|
885 {0, NULL, NULL} |
883 {0, NULL, NULL} |
886 }; |
884 }; |
887 |
885 |
888 JVMFlag* JVMFlag::flags = flagTable; |
886 JVMFlag* JVMFlag::flags = flagTable; |
889 size_t JVMFlag::numFlags = (sizeof(flagTable) / sizeof(JVMFlag)); |
887 size_t JVMFlag::numFlags = (sizeof(flagTable) / sizeof(JVMFlag)); |