提交 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)
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
mapfile : $(MAPFILE) vm.def
mapfile : $(MAPFILE) vm.def mapfile_ext
rm -f $@
awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
{ system ("cat vm.def"); } \
{ system ("cat mapfile_ext"); system ("cat vm.def"); } \
else \
{ print $$0 } \
}' > $@ < $(MAPFILE)
......@@ -258,6 +258,13 @@ mapfile_reorder : mapfile $(REORDERFILE)
vm.def: $(Res_Files) $(Obj_Files)
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
ifeq ($(LINK_INTO),AOUT)
......
......@@ -233,10 +233,10 @@ JVM_OBJ_FILES = $(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 $@
awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
{ system ("cat vm.def"); } \
{ system ("cat mapfile_ext"); system ("cat vm.def"); } \
else \
{ print $$0 } \
}' > $@ < $(MAPFILE)
......@@ -248,6 +248,13 @@ mapfile_reorder : mapfile $(REORDERFILE)
vm.def: $(Res_Files) $(Obj_Files)
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)
STATIC_CXX = false
else
......
......@@ -247,11 +247,12 @@ JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
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 $@
cat $(MAPFILE) $(MAPFILE_DTRACE_OPT) \
| $(NAWK) '{ \
if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") { \
system ("cat mapfile_ext"); \
system ("cat vm.def"); \
} else { \
print $$0; \
......@@ -265,6 +266,13 @@ mapfile_extended : mapfile $(MAPFILE_DTRACE_OPT)
vm.def: $(Obj_Files)
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)
LIBJVM.o =
LIBJVM_MAPFILE =
......
......@@ -98,6 +98,8 @@ const char* Arguments::_gc_log_filename = NULL;
bool Arguments::_has_profile = false;
size_t Arguments::_conservative_max_heap_alignment = 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;
bool Arguments::_java_compiler = false;
bool Arguments::_xdebug_mode = false;
......@@ -1596,9 +1598,11 @@ void Arguments::set_parallel_gc_flags() {
// unless the user actually sets these flags.
if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) {
FLAG_SET_DEFAULT(MinHeapFreeRatio, 0);
_min_heap_free_ratio = MinHeapFreeRatio;
}
if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) {
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
MaxHeapFreeRatio);
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;
}
......@@ -1987,6 +1993,8 @@ bool Arguments::verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_hea
MinHeapFreeRatio);
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;
}
......
......@@ -286,6 +286,10 @@ class Arguments : AllStatic {
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
static AgentLibraryList _libraryList;
static void add_init_library(const char* name, char* options)
......@@ -514,6 +518,10 @@ class Arguments : AllStatic {
static uintx min_heap_size() { return _min_heap_size; }
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
static AgentLibrary* libraries() { return _libraryList.first(); }
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.
先完成此消息的编辑!
想要评论请 注册