comparison src/share/vm/runtime/arguments.cpp @ 14412:e2722a66aba7

Merge
author kvn
date Thu, 05 Sep 2013 11:04:39 -0700
parents bdd155477289 740e263c80c6
children abe03600372a
comparison
equal deleted inserted replaced
14411:bdd155477289 14412:e2722a66aba7
1394 return true; 1394 return true;
1395 } 1395 }
1396 1396
1397 inline uintx max_heap_for_compressed_oops() { 1397 inline uintx max_heap_for_compressed_oops() {
1398 // Avoid sign flip. 1398 // Avoid sign flip.
1399 if (OopEncodingHeapMax < ClassMetaspaceSize + os::vm_page_size()) { 1399 assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1400 return 0; 1400 LP64_ONLY(return OopEncodingHeapMax - os::vm_page_size());
1401 }
1402 LP64_ONLY(return OopEncodingHeapMax - ClassMetaspaceSize - os::vm_page_size());
1403 NOT_LP64(ShouldNotReachHere(); return 0); 1401 NOT_LP64(ShouldNotReachHere(); return 0);
1404 } 1402 }
1405 1403
1406 bool Arguments::should_auto_select_low_pause_collector() { 1404 bool Arguments::should_auto_select_low_pause_collector() {
1407 if (UseAutoGCSelectPolicy && 1405 if (UseAutoGCSelectPolicy &&
1447 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false); 1445 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
1448 } 1446 }
1449 } 1447 }
1450 #endif // _LP64 1448 #endif // _LP64
1451 #endif // ZERO 1449 #endif // ZERO
1450 }
1451
1452
1453 // NOTE: set_use_compressed_klass_ptrs() must be called after calling
1454 // set_use_compressed_oops().
1455 void Arguments::set_use_compressed_klass_ptrs() {
1456 #ifndef ZERO
1457 #ifdef _LP64
1458 // UseCompressedOops must be on for UseCompressedKlassPointers to be on.
1459 if (!UseCompressedOops) {
1460 if (UseCompressedKlassPointers) {
1461 warning("UseCompressedKlassPointers requires UseCompressedOops");
1462 }
1463 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
1464 } else {
1465 // Turn on UseCompressedKlassPointers too
1466 if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
1467 FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
1468 }
1469 // Check the ClassMetaspaceSize to make sure we use compressed klass ptrs.
1470 if (UseCompressedKlassPointers) {
1471 if (ClassMetaspaceSize > KlassEncodingMetaspaceMax) {
1472 warning("Class metaspace size is too large for UseCompressedKlassPointers");
1473 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
1474 }
1475 }
1476 }
1477 #endif // _LP64
1478 #endif // !ZERO
1452 } 1479 }
1453 1480
1454 void Arguments::set_ergonomics_flags() { 1481 void Arguments::set_ergonomics_flags() {
1455 1482
1456 if (os::is_server_class_machine()) { 1483 if (os::is_server_class_machine()) {
1471 // Shared spaces work fine with other GCs but causes bytecode rewriting 1498 // Shared spaces work fine with other GCs but causes bytecode rewriting
1472 // to be disabled, which hurts interpreter performance and decreases 1499 // to be disabled, which hurts interpreter performance and decreases
1473 // server performance. On server class machines, keep the default 1500 // server performance. On server class machines, keep the default
1474 // off unless it is asked for. Future work: either add bytecode rewriting 1501 // off unless it is asked for. Future work: either add bytecode rewriting
1475 // at link time, or rewrite bytecodes in non-shared methods. 1502 // at link time, or rewrite bytecodes in non-shared methods.
1476 if (!DumpSharedSpaces && !RequireSharedSpaces) { 1503 if (!DumpSharedSpaces && !RequireSharedSpaces &&
1504 (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
1477 no_shared_spaces(); 1505 no_shared_spaces();
1478 } 1506 }
1479 } 1507 }
1480 1508
1481 #ifndef ZERO 1509 #ifndef ZERO
1482 #ifdef _LP64 1510 #ifdef _LP64
1483 set_use_compressed_oops(); 1511 set_use_compressed_oops();
1484 // UseCompressedOops must be on for UseCompressedKlassPointers to be on. 1512
1485 if (!UseCompressedOops) { 1513 // set_use_compressed_klass_ptrs() must be called after calling
1486 if (UseCompressedKlassPointers) { 1514 // set_use_compressed_oops().
1487 warning("UseCompressedKlassPointers requires UseCompressedOops"); 1515 set_use_compressed_klass_ptrs();
1488 } 1516
1489 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
1490 } else {
1491 // Turn on UseCompressedKlassPointers too
1492 if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
1493 FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
1494 }
1495 // Set the ClassMetaspaceSize to something that will not need to be
1496 // expanded, since it cannot be expanded.
1497 if (UseCompressedKlassPointers) {
1498 if (ClassMetaspaceSize > KlassEncodingMetaspaceMax) {
1499 warning("Class metaspace size is too large for UseCompressedKlassPointers");
1500 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
1501 } else if (FLAG_IS_DEFAULT(ClassMetaspaceSize)) {
1502 // 100,000 classes seems like a good size, so 100M assumes around 1K
1503 // per klass. The vtable and oopMap is embedded so we don't have a fixed
1504 // size per klass. Eventually, this will be parameterized because it
1505 // would also be useful to determine the optimal size of the
1506 // systemDictionary.
1507 FLAG_SET_ERGO(uintx, ClassMetaspaceSize, 100*M);
1508 }
1509 }
1510 }
1511 // Also checks that certain machines are slower with compressed oops 1517 // Also checks that certain machines are slower with compressed oops
1512 // in vm_version initialization code. 1518 // in vm_version initialization code.
1513 #endif // _LP64 1519 #endif // _LP64
1514 #endif // !ZERO 1520 #endif // !ZERO
1515 } 1521 }
2154 status = status && verify_interval(TLABWasteTargetPercent, 2160 status = status && verify_interval(TLABWasteTargetPercent,
2155 1, 100, "TLABWasteTargetPercent"); 2161 1, 100, "TLABWasteTargetPercent");
2156 2162
2157 status = status && verify_object_alignment(); 2163 status = status && verify_object_alignment();
2158 2164
2159 status = status && verify_min_value(ClassMetaspaceSize, 1*M, 2165 status = status && verify_interval(ClassMetaspaceSize, 1*M, 3*G,
2160 "ClassMetaspaceSize"); 2166 "ClassMetaspaceSize");
2161 2167
2162 status = status && verify_interval(MarkStackSizeMax, 2168 status = status && verify_interval(MarkStackSizeMax,
2163 1, (max_jint - 1), "MarkStackSizeMax"); 2169 1, (max_jint - 1), "MarkStackSizeMax");
2164 status = status && verify_interval(NUMAChunkResizeWeight, 0, 100, "NUMAChunkResizeWeight"); 2170 status = status && verify_interval(NUMAChunkResizeWeight, 0, 100, "NUMAChunkResizeWeight");
3274 } 3280 }
3275 return JNI_OK; 3281 return JNI_OK;
3276 } 3282 }
3277 3283
3278 void Arguments::set_shared_spaces_flags() { 3284 void Arguments::set_shared_spaces_flags() {
3279 #ifdef _LP64
3280 const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
3281
3282 // CompressedOops cannot be used with CDS. The offsets of oopmaps and
3283 // static fields are incorrect in the archive. With some more clever
3284 // initialization, this restriction can probably be lifted.
3285 if (UseCompressedOops) {
3286 if (must_share) {
3287 warning("disabling compressed oops because of %s",
3288 DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
3289 FLAG_SET_CMDLINE(bool, UseCompressedOops, false);
3290 FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false);
3291 } else {
3292 // Prefer compressed oops to class data sharing
3293 if (UseSharedSpaces && Verbose) {
3294 warning("turning off use of shared archive because of compressed oops");
3295 }
3296 no_shared_spaces();
3297 }
3298 }
3299 #endif
3300
3301 if (DumpSharedSpaces) { 3285 if (DumpSharedSpaces) {
3302 if (RequireSharedSpaces) { 3286 if (RequireSharedSpaces) {
3303 warning("cannot dump shared archive while using shared archive"); 3287 warning("cannot dump shared archive while using shared archive");
3304 } 3288 }
3305 UseSharedSpaces = false; 3289 UseSharedSpaces = false;
3290 #ifdef _LP64
3291 if (!UseCompressedOops || !UseCompressedKlassPointers) {
3292 vm_exit_during_initialization(
3293 "Cannot dump shared archive when UseCompressedOops or UseCompressedKlassPointers is off.", NULL);
3294 }
3295 } else {
3296 // UseCompressedOops and UseCompressedKlassPointers must be on for UseSharedSpaces.
3297 if (!UseCompressedOops || !UseCompressedKlassPointers) {
3298 no_shared_spaces();
3299 }
3300 #endif
3306 } 3301 }
3307 } 3302 }
3308 3303
3309 #if !INCLUDE_ALL_GCS 3304 #if !INCLUDE_ALL_GCS
3310 static void force_serial_gc() { 3305 static void force_serial_gc() {