1522 }
1523 return true;
1524 }
1525 return false;
1526 }
1527
1528 void Arguments::set_use_compressed_oops() {
1529 #ifndef ZERO
1530 #ifdef _LP64
1531 // MaxHeapSize is not set up properly at this point, but
1532 // the only value that can override MaxHeapSize if we are
1533 // to use UseCompressedOops is InitialHeapSize.
1534 size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1535
1536 if (max_heap_size <= max_heap_for_compressed_oops()) {
1537 #if !defined(COMPILER1) || defined(TIERED)
1538 if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1539 FLAG_SET_ERGO(bool, UseCompressedOops, true);
1540 }
1541 #endif
1542 #ifdef _WIN64
1543 if (UseLargePages && UseCompressedOops) {
1544 // Cannot allocate guard pages for implicit checks in indexed addressing
1545 // mode, when large pages are specified on windows.
1546 // This flag could be switched ON if narrow oop base address is set to 0,
1547 // see code in Universe::initialize_heap().
1548 Universe::set_narrow_oop_use_implicit_null_checks(false);
1549 }
1550 #endif // _WIN64
1551 } else {
1552 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
1553 warning("Max heap size too large for Compressed Oops");
1554 FLAG_SET_DEFAULT(UseCompressedOops, false);
1555 FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1556 }
1557 }
1558 #endif // _LP64
1559 #endif // ZERO
1560 }
1561
1562
1563 // NOTE: set_use_compressed_klass_ptrs() must be called after calling
1564 // set_use_compressed_oops().
1565 void Arguments::set_use_compressed_klass_ptrs() {
1566 #ifndef ZERO
1567 #ifdef _LP64
1568 // UseCompressedOops must be on for UseCompressedClassPointers to be on.
1569 if (!UseCompressedOops) {
1570 if (UseCompressedClassPointers) {
2416
2417 status = status && verify_interval(AdaptiveTimeWeight, 0, 100, "AdaptiveTimeWeight");
2418 status = status && verify_min_value(AdaptiveSizeDecrementScaleFactor, 1, "AdaptiveSizeDecrementScaleFactor");
2419
2420 status = status && verify_interval(TLABAllocationWeight, 0, 100, "TLABAllocationWeight");
2421 status = status && verify_min_value(MinTLABSize, 1, "MinTLABSize");
2422 status = status && verify_min_value(TLABRefillWasteFraction, 1, "TLABRefillWasteFraction");
2423
2424 status = status && verify_percentage(YoungGenerationSizeSupplement, "YoungGenerationSizeSupplement");
2425 status = status && verify_percentage(TenuredGenerationSizeSupplement, "TenuredGenerationSizeSupplement");
2426
2427 status = status && verify_interval(MaxTenuringThreshold, 0, markOopDesc::max_age + 1, "MaxTenuringThreshold");
2428 status = status && verify_interval(InitialTenuringThreshold, 0, MaxTenuringThreshold, "InitialTenuringThreshold");
2429 status = status && verify_percentage(TargetSurvivorRatio, "TargetSurvivorRatio");
2430 status = status && verify_percentage(MarkSweepDeadRatio, "MarkSweepDeadRatio");
2431
2432 status = status && verify_min_value(MarkSweepAlwaysCompactCount, 1, "MarkSweepAlwaysCompactCount");
2433 #ifdef COMPILER1
2434 status = status && verify_min_value(ValueMapInitialSize, 1, "ValueMapInitialSize");
2435 #endif
2436
2437 if (PrintNMTStatistics) {
2438 #if INCLUDE_NMT
2439 if (MemTracker::tracking_level() == NMT_off) {
2440 #endif // INCLUDE_NMT
2441 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
2442 PrintNMTStatistics = false;
2443 #if INCLUDE_NMT
2444 }
2445 #endif
2446 }
2447
2448 // Need to limit the extent of the padding to reasonable size.
2449 // 8K is well beyond the reasonable HW cache line size, even with the
2450 // aggressive prefetching, while still leaving the room for segregating
2451 // among the distinct pages.
2452 if (ContendedPaddingWidth < 0 || ContendedPaddingWidth > 8192) {
2453 jio_fprintf(defaultStream::error_stream(),
2454 "ContendedPaddingWidth=" INTX_FORMAT " must be in between %d and %d\n",
2455 ContendedPaddingWidth, 0, 8192);
4175 }
4176
4177 void Arguments::PropertyList_add(SystemProperty** plist, SystemProperty *new_p) {
4178 SystemProperty* p = *plist;
4179 if (p == NULL) {
4180 *plist = new_p;
4181 } else {
4182 while (p->next() != NULL) {
4183 p = p->next();
4184 }
4185 p->set_next(new_p);
4186 }
4187 }
4188
4189 void Arguments::PropertyList_add(SystemProperty** plist, const char* k, char* v) {
4190 if (plist == NULL)
4191 return;
4192
4193 SystemProperty* new_p = new SystemProperty(k, v, true);
4194 PropertyList_add(plist, new_p);
4195 }
4196
4197 // This add maintains unique property key in the list.
4198 void Arguments::PropertyList_unique_add(SystemProperty** plist, const char* k, char* v, jboolean append) {
4199 if (plist == NULL)
4200 return;
4201
4202 // If property key exist then update with new value.
4203 SystemProperty* prop;
4204 for (prop = *plist; prop != NULL; prop = prop->next()) {
4205 if (strcmp(k, prop->key()) == 0) {
4206 if (append) {
4207 prop->append_value(v);
4208 } else {
4209 prop->set_value(v);
4210 }
4211 return;
4212 }
4213 }
4214
|
1522 }
1523 return true;
1524 }
1525 return false;
1526 }
1527
1528 void Arguments::set_use_compressed_oops() {
1529 #ifndef ZERO
1530 #ifdef _LP64
1531 // MaxHeapSize is not set up properly at this point, but
1532 // the only value that can override MaxHeapSize if we are
1533 // to use UseCompressedOops is InitialHeapSize.
1534 size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1535
1536 if (max_heap_size <= max_heap_for_compressed_oops()) {
1537 #if !defined(COMPILER1) || defined(TIERED)
1538 if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1539 FLAG_SET_ERGO(bool, UseCompressedOops, true);
1540 }
1541 #endif
1542 } else {
1543 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
1544 warning("Max heap size too large for Compressed Oops");
1545 FLAG_SET_DEFAULT(UseCompressedOops, false);
1546 FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1547 }
1548 }
1549 #endif // _LP64
1550 #endif // ZERO
1551 }
1552
1553
1554 // NOTE: set_use_compressed_klass_ptrs() must be called after calling
1555 // set_use_compressed_oops().
1556 void Arguments::set_use_compressed_klass_ptrs() {
1557 #ifndef ZERO
1558 #ifdef _LP64
1559 // UseCompressedOops must be on for UseCompressedClassPointers to be on.
1560 if (!UseCompressedOops) {
1561 if (UseCompressedClassPointers) {
2407
2408 status = status && verify_interval(AdaptiveTimeWeight, 0, 100, "AdaptiveTimeWeight");
2409 status = status && verify_min_value(AdaptiveSizeDecrementScaleFactor, 1, "AdaptiveSizeDecrementScaleFactor");
2410
2411 status = status && verify_interval(TLABAllocationWeight, 0, 100, "TLABAllocationWeight");
2412 status = status && verify_min_value(MinTLABSize, 1, "MinTLABSize");
2413 status = status && verify_min_value(TLABRefillWasteFraction, 1, "TLABRefillWasteFraction");
2414
2415 status = status && verify_percentage(YoungGenerationSizeSupplement, "YoungGenerationSizeSupplement");
2416 status = status && verify_percentage(TenuredGenerationSizeSupplement, "TenuredGenerationSizeSupplement");
2417
2418 status = status && verify_interval(MaxTenuringThreshold, 0, markOopDesc::max_age + 1, "MaxTenuringThreshold");
2419 status = status && verify_interval(InitialTenuringThreshold, 0, MaxTenuringThreshold, "InitialTenuringThreshold");
2420 status = status && verify_percentage(TargetSurvivorRatio, "TargetSurvivorRatio");
2421 status = status && verify_percentage(MarkSweepDeadRatio, "MarkSweepDeadRatio");
2422
2423 status = status && verify_min_value(MarkSweepAlwaysCompactCount, 1, "MarkSweepAlwaysCompactCount");
2424 #ifdef COMPILER1
2425 status = status && verify_min_value(ValueMapInitialSize, 1, "ValueMapInitialSize");
2426 #endif
2427 status = status && verify_min_value(HeapSearchSteps, 1, "HeapSearchSteps");
2428
2429 if (PrintNMTStatistics) {
2430 #if INCLUDE_NMT
2431 if (MemTracker::tracking_level() == NMT_off) {
2432 #endif // INCLUDE_NMT
2433 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
2434 PrintNMTStatistics = false;
2435 #if INCLUDE_NMT
2436 }
2437 #endif
2438 }
2439
2440 // Need to limit the extent of the padding to reasonable size.
2441 // 8K is well beyond the reasonable HW cache line size, even with the
2442 // aggressive prefetching, while still leaving the room for segregating
2443 // among the distinct pages.
2444 if (ContendedPaddingWidth < 0 || ContendedPaddingWidth > 8192) {
2445 jio_fprintf(defaultStream::error_stream(),
2446 "ContendedPaddingWidth=" INTX_FORMAT " must be in between %d and %d\n",
2447 ContendedPaddingWidth, 0, 8192);
4167 }
4168
4169 void Arguments::PropertyList_add(SystemProperty** plist, SystemProperty *new_p) {
4170 SystemProperty* p = *plist;
4171 if (p == NULL) {
4172 *plist = new_p;
4173 } else {
4174 while (p->next() != NULL) {
4175 p = p->next();
4176 }
4177 p->set_next(new_p);
4178 }
4179 }
4180
4181 void Arguments::PropertyList_add(SystemProperty** plist, const char* k, char* v) {
4182 if (plist == NULL)
4183 return;
4184
4185 SystemProperty* new_p = new SystemProperty(k, v, true);
4186 PropertyList_add(plist, new_p);
4187 }
4188
4189 void Arguments::PropertyList_add(SystemProperty *element) {
4190 PropertyList_add(&_system_properties, element);
4191 }
4192
4193 // This add maintains unique property key in the list.
4194 void Arguments::PropertyList_unique_add(SystemProperty** plist, const char* k, char* v, jboolean append) {
4195 if (plist == NULL)
4196 return;
4197
4198 // If property key exist then update with new value.
4199 SystemProperty* prop;
4200 for (prop = *plist; prop != NULL; prop = prop->next()) {
4201 if (strcmp(k, prop->key()) == 0) {
4202 if (append) {
4203 prop->append_value(v);
4204 } else {
4205 prop->set_value(v);
4206 }
4207 return;
4208 }
4209 }
4210
|