src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/runtime

src/share/vm/runtime/arguments.cpp

Print this page




1298         os::free((void *)old_java_vendor_url_bug);
1299       }
1300     }
1301 
1302     // Create new property and add at the end of the list
1303     PropertyList_unique_add(&_system_properties, key, value, AddProperty, writeable, internal);
1304   }
1305 
1306   if (key != prop) {
1307     // SystemProperty copy passed value, thus free previously allocated
1308     // memory
1309     FreeHeap((void *)key);
1310   }
1311 
1312   return true;
1313 }
1314 
1315 #if INCLUDE_CDS
1316 void Arguments::check_unsupported_dumping_properties() {
1317   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
1318   const char* unsupported_properties[5] = { "jdk.module.main",

1319                                            "jdk.module.path",
1320                                            "jdk.module.upgrade.path",
1321                                            "jdk.module.addmods.0",
1322                                            "jdk.module.limitmods" };
1323   const char* unsupported_options[5] = { "-m",
1324                                         "--module-path",
1325                                         "--upgrade-module-path",
1326                                         "--add-modules",
1327                                         "--limit-modules" };



1328   SystemProperty* sp = system_properties();
1329   while (sp != NULL) {
1330     for (int i = 0; i < 5; i++) {
1331       if (strcmp(sp->key(), unsupported_properties[i]) == 0) {

1332           vm_exit_during_initialization(
1333             "Cannot use the following option when dumping the shared archive", unsupported_options[i]);




1334       }
1335     }
1336     sp = sp->next();
1337   }
1338 
1339   // Check for an exploded module build in use with -Xshare:dump.
1340   if (!has_jimage()) {
1341     vm_exit_during_initialization("Dumping the shared archive is not supported with an exploded module build");
1342   }
1343 }
1344 #endif
1345 
1346 //===========================================================================================================
1347 // Setting int/mixed/comp mode flags
1348 
1349 void Arguments::set_mode_flags(Mode mode) {
1350   // Set up default values for all flags.
1351   // If you add a flag to any of the branches below,
1352   // add a default value for it here.
1353   set_java_compiler(false);




1298         os::free((void *)old_java_vendor_url_bug);
1299       }
1300     }
1301 
1302     // Create new property and add at the end of the list
1303     PropertyList_unique_add(&_system_properties, key, value, AddProperty, writeable, internal);
1304   }
1305 
1306   if (key != prop) {
1307     // SystemProperty copy passed value, thus free previously allocated
1308     // memory
1309     FreeHeap((void *)key);
1310   }
1311 
1312   return true;
1313 }
1314 
1315 #if INCLUDE_CDS
1316 void Arguments::check_unsupported_dumping_properties() {
1317   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
1318   const char* unsupported_properties[] = { "jdk.module.main",
1319                                            "jdk.module.limitmods",
1320                                            "jdk.module.path",
1321                                            "jdk.module.upgrade.path",
1322                                            "jdk.module.addmods.0" };
1323   const char* unsupported_options[] = { "-m",
1324                                         "--limit-modules",
1325                                         "--module-path",
1326                                         "--upgrade-module-path",
1327                                         "--add-modules" };
1328   assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
1329   // If a vm option is found in the unsupported_options array with index less than the warning_idx,
1330   // vm will exit with an error message. Otherwise, it will result in a warning message.
1331   uint warning_idx = 2;
1332   SystemProperty* sp = system_properties();
1333   while (sp != NULL) {
1334     for (uint i = 0; i < ARRAY_SIZE(unsupported_properties); i++) {
1335       if (strcmp(sp->key(), unsupported_properties[i]) == 0) {
1336         if (i < warning_idx) {
1337           vm_exit_during_initialization(
1338             "Cannot use the following option when dumping the shared archive", unsupported_options[i]);
1339         } else {
1340           warning(
1341             "the %s option is ignored when dumping the shared archive", unsupported_options[i]);
1342         }
1343       }
1344     }
1345     sp = sp->next();
1346   }
1347 
1348   // Check for an exploded module build in use with -Xshare:dump.
1349   if (!has_jimage()) {
1350     vm_exit_during_initialization("Dumping the shared archive is not supported with an exploded module build");
1351   }
1352 }
1353 #endif
1354 
1355 //===========================================================================================================
1356 // Setting int/mixed/comp mode flags
1357 
1358 void Arguments::set_mode_flags(Mode mode) {
1359   // Set up default values for all flags.
1360   // If you add a flag to any of the branches below,
1361   // add a default value for it here.
1362   set_java_compiler(false);


src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File