提交 fc0c1306 编写于 作者: J jwilhelm

8055006: Store original value of Min/MaxHeapFreeRatio

Summary: Store the value set by the user and some makefile changes required to change the flags.
Reviewed-by: sla, mchung, bchristi, jmasa, dholmes
上级 e6e40195
...@@ -243,10 +243,10 @@ JVM_OBJ_FILES = $(Obj_Files) ...@@ -243,10 +243,10 @@ JVM_OBJ_FILES = $(Obj_Files)
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
mapfile : $(MAPFILE) vm.def mapfile : $(MAPFILE) vm.def mapfile_ext
rm -f $@ rm -f $@
awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \ awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
{ system ("cat vm.def"); } \ { system ("cat mapfile_ext"); system ("cat vm.def"); } \
else \ else \
{ print $$0 } \ { print $$0 } \
}' > $@ < $(MAPFILE) }' > $@ < $(MAPFILE)
...@@ -258,6 +258,13 @@ mapfile_reorder : mapfile $(REORDERFILE) ...@@ -258,6 +258,13 @@ mapfile_reorder : mapfile $(REORDERFILE)
vm.def: $(Res_Files) $(Obj_Files) vm.def: $(Res_Files) $(Obj_Files)
sh $(GAMMADIR)/make/bsd/makefiles/build_vm_def.sh *.o > $@ sh $(GAMMADIR)/make/bsd/makefiles/build_vm_def.sh *.o > $@
mapfile_ext:
rm -f $@
touch $@
if [ -f $(HS_ALT_MAKE)/bsd/makefiles/mapfile-ext ]; then \
cat $(HS_ALT_MAKE)/bsd/makefiles/mapfile-ext > $@; \
fi
STATIC_CXX = false STATIC_CXX = false
ifeq ($(LINK_INTO),AOUT) ifeq ($(LINK_INTO),AOUT)
......
...@@ -233,10 +233,10 @@ JVM_OBJ_FILES = $(Obj_Files) ...@@ -233,10 +233,10 @@ JVM_OBJ_FILES = $(Obj_Files)
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
mapfile : $(MAPFILE) vm.def mapfile : $(MAPFILE) vm.def mapfile_ext
rm -f $@ rm -f $@
awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \ awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
{ system ("cat vm.def"); } \ { system ("cat mapfile_ext"); system ("cat vm.def"); } \
else \ else \
{ print $$0 } \ { print $$0 } \
}' > $@ < $(MAPFILE) }' > $@ < $(MAPFILE)
...@@ -248,6 +248,13 @@ mapfile_reorder : mapfile $(REORDERFILE) ...@@ -248,6 +248,13 @@ mapfile_reorder : mapfile $(REORDERFILE)
vm.def: $(Res_Files) $(Obj_Files) vm.def: $(Res_Files) $(Obj_Files)
sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@ sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
mapfile_ext:
rm -f $@
touch $@
if [ -f $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext ]; then \
cat $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext > $@; \
fi
ifeq ($(JVM_VARIANT_ZEROSHARK), true) ifeq ($(JVM_VARIANT_ZEROSHARK), true)
STATIC_CXX = false STATIC_CXX = false
else else
......
...@@ -247,11 +247,12 @@ JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS) ...@@ -247,11 +247,12 @@ JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
mapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT) vm.def mapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT) vm.def mapfile_ext
rm -f $@ rm -f $@
cat $(MAPFILE) $(MAPFILE_DTRACE_OPT) \ cat $(MAPFILE) $(MAPFILE_DTRACE_OPT) \
| $(NAWK) '{ \ | $(NAWK) '{ \
if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") { \ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") { \
system ("cat mapfile_ext"); \
system ("cat vm.def"); \ system ("cat vm.def"); \
} else { \ } else { \
print $$0; \ print $$0; \
...@@ -265,6 +266,13 @@ mapfile_extended : mapfile $(MAPFILE_DTRACE_OPT) ...@@ -265,6 +266,13 @@ mapfile_extended : mapfile $(MAPFILE_DTRACE_OPT)
vm.def: $(Obj_Files) vm.def: $(Obj_Files)
sh $(GAMMADIR)/make/solaris/makefiles/build_vm_def.sh *.o > $@ sh $(GAMMADIR)/make/solaris/makefiles/build_vm_def.sh *.o > $@
mapfile_ext:
rm -f $@
touch $@
if [ -f $(HS_ALT_MAKE)/solaris/makefiles/mapfile-ext ]; then \
cat $(HS_ALT_MAKE)/solaris/makefiles/mapfile-ext > $@; \
fi
ifeq ($(LINK_INTO),AOUT) ifeq ($(LINK_INTO),AOUT)
LIBJVM.o = LIBJVM.o =
LIBJVM_MAPFILE = LIBJVM_MAPFILE =
......
...@@ -98,6 +98,8 @@ const char* Arguments::_gc_log_filename = NULL; ...@@ -98,6 +98,8 @@ const char* Arguments::_gc_log_filename = NULL;
bool Arguments::_has_profile = false; bool Arguments::_has_profile = false;
size_t Arguments::_conservative_max_heap_alignment = 0; size_t Arguments::_conservative_max_heap_alignment = 0;
uintx Arguments::_min_heap_size = 0; uintx Arguments::_min_heap_size = 0;
uintx Arguments::_min_heap_free_ratio = 0;
uintx Arguments::_max_heap_free_ratio = 0;
Arguments::Mode Arguments::_mode = _mixed; Arguments::Mode Arguments::_mode = _mixed;
bool Arguments::_java_compiler = false; bool Arguments::_java_compiler = false;
bool Arguments::_xdebug_mode = false; bool Arguments::_xdebug_mode = false;
...@@ -1596,9 +1598,11 @@ void Arguments::set_parallel_gc_flags() { ...@@ -1596,9 +1598,11 @@ void Arguments::set_parallel_gc_flags() {
// unless the user actually sets these flags. // unless the user actually sets these flags.
if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) { if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) {
FLAG_SET_DEFAULT(MinHeapFreeRatio, 0); FLAG_SET_DEFAULT(MinHeapFreeRatio, 0);
_min_heap_free_ratio = MinHeapFreeRatio;
} }
if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) { if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) {
FLAG_SET_DEFAULT(MaxHeapFreeRatio, 100); FLAG_SET_DEFAULT(MaxHeapFreeRatio, 100);
_max_heap_free_ratio = MaxHeapFreeRatio;
} }
} }
...@@ -1973,6 +1977,8 @@ bool Arguments::verify_MinHeapFreeRatio(FormatBuffer<80>& err_msg, uintx min_hea ...@@ -1973,6 +1977,8 @@ bool Arguments::verify_MinHeapFreeRatio(FormatBuffer<80>& err_msg, uintx min_hea
MaxHeapFreeRatio); MaxHeapFreeRatio);
return false; return false;
} }
// This does not set the flag itself, but stores the value in a safe place for later usage.
_min_heap_free_ratio = min_heap_free_ratio;
return true; return true;
} }
...@@ -1987,6 +1993,8 @@ bool Arguments::verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_hea ...@@ -1987,6 +1993,8 @@ bool Arguments::verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_hea
MinHeapFreeRatio); MinHeapFreeRatio);
return false; return false;
} }
// This does not set the flag itself, but stores the value in a safe place for later usage.
_max_heap_free_ratio = max_heap_free_ratio;
return true; return true;
} }
......
...@@ -284,7 +284,11 @@ class Arguments : AllStatic { ...@@ -284,7 +284,11 @@ class Arguments : AllStatic {
// Value of the conservative maximum heap alignment needed // Value of the conservative maximum heap alignment needed
static size_t _conservative_max_heap_alignment; static size_t _conservative_max_heap_alignment;
static uintx _min_heap_size; static uintx _min_heap_size;
// Used to store original flag values
static uintx _min_heap_free_ratio;
static uintx _max_heap_free_ratio;
// -Xrun arguments // -Xrun arguments
static AgentLibraryList _libraryList; static AgentLibraryList _libraryList;
...@@ -514,6 +518,10 @@ class Arguments : AllStatic { ...@@ -514,6 +518,10 @@ class Arguments : AllStatic {
static uintx min_heap_size() { return _min_heap_size; } static uintx min_heap_size() { return _min_heap_size; }
static void set_min_heap_size(uintx v) { _min_heap_size = v; } static void set_min_heap_size(uintx v) { _min_heap_size = v; }
// Returns the original values of -XX:MinHeapFreeRatio and -XX:MaxHeapFreeRatio
static uintx min_heap_free_ratio() { return _min_heap_free_ratio; }
static uintx max_heap_free_ratio() { return _max_heap_free_ratio; }
// -Xrun // -Xrun
static AgentLibrary* libraries() { return _libraryList.first(); } static AgentLibrary* libraries() { return _libraryList.first(); }
static bool init_libraries_at_startup() { return !_libraryList.is_empty(); } static bool init_libraries_at_startup() { return !_libraryList.is_empty(); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册