comparison src/share/vm/runtime/arguments.cpp @ 7066:7d815d842ee0

Merge.
author Christian Haeubl <haeubl@ssw.jku.at>
date Fri, 23 Nov 2012 11:50:27 +0100
parents 8c5333c80cfd 49f0841607b7
children 1baf7f1e3f23
comparison
equal deleted inserted replaced
7065:cfacf5d5bade 7066:7d815d842ee0
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "classfile/javaAssertions.hpp" 26 #include "classfile/javaAssertions.hpp"
27 #include "classfile/symbolTable.hpp"
27 #include "compiler/compilerOracle.hpp" 28 #include "compiler/compilerOracle.hpp"
28 #include "memory/allocation.inline.hpp" 29 #include "memory/allocation.inline.hpp"
29 #include "memory/cardTableRS.hpp" 30 #include "memory/cardTableRS.hpp"
30 #include "memory/referenceProcessor.hpp" 31 #include "memory/referenceProcessor.hpp"
31 #include "memory/universe.inline.hpp" 32 #include "memory/universe.inline.hpp"
256 JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) }, 257 JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) },
257 { "UseParallelOldGCDensePrefix", 258 { "UseParallelOldGCDensePrefix",
258 JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) }, 259 JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) },
259 { "AllowTransitionalJSR292", JDK_Version::jdk(7), JDK_Version::jdk(8) }, 260 { "AllowTransitionalJSR292", JDK_Version::jdk(7), JDK_Version::jdk(8) },
260 { "UseCompressedStrings", JDK_Version::jdk(7), JDK_Version::jdk(8) }, 261 { "UseCompressedStrings", JDK_Version::jdk(7), JDK_Version::jdk(8) },
262 { "CMSPermGenPrecleaningEnabled", JDK_Version::jdk(8), JDK_Version::jdk(9) },
263 { "CMSTriggerPermRatio", JDK_Version::jdk(8), JDK_Version::jdk(9) },
264 { "CMSInitiatingPermOccupancyFraction", JDK_Version::jdk(8), JDK_Version::jdk(9) },
265 { "AdaptivePermSizeWeight", JDK_Version::jdk(8), JDK_Version::jdk(9) },
266 { "PermGenPadding", JDK_Version::jdk(8), JDK_Version::jdk(9) },
267 { "PermMarkSweepDeadRatio", JDK_Version::jdk(8), JDK_Version::jdk(9) },
268 { "PermSize", JDK_Version::jdk(8), JDK_Version::jdk(9) },
269 { "MaxPermSize", JDK_Version::jdk(8), JDK_Version::jdk(9) },
270 { "MinPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) },
271 { "MaxPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) },
272 { "CMSRevisitStackSize", JDK_Version::jdk(8), JDK_Version::jdk(9) },
273 { "PrintRevisitStats", JDK_Version::jdk(8), JDK_Version::jdk(9) },
274 { "UseVectoredExceptions", JDK_Version::jdk(8), JDK_Version::jdk(9) },
261 #ifdef PRODUCT 275 #ifdef PRODUCT
262 { "DesiredMethodLimit", 276 { "DesiredMethodLimit",
263 JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) }, 277 JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
264 #endif // PRODUCT 278 #endif // PRODUCT
265 { NULL, JDK_Version(0), JDK_Version(0) } 279 { NULL, JDK_Version(0), JDK_Version(0) }
795 } 809 }
796 if (num_jvm_args() > 0) { 810 if (num_jvm_args() > 0) {
797 st->print("jvm_args: "); print_jvm_args_on(st); 811 st->print("jvm_args: "); print_jvm_args_on(st);
798 } 812 }
799 st->print_cr("java_command: %s", java_command() ? java_command() : "<unknown>"); 813 st->print_cr("java_command: %s", java_command() ? java_command() : "<unknown>");
814 if (_java_class_path != NULL) {
815 char* path = _java_class_path->value();
816 st->print_cr("java_class_path (initial): %s", strlen(path) == 0 ? "<not set>" : path );
817 }
800 st->print_cr("Launcher Type: %s", _sun_java_launcher); 818 st->print_cr("Launcher Type: %s", _sun_java_launcher);
801 } 819 }
802 820
803 void Arguments::print_jvm_flags_on(outputStream* st) { 821 void Arguments::print_jvm_flags_on(outputStream* st) {
804 if (_num_jvm_flags > 0) { 822 if (_num_jvm_flags > 0) {
877 bool in_quote = false; 895 bool in_quote = false;
878 char quote_c = 0; 896 char quote_c = 0;
879 bool result = true; 897 bool result = true;
880 898
881 int c = getc(stream); 899 int c = getc(stream);
882 while(c != EOF) { 900 while(c != EOF && pos < (int)(sizeof(token)-1)) {
883 if (in_white_space) { 901 if (in_white_space) {
884 if (in_comment) { 902 if (in_comment) {
885 if (c == '\n') in_comment = false; 903 if (c == '\n') in_comment = false;
886 } else { 904 } else {
887 if (c == '#') in_comment = true; 905 if (c == '#') in_comment = true;
1070 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { 1088 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1071 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2); 1089 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2);
1072 } 1090 }
1073 } 1091 }
1074 1092
1075 #ifndef KERNEL 1093 #if INCLUDE_ALTERNATE_GCS
1076 static void disable_adaptive_size_policy(const char* collector_name) { 1094 static void disable_adaptive_size_policy(const char* collector_name) {
1077 if (UseAdaptiveSizePolicy) { 1095 if (UseAdaptiveSizePolicy) {
1078 if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) { 1096 if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) {
1079 warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.", 1097 warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.",
1080 collector_name); 1098 collector_name);
1102 FLAG_SET_DEFAULT(UseParNewGC, false); 1120 FLAG_SET_DEFAULT(UseParNewGC, false);
1103 FLAG_SET_DEFAULT(ParallelGCThreads, 0); 1121 FLAG_SET_DEFAULT(ParallelGCThreads, 0);
1104 } 1122 }
1105 } 1123 }
1106 if (UseParNewGC) { 1124 if (UseParNewGC) {
1107 // CDS doesn't work with ParNew yet
1108 no_shared_spaces();
1109
1110 // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively, 1125 // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively,
1111 // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration 1126 // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration
1112 // we set them to 1024 and 1024. 1127 // we set them to 1024 and 1024.
1113 // See CR 6362902. 1128 // See CR 6362902.
1114 if (FLAG_IS_DEFAULT(YoungPLABSize)) { 1129 if (FLAG_IS_DEFAULT(YoungPLABSize)) {
1119 } 1134 }
1120 1135
1121 // AlwaysTenure flag should make ParNew promote all at first collection. 1136 // AlwaysTenure flag should make ParNew promote all at first collection.
1122 // See CR 6362902. 1137 // See CR 6362902.
1123 if (AlwaysTenure) { 1138 if (AlwaysTenure) {
1124 FLAG_SET_CMDLINE(intx, MaxTenuringThreshold, 0); 1139 FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0);
1125 } 1140 }
1126 // When using compressed oops, we use local overflow stacks, 1141 // When using compressed oops, we use local overflow stacks,
1127 // rather than using a global overflow list chained through 1142 // rather than using a global overflow list chained through
1128 // the klass word of the object's pre-image. 1143 // the klass word of the object's pre-image.
1129 if (UseCompressedOops && !ParGCUseLocalOverflow) { 1144 if (UseCompressedOops && !ParGCUseLocalOverflow) {
1148 // unless explicitly forbidden. 1163 // unless explicitly forbidden.
1149 if (FLAG_IS_DEFAULT(UseParNewGC)) { 1164 if (FLAG_IS_DEFAULT(UseParNewGC)) {
1150 FLAG_SET_ERGO(bool, UseParNewGC, true); 1165 FLAG_SET_ERGO(bool, UseParNewGC, true);
1151 } 1166 }
1152 1167
1153 // Turn off AdaptiveSizePolicy for CMS until it is complete. 1168 // Turn off AdaptiveSizePolicy by default for cms until it is complete.
1154 disable_adaptive_size_policy("UseConcMarkSweepGC"); 1169 disable_adaptive_size_policy("UseConcMarkSweepGC");
1155 1170
1156 // In either case, adjust ParallelGCThreads and/or UseParNewGC 1171 // In either case, adjust ParallelGCThreads and/or UseParNewGC
1157 // as needed. 1172 // as needed.
1158 if (UseParNewGC) { 1173 if (UseParNewGC) {
1238 } 1253 }
1239 // Unless explicitly requested otherwise, definitely 1254 // Unless explicitly requested otherwise, definitely
1240 // promote all objects surviving "tenuring_default" scavenges. 1255 // promote all objects surviving "tenuring_default" scavenges.
1241 if (FLAG_IS_DEFAULT(MaxTenuringThreshold) && 1256 if (FLAG_IS_DEFAULT(MaxTenuringThreshold) &&
1242 FLAG_IS_DEFAULT(SurvivorRatio)) { 1257 FLAG_IS_DEFAULT(SurvivorRatio)) {
1243 FLAG_SET_ERGO(intx, MaxTenuringThreshold, tenuring_default); 1258 FLAG_SET_ERGO(uintx, MaxTenuringThreshold, tenuring_default);
1244 } 1259 }
1245 // If we decided above (or user explicitly requested) 1260 // If we decided above (or user explicitly requested)
1246 // `promote all' (via MaxTenuringThreshold := 0), 1261 // `promote all' (via MaxTenuringThreshold := 0),
1247 // prefer minuscule survivor spaces so as not to waste 1262 // prefer minuscule survivor spaces so as not to waste
1248 // space for (non-existent) survivors 1263 // space for (non-existent) survivors
1290 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 1305 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
1291 MarkStackSize / K, MarkStackSizeMax / K); 1306 MarkStackSize / K, MarkStackSizeMax / K);
1292 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 1307 tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
1293 } 1308 }
1294 } 1309 }
1295 #endif // KERNEL 1310 #endif // INCLUDE_ALTERNATE_GCS
1296 1311
1297 void set_object_alignment() { 1312 void set_object_alignment() {
1298 // Object alignment. 1313 // Object alignment.
1299 assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2"); 1314 assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
1300 MinObjAlignmentInBytes = ObjectAlignmentInBytes; 1315 MinObjAlignmentInBytes = ObjectAlignmentInBytes;
1307 LogMinObjAlignment = LogMinObjAlignmentInBytes - LogHeapWordSize; 1322 LogMinObjAlignment = LogMinObjAlignmentInBytes - LogHeapWordSize;
1308 1323
1309 // Oop encoding heap max 1324 // Oop encoding heap max
1310 OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes; 1325 OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
1311 1326
1312 #ifndef KERNEL 1327 #if INCLUDE_ALTERNATE_GCS
1313 // Set CMS global values 1328 // Set CMS global values
1314 CompactibleFreeListSpace::set_cms_values(); 1329 CompactibleFreeListSpace::set_cms_values();
1315 #endif // KERNEL 1330 #endif // INCLUDE_ALTERNATE_GCS
1316 } 1331 }
1317 1332
1318 bool verify_object_alignment() { 1333 bool verify_object_alignment() {
1319 // Object alignment. 1334 // Object alignment.
1320 if (!is_power_of_2(ObjectAlignmentInBytes)) { 1335 if (!is_power_of_2(ObjectAlignmentInBytes)) {
1348 return true; 1363 return true;
1349 } 1364 }
1350 1365
1351 inline uintx max_heap_for_compressed_oops() { 1366 inline uintx max_heap_for_compressed_oops() {
1352 // Avoid sign flip. 1367 // Avoid sign flip.
1353 if (OopEncodingHeapMax < MaxPermSize + os::vm_page_size()) { 1368 if (OopEncodingHeapMax < ClassMetaspaceSize + os::vm_page_size()) {
1354 return 0; 1369 return 0;
1355 } 1370 }
1356 LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); 1371 LP64_ONLY(return OopEncodingHeapMax - ClassMetaspaceSize - os::vm_page_size());
1357 NOT_LP64(ShouldNotReachHere(); return 0); 1372 NOT_LP64(ShouldNotReachHere(); return 0);
1358 } 1373 }
1359 1374
1360 bool Arguments::should_auto_select_low_pause_collector() { 1375 bool Arguments::should_auto_select_low_pause_collector() {
1361 if (UseAutoGCSelectPolicy && 1376 if (UseAutoGCSelectPolicy &&
1370 } 1385 }
1371 return false; 1386 return false;
1372 } 1387 }
1373 1388
1374 void Arguments::set_ergonomics_flags() { 1389 void Arguments::set_ergonomics_flags() {
1375 // Parallel GC is not compatible with sharing. If one specifies
1376 // that they want sharing explicitly, do not set ergonomics flags.
1377 if (DumpSharedSpaces || RequireSharedSpaces) {
1378 return;
1379 }
1380 1390
1381 if (os::is_server_class_machine()) { 1391 if (os::is_server_class_machine()) {
1382 // If no other collector is requested explicitly, 1392 // If no other collector is requested explicitly,
1383 // let the VM select the collector based on 1393 // let the VM select the collector based on
1384 // machine class and automatic selection policy. 1394 // machine class and automatic selection policy.
1385 if (!UseSerialGC && 1395 if (!UseSerialGC &&
1386 !UseConcMarkSweepGC && 1396 !UseConcMarkSweepGC &&
1387 !UseG1GC && 1397 !UseG1GC &&
1388 !UseParNewGC && 1398 !UseParNewGC &&
1389 !DumpSharedSpaces &&
1390 FLAG_IS_DEFAULT(UseParallelGC)) { 1399 FLAG_IS_DEFAULT(UseParallelGC)) {
1391 if (should_auto_select_low_pause_collector()) { 1400 if (should_auto_select_low_pause_collector()) {
1392 FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true); 1401 FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true);
1393 } else { 1402 } else {
1394 FLAG_SET_ERGO(bool, UseParallelGC, true); 1403 FLAG_SET_ERGO(bool, UseParallelGC, true);
1395 } 1404 }
1405 }
1406 // Shared spaces work fine with other GCs but causes bytecode rewriting
1407 // to be disabled, which hurts interpreter performance and decreases
1408 // server performance. On server class machines, keep the default
1409 // off unless it is asked for. Future work: either add bytecode rewriting
1410 // at link time, or rewrite bytecodes in non-shared methods.
1411 if (!DumpSharedSpaces && !RequireSharedSpaces) {
1396 no_shared_spaces(); 1412 no_shared_spaces();
1397 } 1413 }
1398 } 1414 }
1399 1415
1400 #ifndef ZERO 1416 #ifndef ZERO
1418 #endif // _WIN64 1434 #endif // _WIN64
1419 } else { 1435 } else {
1420 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { 1436 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
1421 warning("Max heap size too large for Compressed Oops"); 1437 warning("Max heap size too large for Compressed Oops");
1422 FLAG_SET_DEFAULT(UseCompressedOops, false); 1438 FLAG_SET_DEFAULT(UseCompressedOops, false);
1439 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
1440 }
1441 }
1442 // UseCompressedOops must be on for UseCompressedKlassPointers to be on.
1443 if (!UseCompressedOops) {
1444 if (UseCompressedKlassPointers) {
1445 warning("UseCompressedKlassPointers requires UseCompressedOops");
1446 }
1447 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
1448 } else {
1449 // Turn on UseCompressedKlassPointers too
1450 if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
1451 FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
1452 }
1453 // Set the ClassMetaspaceSize to something that will not need to be
1454 // expanded, since it cannot be expanded.
1455 if (UseCompressedKlassPointers && FLAG_IS_DEFAULT(ClassMetaspaceSize)) {
1456 // 100,000 classes seems like a good size, so 100M assumes around 1K
1457 // per klass. The vtable and oopMap is embedded so we don't have a fixed
1458 // size per klass. Eventually, this will be parameterized because it
1459 // would also be useful to determine the optimal size of the
1460 // systemDictionary.
1461 FLAG_SET_ERGO(uintx, ClassMetaspaceSize, 100*M);
1423 } 1462 }
1424 } 1463 }
1425 // Also checks that certain machines are slower with compressed oops 1464 // Also checks that certain machines are slower with compressed oops
1426 // in vm_version initialization code. 1465 // in vm_version initialization code.
1427 #endif // _LP64 1466 #endif // _LP64
1459 // Par compact uses lower default values since they are treated as 1498 // Par compact uses lower default values since they are treated as
1460 // minimums. These are different defaults because of the different 1499 // minimums. These are different defaults because of the different
1461 // interpretation and are not ergonomically set. 1500 // interpretation and are not ergonomically set.
1462 if (FLAG_IS_DEFAULT(MarkSweepDeadRatio)) { 1501 if (FLAG_IS_DEFAULT(MarkSweepDeadRatio)) {
1463 FLAG_SET_DEFAULT(MarkSweepDeadRatio, 1); 1502 FLAG_SET_DEFAULT(MarkSweepDeadRatio, 1);
1464 }
1465 if (FLAG_IS_DEFAULT(PermMarkSweepDeadRatio)) {
1466 FLAG_SET_DEFAULT(PermMarkSweepDeadRatio, 5);
1467 } 1503 }
1468 } 1504 }
1469 } 1505 }
1470 if (UseNUMA) { 1506 if (UseNUMA) {
1471 if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) { 1507 if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
1486 Abstract_VM_Version::parallel_worker_threads()); 1522 Abstract_VM_Version::parallel_worker_threads());
1487 if (ParallelGCThreads == 0) { 1523 if (ParallelGCThreads == 0) {
1488 FLAG_SET_DEFAULT(ParallelGCThreads, 1524 FLAG_SET_DEFAULT(ParallelGCThreads,
1489 Abstract_VM_Version::parallel_worker_threads()); 1525 Abstract_VM_Version::parallel_worker_threads());
1490 } 1526 }
1491 no_shared_spaces();
1492 1527
1493 if (FLAG_IS_DEFAULT(MarkStackSize)) { 1528 if (FLAG_IS_DEFAULT(MarkStackSize)) {
1494 FLAG_SET_DEFAULT(MarkStackSize, 128 * TASKQUEUE_SIZE); 1529 FLAG_SET_DEFAULT(MarkStackSize, 128 * TASKQUEUE_SIZE);
1495 } 1530 }
1496 if (PrintGCDetails && Verbose) { 1531 if (PrintGCDetails && Verbose) {
1822 status = false; 1857 status = false;
1823 } 1858 }
1824 1859
1825 status = status && verify_percentage(AdaptiveSizePolicyWeight, 1860 status = status && verify_percentage(AdaptiveSizePolicyWeight,
1826 "AdaptiveSizePolicyWeight"); 1861 "AdaptiveSizePolicyWeight");
1827 status = status && verify_percentage(AdaptivePermSizeWeight, "AdaptivePermSizeWeight");
1828 status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance"); 1862 status = status && verify_percentage(ThresholdTolerance, "ThresholdTolerance");
1829 status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio"); 1863 status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio");
1830 status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio"); 1864 status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio");
1865
1866 // Divide by bucket size to prevent a large size from causing rollover when
1867 // calculating amount of memory needed to be allocated for the String table.
1868 status = status && verify_interval(StringTableSize, defaultStringTableSize,
1869 (max_uintx / StringTable::bucket_size()), "StringTable size");
1831 1870
1832 if (MinHeapFreeRatio > MaxHeapFreeRatio) { 1871 if (MinHeapFreeRatio > MaxHeapFreeRatio) {
1833 jio_fprintf(defaultStream::error_stream(), 1872 jio_fprintf(defaultStream::error_stream(),
1834 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " 1873 "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or "
1835 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n", 1874 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n",
1962 status = status && verify_interval(TLABWasteTargetPercent, 2001 status = status && verify_interval(TLABWasteTargetPercent,
1963 1, 100, "TLABWasteTargetPercent"); 2002 1, 100, "TLABWasteTargetPercent");
1964 2003
1965 status = status && verify_object_alignment(); 2004 status = status && verify_object_alignment();
1966 2005
2006 status = status && verify_min_value(ClassMetaspaceSize, 1*M,
2007 "ClassMetaspaceSize");
2008
2009 #ifdef SPARC
2010 if (UseConcMarkSweepGC || UseG1GC) {
2011 // Issue a stern warning if the user has explicitly set
2012 // UseMemSetInBOT (it is known to cause issues), but allow
2013 // use for experimentation and debugging.
2014 if (VM_Version::is_sun4v() && UseMemSetInBOT) {
2015 assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
2016 warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
2017 " on sun4v; please understand that you are using at your own risk!");
2018 }
2019 }
2020 #endif // SPARC
2021
2022 if (PrintNMTStatistics) {
2023 #if INCLUDE_NMT
2024 if (MemTracker::tracking_level() == MemTracker::NMT_off) {
2025 #endif // INCLUDE_NMT
2026 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
2027 PrintNMTStatistics = false;
2028 #if INCLUDE_NMT
2029 }
2030 #endif
2031 }
1967 #ifdef GRAAL 2032 #ifdef GRAAL
1968 if (UseCompressedOops) { 2033 if (UseCompressedOops) {
1969 jio_fprintf(defaultStream::error_stream(), 2034 jio_fprintf(defaultStream::error_stream(),
1970 "CompressedOops are not supported in Graal at the moment\n"); 2035 "CompressedOops are not supported in Graal at the moment\n");
1971 status = false; 2036 status = false;
1972 } 2037 }
2038 if (UseCompressedKlassPointers) {
2039 jio_fprintf(defaultStream::error_stream(),
2040 "UseCompressedKlassPointers are not supported in Graal at the moment\n");
2041 status = false;
2042 }
1973 if (UseG1GC) { 2043 if (UseG1GC) {
1974 jio_fprintf(defaultStream::error_stream(), 2044 jio_fprintf(defaultStream::error_stream(),
1975 "G1 is not supported in Graal at the moment\n"); 2045 "G1 is not supported in Graal at the moment\n");
1976 status = false; 2046 status = false;
1977 } 2047 }
2048
2049 if (!ScavengeRootsInCode) {
2050 warning("forcing ScavengeRootsInCode non-zero because Graal is enabled");
2051 ScavengeRootsInCode = 1;
2052 }
2053
1978 #endif 2054 #endif
1979
1980 return status; 2055 return status;
1981 } 2056 }
1982 2057
1983 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore, 2058 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
1984 const char* option_type) { 2059 const char* option_type) {
2317 char *options = NULL; 2392 char *options = NULL;
2318 if(pos != NULL) { 2393 if(pos != NULL) {
2319 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. 2394 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied.
2320 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); 2395 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2);
2321 } 2396 }
2322 #ifdef JVMTI_KERNEL 2397 #if !INCLUDE_JVMTI
2323 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { 2398 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
2324 warning("profiling and debugging agents are not supported with Kernel VM"); 2399 warning("profiling and debugging agents are not supported in this VM");
2325 } else 2400 } else
2326 #endif // JVMTI_KERNEL 2401 #endif // !INCLUDE_JVMTI
2327 add_init_library(name, options); 2402 add_init_library(name, options);
2328 } 2403 }
2329 // -agentlib and -agentpath 2404 // -agentlib and -agentpath
2330 } else if (match_option(option, "-agentlib:", &tail) || 2405 } else if (match_option(option, "-agentlib:", &tail) ||
2331 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { 2406 (is_absolute_path = match_option(option, "-agentpath:", &tail))) {
2332 if(tail != NULL) { 2407 if(tail != NULL) {
2337 2412
2338 char *options = NULL; 2413 char *options = NULL;
2339 if(pos != NULL) { 2414 if(pos != NULL) {
2340 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); 2415 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1);
2341 } 2416 }
2342 #ifdef JVMTI_KERNEL 2417 #if !INCLUDE_JVMTI
2343 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { 2418 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
2344 warning("profiling and debugging agents are not supported with Kernel VM"); 2419 warning("profiling and debugging agents are not supported in this VM");
2345 } else 2420 } else
2346 #endif // JVMTI_KERNEL 2421 #endif // !INCLUDE_JVMTI
2347 add_init_agent(name, options, is_absolute_path); 2422 add_init_agent(name, options, is_absolute_path);
2348 2423
2349 } 2424 }
2350 // -javaagent 2425 // -javaagent
2351 } else if (match_option(option, "-javaagent:", &tail)) { 2426 } else if (match_option(option, "-javaagent:", &tail)) {
2427 #if !INCLUDE_JVMTI
2428 warning("Instrumentation agents are not supported in this VM");
2429 #else
2352 if(tail != NULL) { 2430 if(tail != NULL) {
2353 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); 2431 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail);
2354 add_init_agent("instrument", options, false); 2432 add_init_agent("instrument", options, false);
2355 } 2433 }
2434 #endif // !INCLUDE_JVMTI
2356 // -Xnoclassgc 2435 // -Xnoclassgc
2357 } else if (match_option(option, "-Xnoclassgc", &tail)) { 2436 } else if (match_option(option, "-Xnoclassgc", &tail)) {
2358 FLAG_SET_CMDLINE(bool, ClassUnloading, false); 2437 FLAG_SET_CMDLINE(bool, ClassUnloading, false);
2359 // -Xincgc: i-CMS 2438 // -Xincgc: i-CMS
2360 } else if (match_option(option, "-Xincgc", &tail)) { 2439 } else if (match_option(option, "-Xincgc", &tail)) {
2482 // -Xoptimize 2561 // -Xoptimize
2483 } else if (match_option(option, "-Xoptimize", &tail)) { 2562 } else if (match_option(option, "-Xoptimize", &tail)) {
2484 // EVM option, ignore silently for compatibility 2563 // EVM option, ignore silently for compatibility
2485 // -Xprof 2564 // -Xprof
2486 } else if (match_option(option, "-Xprof", &tail)) { 2565 } else if (match_option(option, "-Xprof", &tail)) {
2487 #ifndef FPROF_KERNEL 2566 #if INCLUDE_FPROF
2488 _has_profile = true; 2567 _has_profile = true;
2489 #else // FPROF_KERNEL 2568 #else // INCLUDE_FPROF
2490 // do we have to exit? 2569 // do we have to exit?
2491 warning("Kernel VM does not support flat profiling."); 2570 warning("Flat profiling is not supported in this VM.");
2492 #endif // FPROF_KERNEL 2571 #endif // INCLUDE_FPROF
2493 // -Xaprof 2572 // -Xaprof
2494 } else if (match_option(option, "-Xaprof", &tail)) { 2573 } else if (match_option(option, "-Xaprof", &tail)) {
2495 _has_alloc_profile = true; 2574 _has_alloc_profile = true;
2496 // -Xconcurrentio 2575 // -Xconcurrentio
2497 } else if (match_option(option, "-Xconcurrentio", &tail)) { 2576 } else if (match_option(option, "-Xconcurrentio", &tail)) {
2532 // for testing the compiler; turn off all flags that inhibit compilation 2611 // for testing the compiler; turn off all flags that inhibit compilation
2533 set_mode_flags(_comp); 2612 set_mode_flags(_comp);
2534 2613
2535 // -Xshare:dump 2614 // -Xshare:dump
2536 } else if (match_option(option, "-Xshare:dump", &tail)) { 2615 } else if (match_option(option, "-Xshare:dump", &tail)) {
2537 #ifdef TIERED 2616 #if defined(KERNEL)
2538 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true);
2539 set_mode_flags(_int); // Prevent compilation, which creates objects
2540 #elif defined(COMPILER2)
2541 vm_exit_during_initialization(
2542 "Dumping a shared archive is not supported on the Server JVM.", NULL);
2543 #elif defined(KERNEL)
2544 vm_exit_during_initialization( 2617 vm_exit_during_initialization(
2545 "Dumping a shared archive is not supported on the Kernel JVM.", NULL); 2618 "Dumping a shared archive is not supported on the Kernel JVM.", NULL);
2619 #elif !INCLUDE_CDS
2620 vm_exit_during_initialization(
2621 "Dumping a shared archive is not supported in this VM.", NULL);
2546 #else 2622 #else
2547 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); 2623 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true);
2548 set_mode_flags(_int); // Prevent compilation, which creates objects 2624 set_mode_flags(_int); // Prevent compilation, which creates objects
2549 #endif 2625 #endif
2550 // -Xshare:on 2626 // -Xshare:on
2593 FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true); 2669 FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true);
2594 2670
2595 // JNI hooks 2671 // JNI hooks
2596 } else if (match_option(option, "-Xcheck", &tail)) { 2672 } else if (match_option(option, "-Xcheck", &tail)) {
2597 if (!strcmp(tail, ":jni")) { 2673 if (!strcmp(tail, ":jni")) {
2674 #if !INCLUDE_JNI_CHECK
2675 warning("JNI CHECKING is not supported in this VM");
2676 #else
2598 CheckJNICalls = true; 2677 CheckJNICalls = true;
2678 #endif // INCLUDE_JNI_CHECK
2599 } else if (is_bad_option(option, args->ignoreUnrecognized, 2679 } else if (is_bad_option(option, args->ignoreUnrecognized,
2600 "check")) { 2680 "check")) {
2601 return JNI_EINVAL; 2681 return JNI_EINVAL;
2602 } 2682 }
2603 } else if (match_option(option, "vfprintf", &tail)) { 2683 } else if (match_option(option, "vfprintf", &tail)) {
2638 2718
2639 // Make sure that if we have a lot of memory we cap the 32 bit 2719 // Make sure that if we have a lot of memory we cap the 32 bit
2640 // process space. The 64bit VM version of this function is a nop. 2720 // process space. The 64bit VM version of this function is a nop.
2641 initHeapSize = os::allocatable_physical_memory(initHeapSize); 2721 initHeapSize = os::allocatable_physical_memory(initHeapSize);
2642 2722
2643 // The perm gen is separate but contiguous with the
2644 // object heap (and is reserved with it) so subtract it
2645 // from the heap size.
2646 if (initHeapSize > MaxPermSize) {
2647 initHeapSize = initHeapSize - MaxPermSize;
2648 } else {
2649 warning("AggressiveHeap and MaxPermSize values may conflict");
2650 }
2651
2652 if (FLAG_IS_DEFAULT(MaxHeapSize)) { 2723 if (FLAG_IS_DEFAULT(MaxHeapSize)) {
2653 FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize); 2724 FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize);
2654 FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize); 2725 FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize);
2655 // Currently the minimum size and the initial heap sizes are the same. 2726 // Currently the minimum size and the initial heap sizes are the same.
2656 set_min_heap_size(initHeapSize); 2727 set_min_heap_size(initHeapSize);
2660 FLAG_SET_CMDLINE(uintx, NewSize, 2731 FLAG_SET_CMDLINE(uintx, NewSize,
2661 ((julong)MaxHeapSize / (julong)8) * (julong)3); 2732 ((julong)MaxHeapSize / (julong)8) * (julong)3);
2662 FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize); 2733 FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize);
2663 } 2734 }
2664 2735
2736 #ifndef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD.
2665 FLAG_SET_DEFAULT(UseLargePages, true); 2737 FLAG_SET_DEFAULT(UseLargePages, true);
2738 #endif
2666 2739
2667 // Increase some data structure sizes for efficiency 2740 // Increase some data structure sizes for efficiency
2668 FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize); 2741 FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize);
2669 FLAG_SET_CMDLINE(bool, ResizeTLAB, false); 2742 FLAG_SET_CMDLINE(bool, ResizeTLAB, false);
2670 FLAG_SET_CMDLINE(uintx, TLABSize, 256*K); 2743 FLAG_SET_CMDLINE(uintx, TLABSize, 256*K);
2867 option->optionString); 2940 option->optionString);
2868 describe_range_error(errcode); 2941 describe_range_error(errcode);
2869 return JNI_EINVAL; 2942 return JNI_EINVAL;
2870 } 2943 }
2871 FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size); 2944 FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size);
2945 } else if (match_option(option, "-XX:+UseVMInterruptibleIO", &tail)) {
2946 // NOTE! In JDK 9, the UseVMInterruptibleIO flag will completely go
2947 // away and will cause VM initialization failures!
2948 warning("-XX:+UseVMInterruptibleIO is obsolete and will be removed in a future release.");
2949 FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true);
2872 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx 2950 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
2873 // Skip -XX:Flags= since that case has already been handled 2951 // Skip -XX:Flags= since that case has already been handled
2874 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { 2952 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {
2875 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { 2953 if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
2876 return JNI_EINVAL; 2954 return JNI_EINVAL;
2893 } 2971 }
2894 } 2972 }
2895 2973
2896 // Change the default value for flags which have different default values 2974 // Change the default value for flags which have different default values
2897 // when working with older JDKs. 2975 // when working with older JDKs.
2898 if (JDK_Version::current().compare_major(6) <= 0 &&
2899 FLAG_IS_DEFAULT(UseVMInterruptibleIO)) {
2900 FLAG_SET_DEFAULT(UseVMInterruptibleIO, true);
2901 }
2902 #ifdef LINUX 2976 #ifdef LINUX
2903 if (JDK_Version::current().compare_major(6) <= 0 && 2977 if (JDK_Version::current().compare_major(6) <= 0 &&
2904 FLAG_IS_DEFAULT(UseLinuxPosixThreadCPUClocks)) { 2978 FLAG_IS_DEFAULT(UseLinuxPosixThreadCPUClocks)) {
2905 FLAG_SET_DEFAULT(UseLinuxPosixThreadCPUClocks, false); 2979 FLAG_SET_DEFAULT(UseLinuxPosixThreadCPUClocks, false);
2906 } 2980 }
3062 3136
3063 void Arguments::set_shared_spaces_flags() { 3137 void Arguments::set_shared_spaces_flags() {
3064 const bool must_share = DumpSharedSpaces || RequireSharedSpaces; 3138 const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
3065 const bool might_share = must_share || UseSharedSpaces; 3139 const bool might_share = must_share || UseSharedSpaces;
3066 3140
3067 // The string table is part of the shared archive so the size must match. 3141 // CompressedOops cannot be used with CDS. The offsets of oopmaps and
3068 if (!FLAG_IS_DEFAULT(StringTableSize)) { 3142 // static fields are incorrect in the archive. With some more clever
3069 // Disable sharing. 3143 // initialization, this restriction can probably be lifted.
3070 if (must_share) { 3144 // ??? UseLargePages might be okay now
3071 warning("disabling shared archive %s because of non-default " 3145 const bool cannot_share = UseCompressedOops ||
3072 "StringTableSize", DumpSharedSpaces ? "creation" : "use"); 3146 (UseLargePages && FLAG_IS_CMDLINE(UseLargePages));
3073 }
3074 if (might_share) {
3075 FLAG_SET_DEFAULT(DumpSharedSpaces, false);
3076 FLAG_SET_DEFAULT(RequireSharedSpaces, false);
3077 FLAG_SET_DEFAULT(UseSharedSpaces, false);
3078 }
3079 return;
3080 }
3081
3082 // Check whether class data sharing settings conflict with GC, compressed oops
3083 // or page size, and fix them up. Explicit sharing options override other
3084 // settings.
3085 const bool cannot_share = UseConcMarkSweepGC || CMSIncrementalMode ||
3086 UseG1GC || UseParNewGC || UseParallelGC || UseParallelOldGC ||
3087 UseCompressedOops || UseLargePages && FLAG_IS_CMDLINE(UseLargePages);
3088 if (cannot_share) { 3147 if (cannot_share) {
3089 if (must_share) { 3148 if (must_share) {
3090 warning("selecting serial gc and disabling large pages %s" 3149 warning("disabling large pages %s"
3091 "because of %s", "" LP64_ONLY("and compressed oops "), 3150 "because of %s", "" LP64_ONLY("and compressed oops "),
3092 DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on"); 3151 DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
3093 force_serial_gc();
3094 FLAG_SET_CMDLINE(bool, UseLargePages, false); 3152 FLAG_SET_CMDLINE(bool, UseLargePages, false);
3095 LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false)); 3153 LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false));
3154 LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false));
3096 } else { 3155 } else {
3156 // Prefer compressed oops and large pages to class data sharing
3097 if (UseSharedSpaces && Verbose) { 3157 if (UseSharedSpaces && Verbose) {
3098 warning("turning off use of shared archive because of " 3158 warning("turning off use of shared archive because of large pages%s",
3099 "choice of garbage collector or large pages"); 3159 "" LP64_ONLY(" and/or compressed oops"));
3100 } 3160 }
3101 no_shared_spaces(); 3161 no_shared_spaces();
3102 } 3162 }
3103 } else if (UseLargePages && might_share) { 3163 } else if (UseLargePages && might_share) {
3104 // Disable large pages to allow shared spaces. This is sub-optimal, since 3164 // Disable large pages to allow shared spaces. This is sub-optimal, since
3105 // there may not even be a shared archive to use. 3165 // there may not even be a shared archive to use.
3106 FLAG_SET_DEFAULT(UseLargePages, false); 3166 FLAG_SET_DEFAULT(UseLargePages, false);
3167 }
3168
3169 // Add 2M to any size for SharedReadOnlySize to get around the JPRT setting
3170 if (DumpSharedSpaces && !FLAG_IS_DEFAULT(SharedReadOnlySize)) {
3171 SharedReadOnlySize = 14*M;
3172 }
3173
3174 if (DumpSharedSpaces) {
3175 if (RequireSharedSpaces) {
3176 warning("cannot dump shared archive while using shared archive");
3177 }
3178 UseSharedSpaces = false;
3107 } 3179 }
3108 } 3180 }
3109 3181
3110 // Disable options not supported in this release, with a warning if they 3182 // Disable options not supported in this release, with a warning if they
3111 // were explicitly requested on the command-line 3183 // were explicitly requested on the command-line
3170 if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) { 3242 if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) {
3171 CommandLineFlags::printFlags(tty, false); 3243 CommandLineFlags::printFlags(tty, false);
3172 vm_exit(0); 3244 vm_exit(0);
3173 } 3245 }
3174 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { 3246 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
3247 #if INCLUDE_NMT
3175 MemTracker::init_tracking_options(tail); 3248 MemTracker::init_tracking_options(tail);
3249 #else
3250 warning("Native Memory Tracking is not supported in this VM");
3251 #endif
3176 } 3252 }
3177 3253
3178 3254
3179 #ifndef PRODUCT 3255 #ifndef PRODUCT
3180 if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) { 3256 if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) {
3233 3309
3234 #if (defined JAVASE_EMBEDDED || defined ARM) 3310 #if (defined JAVASE_EMBEDDED || defined ARM)
3235 UNSUPPORTED_OPTION(UseG1GC, "G1 GC"); 3311 UNSUPPORTED_OPTION(UseG1GC, "G1 GC");
3236 #endif 3312 #endif
3237 3313
3314 #ifdef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD.
3315 UNSUPPORTED_OPTION(UseLargePages, "-XX:+UseLargePages");
3316 #endif
3317
3318 #if !INCLUDE_ALTERNATE_GCS
3319 if (UseParallelGC) {
3320 warning("Parallel GC is not supported in this VM. Using Serial GC.");
3321 }
3322 if (UseParallelOldGC) {
3323 warning("Parallel Old GC is not supported in this VM. Using Serial GC.");
3324 }
3325 if (UseConcMarkSweepGC) {
3326 warning("Concurrent Mark Sweep GC is not supported in this VM. Using Serial GC.");
3327 }
3328 if (UseParNewGC) {
3329 warning("Par New GC is not supported in this VM. Using Serial GC.");
3330 }
3331 #endif // INCLUDE_ALTERNATE_GCS
3332
3238 #ifndef PRODUCT 3333 #ifndef PRODUCT
3239 if (TraceBytecodesAt != 0) { 3334 if (TraceBytecodesAt != 0) {
3240 TraceBytecodes = true; 3335 TraceBytecodes = true;
3241 } 3336 }
3242 if (CountCompiledCalls) { 3337 if (CountCompiledCalls) {
3261 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) { 3356 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
3262 warning("forcing ScavengeRootsInCode non-zero because EnableInvokeDynamic is true"); 3357 warning("forcing ScavengeRootsInCode non-zero because EnableInvokeDynamic is true");
3263 } 3358 }
3264 ScavengeRootsInCode = 1; 3359 ScavengeRootsInCode = 1;
3265 } 3360 }
3266 if (!JavaObjectsInPerm && ScavengeRootsInCode == 0) {
3267 if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
3268 warning("forcing ScavengeRootsInCode non-zero because JavaObjectsInPerm is false");
3269 }
3270 ScavengeRootsInCode = 1;
3271 }
3272 3361
3273 if (PrintGCDetails) { 3362 if (PrintGCDetails) {
3274 // Turn on -verbose:gc options as well 3363 // Turn on -verbose:gc options as well
3275 PrintGC = true; 3364 PrintGC = true;
3276 } 3365 }
3287 set_object_alignment(); 3376 set_object_alignment();
3288 3377
3289 #ifdef SERIALGC 3378 #ifdef SERIALGC
3290 force_serial_gc(); 3379 force_serial_gc();
3291 #endif // SERIALGC 3380 #endif // SERIALGC
3292 #ifdef KERNEL 3381 #if !INCLUDE_CDS
3293 no_shared_spaces(); 3382 no_shared_spaces();
3294 #endif // KERNEL 3383 #endif // INCLUDE_CDS
3295 3384
3296 // Set flags based on ergonomics. 3385 // Set flags based on ergonomics.
3297 set_ergonomics_flags(); 3386 set_ergonomics_flags();
3298 3387
3299 set_shared_spaces_flags(); 3388 set_shared_spaces_flags();
3311 vm_exit_during_initialization( 3400 vm_exit_during_initialization(
3312 "Incompatible compilation policy selected", NULL); 3401 "Incompatible compilation policy selected", NULL);
3313 } 3402 }
3314 } 3403 }
3315 3404
3316 #ifndef KERNEL
3317 // Set heap size based on available physical memory 3405 // Set heap size based on available physical memory
3318 set_heap_size(); 3406 set_heap_size();
3407
3408 #if INCLUDE_ALTERNATE_GCS
3319 // Set per-collector flags 3409 // Set per-collector flags
3320 if (UseParallelGC || UseParallelOldGC) { 3410 if (UseParallelGC || UseParallelOldGC) {
3321 set_parallel_gc_flags(); 3411 set_parallel_gc_flags();
3322 } else if (UseConcMarkSweepGC) { // should be done before ParNew check below 3412 } else if (UseConcMarkSweepGC) { // should be done before ParNew check below
3323 set_cms_and_parnew_gc_flags(); 3413 set_cms_and_parnew_gc_flags();
3324 } else if (UseParNewGC) { // skipped if CMS is set above 3414 } else if (UseParNewGC) { // skipped if CMS is set above
3325 set_parnew_gc_flags(); 3415 set_parnew_gc_flags();
3326 } else if (UseG1GC) { 3416 } else if (UseG1GC) {
3327 set_g1_gc_flags(); 3417 set_g1_gc_flags();
3328 } 3418 }
3329 #endif // KERNEL 3419 #endif // INCLUDE_ALTERNATE_GCS
3330 3420
3331 #ifdef SERIALGC 3421 #ifdef SERIALGC
3332 assert(verify_serial_gc_flags(), "SerialGC unset"); 3422 assert(verify_serial_gc_flags(), "SerialGC unset");
3333 #endif // SERIALGC 3423 #endif // SERIALGC
3334 3424
3358 #ifdef CC_INTERP 3448 #ifdef CC_INTERP
3359 // Clear flags not supported by the C++ interpreter 3449 // Clear flags not supported by the C++ interpreter
3360 FLAG_SET_DEFAULT(ProfileInterpreter, false); 3450 FLAG_SET_DEFAULT(ProfileInterpreter, false);
3361 FLAG_SET_DEFAULT(UseBiasedLocking, false); 3451 FLAG_SET_DEFAULT(UseBiasedLocking, false);
3362 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false)); 3452 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedOops, false));
3453 LP64_ONLY(FLAG_SET_DEFAULT(UseCompressedKlassPointers, false));
3363 #endif // CC_INTERP 3454 #endif // CC_INTERP
3364 3455
3365 #ifdef COMPILER2 3456 #ifdef COMPILER2
3366 if (!UseBiasedLocking || EmitSync != 0) { 3457 if (!UseBiasedLocking || EmitSync != 0) {
3367 UseOptoBiasInlining = false; 3458 UseOptoBiasInlining = false;