src/share/vm/runtime/arguments.cpp
Print this page
rev 5146 : imported patch first-patch
*** 50,60 ****
--- 50,63 ----
# include "os_windows.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_bsd
# include "os_bsd.inline.hpp"
#endif
+ #include "memory/genCollectedHeap.hpp"
#if INCLUDE_ALL_GCS
+ #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
+ #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
#endif // INCLUDE_ALL_GCS
// Note: This is a special bug reporting site for the JVM
#define DEFAULT_VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/crash.jsp"
*** 88,97 ****
--- 91,101 ----
int Arguments::_num_jvm_args = 0;
char* Arguments::_java_command = NULL;
SystemProperty* Arguments::_system_properties = NULL;
const char* Arguments::_gc_log_filename = NULL;
bool Arguments::_has_profile = false;
+ size_t Arguments::_largest_heap_alignment = 0;
uintx Arguments::_min_heap_size = 0;
Arguments::Mode Arguments::_mode = _mixed;
bool Arguments::_java_compiler = false;
bool Arguments::_xdebug_mode = false;
const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG;
*** 1389,1402 ****
return false;
}
return true;
}
! inline uintx max_heap_for_compressed_oops() {
// Avoid sign flip.
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 &&
--- 1393,1408 ----
return false;
}
return true;
}
! uintx Arguments::max_heap_for_compressed_oops() {
// Avoid sign flip.
assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
! size_t aligned_null_page_size = align_size_up_(os::vm_page_size(), Arguments::largest_heap_alignment());
!
! LP64_ONLY(return OopEncodingHeapMax - aligned_null_page_size);
NOT_LP64(ShouldNotReachHere(); return 0);
}
bool Arguments::should_auto_select_low_pause_collector() {
if (UseAutoGCSelectPolicy &&
*** 1473,1482 ****
--- 1479,1505 ----
}
#endif // _LP64
#endif // !ZERO
}
+ void Arguments::set_largest_max_heap_alignment() {
+ size_t gc_alignment;
+ #if INCLUDE_ALL_GCS
+ if (UseParallelGC) {
+ gc_alignment = ParallelScavengeHeap::max_heap_alignment();
+ } else if (UseG1GC) {
+ gc_alignment = G1CollectedHeap::max_heap_alignment();
+ } else {
+ #endif // INCLUDE_ALL_GCS
+ gc_alignment = GenCollectedHeap::max_heap_alignment();
+ #if INCLUDE_ALL_GCS
+ }
+ #endif // INCLUDE_ALL_GCS
+ _largest_heap_alignment = MAX3(gc_alignment, os::max_page_size(),
+ CollectorPolicy::compute_largest_heap_alignment());
+ }
+
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
*** 1501,1510 ****
--- 1524,1535 ----
(FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
no_shared_spaces();
}
}
+ set_largest_max_heap_alignment();
+
#ifndef ZERO
#ifdef _LP64
set_use_compressed_oops();
// set_use_compressed_klass_ptrs() must be called after calling
*** 3515,3524 ****
--- 3540,3554 ----
FLAG_SET_DEFAULT(PrintSharedSpaces, false);
}
no_shared_spaces();
#endif // INCLUDE_CDS
+ // We need to initialize large page support here because ergonomics takes some
+ // decisions depending on large page support and the calculated large page size.
+ // Ergonomics may turn off large page support off later again.
+ os::large_page_init();
+
// Set flags based on ergonomics.
set_ergonomics_flags();
set_shared_spaces_flags();