< prev index next > src/hotspot/share/runtime/arguments.cpp
Print this page
}
} else {
if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
warning("Max heap size too large for Compressed Oops");
FLAG_SET_DEFAULT(UseCompressedOops, false);
- if (COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS) {
- FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
- }
}
}
#endif // _LP64
}
-
// NOTE: set_use_compressed_klass_ptrs() must be called after calling
// set_use_compressed_oops().
void Arguments::set_use_compressed_klass_ptrs() {
#ifdef _LP64
- // On some architectures, the use of UseCompressedClassPointers implies the use of
- // UseCompressedOops. The reason is that the rheap_base register of said platforms
- // is reused to perform some optimized spilling, in order to use rheap_base as a
- // temp register. But by treating it as any other temp register, spilling can typically
- // be completely avoided instead. So it is better not to perform this trick. And by
- // not having that reliance, large heaps, or heaps not supporting compressed oops,
- // can still use compressed class pointers.
- if (COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS && !UseCompressedOops) {
- if (UseCompressedClassPointers) {
- warning("UseCompressedClassPointers requires UseCompressedOops");
- }
- FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
- } else {
- // Turn on UseCompressedClassPointers too
- if (FLAG_IS_DEFAULT(UseCompressedClassPointers)) {
- FLAG_SET_ERGO(UseCompressedClassPointers, true);
- }
- // Check the CompressedClassSpaceSize to make sure we use compressed klass ptrs.
- if (UseCompressedClassPointers) {
- if (CompressedClassSpaceSize > KlassEncodingMetaspaceMax) {
- warning("CompressedClassSpaceSize is too large for UseCompressedClassPointers");
- FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
- }
- }
- }
+ if (!UseCompressedClassPointers) {
+ // Lilliput requires compressed class pointers. Default shall reflect that.
+ // If user specifies -UseCompressedClassPointers, it should be reverted with
+ // a warning.
+ assert(!FLAG_IS_DEFAULT(UseCompressedClassPointers), "Wrong default for UseCompressedClassPointers");
+ warning("Lilliput reqires compressed class pointers.");
+ FLAG_SET_ERGO(UseCompressedClassPointers, true);
+ }
+ // Assert validity of compressed class space size. User arg should have been checked at this point
+ // (see CompressedClassSpaceSizeConstraintFunc()), so no need to be nice about it, this fires in
+ // case the default is wrong.
+ assert(CompressedClassSpaceSize <= Metaspace::max_class_space_size(),
+ "CompressedClassSpaceSize " SIZE_FORMAT " too large (max: " SIZE_FORMAT ")",
+ CompressedClassSpaceSize, Metaspace::max_class_space_size());
#endif // _LP64
}
void Arguments::set_conservative_max_heap_alignment() {
// The conservative maximum required alignment for the heap is the maximum of
log_info(cds)("UseCompressedOops and UseCompressedClassPointers have been disabled due to"
" max heap " SIZE_FORMAT " > compressed oop heap " SIZE_FORMAT ". "
"Please check the setting of MaxRAMPercentage %5.2f."
,(size_t)reasonable_max, (size_t)max_coop_heap, MaxRAMPercentage);
FLAG_SET_ERGO(UseCompressedOops, false);
- if (COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS) {
- FLAG_SET_ERGO(UseCompressedClassPointers, false);
- }
} else {
reasonable_max = MIN2(reasonable_max, max_coop_heap);
}
}
}
if (FLAG_IS_CMDLINE(DiagnoseSyncOnValueBasedClasses)) {
if (DiagnoseSyncOnValueBasedClasses == ObjectSynchronizer::LOG_WARNING && !log_is_enabled(Info, valuebasedclasses)) {
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(valuebasedclasses));
}
}
+
return JNI_OK;
}
jint Arguments::adjust_after_os() {
if (UseNUMA) {
< prev index next >