< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page
rev 52611 : webrev.00
rev 52613 : webrev.01


1605   if (SurvivorAlignmentInBytes == 0) {
1606     SurvivorAlignmentInBytes = ObjectAlignmentInBytes;
1607   }
1608 }
1609 
1610 size_t Arguments::max_heap_for_compressed_oops() {
1611   // Avoid sign flip.
1612   assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1613   // We need to fit both the NULL page and the heap into the memory budget, while
1614   // keeping alignment constraints of the heap. To guarantee the latter, as the
1615   // NULL page is located before the heap, we pad the NULL page to the conservative
1616   // maximum alignment that the GC may ever impose upon the heap.
1617   size_t displacement_due_to_null_page = align_up((size_t)os::vm_page_size(),
1618                                                   _conservative_max_heap_alignment);
1619 
1620   LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page);
1621   NOT_LP64(ShouldNotReachHere(); return 0);
1622 }
1623 
1624 void Arguments::set_use_compressed_oops() {




1625 #ifndef ZERO
1626 #ifdef _LP64
1627   // MaxHeapSize is not set up properly at this point, but
1628   // the only value that can override MaxHeapSize if we are
1629   // to use UseCompressedOops is InitialHeapSize.
1630   size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1631 
1632   if (max_heap_size <= max_heap_for_compressed_oops()) {
1633 #if !defined(COMPILER1) || defined(TIERED)
1634     if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1635       FLAG_SET_ERGO(bool, UseCompressedOops, true);
1636     }
1637 #endif
1638   } else {
1639     if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
1640       warning("Max heap size too large for Compressed Oops");
1641       FLAG_SET_DEFAULT(UseCompressedOops, false);
1642       FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1643     }
1644   }


2046         AddProperty, UnwriteableProperty, InternalProperty);
2047     if (!create_numbered_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
2048       return false;
2049     }
2050   }
2051 #endif
2052 
2053 #ifndef SUPPORT_RESERVED_STACK_AREA
2054   if (StackReservedPages != 0) {
2055     FLAG_SET_CMDLINE(intx, StackReservedPages, 0);
2056     warning("Reserved Stack Area not supported on this platform");
2057   }
2058 #endif
2059 
2060   if (!FLAG_IS_DEFAULT(AllocateHeapAt)) {
2061     if ((UseNUMAInterleaving && !FLAG_IS_DEFAULT(UseNUMAInterleaving)) || (UseNUMA && !FLAG_IS_DEFAULT(UseNUMA))) {
2062       log_warning(arguments) ("NUMA support for Heap depends on the file system when AllocateHeapAt option is used.\n");
2063     }
2064   }
2065 
2066   if(!FLAG_IS_DEFAULT(AllocateHeapAt) && !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
2067     jio_fprintf(defaultStream::error_stream(),
2068                 "AllocateHeapAt and AllocateOldGenAt cannot be used together.\n");
2069     status = false;
2070   }
2071 
2072   if (!FLAG_IS_DEFAULT(AllocateOldGenAt) && (UseSerialGC || UseConcMarkSweepGC || UseEpsilonGC || UseZGC)) {
2073     jio_fprintf(defaultStream::error_stream(),
2074       "AllocateOldGenAt not supported for selected GC.\n");
2075     status = false;
2076   }
2077 
2078   return status;
2079 }
2080 
2081 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2082   const char* option_type) {
2083   if (ignore) return false;
2084 
2085   const char* spacer = " ";
2086   if (option_type == NULL) {
2087     option_type = ++spacer; // Set both to the empty string.
2088   }
2089 
2090   jio_fprintf(defaultStream::error_stream(),
2091               "Unrecognized %s%soption: %s\n", option_type, spacer,
2092               option->optionString);
2093   return true;
2094 }
2095 
2096 static const char* user_assertion_options[] = {




1605   if (SurvivorAlignmentInBytes == 0) {
1606     SurvivorAlignmentInBytes = ObjectAlignmentInBytes;
1607   }
1608 }
1609 
1610 size_t Arguments::max_heap_for_compressed_oops() {
1611   // Avoid sign flip.
1612   assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1613   // We need to fit both the NULL page and the heap into the memory budget, while
1614   // keeping alignment constraints of the heap. To guarantee the latter, as the
1615   // NULL page is located before the heap, we pad the NULL page to the conservative
1616   // maximum alignment that the GC may ever impose upon the heap.
1617   size_t displacement_due_to_null_page = align_up((size_t)os::vm_page_size(),
1618                                                   _conservative_max_heap_alignment);
1619 
1620   LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page);
1621   NOT_LP64(ShouldNotReachHere(); return 0);
1622 }
1623 
1624 void Arguments::set_use_compressed_oops() {
1625 if (AllocateOldGenAt != NULL) {
1626   FLAG_SET_ERGO(bool, UseCompressedOops, false);
1627   return;
1628 }
1629 #ifndef ZERO
1630 #ifdef _LP64
1631   // MaxHeapSize is not set up properly at this point, but
1632   // the only value that can override MaxHeapSize if we are
1633   // to use UseCompressedOops is InitialHeapSize.
1634   size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
1635 
1636   if (max_heap_size <= max_heap_for_compressed_oops()) {
1637 #if !defined(COMPILER1) || defined(TIERED)
1638     if (FLAG_IS_DEFAULT(UseCompressedOops)) {
1639       FLAG_SET_ERGO(bool, UseCompressedOops, true);
1640     }
1641 #endif
1642   } else {
1643     if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
1644       warning("Max heap size too large for Compressed Oops");
1645       FLAG_SET_DEFAULT(UseCompressedOops, false);
1646       FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1647     }
1648   }


2050         AddProperty, UnwriteableProperty, InternalProperty);
2051     if (!create_numbered_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
2052       return false;
2053     }
2054   }
2055 #endif
2056 
2057 #ifndef SUPPORT_RESERVED_STACK_AREA
2058   if (StackReservedPages != 0) {
2059     FLAG_SET_CMDLINE(intx, StackReservedPages, 0);
2060     warning("Reserved Stack Area not supported on this platform");
2061   }
2062 #endif
2063 
2064   if (!FLAG_IS_DEFAULT(AllocateHeapAt)) {
2065     if ((UseNUMAInterleaving && !FLAG_IS_DEFAULT(UseNUMAInterleaving)) || (UseNUMA && !FLAG_IS_DEFAULT(UseNUMA))) {
2066       log_warning(arguments) ("NUMA support for Heap depends on the file system when AllocateHeapAt option is used.\n");
2067     }
2068   }
2069 
2070   status = status && GCArguments::check_args_consistency();










2071 
2072   return status;
2073 }
2074 
2075 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2076   const char* option_type) {
2077   if (ignore) return false;
2078 
2079   const char* spacer = " ";
2080   if (option_type == NULL) {
2081     option_type = ++spacer; // Set both to the empty string.
2082   }
2083 
2084   jio_fprintf(defaultStream::error_stream(),
2085               "Unrecognized %s%soption: %s\n", option_type, spacer,
2086               option->optionString);
2087   return true;
2088 }
2089 
2090 static const char* user_assertion_options[] = {


< prev index next >