1440
1441 if (eq == NULL) {
1442 // property doesn't have a value, thus use passed string
1443 key = prop;
1444 } else {
1445 // property have a value, thus extract it and save to the
1446 // allocated string
1447 size_t key_len = eq - prop;
1448 char* tmp_key = AllocateHeap(key_len + 1, mtArguments);
1449
1450 jio_snprintf(tmp_key, key_len + 1, "%s", prop);
1451 key = tmp_key;
1452
1453 value = &prop[key_len + 1];
1454 }
1455
1456 #if INCLUDE_CDS
1457 if (is_internal_module_property(key) ||
1458 strcmp(key, "jdk.module.main") == 0) {
1459 MetaspaceShared::disable_optimized_module_handling();
1460 log_info(cds)("Using optimized module handling disabled due to incompatible property: %s=%s", key, value);
1461 }
1462 #endif
1463
1464 if (strcmp(key, "java.compiler") == 0) {
1465 process_java_compiler_argument(value);
1466 // Record value in Arguments, but let it get passed to Java.
1467 } else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0) {
1468 // sun.java.launcher.is_altjvm property is
1469 // private and is processed in process_sun_java_launcher_properties();
1470 // the sun.java.launcher property is passed on to the java application
1471 } else if (strcmp(key, "sun.boot.library.path") == 0) {
1472 // append is true, writable is true, internal is false
1473 PropertyList_unique_add(&_system_properties, key, value, AppendProperty,
1474 WriteableProperty, ExternalProperty);
1475 } else {
1476 if (strcmp(key, "sun.java.command") == 0) {
1477 char *old_java_command = _java_command;
1478 _java_command = os::strdup_check_oom(value, mtArguments);
1479 if (old_java_command != NULL) {
1480 os::free(old_java_command);
2489 if (*tail == '\0') {
2490 JavaAssertions::setUserClassDefault(enable);
2491 } else {
2492 assert(*tail == ':', "bogus match by match_option()");
2493 JavaAssertions::addOption(tail + 1, enable);
2494 }
2495 // -dsa / -esa / -disablesystemassertions / -enablesystemassertions
2496 } else if (match_option(option, system_assertion_options, &tail, false)) {
2497 bool enable = option->optionString[1] == 'e'; // char after '-' is 'e'
2498 JavaAssertions::setSystemClassDefault(enable);
2499 // -bootclasspath:
2500 } else if (match_option(option, "-Xbootclasspath:", &tail)) {
2501 jio_fprintf(defaultStream::output_stream(),
2502 "-Xbootclasspath is no longer a supported option.\n");
2503 return JNI_EINVAL;
2504 // -bootclasspath/a:
2505 } else if (match_option(option, "-Xbootclasspath/a:", &tail)) {
2506 Arguments::append_sysclasspath(tail);
2507 #if INCLUDE_CDS
2508 MetaspaceShared::disable_optimized_module_handling();
2509 log_info(cds)("Using optimized module handling disabled due to bootclasspath was appended");
2510 #endif
2511 // -bootclasspath/p:
2512 } else if (match_option(option, "-Xbootclasspath/p:", &tail)) {
2513 jio_fprintf(defaultStream::output_stream(),
2514 "-Xbootclasspath/p is no longer a supported option.\n");
2515 return JNI_EINVAL;
2516 // -Xrun
2517 } else if (match_option(option, "-Xrun", &tail)) {
2518 if (tail != NULL) {
2519 const char* pos = strchr(tail, ':');
2520 size_t len = (pos == NULL) ? strlen(tail) : pos - tail;
2521 char* name = NEW_C_HEAP_ARRAY(char, len + 1, mtArguments);
2522 jio_snprintf(name, len + 1, "%s", tail);
2523
2524 char *options = NULL;
2525 if(pos != NULL) {
2526 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied.
2527 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtArguments), pos+1, len2);
2528 }
2529 #if !INCLUDE_JVMTI
|
1440
1441 if (eq == NULL) {
1442 // property doesn't have a value, thus use passed string
1443 key = prop;
1444 } else {
1445 // property have a value, thus extract it and save to the
1446 // allocated string
1447 size_t key_len = eq - prop;
1448 char* tmp_key = AllocateHeap(key_len + 1, mtArguments);
1449
1450 jio_snprintf(tmp_key, key_len + 1, "%s", prop);
1451 key = tmp_key;
1452
1453 value = &prop[key_len + 1];
1454 }
1455
1456 #if INCLUDE_CDS
1457 if (is_internal_module_property(key) ||
1458 strcmp(key, "jdk.module.main") == 0) {
1459 MetaspaceShared::disable_optimized_module_handling();
1460 log_info(cds)("optimized module handling: disabled due to incompatible property: %s=%s", key, value);
1461 }
1462 if (strcmp(key, "jdk.module.showModuleResolution") == 0 ||
1463 strcmp(key, "jdk.module.illegalAccess") == 0 ||
1464 strcmp(key, "jdk.module.validation") == 0 ||
1465 strcmp(key, "java.system.class.loader") == 0) {
1466 MetaspaceShared::disable_full_module_graph();
1467 log_info(cds)("full module graph: disabled due to incompatible property: %s=%s", key, value);
1468 }
1469 #endif
1470
1471 if (strcmp(key, "java.compiler") == 0) {
1472 process_java_compiler_argument(value);
1473 // Record value in Arguments, but let it get passed to Java.
1474 } else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0) {
1475 // sun.java.launcher.is_altjvm property is
1476 // private and is processed in process_sun_java_launcher_properties();
1477 // the sun.java.launcher property is passed on to the java application
1478 } else if (strcmp(key, "sun.boot.library.path") == 0) {
1479 // append is true, writable is true, internal is false
1480 PropertyList_unique_add(&_system_properties, key, value, AppendProperty,
1481 WriteableProperty, ExternalProperty);
1482 } else {
1483 if (strcmp(key, "sun.java.command") == 0) {
1484 char *old_java_command = _java_command;
1485 _java_command = os::strdup_check_oom(value, mtArguments);
1486 if (old_java_command != NULL) {
1487 os::free(old_java_command);
2496 if (*tail == '\0') {
2497 JavaAssertions::setUserClassDefault(enable);
2498 } else {
2499 assert(*tail == ':', "bogus match by match_option()");
2500 JavaAssertions::addOption(tail + 1, enable);
2501 }
2502 // -dsa / -esa / -disablesystemassertions / -enablesystemassertions
2503 } else if (match_option(option, system_assertion_options, &tail, false)) {
2504 bool enable = option->optionString[1] == 'e'; // char after '-' is 'e'
2505 JavaAssertions::setSystemClassDefault(enable);
2506 // -bootclasspath:
2507 } else if (match_option(option, "-Xbootclasspath:", &tail)) {
2508 jio_fprintf(defaultStream::output_stream(),
2509 "-Xbootclasspath is no longer a supported option.\n");
2510 return JNI_EINVAL;
2511 // -bootclasspath/a:
2512 } else if (match_option(option, "-Xbootclasspath/a:", &tail)) {
2513 Arguments::append_sysclasspath(tail);
2514 #if INCLUDE_CDS
2515 MetaspaceShared::disable_optimized_module_handling();
2516 log_info(cds)("optimized module handling: disabled due to bootclasspath was appended");
2517 #endif
2518 // -bootclasspath/p:
2519 } else if (match_option(option, "-Xbootclasspath/p:", &tail)) {
2520 jio_fprintf(defaultStream::output_stream(),
2521 "-Xbootclasspath/p is no longer a supported option.\n");
2522 return JNI_EINVAL;
2523 // -Xrun
2524 } else if (match_option(option, "-Xrun", &tail)) {
2525 if (tail != NULL) {
2526 const char* pos = strchr(tail, ':');
2527 size_t len = (pos == NULL) ? strlen(tail) : pos - tail;
2528 char* name = NEW_C_HEAP_ARRAY(char, len + 1, mtArguments);
2529 jio_snprintf(name, len + 1, "%s", tail);
2530
2531 char *options = NULL;
2532 if(pos != NULL) {
2533 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied.
2534 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtArguments), pos+1, len2);
2535 }
2536 #if !INCLUDE_JVMTI
|