src/share/vm/runtime/arguments.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/runtime/arguments.cpp Thu Aug 15 09:55:11 2013
--- new/src/share/vm/runtime/arguments.cpp Thu Aug 15 09:55:09 2013
*** 1391,1404 ****
--- 1391,1402 ----
return true;
}
inline uintx max_heap_for_compressed_oops() {
// Avoid sign flip.
if (OopEncodingHeapMax < ClassMetaspaceSize + os::vm_page_size()) {
! return 0;
}
LP64_ONLY(return OopEncodingHeapMax - ClassMetaspaceSize - os::vm_page_size());
+ assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
! LP64_ONLY(return OopEncodingHeapMax - os::vm_page_size());
NOT_LP64(ShouldNotReachHere(); return 0);
}
bool Arguments::should_auto_select_low_pause_collector() {
if (UseAutoGCSelectPolicy &&
*** 1446,1455 ****
--- 1444,1482 ----
}
#endif // _LP64
#endif // ZERO
}
+
+ // NOTE: set_use_compressed_klass_ptrs() must be called after calling
+ // set_use_compressed_oops().
+ void Arguments::set_use_compressed_klass_ptrs() {
+ #ifndef ZERO
+ #ifdef _LP64
+ // UseCompressedOops must be on for UseCompressedKlassPointers to be on.
+ if (!UseCompressedOops) {
+ if (UseCompressedKlassPointers) {
+ warning("UseCompressedKlassPointers requires UseCompressedOops");
+ }
+ FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
+ } else {
+ // Turn on UseCompressedKlassPointers too
+ if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
+ FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
+ }
+ // Check the ClassMetaspaceSize to make sure we use compressed klass ptrs.
+ if (UseCompressedKlassPointers) {
+ if (ClassMetaspaceSize > KlassEncodingMetaspaceMax) {
+ warning("Class metaspace size is too large for UseCompressedKlassPointers");
+ FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
+ }
+ }
+ }
+ #endif // _LP64
+ #endif // !ZERO
+ }
+
void Arguments::set_ergonomics_flags() {
if (os::is_server_class_machine()) {
// If no other collector is requested explicitly,
// let the VM select the collector based on
*** 1468,1512 ****
--- 1495,1518 ----
// Shared spaces work fine with other GCs but causes bytecode rewriting
// to be disabled, which hurts interpreter performance and decreases
// server performance. On server class machines, keep the default
// off unless it is asked for. Future work: either add bytecode rewriting
// at link time, or rewrite bytecodes in non-shared methods.
! if (!DumpSharedSpaces && !RequireSharedSpaces) {
! if (!DumpSharedSpaces && !RequireSharedSpaces &&
+ (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
no_shared_spaces();
}
}
#ifndef ZERO
#ifdef _LP64
set_use_compressed_oops();
// UseCompressedOops must be on for UseCompressedKlassPointers to be on.
if (!UseCompressedOops) {
if (UseCompressedKlassPointers) {
! warning("UseCompressedKlassPointers requires UseCompressedOops");
}
FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
} else {
// Turn on UseCompressedKlassPointers too
if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
}
// Set the ClassMetaspaceSize to something that will not need to be
// expanded, since it cannot be expanded.
if (UseCompressedKlassPointers) {
if (ClassMetaspaceSize > KlassEncodingMetaspaceMax) {
warning("Class metaspace size is too large for UseCompressedKlassPointers");
FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
} else if (FLAG_IS_DEFAULT(ClassMetaspaceSize)) {
// 100,000 classes seems like a good size, so 100M assumes around 1K
// per klass. The vtable and oopMap is embedded so we don't have a fixed
// size per klass. Eventually, this will be parameterized because it
// would also be useful to determine the optimal size of the
// systemDictionary.
FLAG_SET_ERGO(uintx, ClassMetaspaceSize, 100*M);
}
}
}
+
+ // set_use_compressed_klass_ptrs() must be called after calling
+ // set_use_compressed_oops().
! set_use_compressed_klass_ptrs();
+
// Also checks that certain machines are slower with compressed oops
// in vm_version initialization code.
#endif // _LP64
#endif // !ZERO
}
*** 2151,2161 ****
--- 2157,2167 ----
status = status && verify_interval(TLABWasteTargetPercent,
1, 100, "TLABWasteTargetPercent");
status = status && verify_object_alignment();
! status = status && verify_min_value(ClassMetaspaceSize, 1*M,
! status = status && verify_interval(ClassMetaspaceSize, 1*M, 3*G,
"ClassMetaspaceSize");
status = status && verify_interval(MarkStackSizeMax,
1, (max_jint - 1), "MarkStackSizeMax");
status = status && verify_interval(NUMAChunkResizeWeight, 0, 100, "NUMAChunkResizeWeight");
*** 3271,3307 ****
--- 3277,3302 ----
}
return JNI_OK;
}
void Arguments::set_shared_spaces_flags() {
#ifdef _LP64
const bool must_share = DumpSharedSpaces || RequireSharedSpaces;
// CompressedOops cannot be used with CDS. The offsets of oopmaps and
// static fields are incorrect in the archive. With some more clever
// initialization, this restriction can probably be lifted.
if (UseCompressedOops) {
if (must_share) {
warning("disabling compressed oops because of %s",
DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
FLAG_SET_CMDLINE(bool, UseCompressedOops, false);
FLAG_SET_CMDLINE(bool, UseCompressedKlassPointers, false);
} else {
// Prefer compressed oops to class data sharing
if (UseSharedSpaces && Verbose) {
warning("turning off use of shared archive because of compressed oops");
}
no_shared_spaces();
}
}
#endif
if (DumpSharedSpaces) {
if (RequireSharedSpaces) {
warning("cannot dump shared archive while using shared archive");
}
UseSharedSpaces = false;
+ #ifdef _LP64
+ if (!UseCompressedOops || !UseCompressedKlassPointers) {
+ vm_exit_during_initialization(
+ "Cannot dump shared archive when UseCompressedOops or UseCompressedKlassPointers is off.", NULL);
+ }
+ } else {
+ // UseCompressedOops and UseCompressedKlassPointers must be on for UseSharedSpaces.
+ if (!UseCompressedOops || !UseCompressedKlassPointers) {
+ no_shared_spaces();
+ }
+ #endif
}
}
#if !INCLUDE_ALL_GCS
static void force_serial_gc() {
src/share/vm/runtime/arguments.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File