8307935: Class space argument processing can be simplified

Reviewed-by: stefank, coleenp
This commit is contained in:
Thomas Stuefe 2023-05-13 06:35:17 +00:00
parent 46e3d24a6f
commit e54051ae9e
2 changed files with 3 additions and 25 deletions

View file

@ -1482,29 +1482,10 @@ void Arguments::set_use_compressed_oops() {
#endif // _LP64 #endif // _LP64
} }
// NOTE: set_use_compressed_klass_ptrs() must be called after calling
// set_use_compressed_oops().
void Arguments::set_use_compressed_klass_ptrs() { void Arguments::set_use_compressed_klass_ptrs() {
#ifdef _LP64 #ifdef _LP64
// On some architectures, the use of UseCompressedClassPointers implies the use of assert(!UseCompressedClassPointers || CompressedClassSpaceSize <= KlassEncodingMetaspaceMax,
// UseCompressedOops. The reason is that the rheap_base register of said platforms "CompressedClassSpaceSize is too large for UseCompressedClassPointers");
// 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.
// 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);
}
}
#endif // _LP64 #endif // _LP64
} }
@ -1526,9 +1507,6 @@ jint Arguments::set_ergonomics_flags() {
#ifdef _LP64 #ifdef _LP64
set_use_compressed_oops(); set_use_compressed_oops();
// set_use_compressed_klass_ptrs() must be called after calling
// set_use_compressed_oops().
set_use_compressed_klass_ptrs(); set_use_compressed_klass_ptrs();
// Also checks that certain machines are slower with compressed oops // Also checks that certain machines are slower with compressed oops

View file

@ -125,7 +125,7 @@ const size_t minimumSymbolTableSize = 1024;
"Use 32-bit object references in 64-bit VM. " \ "Use 32-bit object references in 64-bit VM. " \
"lp64_product means flag is always constant in 32 bit VM") \ "lp64_product means flag is always constant in 32 bit VM") \
\ \
product(bool, UseCompressedClassPointers, false, \ product(bool, UseCompressedClassPointers, true, \
"Use 32-bit class pointers in 64-bit VM. " \ "Use 32-bit class pointers in 64-bit VM. " \
"lp64_product means flag is always constant in 32 bit VM") \ "lp64_product means flag is always constant in 32 bit VM") \
\ \