Merge
This commit is contained in:
commit
1665046b90
1
.hgtags
1
.hgtags
@ -297,3 +297,4 @@ b2f9702efbe95527ea3a991474fda23987ff1c5c jdk9-b48
|
|||||||
d6224d6021459ac8b3832e822f5acc849fa944af jdk9-b52
|
d6224d6021459ac8b3832e822f5acc849fa944af jdk9-b52
|
||||||
874d76e4699dfcd61ae1826c9fe0ddc1610ad598 jdk9-b53
|
874d76e4699dfcd61ae1826c9fe0ddc1610ad598 jdk9-b53
|
||||||
82cd31c5d6ca8d4c1653f4eb1c09eb2d9a3b2813 jdk9-b54
|
82cd31c5d6ca8d4c1653f4eb1c09eb2d9a3b2813 jdk9-b54
|
||||||
|
c97e2d1bad9708d379793ba2a4c848eda14c741e jdk9-b55
|
||||||
|
@ -297,3 +297,4 @@ d1f37d39ff2421f956a6ddf316cf763807bc3363 jdk9-b50
|
|||||||
1822e59f17121b09e7899cf338cfb6e37fe5fceb jdk9-b52
|
1822e59f17121b09e7899cf338cfb6e37fe5fceb jdk9-b52
|
||||||
d6ed47125a76cd1cf8a100568507bfb5e9669d9f jdk9-b53
|
d6ed47125a76cd1cf8a100568507bfb5e9669d9f jdk9-b53
|
||||||
cb7367141e910e265b8344a8facee740bd1e5467 jdk9-b54
|
cb7367141e910e265b8344a8facee740bd1e5467 jdk9-b54
|
||||||
|
0c37a832458f0e0b7d2a3f1a6f69aeae311aeb18 jdk9-b55
|
||||||
|
@ -54,6 +54,7 @@ m4_include([toolchain_windows.m4])
|
|||||||
|
|
||||||
AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
|
AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
|
||||||
AC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
|
AC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
|
||||||
|
AC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
|
||||||
AC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])
|
AC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])
|
||||||
|
|
||||||
# This line needs to be here, verbatim, after all includes and the dummy hook
|
# This line needs to be here, verbatim, after all includes and the dummy hook
|
||||||
@ -265,6 +266,7 @@ CONFIG_STATUS="$OUTPUT_ROOT/config.status"
|
|||||||
|
|
||||||
# Create the actual output files. Now the main work of configure is done.
|
# Create the actual output files. Now the main work of configure is done.
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
|
||||||
|
|
||||||
# Try to move the config.log file to the output directory.
|
# Try to move the config.log file to the output directory.
|
||||||
if test -e ./config.log; then
|
if test -e ./config.log; then
|
||||||
|
@ -481,9 +481,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
|||||||
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
|
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
|
||||||
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
|
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
|
||||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||||
LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
|
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
|
||||||
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
|
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
|
||||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
|
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
|
||||||
@ -762,6 +761,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
|||||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||||
LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
|
LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
|
||||||
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
|
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
|
||||||
|
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||||
|
LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -liconv -bexpall -bernotok"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Customize LDFLAGS for executables
|
# Customize LDFLAGS for executables
|
||||||
|
@ -4362,13 +4362,14 @@ VS_SDK_PLATFORM_NAME_2013=
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This line needs to be here, verbatim, after all includes and the dummy hook
|
# This line needs to be here, verbatim, after all includes and the dummy hook
|
||||||
# definitions. It is replaced with custom functionality when building
|
# definitions. It is replaced with custom functionality when building
|
||||||
# custom sources.
|
# custom sources.
|
||||||
#CUSTOM_AUTOCONF_INCLUDE
|
#CUSTOM_AUTOCONF_INCLUDE
|
||||||
|
|
||||||
# Do not change or remove the following line, it is needed for consistency checks:
|
# Do not change or remove the following line, it is needed for consistency checks:
|
||||||
DATE_WHEN_GENERATED=1425994551
|
DATE_WHEN_GENERATED=1426774983
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -41173,7 +41174,7 @@ $as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid."
|
|||||||
|
|
||||||
|
|
||||||
# jtreg win32 script works for everybody
|
# jtreg win32 script works for everybody
|
||||||
JTREGEXE="$JT_HOME/win32/bin/jtreg"
|
JTREGEXE="$JT_HOME/bin/jtreg"
|
||||||
|
|
||||||
if test ! -f "$JTREGEXE"; then
|
if test ! -f "$JTREGEXE"; then
|
||||||
as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
|
as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
|
||||||
@ -42372,9 +42373,8 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
|
|||||||
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
|
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
|
||||||
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
|
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
|
||||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||||
LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
|
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
|
||||||
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
|
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
|
||||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
|
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
|
||||||
@ -42668,6 +42668,8 @@ fi
|
|||||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||||
LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
|
LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
|
||||||
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
|
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
|
||||||
|
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||||
|
LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -liconv -bexpall -bernotok"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Customize LDFLAGS for executables
|
# Customize LDFLAGS for executables
|
||||||
@ -52969,6 +52971,7 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Try to move the config.log file to the output directory.
|
# Try to move the config.log file to the output directory.
|
||||||
if test -e ./config.log; then
|
if test -e ./config.log; then
|
||||||
$MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null
|
$MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null
|
||||||
|
@ -763,7 +763,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
|
|||||||
BASIC_FIXUP_PATH([JT_HOME])
|
BASIC_FIXUP_PATH([JT_HOME])
|
||||||
|
|
||||||
# jtreg win32 script works for everybody
|
# jtreg win32 script works for everybody
|
||||||
JTREGEXE="$JT_HOME/win32/bin/jtreg"
|
JTREGEXE="$JT_HOME/bin/jtreg"
|
||||||
|
|
||||||
if test ! -f "$JTREGEXE"; then
|
if test ! -f "$JTREGEXE"; then
|
||||||
AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
|
AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
|
||||||
|
@ -297,3 +297,4 @@ a13c49c5f2899b702652a460ed7aa73123e671e6 jdk9-b48
|
|||||||
b8538bbb6f224ab1dabba579137099c166ad4724 jdk9-b52
|
b8538bbb6f224ab1dabba579137099c166ad4724 jdk9-b52
|
||||||
aadc16ca5ab7d56f92ef9dbfa443595a939241b4 jdk9-b53
|
aadc16ca5ab7d56f92ef9dbfa443595a939241b4 jdk9-b53
|
||||||
d469c5ad0c763e325a78e0af3016878a57dfc5cc jdk9-b54
|
d469c5ad0c763e325a78e0af3016878a57dfc5cc jdk9-b54
|
||||||
|
734ca5311a225711b79618f3e92f47f07c82154a jdk9-b55
|
||||||
|
@ -457,3 +457,4 @@ e0947f58c9c1426aa0d98b98ebb78357b27a7b99 jdk9-b50
|
|||||||
9fb7fdc554db5be5c5b10f88f529ec3b870c44e3 jdk9-b52
|
9fb7fdc554db5be5c5b10f88f529ec3b870c44e3 jdk9-b52
|
||||||
effd5ef0c3eb4bb85aa975c489d6761dbf13ad6a jdk9-b53
|
effd5ef0c3eb4bb85aa975c489d6761dbf13ad6a jdk9-b53
|
||||||
c3b117fa5bdedfafd9ed236403e6d406911195b1 jdk9-b54
|
c3b117fa5bdedfafd9ed236403e6d406911195b1 jdk9-b54
|
||||||
|
be49ab55e5c498c5077bbf58c2737100d1992339 jdk9-b55
|
||||||
|
@ -123,6 +123,7 @@ public class VM {
|
|||||||
|
|
||||||
private static Type intxType;
|
private static Type intxType;
|
||||||
private static Type uintxType;
|
private static Type uintxType;
|
||||||
|
private static Type sizetType;
|
||||||
private static CIntegerType boolType;
|
private static CIntegerType boolType;
|
||||||
private Boolean sharingEnabled;
|
private Boolean sharingEnabled;
|
||||||
private Boolean compressedOopsEnabled;
|
private Boolean compressedOopsEnabled;
|
||||||
@ -175,7 +176,7 @@ public class VM {
|
|||||||
|
|
||||||
public long getIntx() {
|
public long getIntx() {
|
||||||
if (Assert.ASSERTS_ENABLED) {
|
if (Assert.ASSERTS_ENABLED) {
|
||||||
Assert.that(isIntx(), "not a intx flag!");
|
Assert.that(isIntx(), "not an intx flag!");
|
||||||
}
|
}
|
||||||
return addr.getCIntegerAt(0, intxType.getSize(), false);
|
return addr.getCIntegerAt(0, intxType.getSize(), false);
|
||||||
}
|
}
|
||||||
@ -191,6 +192,17 @@ public class VM {
|
|||||||
return addr.getCIntegerAt(0, uintxType.getSize(), true);
|
return addr.getCIntegerAt(0, uintxType.getSize(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSizet() {
|
||||||
|
return type.equals("size_t");
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getSizet() {
|
||||||
|
if (Assert.ASSERTS_ENABLED) {
|
||||||
|
Assert.that(isSizet(), "not a size_t flag!");
|
||||||
|
}
|
||||||
|
return addr.getCIntegerAt(0, sizetType.getSize(), true);
|
||||||
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
if (isBool()) {
|
if (isBool()) {
|
||||||
return new Boolean(getBool()).toString();
|
return new Boolean(getBool()).toString();
|
||||||
@ -198,6 +210,8 @@ public class VM {
|
|||||||
return new Long(getIntx()).toString();
|
return new Long(getIntx()).toString();
|
||||||
} else if (isUIntx()) {
|
} else if (isUIntx()) {
|
||||||
return new Long(getUIntx()).toString();
|
return new Long(getUIntx()).toString();
|
||||||
|
} else if (isSizet()) {
|
||||||
|
return new Long(getSizet()).toString();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -323,6 +337,7 @@ public class VM {
|
|||||||
|
|
||||||
intxType = db.lookupType("intx");
|
intxType = db.lookupType("intx");
|
||||||
uintxType = db.lookupType("uintx");
|
uintxType = db.lookupType("uintx");
|
||||||
|
sizetType = db.lookupType("size_t");
|
||||||
boolType = (CIntegerType) db.lookupType("bool");
|
boolType = (CIntegerType) db.lookupType("bool");
|
||||||
|
|
||||||
minObjAlignmentInBytes = getObjectAlignmentInBytes();
|
minObjAlignmentInBytes = getObjectAlignmentInBytes();
|
||||||
|
@ -207,7 +207,7 @@ ifeq ($(USE_CLANG), true)
|
|||||||
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
||||||
endif
|
endif
|
||||||
|
|
||||||
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
|
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual
|
||||||
|
|
||||||
ifeq ($(USE_CLANG),)
|
ifeq ($(USE_CLANG),)
|
||||||
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
||||||
|
@ -6056,7 +6056,7 @@ instruct loadD_volatile(vRegD dst, /* sync_memory*/indirect mem)
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
// Store Byte
|
// Store Byte
|
||||||
instruct storeB_volatile(iRegI src, /* sync_memory*/indirect mem)
|
instruct storeB_volatile(iRegIorL2I src, /* sync_memory*/indirect mem)
|
||||||
%{
|
%{
|
||||||
match(Set mem (StoreB mem src));
|
match(Set mem (StoreB mem src));
|
||||||
|
|
||||||
@ -6069,7 +6069,7 @@ instruct storeB_volatile(iRegI src, /* sync_memory*/indirect mem)
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
// Store Char/Short
|
// Store Char/Short
|
||||||
instruct storeC_volatile(iRegI src, /* sync_memory*/indirect mem)
|
instruct storeC_volatile(iRegIorL2I src, /* sync_memory*/indirect mem)
|
||||||
%{
|
%{
|
||||||
match(Set mem (StoreC mem src));
|
match(Set mem (StoreC mem src));
|
||||||
|
|
||||||
@ -6225,7 +6225,7 @@ instruct bytes_reverse_short(iRegINoSp dst, iRegIorL2I src) %{
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Zero Count Instructions
|
// Zero Count Instructions
|
||||||
|
|
||||||
instruct countLeadingZerosI(iRegINoSp dst, iRegI src) %{
|
instruct countLeadingZerosI(iRegINoSp dst, iRegIorL2I src) %{
|
||||||
match(Set dst (CountLeadingZerosI src));
|
match(Set dst (CountLeadingZerosI src));
|
||||||
|
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -6249,7 +6249,7 @@ instruct countLeadingZerosL(iRegINoSp dst, iRegL src) %{
|
|||||||
ins_pipe(ialu_reg);
|
ins_pipe(ialu_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct countTrailingZerosI(iRegINoSp dst, iRegI src) %{
|
instruct countTrailingZerosI(iRegINoSp dst, iRegIorL2I src) %{
|
||||||
match(Set dst (CountTrailingZerosI src));
|
match(Set dst (CountTrailingZerosI src));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 2);
|
ins_cost(INSN_COST * 2);
|
||||||
@ -6935,7 +6935,7 @@ instruct cmpL3_reg_imm(iRegINoSp dst, iRegL src1, immLAddSub src2, rFlagsReg fla
|
|||||||
// which throws a ShouldNotHappen. So, we have to provide two flavours
|
// which throws a ShouldNotHappen. So, we have to provide two flavours
|
||||||
// of each rule, one for a cmpOp and a second for a cmpOpU (sigh).
|
// of each rule, one for a cmpOp and a second for a cmpOpU (sigh).
|
||||||
|
|
||||||
instruct cmovI_reg_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegI src1, iRegI src2) %{
|
instruct cmovI_reg_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2) %{
|
||||||
match(Set dst (CMoveI (Binary cmp cr) (Binary src1 src2)));
|
match(Set dst (CMoveI (Binary cmp cr) (Binary src1 src2)));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 2);
|
ins_cost(INSN_COST * 2);
|
||||||
@ -6951,7 +6951,7 @@ instruct cmovI_reg_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegI src1, iRegI
|
|||||||
ins_pipe(icond_reg_reg);
|
ins_pipe(icond_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct cmovUI_reg_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegI src1, iRegI src2) %{
|
instruct cmovUI_reg_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2) %{
|
||||||
match(Set dst (CMoveI (Binary cmp cr) (Binary src1 src2)));
|
match(Set dst (CMoveI (Binary cmp cr) (Binary src1 src2)));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 2);
|
ins_cost(INSN_COST * 2);
|
||||||
@ -6976,7 +6976,7 @@ instruct cmovUI_reg_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegI src1, iR
|
|||||||
// we ought only to be able to cull one of these variants as the ideal
|
// we ought only to be able to cull one of these variants as the ideal
|
||||||
// transforms ought always to order the zero consistently (to left/right?)
|
// transforms ought always to order the zero consistently (to left/right?)
|
||||||
|
|
||||||
instruct cmovI_zero_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, immI0 zero, iRegI src) %{
|
instruct cmovI_zero_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, immI0 zero, iRegIorL2I src) %{
|
||||||
match(Set dst (CMoveI (Binary cmp cr) (Binary zero src)));
|
match(Set dst (CMoveI (Binary cmp cr) (Binary zero src)));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 2);
|
ins_cost(INSN_COST * 2);
|
||||||
@ -6992,7 +6992,7 @@ instruct cmovI_zero_reg(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, immI0 zero, iReg
|
|||||||
ins_pipe(icond_reg);
|
ins_pipe(icond_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct cmovUI_zero_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, immI0 zero, iRegI src) %{
|
instruct cmovUI_zero_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, immI0 zero, iRegIorL2I src) %{
|
||||||
match(Set dst (CMoveI (Binary cmp cr) (Binary zero src)));
|
match(Set dst (CMoveI (Binary cmp cr) (Binary zero src)));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 2);
|
ins_cost(INSN_COST * 2);
|
||||||
@ -7008,7 +7008,7 @@ instruct cmovUI_zero_reg(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, immI0 zero, i
|
|||||||
ins_pipe(icond_reg);
|
ins_pipe(icond_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct cmovI_reg_zero(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegI src, immI0 zero) %{
|
instruct cmovI_reg_zero(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegIorL2I src, immI0 zero) %{
|
||||||
match(Set dst (CMoveI (Binary cmp cr) (Binary src zero)));
|
match(Set dst (CMoveI (Binary cmp cr) (Binary src zero)));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 2);
|
ins_cost(INSN_COST * 2);
|
||||||
@ -7024,7 +7024,7 @@ instruct cmovI_reg_zero(cmpOp cmp, rFlagsReg cr, iRegINoSp dst, iRegI src, immI0
|
|||||||
ins_pipe(icond_reg);
|
ins_pipe(icond_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct cmovUI_reg_zero(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegI src, immI0 zero) %{
|
instruct cmovUI_reg_zero(cmpOpU cmp, rFlagsRegU cr, iRegINoSp dst, iRegIorL2I src, immI0 zero) %{
|
||||||
match(Set dst (CMoveI (Binary cmp cr) (Binary src zero)));
|
match(Set dst (CMoveI (Binary cmp cr) (Binary src zero)));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 2);
|
ins_cost(INSN_COST * 2);
|
||||||
@ -7476,7 +7476,7 @@ instruct addI_reg_reg(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2) %{
|
|||||||
ins_pipe(ialu_reg_reg);
|
ins_pipe(ialu_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct addI_reg_imm(iRegINoSp dst, iRegI src1, immIAddSub src2) %{
|
instruct addI_reg_imm(iRegINoSp dst, iRegIorL2I src1, immIAddSub src2) %{
|
||||||
match(Set dst (AddI src1 src2));
|
match(Set dst (AddI src1 src2));
|
||||||
|
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -7869,7 +7869,7 @@ instruct divI(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2) %{
|
|||||||
ins_pipe(idiv_reg_reg);
|
ins_pipe(idiv_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct signExtract(iRegINoSp dst, iRegI src1, immI_31 div1, immI_31 div2) %{
|
instruct signExtract(iRegINoSp dst, iRegIorL2I src1, immI_31 div1, immI_31 div2) %{
|
||||||
match(Set dst (URShiftI (RShiftI src1 div1) div2));
|
match(Set dst (URShiftI (RShiftI src1 div1) div2));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
format %{ "lsrw $dst, $src1, $div1" %}
|
format %{ "lsrw $dst, $src1, $div1" %}
|
||||||
@ -7879,7 +7879,7 @@ instruct signExtract(iRegINoSp dst, iRegI src1, immI_31 div1, immI_31 div2) %{
|
|||||||
ins_pipe(ialu_reg_shift);
|
ins_pipe(ialu_reg_shift);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct div2Round(iRegINoSp dst, iRegI src, immI_31 div1, immI_31 div2) %{
|
instruct div2Round(iRegINoSp dst, iRegIorL2I src, immI_31 div1, immI_31 div2) %{
|
||||||
match(Set dst (AddI src (URShiftI (RShiftI src div1) div2)));
|
match(Set dst (AddI src (URShiftI (RShiftI src div1) div2)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
format %{ "addw $dst, $src, LSR $div1" %}
|
format %{ "addw $dst, $src, LSR $div1" %}
|
||||||
@ -8189,7 +8189,7 @@ instruct regL_not_reg(iRegLNoSp dst,
|
|||||||
ins_pipe(ialu_reg);
|
ins_pipe(ialu_reg);
|
||||||
%}
|
%}
|
||||||
instruct regI_not_reg(iRegINoSp dst,
|
instruct regI_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, immI_M1 m1,
|
iRegIorL2I src1, immI_M1 m1,
|
||||||
rFlagsReg cr) %{
|
rFlagsReg cr) %{
|
||||||
match(Set dst (XorI src1 m1));
|
match(Set dst (XorI src1 m1));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -8206,14 +8206,14 @@ instruct regI_not_reg(iRegINoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AndI_reg_not_reg(iRegINoSp dst,
|
instruct AndI_reg_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2, immI_M1 m1,
|
iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1,
|
||||||
rFlagsReg cr) %{
|
rFlagsReg cr) %{
|
||||||
match(Set dst (AndI src1 (XorI src2 m1)));
|
match(Set dst (AndI src1 (XorI src2 m1)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
format %{ "bic $dst, $src1, $src2" %}
|
format %{ "bicw $dst, $src1, $src2" %}
|
||||||
|
|
||||||
ins_encode %{
|
ins_encode %{
|
||||||
__ bic(as_Register($dst$$reg),
|
__ bicw(as_Register($dst$$reg),
|
||||||
as_Register($src1$$reg),
|
as_Register($src1$$reg),
|
||||||
as_Register($src2$$reg),
|
as_Register($src2$$reg),
|
||||||
Assembler::LSL, 0);
|
Assembler::LSL, 0);
|
||||||
@ -8240,14 +8240,14 @@ instruct AndL_reg_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct OrI_reg_not_reg(iRegINoSp dst,
|
instruct OrI_reg_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2, immI_M1 m1,
|
iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1,
|
||||||
rFlagsReg cr) %{
|
rFlagsReg cr) %{
|
||||||
match(Set dst (OrI src1 (XorI src2 m1)));
|
match(Set dst (OrI src1 (XorI src2 m1)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
format %{ "orn $dst, $src1, $src2" %}
|
format %{ "ornw $dst, $src1, $src2" %}
|
||||||
|
|
||||||
ins_encode %{
|
ins_encode %{
|
||||||
__ orn(as_Register($dst$$reg),
|
__ ornw(as_Register($dst$$reg),
|
||||||
as_Register($src1$$reg),
|
as_Register($src1$$reg),
|
||||||
as_Register($src2$$reg),
|
as_Register($src2$$reg),
|
||||||
Assembler::LSL, 0);
|
Assembler::LSL, 0);
|
||||||
@ -8274,14 +8274,14 @@ instruct OrL_reg_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct XorI_reg_not_reg(iRegINoSp dst,
|
instruct XorI_reg_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2, immI_M1 m1,
|
iRegIorL2I src1, iRegIorL2I src2, immI_M1 m1,
|
||||||
rFlagsReg cr) %{
|
rFlagsReg cr) %{
|
||||||
match(Set dst (XorI m1 (XorI src2 src1)));
|
match(Set dst (XorI m1 (XorI src2 src1)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
format %{ "eon $dst, $src1, $src2" %}
|
format %{ "eonw $dst, $src1, $src2" %}
|
||||||
|
|
||||||
ins_encode %{
|
ins_encode %{
|
||||||
__ eon(as_Register($dst$$reg),
|
__ eonw(as_Register($dst$$reg),
|
||||||
as_Register($src1$$reg),
|
as_Register($src1$$reg),
|
||||||
as_Register($src2$$reg),
|
as_Register($src2$$reg),
|
||||||
Assembler::LSL, 0);
|
Assembler::LSL, 0);
|
||||||
@ -8308,7 +8308,7 @@ instruct XorL_reg_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AndI_reg_URShift_not_reg(iRegINoSp dst,
|
instruct AndI_reg_URShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (AndI src1 (XorI(URShiftI src2 src3) src4)));
|
match(Set dst (AndI src1 (XorI(URShiftI src2 src3) src4)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8344,7 +8344,7 @@ instruct AndL_reg_URShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AndI_reg_RShift_not_reg(iRegINoSp dst,
|
instruct AndI_reg_RShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (AndI src1 (XorI(RShiftI src2 src3) src4)));
|
match(Set dst (AndI src1 (XorI(RShiftI src2 src3) src4)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8380,7 +8380,7 @@ instruct AndL_reg_RShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AndI_reg_LShift_not_reg(iRegINoSp dst,
|
instruct AndI_reg_LShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (AndI src1 (XorI(LShiftI src2 src3) src4)));
|
match(Set dst (AndI src1 (XorI(LShiftI src2 src3) src4)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8416,7 +8416,7 @@ instruct AndL_reg_LShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct XorI_reg_URShift_not_reg(iRegINoSp dst,
|
instruct XorI_reg_URShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (XorI src4 (XorI(URShiftI src2 src3) src1)));
|
match(Set dst (XorI src4 (XorI(URShiftI src2 src3) src1)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8452,7 +8452,7 @@ instruct XorL_reg_URShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct XorI_reg_RShift_not_reg(iRegINoSp dst,
|
instruct XorI_reg_RShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (XorI src4 (XorI(RShiftI src2 src3) src1)));
|
match(Set dst (XorI src4 (XorI(RShiftI src2 src3) src1)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8488,7 +8488,7 @@ instruct XorL_reg_RShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct XorI_reg_LShift_not_reg(iRegINoSp dst,
|
instruct XorI_reg_LShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (XorI src4 (XorI(LShiftI src2 src3) src1)));
|
match(Set dst (XorI src4 (XorI(LShiftI src2 src3) src1)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8524,7 +8524,7 @@ instruct XorL_reg_LShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct OrI_reg_URShift_not_reg(iRegINoSp dst,
|
instruct OrI_reg_URShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (OrI src1 (XorI(URShiftI src2 src3) src4)));
|
match(Set dst (OrI src1 (XorI(URShiftI src2 src3) src4)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8560,7 +8560,7 @@ instruct OrL_reg_URShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct OrI_reg_RShift_not_reg(iRegINoSp dst,
|
instruct OrI_reg_RShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (OrI src1 (XorI(RShiftI src2 src3) src4)));
|
match(Set dst (OrI src1 (XorI(RShiftI src2 src3) src4)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8596,7 +8596,7 @@ instruct OrL_reg_RShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct OrI_reg_LShift_not_reg(iRegINoSp dst,
|
instruct OrI_reg_LShift_not_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
immI src3, immI_M1 src4, rFlagsReg cr) %{
|
||||||
match(Set dst (OrI src1 (XorI(LShiftI src2 src3) src4)));
|
match(Set dst (OrI src1 (XorI(LShiftI src2 src3) src4)));
|
||||||
ins_cost(1.9 * INSN_COST);
|
ins_cost(1.9 * INSN_COST);
|
||||||
@ -8632,7 +8632,7 @@ instruct OrL_reg_LShift_not_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AndI_reg_URShift_reg(iRegINoSp dst,
|
instruct AndI_reg_URShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (AndI src1 (URShiftI src2 src3)));
|
match(Set dst (AndI src1 (URShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8670,7 +8670,7 @@ instruct AndL_reg_URShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AndI_reg_RShift_reg(iRegINoSp dst,
|
instruct AndI_reg_RShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (AndI src1 (RShiftI src2 src3)));
|
match(Set dst (AndI src1 (RShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8708,7 +8708,7 @@ instruct AndL_reg_RShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AndI_reg_LShift_reg(iRegINoSp dst,
|
instruct AndI_reg_LShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (AndI src1 (LShiftI src2 src3)));
|
match(Set dst (AndI src1 (LShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8746,7 +8746,7 @@ instruct AndL_reg_LShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct XorI_reg_URShift_reg(iRegINoSp dst,
|
instruct XorI_reg_URShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (XorI src1 (URShiftI src2 src3)));
|
match(Set dst (XorI src1 (URShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8784,7 +8784,7 @@ instruct XorL_reg_URShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct XorI_reg_RShift_reg(iRegINoSp dst,
|
instruct XorI_reg_RShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (XorI src1 (RShiftI src2 src3)));
|
match(Set dst (XorI src1 (RShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8822,7 +8822,7 @@ instruct XorL_reg_RShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct XorI_reg_LShift_reg(iRegINoSp dst,
|
instruct XorI_reg_LShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (XorI src1 (LShiftI src2 src3)));
|
match(Set dst (XorI src1 (LShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8860,7 +8860,7 @@ instruct XorL_reg_LShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct OrI_reg_URShift_reg(iRegINoSp dst,
|
instruct OrI_reg_URShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (OrI src1 (URShiftI src2 src3)));
|
match(Set dst (OrI src1 (URShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8898,7 +8898,7 @@ instruct OrL_reg_URShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct OrI_reg_RShift_reg(iRegINoSp dst,
|
instruct OrI_reg_RShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (OrI src1 (RShiftI src2 src3)));
|
match(Set dst (OrI src1 (RShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8936,7 +8936,7 @@ instruct OrL_reg_RShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct OrI_reg_LShift_reg(iRegINoSp dst,
|
instruct OrI_reg_LShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (OrI src1 (LShiftI src2 src3)));
|
match(Set dst (OrI src1 (LShiftI src2 src3)));
|
||||||
|
|
||||||
@ -8974,7 +8974,7 @@ instruct OrL_reg_LShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AddI_reg_URShift_reg(iRegINoSp dst,
|
instruct AddI_reg_URShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (AddI src1 (URShiftI src2 src3)));
|
match(Set dst (AddI src1 (URShiftI src2 src3)));
|
||||||
|
|
||||||
@ -9012,7 +9012,7 @@ instruct AddL_reg_URShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AddI_reg_RShift_reg(iRegINoSp dst,
|
instruct AddI_reg_RShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (AddI src1 (RShiftI src2 src3)));
|
match(Set dst (AddI src1 (RShiftI src2 src3)));
|
||||||
|
|
||||||
@ -9050,7 +9050,7 @@ instruct AddL_reg_RShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AddI_reg_LShift_reg(iRegINoSp dst,
|
instruct AddI_reg_LShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (AddI src1 (LShiftI src2 src3)));
|
match(Set dst (AddI src1 (LShiftI src2 src3)));
|
||||||
|
|
||||||
@ -9088,7 +9088,7 @@ instruct AddL_reg_LShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct SubI_reg_URShift_reg(iRegINoSp dst,
|
instruct SubI_reg_URShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (SubI src1 (URShiftI src2 src3)));
|
match(Set dst (SubI src1 (URShiftI src2 src3)));
|
||||||
|
|
||||||
@ -9126,7 +9126,7 @@ instruct SubL_reg_URShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct SubI_reg_RShift_reg(iRegINoSp dst,
|
instruct SubI_reg_RShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (SubI src1 (RShiftI src2 src3)));
|
match(Set dst (SubI src1 (RShiftI src2 src3)));
|
||||||
|
|
||||||
@ -9164,7 +9164,7 @@ instruct SubL_reg_RShift_reg(iRegLNoSp dst,
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
instruct SubI_reg_LShift_reg(iRegINoSp dst,
|
instruct SubI_reg_LShift_reg(iRegINoSp dst,
|
||||||
iRegI src1, iRegI src2,
|
iRegIorL2I src1, iRegIorL2I src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst (SubI src1 (LShiftI src2 src3)));
|
match(Set dst (SubI src1 (LShiftI src2 src3)));
|
||||||
|
|
||||||
@ -9228,7 +9228,7 @@ instruct sbfmL(iRegLNoSp dst, iRegL src, immI lshift_count, immI rshift_count)
|
|||||||
|
|
||||||
// Shift Left followed by Shift Right.
|
// Shift Left followed by Shift Right.
|
||||||
// This idiom is used by the compiler for the i2b bytecode etc.
|
// This idiom is used by the compiler for the i2b bytecode etc.
|
||||||
instruct sbfmwI(iRegINoSp dst, iRegI src, immI lshift_count, immI rshift_count)
|
instruct sbfmwI(iRegINoSp dst, iRegIorL2I src, immI lshift_count, immI rshift_count)
|
||||||
%{
|
%{
|
||||||
match(Set dst (RShiftI (LShiftI src lshift_count) rshift_count));
|
match(Set dst (RShiftI (LShiftI src lshift_count) rshift_count));
|
||||||
// Make sure we are not going to exceed what sbfmw can do.
|
// Make sure we are not going to exceed what sbfmw can do.
|
||||||
@ -9274,7 +9274,7 @@ instruct ubfmL(iRegLNoSp dst, iRegL src, immI lshift_count, immI rshift_count)
|
|||||||
|
|
||||||
// Shift Left followed by Shift Right.
|
// Shift Left followed by Shift Right.
|
||||||
// This idiom is used by the compiler for the i2b bytecode etc.
|
// This idiom is used by the compiler for the i2b bytecode etc.
|
||||||
instruct ubfmwI(iRegINoSp dst, iRegI src, immI lshift_count, immI rshift_count)
|
instruct ubfmwI(iRegINoSp dst, iRegIorL2I src, immI lshift_count, immI rshift_count)
|
||||||
%{
|
%{
|
||||||
match(Set dst (URShiftI (LShiftI src lshift_count) rshift_count));
|
match(Set dst (URShiftI (LShiftI src lshift_count) rshift_count));
|
||||||
// Make sure we are not going to exceed what ubfmw can do.
|
// Make sure we are not going to exceed what ubfmw can do.
|
||||||
@ -9296,7 +9296,7 @@ instruct ubfmwI(iRegINoSp dst, iRegI src, immI lshift_count, immI rshift_count)
|
|||||||
%}
|
%}
|
||||||
// Bitfield extract with shift & mask
|
// Bitfield extract with shift & mask
|
||||||
|
|
||||||
instruct ubfxwI(iRegINoSp dst, iRegI src, immI rshift, immI_bitmask mask)
|
instruct ubfxwI(iRegINoSp dst, iRegIorL2I src, immI rshift, immI_bitmask mask)
|
||||||
%{
|
%{
|
||||||
match(Set dst (AndI (URShiftI src rshift) mask));
|
match(Set dst (AndI (URShiftI src rshift) mask));
|
||||||
|
|
||||||
@ -9362,7 +9362,7 @@ instruct extrOrL(iRegLNoSp dst, iRegL src1, iRegL src2, immI lshift, immI rshift
|
|||||||
ins_pipe(ialu_reg_reg_extr);
|
ins_pipe(ialu_reg_reg_extr);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct extrOrI(iRegINoSp dst, iRegI src1, iRegI src2, immI lshift, immI rshift, rFlagsReg cr)
|
instruct extrOrI(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI lshift, immI rshift, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (OrI (LShiftI src1 lshift) (URShiftI src2 rshift)));
|
match(Set dst (OrI (LShiftI src1 lshift) (URShiftI src2 rshift)));
|
||||||
predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & 31));
|
predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & 31));
|
||||||
@ -9392,7 +9392,7 @@ instruct extrAddL(iRegLNoSp dst, iRegL src1, iRegL src2, immI lshift, immI rshif
|
|||||||
ins_pipe(ialu_reg_reg_extr);
|
ins_pipe(ialu_reg_reg_extr);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct extrAddI(iRegINoSp dst, iRegI src1, iRegI src2, immI lshift, immI rshift, rFlagsReg cr)
|
instruct extrAddI(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI lshift, immI rshift, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (AddI (LShiftI src1 lshift) (URShiftI src2 rshift)));
|
match(Set dst (AddI (LShiftI src1 lshift) (URShiftI src2 rshift)));
|
||||||
predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & 31));
|
predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & 31));
|
||||||
@ -9571,7 +9571,7 @@ instruct SubExtI(iRegLNoSp dst, iRegL src1, iRegIorL2I src2, rFlagsReg cr)
|
|||||||
%};
|
%};
|
||||||
|
|
||||||
|
|
||||||
instruct AddExtI_sxth(iRegINoSp dst, iRegI src1, iRegI src2, immI_16 lshift, immI_16 rshift, rFlagsReg cr)
|
instruct AddExtI_sxth(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_16 lshift, immI_16 rshift, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (AddI src1 (RShiftI (LShiftI src2 lshift) rshift)));
|
match(Set dst (AddI src1 (RShiftI (LShiftI src2 lshift) rshift)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -9584,7 +9584,7 @@ instruct AddExtI_sxth(iRegINoSp dst, iRegI src1, iRegI src2, immI_16 lshift, imm
|
|||||||
ins_pipe(ialu_reg_reg);
|
ins_pipe(ialu_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AddExtI_sxtb(iRegINoSp dst, iRegI src1, iRegI src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr)
|
instruct AddExtI_sxtb(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (AddI src1 (RShiftI (LShiftI src2 lshift) rshift)));
|
match(Set dst (AddI src1 (RShiftI (LShiftI src2 lshift) rshift)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -9597,7 +9597,7 @@ instruct AddExtI_sxtb(iRegINoSp dst, iRegI src1, iRegI src2, immI_24 lshift, imm
|
|||||||
ins_pipe(ialu_reg_reg);
|
ins_pipe(ialu_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AddExtI_uxtb(iRegINoSp dst, iRegI src1, iRegI src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr)
|
instruct AddExtI_uxtb(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_24 lshift, immI_24 rshift, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (AddI src1 (URShiftI (LShiftI src2 lshift) rshift)));
|
match(Set dst (AddI src1 (URShiftI (LShiftI src2 lshift) rshift)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -9663,7 +9663,7 @@ instruct AddExtL_uxtb(iRegLNoSp dst, iRegL src1, iRegL src2, immI_56 lshift, imm
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
instruct AddExtI_uxtb_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_255 mask, rFlagsReg cr)
|
instruct AddExtI_uxtb_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_255 mask, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (AddI src1 (AndI src2 mask)));
|
match(Set dst (AddI src1 (AndI src2 mask)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -9676,7 +9676,7 @@ instruct AddExtI_uxtb_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_255 mask,
|
|||||||
ins_pipe(ialu_reg_reg);
|
ins_pipe(ialu_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct AddExtI_uxth_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_65535 mask, rFlagsReg cr)
|
instruct AddExtI_uxth_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_65535 mask, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (AddI src1 (AndI src2 mask)));
|
match(Set dst (AddI src1 (AndI src2 mask)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -9728,7 +9728,7 @@ instruct AddExtL_uxtw_and(iRegLNoSp dst, iRegL src1, iRegL src2, immL_4294967295
|
|||||||
ins_pipe(ialu_reg_reg);
|
ins_pipe(ialu_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct SubExtI_uxtb_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_255 mask, rFlagsReg cr)
|
instruct SubExtI_uxtb_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_255 mask, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (SubI src1 (AndI src2 mask)));
|
match(Set dst (SubI src1 (AndI src2 mask)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -9741,7 +9741,7 @@ instruct SubExtI_uxtb_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_255 mask,
|
|||||||
ins_pipe(ialu_reg_reg);
|
ins_pipe(ialu_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct SubExtI_uxth_and(iRegINoSp dst, iRegI src1, iRegI src2, immI_65535 mask, rFlagsReg cr)
|
instruct SubExtI_uxth_and(iRegINoSp dst, iRegIorL2I src1, iRegIorL2I src2, immI_65535 mask, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (SubI src1 (AndI src2 mask)));
|
match(Set dst (SubI src1 (AndI src2 mask)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -10343,7 +10343,7 @@ instruct convI2L_reg_reg(iRegLNoSp dst, iRegIorL2I src)
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
// this pattern occurs in bigmath arithmetic
|
// this pattern occurs in bigmath arithmetic
|
||||||
instruct convUI2L_reg_reg(iRegLNoSp dst, iRegI src, immL_32bits mask)
|
instruct convUI2L_reg_reg(iRegLNoSp dst, iRegIorL2I src, immL_32bits mask)
|
||||||
%{
|
%{
|
||||||
match(Set dst (AndL (ConvI2L src) mask));
|
match(Set dst (AndL (ConvI2L src) mask));
|
||||||
|
|
||||||
@ -10369,7 +10369,7 @@ instruct convL2I_reg(iRegINoSp dst, iRegL src) %{
|
|||||||
ins_pipe(ialu_reg);
|
ins_pipe(ialu_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct convI2B(iRegINoSp dst, iRegI src, rFlagsReg cr)
|
instruct convI2B(iRegINoSp dst, iRegIorL2I src, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (Conv2B src));
|
match(Set dst (Conv2B src));
|
||||||
effect(KILL cr);
|
effect(KILL cr);
|
||||||
@ -10457,7 +10457,7 @@ instruct convF2L_reg_reg(iRegLNoSp dst, vRegF src) %{
|
|||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct convI2F_reg_reg(vRegF dst, iRegI src) %{
|
instruct convI2F_reg_reg(vRegF dst, iRegIorL2I src) %{
|
||||||
match(Set dst (ConvI2F src));
|
match(Set dst (ConvI2F src));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 5);
|
ins_cost(INSN_COST * 5);
|
||||||
@ -10509,7 +10509,7 @@ instruct convD2L_reg_reg(iRegLNoSp dst, vRegD src) %{
|
|||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct convI2D_reg_reg(vRegD dst, iRegI src) %{
|
instruct convI2D_reg_reg(vRegD dst, iRegIorL2I src) %{
|
||||||
match(Set dst (ConvI2D src));
|
match(Set dst (ConvI2D src));
|
||||||
|
|
||||||
ins_cost(INSN_COST * 5);
|
ins_cost(INSN_COST * 5);
|
||||||
@ -10772,7 +10772,7 @@ instruct clearArray_reg_reg(iRegL_R11 cnt, iRegP_R10 base, Universe dummy, rFlag
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Overflow Math Instructions
|
// Overflow Math Instructions
|
||||||
|
|
||||||
instruct overflowAddI_reg_reg(rFlagsReg cr, iRegI op1, iRegI op2)
|
instruct overflowAddI_reg_reg(rFlagsReg cr, iRegIorL2I op1, iRegIorL2I op2)
|
||||||
%{
|
%{
|
||||||
match(Set cr (OverflowAddI op1 op2));
|
match(Set cr (OverflowAddI op1 op2));
|
||||||
|
|
||||||
@ -10785,7 +10785,7 @@ instruct overflowAddI_reg_reg(rFlagsReg cr, iRegI op1, iRegI op2)
|
|||||||
ins_pipe(icmp_reg_reg);
|
ins_pipe(icmp_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct overflowAddI_reg_imm(rFlagsReg cr, iRegI op1, immIAddSub op2)
|
instruct overflowAddI_reg_imm(rFlagsReg cr, iRegIorL2I op1, immIAddSub op2)
|
||||||
%{
|
%{
|
||||||
match(Set cr (OverflowAddI op1 op2));
|
match(Set cr (OverflowAddI op1 op2));
|
||||||
|
|
||||||
@ -10824,7 +10824,7 @@ instruct overflowAddL_reg_imm(rFlagsReg cr, iRegL op1, immLAddSub op2)
|
|||||||
ins_pipe(icmp_reg_imm);
|
ins_pipe(icmp_reg_imm);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct overflowSubI_reg_reg(rFlagsReg cr, iRegI op1, iRegI op2)
|
instruct overflowSubI_reg_reg(rFlagsReg cr, iRegIorL2I op1, iRegIorL2I op2)
|
||||||
%{
|
%{
|
||||||
match(Set cr (OverflowSubI op1 op2));
|
match(Set cr (OverflowSubI op1 op2));
|
||||||
|
|
||||||
@ -10837,7 +10837,7 @@ instruct overflowSubI_reg_reg(rFlagsReg cr, iRegI op1, iRegI op2)
|
|||||||
ins_pipe(icmp_reg_reg);
|
ins_pipe(icmp_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct overflowSubI_reg_imm(rFlagsReg cr, iRegI op1, immIAddSub op2)
|
instruct overflowSubI_reg_imm(rFlagsReg cr, iRegIorL2I op1, immIAddSub op2)
|
||||||
%{
|
%{
|
||||||
match(Set cr (OverflowSubI op1 op2));
|
match(Set cr (OverflowSubI op1 op2));
|
||||||
|
|
||||||
@ -10876,7 +10876,7 @@ instruct overflowSubL_reg_imm(rFlagsReg cr, iRegL op1, immLAddSub op2)
|
|||||||
ins_pipe(icmp_reg_imm);
|
ins_pipe(icmp_reg_imm);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct overflowNegI_reg(rFlagsReg cr, immI0 zero, iRegI op1)
|
instruct overflowNegI_reg(rFlagsReg cr, immI0 zero, iRegIorL2I op1)
|
||||||
%{
|
%{
|
||||||
match(Set cr (OverflowSubI zero op1));
|
match(Set cr (OverflowSubI zero op1));
|
||||||
|
|
||||||
@ -10902,7 +10902,7 @@ instruct overflowNegL_reg(rFlagsReg cr, immI0 zero, iRegL op1)
|
|||||||
ins_pipe(icmp_reg_imm);
|
ins_pipe(icmp_reg_imm);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct overflowMulI_reg(rFlagsReg cr, iRegI op1, iRegI op2)
|
instruct overflowMulI_reg(rFlagsReg cr, iRegIorL2I op1, iRegIorL2I op2)
|
||||||
%{
|
%{
|
||||||
match(Set cr (OverflowMulI op1 op2));
|
match(Set cr (OverflowMulI op1 op2));
|
||||||
|
|
||||||
@ -10923,7 +10923,7 @@ instruct overflowMulI_reg(rFlagsReg cr, iRegI op1, iRegI op2)
|
|||||||
ins_pipe(pipe_slow);
|
ins_pipe(pipe_slow);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct overflowMulI_reg_branch(cmpOp cmp, iRegI op1, iRegI op2, label labl, rFlagsReg cr)
|
instruct overflowMulI_reg_branch(cmpOp cmp, iRegIorL2I op1, iRegIorL2I op2, label labl, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(If cmp (OverflowMulI op1 op2));
|
match(If cmp (OverflowMulI op1 op2));
|
||||||
predicate(n->in(1)->as_Bool()->_test._test == BoolTest::overflow
|
predicate(n->in(1)->as_Bool()->_test._test == BoolTest::overflow
|
||||||
@ -11393,7 +11393,7 @@ instruct compD3_reg_immD0(iRegINoSp dst, vRegD src1, immD0 zero, rFlagsReg cr)
|
|||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct cmpLTMask_reg_reg(iRegINoSp dst, iRegI p, iRegI q, rFlagsReg cr)
|
instruct cmpLTMask_reg_reg(iRegINoSp dst, iRegIorL2I p, iRegIorL2I q, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (CmpLTMask p q));
|
match(Set dst (CmpLTMask p q));
|
||||||
effect(KILL cr);
|
effect(KILL cr);
|
||||||
@ -11414,7 +11414,7 @@ instruct cmpLTMask_reg_reg(iRegINoSp dst, iRegI p, iRegI q, rFlagsReg cr)
|
|||||||
ins_pipe(ialu_reg_reg);
|
ins_pipe(ialu_reg_reg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
instruct cmpLTMask_reg_zero(iRegINoSp dst, iRegI src, immI0 zero, rFlagsReg cr)
|
instruct cmpLTMask_reg_zero(iRegINoSp dst, iRegIorL2I src, immI0 zero, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst (CmpLTMask src zero));
|
match(Set dst (CmpLTMask src zero));
|
||||||
effect(KILL cr);
|
effect(KILL cr);
|
||||||
@ -11548,7 +11548,7 @@ instruct branchConU(cmpOpU cmp, rFlagsRegU cr, label lbl)
|
|||||||
// shorter than (cmp; branch), have the additional benefit of not
|
// shorter than (cmp; branch), have the additional benefit of not
|
||||||
// killing the flags.
|
// killing the flags.
|
||||||
|
|
||||||
instruct cmpI_imm0_branch(cmpOp cmp, iRegI op1, immI0 op2, label labl, rFlagsReg cr) %{
|
instruct cmpI_imm0_branch(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl, rFlagsReg cr) %{
|
||||||
match(If cmp (CmpI op1 op2));
|
match(If cmp (CmpI op1 op2));
|
||||||
predicate(n->in(1)->as_Bool()->_test._test == BoolTest::ne
|
predicate(n->in(1)->as_Bool()->_test._test == BoolTest::ne
|
||||||
|| n->in(1)->as_Bool()->_test._test == BoolTest::eq);
|
|| n->in(1)->as_Bool()->_test._test == BoolTest::eq);
|
||||||
|
@ -24,11 +24,13 @@ dnl Process this file with m4 aarch64_ad.m4 to generate the arithmetic
|
|||||||
dnl and shift patterns patterns used in aarch64.ad.
|
dnl and shift patterns patterns used in aarch64.ad.
|
||||||
dnl
|
dnl
|
||||||
// BEGIN This section of the file is automatically generated. Do not edit --------------
|
// BEGIN This section of the file is automatically generated. Do not edit --------------
|
||||||
|
dnl
|
||||||
|
define(`ORL2I', `ifelse($1,I,orL2I)')
|
||||||
|
dnl
|
||||||
define(`BASE_SHIFT_INSN',
|
define(`BASE_SHIFT_INSN',
|
||||||
`
|
`
|
||||||
instruct $2$1_reg_$4_reg(iReg$1NoSp dst,
|
instruct $2$1_reg_$4_reg(iReg$1NoSp dst,
|
||||||
iReg$1 src1, iReg$1 src2,
|
iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2,
|
||||||
immI src3, rFlagsReg cr) %{
|
immI src3, rFlagsReg cr) %{
|
||||||
match(Set dst ($2$1 src1 ($4$1 src2 src3)));
|
match(Set dst ($2$1 src1 ($4$1 src2 src3)));
|
||||||
|
|
||||||
@ -48,7 +50,7 @@ instruct $2$1_reg_$4_reg(iReg$1NoSp dst,
|
|||||||
define(`BASE_INVERTED_INSN',
|
define(`BASE_INVERTED_INSN',
|
||||||
`
|
`
|
||||||
instruct $2$1_reg_not_reg(iReg$1NoSp dst,
|
instruct $2$1_reg_not_reg(iReg$1NoSp dst,
|
||||||
iReg$1 src1, iReg$1 src2, imm$1_M1 m1,
|
iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, imm$1_M1 m1,
|
||||||
rFlagsReg cr) %{
|
rFlagsReg cr) %{
|
||||||
dnl This ifelse is because hotspot reassociates (xor (xor ..)..)
|
dnl This ifelse is because hotspot reassociates (xor (xor ..)..)
|
||||||
dnl into this canonical form.
|
dnl into this canonical form.
|
||||||
@ -70,7 +72,7 @@ dnl into this canonical form.
|
|||||||
define(`INVERTED_SHIFT_INSN',
|
define(`INVERTED_SHIFT_INSN',
|
||||||
`
|
`
|
||||||
instruct $2$1_reg_$4_not_reg(iReg$1NoSp dst,
|
instruct $2$1_reg_$4_not_reg(iReg$1NoSp dst,
|
||||||
iReg$1 src1, iReg$1 src2,
|
iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2,
|
||||||
immI src3, imm$1_M1 src4, rFlagsReg cr) %{
|
immI src3, imm$1_M1 src4, rFlagsReg cr) %{
|
||||||
dnl This ifelse is because hotspot reassociates (xor (xor ..)..)
|
dnl This ifelse is because hotspot reassociates (xor (xor ..)..)
|
||||||
dnl into this canonical form.
|
dnl into this canonical form.
|
||||||
@ -92,7 +94,7 @@ dnl into this canonical form.
|
|||||||
%}')dnl
|
%}')dnl
|
||||||
define(`NOT_INSN',
|
define(`NOT_INSN',
|
||||||
`instruct reg$1_not_reg(iReg$1NoSp dst,
|
`instruct reg$1_not_reg(iReg$1NoSp dst,
|
||||||
iReg$1 src1, imm$1_M1 m1,
|
iReg$1`'ORL2I($1) src1, imm$1_M1 m1,
|
||||||
rFlagsReg cr) %{
|
rFlagsReg cr) %{
|
||||||
match(Set dst (Xor$1 src1 m1));
|
match(Set dst (Xor$1 src1 m1));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -113,7 +115,7 @@ define(`BOTH_SHIFT_INSNS',
|
|||||||
BASE_SHIFT_INSN(L, $1, $2, $3, $4)')dnl
|
BASE_SHIFT_INSN(L, $1, $2, $3, $4)')dnl
|
||||||
dnl
|
dnl
|
||||||
define(`BOTH_INVERTED_INSNS',
|
define(`BOTH_INVERTED_INSNS',
|
||||||
`BASE_INVERTED_INSN(I, $1, $2, $3, $4)
|
`BASE_INVERTED_INSN(I, $1, $2w, $3, $4)
|
||||||
BASE_INVERTED_INSN(L, $1, $2, $3, $4)')dnl
|
BASE_INVERTED_INSN(L, $1, $2, $3, $4)')dnl
|
||||||
dnl
|
dnl
|
||||||
define(`BOTH_INVERTED_SHIFT_INSNS',
|
define(`BOTH_INVERTED_SHIFT_INSNS',
|
||||||
@ -149,7 +151,7 @@ define(`EXTEND', `($2$1 (LShift$1 $3 $4) $5)')
|
|||||||
define(`BFM_INSN',`
|
define(`BFM_INSN',`
|
||||||
// Shift Left followed by Shift Right.
|
// Shift Left followed by Shift Right.
|
||||||
// This idiom is used by the compiler for the i2b bytecode etc.
|
// This idiom is used by the compiler for the i2b bytecode etc.
|
||||||
instruct $4$1(iReg$1NoSp dst, iReg$1 src, immI lshift_count, immI rshift_count)
|
instruct $4$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src, immI lshift_count, immI rshift_count)
|
||||||
%{
|
%{
|
||||||
match(Set dst EXTEND($1, $3, src, lshift_count, rshift_count));
|
match(Set dst EXTEND($1, $3, src, lshift_count, rshift_count));
|
||||||
// Make sure we are not going to exceed what $4 can do.
|
// Make sure we are not going to exceed what $4 can do.
|
||||||
@ -176,7 +178,7 @@ BFM_INSN(I, 31, URShift, ubfmw)
|
|||||||
dnl
|
dnl
|
||||||
// Bitfield extract with shift & mask
|
// Bitfield extract with shift & mask
|
||||||
define(`BFX_INSN',
|
define(`BFX_INSN',
|
||||||
`instruct $3$1(iReg$1NoSp dst, iReg$1 src, immI rshift, imm$1_bitmask mask)
|
`instruct $3$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src, immI rshift, imm$1_bitmask mask)
|
||||||
%{
|
%{
|
||||||
match(Set dst (And$1 ($2$1 src rshift) mask));
|
match(Set dst (And$1 ($2$1 src rshift) mask));
|
||||||
|
|
||||||
@ -215,7 +217,7 @@ instruct ubfxIConvI2L(iRegLNoSp dst, iRegIorL2I src, immI rshift, immI_bitmask m
|
|||||||
// Rotations
|
// Rotations
|
||||||
|
|
||||||
define(`EXTRACT_INSN',
|
define(`EXTRACT_INSN',
|
||||||
`instruct extr$3$1(iReg$1NoSp dst, iReg$1 src1, iReg$1 src2, immI lshift, immI rshift, rFlagsReg cr)
|
`instruct extr$3$1(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI lshift, immI rshift, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst ($3$1 (LShift$1 src1 lshift) (URShift$1 src2 rshift)));
|
match(Set dst ($3$1 (LShift$1 src1 lshift) (URShift$1 src2 rshift)));
|
||||||
predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & $2));
|
predicate(0 == ((n->in(1)->in(2)->get_int() + n->in(2)->in(2)->get_int()) & $2));
|
||||||
@ -299,7 +301,7 @@ ROR_INSN(I, 0, ror)
|
|||||||
// Add/subtract (extended)
|
// Add/subtract (extended)
|
||||||
dnl ADD_SUB_EXTENDED(mode, size, add node, shift node, insn, shift type, wordsize
|
dnl ADD_SUB_EXTENDED(mode, size, add node, shift node, insn, shift type, wordsize
|
||||||
define(`ADD_SUB_CONV', `
|
define(`ADD_SUB_CONV', `
|
||||||
instruct $3Ext$1(iReg$2NoSp dst, iReg$2 src1, iReg$1orL2I src2, rFlagsReg cr)
|
instruct $3Ext$1(iReg$2NoSp dst, iReg$2`'ORL2I($2) src1, iReg$1`'ORL2I($1) src2, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst ($3$2 src1 (ConvI2L src2)));
|
match(Set dst ($3$2 src1 (ConvI2L src2)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -315,7 +317,7 @@ ADD_SUB_CONV(I,L,Add,add,sxtw);
|
|||||||
ADD_SUB_CONV(I,L,Sub,sub,sxtw);
|
ADD_SUB_CONV(I,L,Sub,sub,sxtw);
|
||||||
dnl
|
dnl
|
||||||
define(`ADD_SUB_EXTENDED', `
|
define(`ADD_SUB_EXTENDED', `
|
||||||
instruct $3Ext$1_$6(iReg$1NoSp dst, iReg$1 src1, iReg$1 src2, immI_`'eval($7-$2) lshift, immI_`'eval($7-$2) rshift, rFlagsReg cr)
|
instruct $3Ext$1_$6(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, immI_`'eval($7-$2) lshift, immI_`'eval($7-$2) rshift, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst ($3$1 src1 EXTEND($1, $4, src2, lshift, rshift)));
|
match(Set dst ($3$1 src1 EXTEND($1, $4, src2, lshift, rshift)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
@ -337,7 +339,7 @@ ADD_SUB_EXTENDED(L,8,Add,URShift,add,uxtb,64)
|
|||||||
dnl
|
dnl
|
||||||
dnl ADD_SUB_ZERO_EXTEND(mode, size, add node, insn, shift type)
|
dnl ADD_SUB_ZERO_EXTEND(mode, size, add node, insn, shift type)
|
||||||
define(`ADD_SUB_ZERO_EXTEND', `
|
define(`ADD_SUB_ZERO_EXTEND', `
|
||||||
instruct $3Ext$1_$5_and(iReg$1NoSp dst, iReg$1 src1, iReg$1 src2, imm$1_$2 mask, rFlagsReg cr)
|
instruct $3Ext$1_$5_and(iReg$1NoSp dst, iReg$1`'ORL2I($1) src1, iReg$1`'ORL2I($1) src2, imm$1_$2 mask, rFlagsReg cr)
|
||||||
%{
|
%{
|
||||||
match(Set dst ($3$1 src1 (And$1 src2 mask)));
|
match(Set dst ($3$1 src1 (And$1 src2 mask)));
|
||||||
ins_cost(INSN_COST);
|
ins_cost(INSN_COST);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -673,7 +673,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
|
void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
|
||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
// With G1, don't generate the call if we statically know that the target in uninitialized
|
// With G1, don't generate the call if we statically know that the target in uninitialized
|
||||||
if (!dest_uninitialized) {
|
if (!dest_uninitialized) {
|
||||||
@ -719,7 +718,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
assert_different_registers(start, end, scratch);
|
assert_different_registers(start, end, scratch);
|
||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -150,7 +150,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
|
|||||||
assert(val == noreg || val == r0, "parameter is just for looks");
|
assert(val == noreg || val == r0, "parameter is just for looks");
|
||||||
switch (barrier) {
|
switch (barrier) {
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
// flatten object address if needed
|
// flatten object address if needed
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -49,7 +49,7 @@ define_pd_global(intx, FreqInlineSize, 175);
|
|||||||
define_pd_global(intx, MinJumpTableSize, 10);
|
define_pd_global(intx, MinJumpTableSize, 10);
|
||||||
define_pd_global(intx, INTPRESSURE, 25);
|
define_pd_global(intx, INTPRESSURE, 25);
|
||||||
define_pd_global(intx, InteriorEntryAlignment, 16);
|
define_pd_global(intx, InteriorEntryAlignment, 16);
|
||||||
define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
|
define_pd_global(size_t, NewSizeThreadIncrease, ScaleForWordSize(4*K));
|
||||||
define_pd_global(intx, RegisterCostAreaRatio, 16000);
|
define_pd_global(intx, RegisterCostAreaRatio, 16000);
|
||||||
define_pd_global(bool, UseTLAB, true);
|
define_pd_global(bool, UseTLAB, true);
|
||||||
define_pd_global(bool, ResizeTLAB, true);
|
define_pd_global(bool, ResizeTLAB, true);
|
||||||
@ -85,14 +85,14 @@ define_pd_global(intx, NonNMethodCodeHeapSize, 5*M );
|
|||||||
define_pd_global(intx, CodeCacheExpansionSize, 64*K);
|
define_pd_global(intx, CodeCacheExpansionSize, 64*K);
|
||||||
|
|
||||||
// Ergonomics related flags
|
// Ergonomics related flags
|
||||||
define_pd_global(uint64_t,MaxRAM, 4ULL*G);
|
define_pd_global(uint64_t, MaxRAM, 4ULL*G);
|
||||||
define_pd_global(uintx, CodeCacheMinBlockLength, 4);
|
define_pd_global(uintx, CodeCacheMinBlockLength, 4);
|
||||||
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
||||||
|
|
||||||
define_pd_global(bool, TrapBasedRangeChecks, true);
|
define_pd_global(bool, TrapBasedRangeChecks, true);
|
||||||
|
|
||||||
// Heap related flags
|
// Heap related flags
|
||||||
define_pd_global(uintx,MetaspaceSize, ScaleForWordSize(16*M));
|
define_pd_global(size_t, MetaspaceSize, ScaleForWordSize(16*M));
|
||||||
|
|
||||||
// Ergonomics related flags
|
// Ergonomics related flags
|
||||||
define_pd_global(bool, NeverActAsServerClassMachine, false);
|
define_pd_global(bool, NeverActAsServerClassMachine, false);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2013 SAP AG. All rights reserved.
|
* Copyright 2012, 2013 SAP AG. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -56,7 +56,7 @@ define_pd_global(bool, RewriteFrequentPairs, true);
|
|||||||
define_pd_global(bool, UseMembar, false);
|
define_pd_global(bool, UseMembar, false);
|
||||||
|
|
||||||
// GC Ergo Flags
|
// GC Ergo Flags
|
||||||
define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // Default max size of CMS young gen, per GC worker thread.
|
define_pd_global(size_t, CMSYoungGenPerWorker, 16*M); // Default max size of CMS young gen, per GC worker thread.
|
||||||
|
|
||||||
define_pd_global(uintx, TypeProfileLevel, 0);
|
define_pd_global(uintx, TypeProfileLevel, 0);
|
||||||
|
|
||||||
|
@ -608,7 +608,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1) {
|
void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1) {
|
||||||
BarrierSet* const bs = Universe::heap()->barrier_set();
|
BarrierSet* const bs = Universe::heap()->barrier_set();
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
// With G1, don't generate the call if we statically know that the target in uninitialized
|
// With G1, don't generate the call if we statically know that the target in uninitialized
|
||||||
if (!dest_uninitialized) {
|
if (!dest_uninitialized) {
|
||||||
@ -665,7 +664,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
BarrierSet* const bs = Universe::heap()->barrier_set();
|
BarrierSet* const bs = Universe::heap()->barrier_set();
|
||||||
|
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
if (branchToEnd) {
|
if (branchToEnd) {
|
||||||
|
@ -66,7 +66,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
|
|||||||
|
|
||||||
switch (barrier) {
|
switch (barrier) {
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
// Load and record the previous value.
|
// Load and record the previous value.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -53,10 +53,10 @@ define_pd_global(intx, NonNMethodCodeHeapSize, 5*M );
|
|||||||
define_pd_global(intx, CodeCacheExpansionSize, 32*K );
|
define_pd_global(intx, CodeCacheExpansionSize, 32*K );
|
||||||
define_pd_global(uintx, CodeCacheMinBlockLength, 1);
|
define_pd_global(uintx, CodeCacheMinBlockLength, 1);
|
||||||
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
||||||
define_pd_global(uintx, MetaspaceSize, 12*M );
|
define_pd_global(size_t, MetaspaceSize, 12*M );
|
||||||
define_pd_global(bool, NeverActAsServerClassMachine, true );
|
define_pd_global(bool, NeverActAsServerClassMachine, true );
|
||||||
define_pd_global(intx, NewSizeThreadIncrease, 16*K );
|
define_pd_global(size_t, NewSizeThreadIncrease, 16*K );
|
||||||
define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
define_pd_global(uint64_t, MaxRAM, 1ULL*G);
|
||||||
define_pd_global(intx, InitialCodeCacheSize, 160*K);
|
define_pd_global(intx, InitialCodeCacheSize, 160*K);
|
||||||
#endif // !TIERED
|
#endif // !TIERED
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -51,7 +51,7 @@ define_pd_global(intx, FLOATPRESSURE, 52); // C2 on V9 gets to u
|
|||||||
define_pd_global(intx, FreqInlineSize, 175);
|
define_pd_global(intx, FreqInlineSize, 175);
|
||||||
define_pd_global(intx, INTPRESSURE, 48); // large register set
|
define_pd_global(intx, INTPRESSURE, 48); // large register set
|
||||||
define_pd_global(intx, InteriorEntryAlignment, 16); // = CodeEntryAlignment
|
define_pd_global(intx, InteriorEntryAlignment, 16); // = CodeEntryAlignment
|
||||||
define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
|
define_pd_global(size_t, NewSizeThreadIncrease, ScaleForWordSize(4*K));
|
||||||
define_pd_global(intx, RegisterCostAreaRatio, 12000);
|
define_pd_global(intx, RegisterCostAreaRatio, 12000);
|
||||||
define_pd_global(bool, UseTLAB, true);
|
define_pd_global(bool, UseTLAB, true);
|
||||||
define_pd_global(bool, ResizeTLAB, true);
|
define_pd_global(bool, ResizeTLAB, true);
|
||||||
@ -90,7 +90,7 @@ define_pd_global(intx, ProfiledCodeHeapSize, 14*M);
|
|||||||
define_pd_global(intx, NonNMethodCodeHeapSize, 5*M );
|
define_pd_global(intx, NonNMethodCodeHeapSize, 5*M );
|
||||||
define_pd_global(intx, CodeCacheExpansionSize, 32*K);
|
define_pd_global(intx, CodeCacheExpansionSize, 32*K);
|
||||||
// Ergonomics related flags
|
// Ergonomics related flags
|
||||||
define_pd_global(uint64_t,MaxRAM, 4ULL*G);
|
define_pd_global(uint64_t, MaxRAM, 4ULL*G);
|
||||||
#endif
|
#endif
|
||||||
define_pd_global(uintx, CodeCacheMinBlockLength, 4);
|
define_pd_global(uintx, CodeCacheMinBlockLength, 4);
|
||||||
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
||||||
@ -98,7 +98,7 @@ define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
|||||||
define_pd_global(bool, TrapBasedRangeChecks, false); // Not needed on sparc.
|
define_pd_global(bool, TrapBasedRangeChecks, false); // Not needed on sparc.
|
||||||
|
|
||||||
// Heap related flags
|
// Heap related flags
|
||||||
define_pd_global(uintx,MetaspaceSize, ScaleForWordSize(16*M));
|
define_pd_global(size_t, MetaspaceSize, ScaleForWordSize(16*M));
|
||||||
|
|
||||||
// Ergonomics related flags
|
// Ergonomics related flags
|
||||||
define_pd_global(bool, NeverActAsServerClassMachine, false);
|
define_pd_global(bool, NeverActAsServerClassMachine, false);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -75,7 +75,7 @@ define_pd_global(bool, RewriteFrequentPairs, true);
|
|||||||
define_pd_global(bool, UseMembar, false);
|
define_pd_global(bool, UseMembar, false);
|
||||||
|
|
||||||
// GC Ergo Flags
|
// GC Ergo Flags
|
||||||
define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
|
define_pd_global(size_t, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
|
||||||
|
|
||||||
define_pd_global(uintx, TypeProfileLevel, 0);
|
define_pd_global(uintx, TypeProfileLevel, 0);
|
||||||
|
|
||||||
|
@ -957,7 +957,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
|
void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
|
||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
// With G1, don't generate the call if we statically know that the target in uninitialized
|
// With G1, don't generate the call if we statically know that the target in uninitialized
|
||||||
if (!dest_uninitialized) {
|
if (!dest_uninitialized) {
|
||||||
@ -1005,7 +1004,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
|
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
// Get some new fresh output registers.
|
// Get some new fresh output registers.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -56,7 +56,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
|
|||||||
assert(index == noreg || offset == 0, "only one offset");
|
assert(index == noreg || offset == 0, "only one offset");
|
||||||
switch (barrier) {
|
switch (barrier) {
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
// Load and record the previous value.
|
// Load and record the previous value.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -32,39 +32,39 @@
|
|||||||
// (see c1_globals.hpp)
|
// (see c1_globals.hpp)
|
||||||
|
|
||||||
#ifndef TIERED
|
#ifndef TIERED
|
||||||
define_pd_global(bool, BackgroundCompilation, true );
|
define_pd_global(bool, BackgroundCompilation, true );
|
||||||
define_pd_global(bool, UseTLAB, true );
|
define_pd_global(bool, UseTLAB, true );
|
||||||
define_pd_global(bool, ResizeTLAB, true );
|
define_pd_global(bool, ResizeTLAB, true );
|
||||||
define_pd_global(bool, InlineIntrinsics, true );
|
define_pd_global(bool, InlineIntrinsics, true );
|
||||||
define_pd_global(bool, PreferInterpreterNativeStubs, false);
|
define_pd_global(bool, PreferInterpreterNativeStubs, false);
|
||||||
define_pd_global(bool, ProfileTraps, false);
|
define_pd_global(bool, ProfileTraps, false);
|
||||||
define_pd_global(bool, UseOnStackReplacement, true );
|
define_pd_global(bool, UseOnStackReplacement, true );
|
||||||
define_pd_global(bool, TieredCompilation, false);
|
define_pd_global(bool, TieredCompilation, false);
|
||||||
define_pd_global(intx, CompileThreshold, 1500 );
|
define_pd_global(intx, CompileThreshold, 1500 );
|
||||||
|
|
||||||
define_pd_global(intx, OnStackReplacePercentage, 933 );
|
define_pd_global(intx, OnStackReplacePercentage, 933 );
|
||||||
define_pd_global(intx, FreqInlineSize, 325 );
|
define_pd_global(intx, FreqInlineSize, 325 );
|
||||||
define_pd_global(intx, NewSizeThreadIncrease, 4*K );
|
define_pd_global(size_t, NewSizeThreadIncrease, 4*K );
|
||||||
define_pd_global(intx, InitialCodeCacheSize, 160*K);
|
define_pd_global(intx, InitialCodeCacheSize, 160*K);
|
||||||
define_pd_global(intx, ReservedCodeCacheSize, 32*M );
|
define_pd_global(intx, ReservedCodeCacheSize, 32*M );
|
||||||
define_pd_global(intx, NonProfiledCodeHeapSize, 13*M );
|
define_pd_global(intx, NonProfiledCodeHeapSize, 13*M );
|
||||||
define_pd_global(intx, ProfiledCodeHeapSize, 14*M );
|
define_pd_global(intx, ProfiledCodeHeapSize, 14*M );
|
||||||
define_pd_global(intx, NonNMethodCodeHeapSize, 5*M );
|
define_pd_global(intx, NonNMethodCodeHeapSize, 5*M );
|
||||||
define_pd_global(bool, ProfileInterpreter, false);
|
define_pd_global(bool, ProfileInterpreter, false);
|
||||||
define_pd_global(intx, CodeCacheExpansionSize, 32*K );
|
define_pd_global(intx, CodeCacheExpansionSize, 32*K );
|
||||||
define_pd_global(uintx, CodeCacheMinBlockLength, 1);
|
define_pd_global(uintx, CodeCacheMinBlockLength, 1 );
|
||||||
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
||||||
define_pd_global(uintx, MetaspaceSize, 12*M );
|
define_pd_global(size_t, MetaspaceSize, 12*M );
|
||||||
define_pd_global(bool, NeverActAsServerClassMachine, true );
|
define_pd_global(bool, NeverActAsServerClassMachine, true );
|
||||||
define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
define_pd_global(uint64_t, MaxRAM, 1ULL*G);
|
||||||
define_pd_global(bool, CICompileOSR, true );
|
define_pd_global(bool, CICompileOSR, true );
|
||||||
#endif // !TIERED
|
#endif // !TIERED
|
||||||
define_pd_global(bool, UseTypeProfile, false);
|
define_pd_global(bool, UseTypeProfile, false);
|
||||||
define_pd_global(bool, RoundFPResults, true );
|
define_pd_global(bool, RoundFPResults, true );
|
||||||
|
|
||||||
define_pd_global(bool, LIRFillDelaySlots, false);
|
define_pd_global(bool, LIRFillDelaySlots, false);
|
||||||
define_pd_global(bool, OptimizeSinglePrecision, true );
|
define_pd_global(bool, OptimizeSinglePrecision, true );
|
||||||
define_pd_global(bool, CSEArrayLength, false);
|
define_pd_global(bool, CSEArrayLength, false);
|
||||||
define_pd_global(bool, TwoOperandLIRForm, true );
|
define_pd_global(bool, TwoOperandLIRForm, true );
|
||||||
|
|
||||||
#endif // CPU_X86_VM_C1_GLOBALS_X86_HPP
|
#endif // CPU_X86_VM_C1_GLOBALS_X86_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -54,25 +54,25 @@ define_pd_global(intx, MinJumpTableSize, 10);
|
|||||||
#ifdef AMD64
|
#ifdef AMD64
|
||||||
define_pd_global(intx, INTPRESSURE, 13);
|
define_pd_global(intx, INTPRESSURE, 13);
|
||||||
define_pd_global(intx, InteriorEntryAlignment, 16);
|
define_pd_global(intx, InteriorEntryAlignment, 16);
|
||||||
define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
|
define_pd_global(size_t, NewSizeThreadIncrease, ScaleForWordSize(4*K));
|
||||||
define_pd_global(intx, LoopUnrollLimit, 60);
|
define_pd_global(intx, LoopUnrollLimit, 60);
|
||||||
// InitialCodeCacheSize derived from specjbb2000 run.
|
// InitialCodeCacheSize derived from specjbb2000 run.
|
||||||
define_pd_global(intx, InitialCodeCacheSize, 2496*K); // Integral multiple of CodeCacheExpansionSize
|
define_pd_global(intx, InitialCodeCacheSize, 2496*K); // Integral multiple of CodeCacheExpansionSize
|
||||||
define_pd_global(intx, CodeCacheExpansionSize, 64*K);
|
define_pd_global(intx, CodeCacheExpansionSize, 64*K);
|
||||||
|
|
||||||
// Ergonomics related flags
|
// Ergonomics related flags
|
||||||
define_pd_global(uint64_t,MaxRAM, 128ULL*G);
|
define_pd_global(uint64_t, MaxRAM, 128ULL*G);
|
||||||
#else
|
#else
|
||||||
define_pd_global(intx, INTPRESSURE, 6);
|
define_pd_global(intx, INTPRESSURE, 6);
|
||||||
define_pd_global(intx, InteriorEntryAlignment, 4);
|
define_pd_global(intx, InteriorEntryAlignment, 4);
|
||||||
define_pd_global(intx, NewSizeThreadIncrease, 4*K);
|
define_pd_global(size_t, NewSizeThreadIncrease, 4*K);
|
||||||
define_pd_global(intx, LoopUnrollLimit, 50); // Design center runs on 1.3.1
|
define_pd_global(intx, LoopUnrollLimit, 50); // Design center runs on 1.3.1
|
||||||
// InitialCodeCacheSize derived from specjbb2000 run.
|
// InitialCodeCacheSize derived from specjbb2000 run.
|
||||||
define_pd_global(intx, InitialCodeCacheSize, 2304*K); // Integral multiple of CodeCacheExpansionSize
|
define_pd_global(intx, InitialCodeCacheSize, 2304*K); // Integral multiple of CodeCacheExpansionSize
|
||||||
define_pd_global(intx, CodeCacheExpansionSize, 32*K);
|
define_pd_global(intx, CodeCacheExpansionSize, 32*K);
|
||||||
|
|
||||||
// Ergonomics related flags
|
// Ergonomics related flags
|
||||||
define_pd_global(uint64_t,MaxRAM, 4ULL*G);
|
define_pd_global(uint64_t, MaxRAM, 4ULL*G);
|
||||||
#endif // AMD64
|
#endif // AMD64
|
||||||
define_pd_global(intx, RegisterCostAreaRatio, 16000);
|
define_pd_global(intx, RegisterCostAreaRatio, 16000);
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K);
|
|||||||
define_pd_global(bool, TrapBasedRangeChecks, false); // Not needed on x86.
|
define_pd_global(bool, TrapBasedRangeChecks, false); // Not needed on x86.
|
||||||
|
|
||||||
// Heap related flags
|
// Heap related flags
|
||||||
define_pd_global(uintx,MetaspaceSize, ScaleForWordSize(16*M));
|
define_pd_global(size_t, MetaspaceSize, ScaleForWordSize(16*M));
|
||||||
|
|
||||||
// Ergonomics related flags
|
// Ergonomics related flags
|
||||||
define_pd_global(bool, NeverActAsServerClassMachine, false);
|
define_pd_global(bool, NeverActAsServerClassMachine, false);
|
||||||
|
@ -78,7 +78,7 @@ define_pd_global(bool, UseMembar, false);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GC Ergo Flags
|
// GC Ergo Flags
|
||||||
define_pd_global(uintx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread
|
define_pd_global(size_t, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread
|
||||||
|
|
||||||
define_pd_global(uintx, TypeProfileLevel, 111);
|
define_pd_global(uintx, TypeProfileLevel, 111);
|
||||||
|
|
||||||
|
@ -706,7 +706,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
assert_different_registers(start, count);
|
assert_different_registers(start, count);
|
||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
// With G1, don't generate the call if we statically know that the target in uninitialized
|
// With G1, don't generate the call if we statically know that the target in uninitialized
|
||||||
if (!uninitialized_target) {
|
if (!uninitialized_target) {
|
||||||
@ -739,7 +738,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
assert_different_registers(start, count);
|
assert_different_registers(start, count);
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
__ pusha(); // push registers
|
__ pusha(); // push registers
|
||||||
|
@ -1207,7 +1207,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
|
void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
|
||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
// With G1, don't generate the call if we statically know that the target in uninitialized
|
// With G1, don't generate the call if we statically know that the target in uninitialized
|
||||||
if (!dest_uninitialized) {
|
if (!dest_uninitialized) {
|
||||||
@ -1252,7 +1251,6 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
assert_different_registers(start, count, scratch);
|
assert_different_registers(start, count, scratch);
|
||||||
BarrierSet* bs = Universe::heap()->barrier_set();
|
BarrierSet* bs = Universe::heap()->barrier_set();
|
||||||
switch (bs->kind()) {
|
switch (bs->kind()) {
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
__ pusha(); // push registers (overkill)
|
__ pusha(); // push registers (overkill)
|
||||||
|
@ -156,7 +156,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
|
|||||||
assert(val == noreg || val == rax, "parameter is just for looks");
|
assert(val == noreg || val == rax, "parameter is just for looks");
|
||||||
switch (barrier) {
|
switch (barrier) {
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
// flatten object address if needed
|
// flatten object address if needed
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -57,7 +57,7 @@ define_pd_global(bool, RewriteFrequentPairs, true);
|
|||||||
define_pd_global(bool, UseMembar, true);
|
define_pd_global(bool, UseMembar, true);
|
||||||
|
|
||||||
// GC Ergo Flags
|
// GC Ergo Flags
|
||||||
define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
|
define_pd_global(size_t, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
|
||||||
|
|
||||||
define_pd_global(uintx, TypeProfileLevel, 0);
|
define_pd_global(uintx, TypeProfileLevel, 0);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2008, 2009, 2010 Red Hat, Inc.
|
* Copyright 2008, 2009, 2010 Red Hat, Inc.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -50,7 +50,7 @@ define_pd_global(intx, Tier4BackEdgeThreshold, 100000);
|
|||||||
define_pd_global(intx, OnStackReplacePercentage, 933 );
|
define_pd_global(intx, OnStackReplacePercentage, 933 );
|
||||||
define_pd_global(intx, FreqInlineSize, 325 );
|
define_pd_global(intx, FreqInlineSize, 325 );
|
||||||
define_pd_global(uintx, NewRatio, 12 );
|
define_pd_global(uintx, NewRatio, 12 );
|
||||||
define_pd_global(intx, NewSizeThreadIncrease, 4*K );
|
define_pd_global(size_t, NewSizeThreadIncrease, 4*K );
|
||||||
define_pd_global(intx, InitialCodeCacheSize, 160*K);
|
define_pd_global(intx, InitialCodeCacheSize, 160*K);
|
||||||
define_pd_global(intx, ReservedCodeCacheSize, 32*M );
|
define_pd_global(intx, ReservedCodeCacheSize, 32*M );
|
||||||
define_pd_global(intx, NonProfiledCodeHeapSize, 13*M );
|
define_pd_global(intx, NonProfiledCodeHeapSize, 13*M );
|
||||||
@ -61,7 +61,7 @@ define_pd_global(intx, CodeCacheExpansionSize, 32*K );
|
|||||||
define_pd_global(uintx, CodeCacheMinBlockLength, 1 );
|
define_pd_global(uintx, CodeCacheMinBlockLength, 1 );
|
||||||
define_pd_global(uintx, CodeCacheMinimumUseSpace, 200*K);
|
define_pd_global(uintx, CodeCacheMinimumUseSpace, 200*K);
|
||||||
|
|
||||||
define_pd_global(uintx, MetaspaceSize, 12*M );
|
define_pd_global(size_t, MetaspaceSize, 12*M );
|
||||||
define_pd_global(bool, NeverActAsServerClassMachine, true );
|
define_pd_global(bool, NeverActAsServerClassMachine, true );
|
||||||
define_pd_global(uint64_t, MaxRAM, 1ULL*G);
|
define_pd_global(uint64_t, MaxRAM, 1ULL*G);
|
||||||
define_pd_global(bool, CICompileOSR, true );
|
define_pd_global(bool, CICompileOSR, true );
|
||||||
|
@ -40,13 +40,13 @@ define_pd_global(intx, VMThreadStackSize, 2048);
|
|||||||
define_pd_global(intx, CompilerThreadStackSize, 4096);
|
define_pd_global(intx, CompilerThreadStackSize, 4096);
|
||||||
|
|
||||||
// Allow extra space in DEBUG builds for asserts.
|
// Allow extra space in DEBUG builds for asserts.
|
||||||
define_pd_global(uintx,JVMInvokeMethodSlack, 8192);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||||
|
|
||||||
define_pd_global(intx, StackYellowPages, 6);
|
define_pd_global(intx, StackYellowPages, 6);
|
||||||
define_pd_global(intx, StackRedPages, 1);
|
define_pd_global(intx, StackRedPages, 1);
|
||||||
define_pd_global(intx, StackShadowPages, 6 DEBUG_ONLY(+2));
|
define_pd_global(intx, StackShadowPages, 6 DEBUG_ONLY(+2));
|
||||||
|
|
||||||
// Only used on 64 bit platforms
|
// Only used on 64 bit platforms
|
||||||
define_pd_global(uintx,HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
|
|
||||||
#endif // OS_CPU_AIX_OJDKPPC_VM_GLOBALS_AIX_PPC_HPP
|
#endif // OS_CPU_AIX_OJDKPPC_VM_GLOBALS_AIX_PPC_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -43,9 +43,9 @@ define_pd_global(intx, VMThreadStackSize, 512);
|
|||||||
|
|
||||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||||
|
|
||||||
define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||||
|
|
||||||
// Used on 64 bit platforms for UseCompressedOops base address
|
// Used on 64 bit platforms for UseCompressedOops base address
|
||||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
|
|
||||||
#endif // OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP
|
#endif // OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2007, 2008, 2010 Red Hat, Inc.
|
* Copyright 2007, 2008, 2010 Red Hat, Inc.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -39,9 +39,9 @@ define_pd_global(intx, VMThreadStackSize, 1024);
|
|||||||
define_pd_global(intx, VMThreadStackSize, 512);
|
define_pd_global(intx, VMThreadStackSize, 512);
|
||||||
#endif // _LP64
|
#endif // _LP64
|
||||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||||
define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||||
|
|
||||||
// Used on 64 bit platforms for UseCompressedOops base address
|
// Used on 64 bit platforms for UseCompressedOops base address
|
||||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
|
|
||||||
#endif // OS_CPU_BSD_ZERO_VM_GLOBALS_BSD_ZERO_HPP
|
#endif // OS_CPU_BSD_ZERO_VM_GLOBALS_BSD_ZERO_HPP
|
||||||
|
@ -116,6 +116,14 @@ address os::Linux::ucontext_get_pc(ucontext_t * uc) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void os::Linux::ucontext_set_pc(ucontext_t * uc, address pc) {
|
||||||
|
#ifdef BUILTIN_SIM
|
||||||
|
uc->uc_mcontext.gregs[REG_PC] = (intptr_t)pc;
|
||||||
|
#else
|
||||||
|
uc->uc_mcontext.pc = (intptr_t)pc;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
intptr_t* os::Linux::ucontext_get_sp(ucontext_t * uc) {
|
intptr_t* os::Linux::ucontext_get_sp(ucontext_t * uc) {
|
||||||
#ifdef BUILTIN_SIM
|
#ifdef BUILTIN_SIM
|
||||||
return (intptr_t*)uc->uc_mcontext.gregs[REG_SP];
|
return (intptr_t*)uc->uc_mcontext.gregs[REG_SP];
|
||||||
@ -311,7 +319,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (StubRoutines::is_safefetch_fault(pc)) {
|
if (StubRoutines::is_safefetch_fault(pc)) {
|
||||||
uc->uc_mcontext.pc = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
|
os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -432,11 +440,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
// save all thread context in case we need to restore it
|
// save all thread context in case we need to restore it
|
||||||
if (thread != NULL) thread->set_saved_exception_pc(pc);
|
if (thread != NULL) thread->set_saved_exception_pc(pc);
|
||||||
|
|
||||||
#ifdef BUILTIN_SIM
|
os::Linux::ucontext_set_pc(uc, stub);
|
||||||
uc->uc_mcontext.gregs[REG_PC] = (greg_t)stub;
|
|
||||||
#else
|
|
||||||
uc->uc_mcontext.pc = (__u64)stub;
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,13 +40,13 @@ define_pd_global(intx, VMThreadStackSize, 2048);
|
|||||||
define_pd_global(intx, CompilerThreadStackSize, 4096);
|
define_pd_global(intx, CompilerThreadStackSize, 4096);
|
||||||
|
|
||||||
// Allow extra space in DEBUG builds for asserts.
|
// Allow extra space in DEBUG builds for asserts.
|
||||||
define_pd_global(uintx,JVMInvokeMethodSlack, 8192);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||||
|
|
||||||
define_pd_global(intx, StackYellowPages, 6);
|
define_pd_global(intx, StackYellowPages, 6);
|
||||||
define_pd_global(intx, StackRedPages, 1);
|
define_pd_global(intx, StackRedPages, 1);
|
||||||
define_pd_global(intx, StackShadowPages, 6 DEBUG_ONLY(+2));
|
define_pd_global(intx, StackShadowPages, 6 DEBUG_ONLY(+2));
|
||||||
|
|
||||||
// Only used on 64 bit platforms
|
// Only used on 64 bit platforms
|
||||||
define_pd_global(uintx,HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
|
|
||||||
#endif // OS_CPU_LINUX_PPC_VM_GLOBALS_LINUX_PPC_HPP
|
#endif // OS_CPU_LINUX_PPC_VM_GLOBALS_LINUX_PPC_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -30,10 +30,10 @@
|
|||||||
// runtime system. (see globals.hpp)
|
// runtime system. (see globals.hpp)
|
||||||
//
|
//
|
||||||
|
|
||||||
define_pd_global(uintx, JVMInvokeMethodSlack, 12288);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 12288);
|
||||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||||
|
|
||||||
// Used on 64 bit platforms for UseCompressedOops base address
|
// Used on 64 bit platforms for UseCompressedOops base address
|
||||||
define_pd_global(uintx, HeapBaseMinAddress, CONST64(4)*G);
|
define_pd_global(size_t, HeapBaseMinAddress, CONST64(4)*G);
|
||||||
|
|
||||||
#endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
|
#endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -42,9 +42,9 @@ define_pd_global(intx, VMThreadStackSize, 512);
|
|||||||
|
|
||||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||||
|
|
||||||
define_pd_global(uintx,JVMInvokeMethodSlack, 8192);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||||
|
|
||||||
// Used on 64 bit platforms for UseCompressedOops base address
|
// Used on 64 bit platforms for UseCompressedOops base address
|
||||||
define_pd_global(uintx,HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
|
|
||||||
#endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
|
#endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2007, 2008, 2010 Red Hat, Inc.
|
* Copyright 2007, 2008, 2010 Red Hat, Inc.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
@ -39,9 +39,9 @@ define_pd_global(intx, VMThreadStackSize, 1024);
|
|||||||
define_pd_global(intx, VMThreadStackSize, 512);
|
define_pd_global(intx, VMThreadStackSize, 512);
|
||||||
#endif // _LP64
|
#endif // _LP64
|
||||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||||
define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||||
|
|
||||||
// Used on 64 bit platforms for UseCompressedOops base address
|
// Used on 64 bit platforms for UseCompressedOops base address
|
||||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
|
|
||||||
#endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
|
#endif // OS_CPU_LINUX_ZERO_VM_GLOBALS_LINUX_ZERO_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -30,16 +30,16 @@
|
|||||||
// (see globals.hpp)
|
// (see globals.hpp)
|
||||||
//
|
//
|
||||||
|
|
||||||
define_pd_global(uintx, JVMInvokeMethodSlack, 12288);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 12288);
|
||||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||||
|
|
||||||
// Used on 64 bit platforms for UseCompressedOops base address
|
// Used on 64 bit platforms for UseCompressedOops base address
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
// use 6G as default base address because by default the OS maps the application
|
// use 6G as default base address because by default the OS maps the application
|
||||||
// to 4G on Solaris-Sparc. This leaves at least 2G for the native heap.
|
// to 4G on Solaris-Sparc. This leaves at least 2G for the native heap.
|
||||||
define_pd_global(uintx, HeapBaseMinAddress, CONST64(6)*G);
|
define_pd_global(size_t, HeapBaseMinAddress, CONST64(6)*G);
|
||||||
#else
|
#else
|
||||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -32,18 +32,18 @@ define_pd_global(bool, DontYieldALot, true); // Determined in the des
|
|||||||
#ifdef AMD64
|
#ifdef AMD64
|
||||||
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default
|
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default
|
||||||
define_pd_global(intx, VMThreadStackSize, 1024);
|
define_pd_global(intx, VMThreadStackSize, 1024);
|
||||||
define_pd_global(uintx,JVMInvokeMethodSlack, 8*K);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 8*K);
|
||||||
#else
|
#else
|
||||||
// ThreadStackSize 320 allows a couple of test cases to run while
|
// ThreadStackSize 320 allows a couple of test cases to run while
|
||||||
// keeping the number of threads that can be created high.
|
// keeping the number of threads that can be created high.
|
||||||
define_pd_global(intx, ThreadStackSize, 320);
|
define_pd_global(intx, ThreadStackSize, 320);
|
||||||
define_pd_global(intx, VMThreadStackSize, 512);
|
define_pd_global(intx, VMThreadStackSize, 512);
|
||||||
define_pd_global(uintx,JVMInvokeMethodSlack, 10*K);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 10*K);
|
||||||
#endif // AMD64
|
#endif // AMD64
|
||||||
|
|
||||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||||
|
|
||||||
// Used on 64 bit platforms for UseCompressedOops base address
|
// Used on 64 bit platforms for UseCompressedOops base address
|
||||||
define_pd_global(uintx,HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
|
|
||||||
#endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
|
#endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -43,9 +43,9 @@ define_pd_global(intx, CompilerThreadStackSize, 1024);
|
|||||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
define_pd_global(uintx, JVMInvokeMethodSlack, 8192);
|
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||||
|
|
||||||
// Used on 64 bit platforms for UseCompressedOops base address
|
// Used on 64 bit platforms for UseCompressedOops base address
|
||||||
define_pd_global(uintx, HeapBaseMinAddress, 2*G);
|
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||||
|
|
||||||
#endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
|
#endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
|
||||||
|
@ -1421,7 +1421,6 @@ void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
|
|||||||
// Do the pre-write barrier, if any.
|
// Do the pre-write barrier, if any.
|
||||||
switch (_bs->kind()) {
|
switch (_bs->kind()) {
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info);
|
G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info);
|
||||||
break;
|
break;
|
||||||
@ -1442,7 +1441,6 @@ void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
|
|||||||
void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
|
void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
|
||||||
switch (_bs->kind()) {
|
switch (_bs->kind()) {
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
case BarrierSet::G1SATBCT:
|
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
G1SATBCardTableModRef_post_barrier(addr, new_val);
|
G1SATBCardTableModRef_post_barrier(addr, new_val);
|
||||||
break;
|
break;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -186,7 +186,7 @@ HeapWord* CompactibleFreeListSpace::forward(oop q, size_t size,
|
|||||||
cp->space->set_compaction_top(compact_top);
|
cp->space->set_compaction_top(compact_top);
|
||||||
cp->space = cp->space->next_compaction_space();
|
cp->space = cp->space->next_compaction_space();
|
||||||
if (cp->space == NULL) {
|
if (cp->space == NULL) {
|
||||||
cp->gen = GenCollectedHeap::heap()->prev_gen(cp->gen);
|
cp->gen = GenCollectedHeap::heap()->young_gen();
|
||||||
assert(cp->gen != NULL, "compaction must succeed");
|
assert(cp->gen != NULL, "compaction must succeed");
|
||||||
cp->space = cp->gen->first_compaction_space();
|
cp->space = cp->gen->first_compaction_space();
|
||||||
assert(cp->space != NULL, "generation must have a first compaction space");
|
assert(cp->space != NULL, "generation must have a first compaction space");
|
||||||
@ -900,7 +900,6 @@ void CompactibleFreeListSpace::object_iterate_mem(MemRegion mr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Callers of this iterator beware: The closure application should
|
// Callers of this iterator beware: The closure application should
|
||||||
// be robust in the face of uninitialized objects and should (always)
|
// be robust in the face of uninitialized objects and should (always)
|
||||||
// return a correct size so that the next addr + size below gives us a
|
// return a correct size so that the next addr + size below gives us a
|
||||||
@ -2663,8 +2662,8 @@ void CFLS_LAB::compute_desired_plab_size() {
|
|||||||
// Need to smooth wrt historical average
|
// Need to smooth wrt historical average
|
||||||
if (ResizeOldPLAB) {
|
if (ResizeOldPLAB) {
|
||||||
_blocks_to_claim[i].sample(
|
_blocks_to_claim[i].sample(
|
||||||
MAX2((size_t)CMSOldPLABMin,
|
MAX2(CMSOldPLABMin,
|
||||||
MIN2((size_t)CMSOldPLABMax,
|
MIN2(CMSOldPLABMax,
|
||||||
_global_num_blocks[i]/(_global_num_workers[i]*CMSOldPLABNumRefills))));
|
_global_num_blocks[i]/(_global_num_workers[i]*CMSOldPLABNumRefills))));
|
||||||
}
|
}
|
||||||
// Reset counters for next round
|
// Reset counters for next round
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -36,7 +36,9 @@
|
|||||||
// space, in this case a CompactibleFreeListSpace.
|
// space, in this case a CompactibleFreeListSpace.
|
||||||
|
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
|
class CMSCollector;
|
||||||
class CompactibleFreeListSpace;
|
class CompactibleFreeListSpace;
|
||||||
|
class ConcurrentMarkSweepGeneration;
|
||||||
class BlkClosure;
|
class BlkClosure;
|
||||||
class BlkClosureCareful;
|
class BlkClosureCareful;
|
||||||
class FreeChunk;
|
class FreeChunk;
|
||||||
@ -396,6 +398,10 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
|||||||
// Resizing support
|
// Resizing support
|
||||||
void set_end(HeapWord* value); // override
|
void set_end(HeapWord* value); // override
|
||||||
|
|
||||||
|
// Never mangle CompactibleFreeListSpace
|
||||||
|
void mangle_unused_area() {}
|
||||||
|
void mangle_unused_area_complete() {}
|
||||||
|
|
||||||
// Mutual exclusion support
|
// Mutual exclusion support
|
||||||
Mutex* freelistLock() const { return &_freelistLock; }
|
Mutex* freelistLock() const { return &_freelistLock; }
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ void CMSStats::adjust_cms_free_adjustment_factor(bool fail, size_t free) {
|
|||||||
double CMSStats::time_until_cms_gen_full() const {
|
double CMSStats::time_until_cms_gen_full() const {
|
||||||
size_t cms_free = _cms_gen->cmsSpace()->free();
|
size_t cms_free = _cms_gen->cmsSpace()->free();
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
size_t expected_promotion = MIN2(gch->get_gen(0)->capacity(),
|
size_t expected_promotion = MIN2(gch->young_gen()->capacity(),
|
||||||
(size_t) _cms_gen->gc_stats()->avg_promoted()->padded_average());
|
(size_t) _cms_gen->gc_stats()->avg_promoted()->padded_average());
|
||||||
if (cms_free > expected_promotion) {
|
if (cms_free > expected_promotion) {
|
||||||
// Start a cms collection if there isn't enough space to promote
|
// Start a cms collection if there isn't enough space to promote
|
||||||
@ -506,7 +506,7 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
|||||||
_collector_policy(cp),
|
_collector_policy(cp),
|
||||||
_should_unload_classes(CMSClassUnloadingEnabled),
|
_should_unload_classes(CMSClassUnloadingEnabled),
|
||||||
_concurrent_cycles_since_last_unload(0),
|
_concurrent_cycles_since_last_unload(0),
|
||||||
_roots_scanning_options(SharedHeap::SO_None),
|
_roots_scanning_options(GenCollectedHeap::SO_None),
|
||||||
_inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
|
_inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
|
||||||
_intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
|
_intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
|
||||||
_gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
|
_gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
|
||||||
@ -626,8 +626,8 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
|||||||
|
|
||||||
// Support for parallelizing young gen rescan
|
// Support for parallelizing young gen rescan
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
assert(gch->prev_gen(_cmsGen)->kind() == Generation::ParNew, "CMS can only be used with ParNew");
|
assert(gch->young_gen()->kind() == Generation::ParNew, "CMS can only be used with ParNew");
|
||||||
_young_gen = (ParNewGeneration*)gch->prev_gen(_cmsGen);
|
_young_gen = (ParNewGeneration*)gch->young_gen();
|
||||||
if (gch->supports_inline_contig_alloc()) {
|
if (gch->supports_inline_contig_alloc()) {
|
||||||
_top_addr = gch->top_addr();
|
_top_addr = gch->top_addr();
|
||||||
_end_addr = gch->end_addr();
|
_end_addr = gch->end_addr();
|
||||||
@ -869,7 +869,7 @@ void ConcurrentMarkSweepGeneration::compute_new_size_free_list() {
|
|||||||
if (prev_level >= 0) {
|
if (prev_level >= 0) {
|
||||||
size_t prev_size = 0;
|
size_t prev_size = 0;
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
Generation* prev_gen = gch->get_gen(prev_level);
|
Generation* prev_gen = gch->young_gen();
|
||||||
prev_size = prev_gen->capacity();
|
prev_size = prev_gen->capacity();
|
||||||
gclog_or_tty->print_cr(" Younger gen size "SIZE_FORMAT,
|
gclog_or_tty->print_cr(" Younger gen size "SIZE_FORMAT,
|
||||||
prev_size/1000);
|
prev_size/1000);
|
||||||
@ -1049,11 +1049,8 @@ oop ConcurrentMarkSweepGeneration::promote(oop obj, size_t obj_size) {
|
|||||||
// expand and retry
|
// expand and retry
|
||||||
size_t s = _cmsSpace->expansionSpaceRequired(obj_size); // HeapWords
|
size_t s = _cmsSpace->expansionSpaceRequired(obj_size); // HeapWords
|
||||||
expand_for_gc_cause(s*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_promotion);
|
expand_for_gc_cause(s*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_promotion);
|
||||||
// Since there's currently no next generation, we don't try to promote
|
// Since this is the old generation, we don't try to promote
|
||||||
// into a more senior generation.
|
// into a more senior generation.
|
||||||
assert(next_gen() == NULL, "assumption, based upon which no attempt "
|
|
||||||
"is made to pass on a possibly failing "
|
|
||||||
"promotion to next generation");
|
|
||||||
res = _cmsSpace->promote(obj, obj_size);
|
res = _cmsSpace->promote(obj, obj_size);
|
||||||
}
|
}
|
||||||
if (res != NULL) {
|
if (res != NULL) {
|
||||||
@ -2499,7 +2496,7 @@ void CMSCollector::verify_after_remark_work_1() {
|
|||||||
gch->gen_process_roots(_cmsGen->level(),
|
gch->gen_process_roots(_cmsGen->level(),
|
||||||
true, // younger gens are roots
|
true, // younger gens are roots
|
||||||
true, // activate StrongRootsScope
|
true, // activate StrongRootsScope
|
||||||
SharedHeap::ScanningOption(roots_scanning_options()),
|
GenCollectedHeap::ScanningOption(roots_scanning_options()),
|
||||||
should_unload_classes(),
|
should_unload_classes(),
|
||||||
¬Older,
|
¬Older,
|
||||||
NULL,
|
NULL,
|
||||||
@ -2567,7 +2564,7 @@ void CMSCollector::verify_after_remark_work_2() {
|
|||||||
gch->gen_process_roots(_cmsGen->level(),
|
gch->gen_process_roots(_cmsGen->level(),
|
||||||
true, // younger gens are roots
|
true, // younger gens are roots
|
||||||
true, // activate StrongRootsScope
|
true, // activate StrongRootsScope
|
||||||
SharedHeap::ScanningOption(roots_scanning_options()),
|
GenCollectedHeap::ScanningOption(roots_scanning_options()),
|
||||||
should_unload_classes(),
|
should_unload_classes(),
|
||||||
¬Older,
|
¬Older,
|
||||||
NULL,
|
NULL,
|
||||||
@ -2751,7 +2748,7 @@ bool ConcurrentMarkSweepGeneration::is_too_full() const {
|
|||||||
void CMSCollector::setup_cms_unloading_and_verification_state() {
|
void CMSCollector::setup_cms_unloading_and_verification_state() {
|
||||||
const bool should_verify = VerifyBeforeGC || VerifyAfterGC || VerifyDuringGC
|
const bool should_verify = VerifyBeforeGC || VerifyAfterGC || VerifyDuringGC
|
||||||
|| VerifyBeforeExit;
|
|| VerifyBeforeExit;
|
||||||
const int rso = SharedHeap::SO_AllCodeCache;
|
const int rso = GenCollectedHeap::SO_AllCodeCache;
|
||||||
|
|
||||||
// We set the proper root for this CMS cycle here.
|
// We set the proper root for this CMS cycle here.
|
||||||
if (should_unload_classes()) { // Should unload classes this cycle
|
if (should_unload_classes()) { // Should unload classes this cycle
|
||||||
@ -3000,7 +2997,6 @@ void CMSCollector::checkpointRootsInitial() {
|
|||||||
report_heap_summary(GCWhen::BeforeGC);
|
report_heap_summary(GCWhen::BeforeGC);
|
||||||
|
|
||||||
ReferenceProcessor* rp = ref_processor();
|
ReferenceProcessor* rp = ref_processor();
|
||||||
SpecializationStats::clear();
|
|
||||||
assert(_restart_addr == NULL, "Control point invariant");
|
assert(_restart_addr == NULL, "Control point invariant");
|
||||||
{
|
{
|
||||||
// acquire locks for subsequent manipulations
|
// acquire locks for subsequent manipulations
|
||||||
@ -3011,7 +3007,6 @@ void CMSCollector::checkpointRootsInitial() {
|
|||||||
rp->enable_discovery();
|
rp->enable_discovery();
|
||||||
_collectorState = Marking;
|
_collectorState = Marking;
|
||||||
}
|
}
|
||||||
SpecializationStats::print();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMSCollector::checkpointRootsInitialWork() {
|
void CMSCollector::checkpointRootsInitialWork() {
|
||||||
@ -3092,7 +3087,7 @@ void CMSCollector::checkpointRootsInitialWork() {
|
|||||||
gch->gen_process_roots(_cmsGen->level(),
|
gch->gen_process_roots(_cmsGen->level(),
|
||||||
true, // younger gens are roots
|
true, // younger gens are roots
|
||||||
true, // activate StrongRootsScope
|
true, // activate StrongRootsScope
|
||||||
SharedHeap::ScanningOption(roots_scanning_options()),
|
GenCollectedHeap::ScanningOption(roots_scanning_options()),
|
||||||
should_unload_classes(),
|
should_unload_classes(),
|
||||||
¬Older,
|
¬Older,
|
||||||
NULL,
|
NULL,
|
||||||
@ -4329,7 +4324,6 @@ void CMSCollector::checkpointRootsFinal() {
|
|||||||
verify_work_stacks_empty();
|
verify_work_stacks_empty();
|
||||||
verify_overflow_empty();
|
verify_overflow_empty();
|
||||||
|
|
||||||
SpecializationStats::clear();
|
|
||||||
if (PrintGCDetails) {
|
if (PrintGCDetails) {
|
||||||
gclog_or_tty->print("[YG occupancy: "SIZE_FORMAT" K ("SIZE_FORMAT" K)]",
|
gclog_or_tty->print("[YG occupancy: "SIZE_FORMAT" K ("SIZE_FORMAT" K)]",
|
||||||
_young_gen->used() / K,
|
_young_gen->used() / K,
|
||||||
@ -4360,7 +4354,6 @@ void CMSCollector::checkpointRootsFinal() {
|
|||||||
}
|
}
|
||||||
verify_work_stacks_empty();
|
verify_work_stacks_empty();
|
||||||
verify_overflow_empty();
|
verify_overflow_empty();
|
||||||
SpecializationStats::print();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMSCollector::checkpointRootsFinalWork() {
|
void CMSCollector::checkpointRootsFinalWork() {
|
||||||
@ -4528,13 +4521,13 @@ void CMSParInitialMarkTask::work(uint worker_id) {
|
|||||||
gch->gen_process_roots(_collector->_cmsGen->level(),
|
gch->gen_process_roots(_collector->_cmsGen->level(),
|
||||||
false, // yg was scanned above
|
false, // yg was scanned above
|
||||||
false, // this is parallel code
|
false, // this is parallel code
|
||||||
SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
|
GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
|
||||||
_collector->should_unload_classes(),
|
_collector->should_unload_classes(),
|
||||||
&par_mri_cl,
|
&par_mri_cl,
|
||||||
NULL,
|
NULL,
|
||||||
&cld_closure);
|
&cld_closure);
|
||||||
assert(_collector->should_unload_classes()
|
assert(_collector->should_unload_classes()
|
||||||
|| (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
|
|| (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
|
||||||
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
|
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
|
||||||
_timer.stop();
|
_timer.stop();
|
||||||
if (PrintCMSStatistics != 0) {
|
if (PrintCMSStatistics != 0) {
|
||||||
@ -4664,14 +4657,14 @@ void CMSParRemarkTask::work(uint worker_id) {
|
|||||||
gch->gen_process_roots(_collector->_cmsGen->level(),
|
gch->gen_process_roots(_collector->_cmsGen->level(),
|
||||||
false, // yg was scanned above
|
false, // yg was scanned above
|
||||||
false, // this is parallel code
|
false, // this is parallel code
|
||||||
SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
|
GenCollectedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
|
||||||
_collector->should_unload_classes(),
|
_collector->should_unload_classes(),
|
||||||
&par_mrias_cl,
|
&par_mrias_cl,
|
||||||
NULL,
|
NULL,
|
||||||
NULL); // The dirty klasses will be handled below
|
NULL); // The dirty klasses will be handled below
|
||||||
|
|
||||||
assert(_collector->should_unload_classes()
|
assert(_collector->should_unload_classes()
|
||||||
|| (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
|
|| (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
|
||||||
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
|
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
|
||||||
_timer.stop();
|
_timer.stop();
|
||||||
if (PrintCMSStatistics != 0) {
|
if (PrintCMSStatistics != 0) {
|
||||||
@ -5255,14 +5248,14 @@ void CMSCollector::do_remark_non_parallel() {
|
|||||||
gch->gen_process_roots(_cmsGen->level(),
|
gch->gen_process_roots(_cmsGen->level(),
|
||||||
true, // younger gens as roots
|
true, // younger gens as roots
|
||||||
false, // use the local StrongRootsScope
|
false, // use the local StrongRootsScope
|
||||||
SharedHeap::ScanningOption(roots_scanning_options()),
|
GenCollectedHeap::ScanningOption(roots_scanning_options()),
|
||||||
should_unload_classes(),
|
should_unload_classes(),
|
||||||
&mrias_cl,
|
&mrias_cl,
|
||||||
NULL,
|
NULL,
|
||||||
NULL); // The dirty klasses will be handled below
|
NULL); // The dirty klasses will be handled below
|
||||||
|
|
||||||
assert(should_unload_classes()
|
assert(should_unload_classes()
|
||||||
|| (roots_scanning_options() & SharedHeap::SO_AllCodeCache),
|
|| (roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache),
|
||||||
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
|
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -25,6 +25,7 @@
|
|||||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
|
#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
|
||||||
#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_HPP
|
||||||
|
|
||||||
|
#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
|
||||||
#include "gc_implementation/shared/gcHeapSummary.hpp"
|
#include "gc_implementation/shared/gcHeapSummary.hpp"
|
||||||
#include "gc_implementation/shared/gSpaceCounters.hpp"
|
#include "gc_implementation/shared/gSpaceCounters.hpp"
|
||||||
#include "gc_implementation/shared/gcStats.hpp"
|
#include "gc_implementation/shared/gcStats.hpp"
|
||||||
@ -55,6 +56,7 @@
|
|||||||
// means of a sliding mark-compact.
|
// means of a sliding mark-compact.
|
||||||
|
|
||||||
class AdaptiveSizePolicy;
|
class AdaptiveSizePolicy;
|
||||||
|
class CMSCollector;
|
||||||
class CMSConcMarkingTask;
|
class CMSConcMarkingTask;
|
||||||
class CMSGCAdaptivePolicyCounters;
|
class CMSGCAdaptivePolicyCounters;
|
||||||
class CMSTracer;
|
class CMSTracer;
|
||||||
@ -64,6 +66,7 @@ class ConcurrentMarkSweepPolicy;
|
|||||||
class ConcurrentMarkSweepThread;
|
class ConcurrentMarkSweepThread;
|
||||||
class CompactibleFreeListSpace;
|
class CompactibleFreeListSpace;
|
||||||
class FreeChunk;
|
class FreeChunk;
|
||||||
|
class ParNewGeneration;
|
||||||
class PromotionInfo;
|
class PromotionInfo;
|
||||||
class ScanMarkedObjectsAgainCarefullyClosure;
|
class ScanMarkedObjectsAgainCarefullyClosure;
|
||||||
class TenuredGeneration;
|
class TenuredGeneration;
|
||||||
|
@ -696,32 +696,32 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FLAG_IS_DEFAULT(MarkStackSize)) {
|
if (FLAG_IS_DEFAULT(MarkStackSize)) {
|
||||||
uintx mark_stack_size =
|
size_t mark_stack_size =
|
||||||
MIN2(MarkStackSizeMax,
|
MIN2(MarkStackSizeMax,
|
||||||
MAX2(MarkStackSize, (uintx) (parallel_marking_threads() * TASKQUEUE_SIZE)));
|
MAX2(MarkStackSize, (size_t) (parallel_marking_threads() * TASKQUEUE_SIZE)));
|
||||||
// Verify that the calculated value for MarkStackSize is in range.
|
// Verify that the calculated value for MarkStackSize is in range.
|
||||||
// It would be nice to use the private utility routine from Arguments.
|
// It would be nice to use the private utility routine from Arguments.
|
||||||
if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
|
if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
|
||||||
warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): "
|
warning("Invalid value calculated for MarkStackSize (" SIZE_FORMAT "): "
|
||||||
"must be between " UINTX_FORMAT " and " UINTX_FORMAT,
|
"must be between 1 and " SIZE_FORMAT,
|
||||||
mark_stack_size, (uintx) 1, MarkStackSizeMax);
|
mark_stack_size, MarkStackSizeMax);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size);
|
FLAG_SET_ERGO(size_t, MarkStackSize, mark_stack_size);
|
||||||
} else {
|
} else {
|
||||||
// Verify MarkStackSize is in range.
|
// Verify MarkStackSize is in range.
|
||||||
if (FLAG_IS_CMDLINE(MarkStackSize)) {
|
if (FLAG_IS_CMDLINE(MarkStackSize)) {
|
||||||
if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
|
if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
|
||||||
if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
|
if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
|
||||||
warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): "
|
warning("Invalid value specified for MarkStackSize (" SIZE_FORMAT "): "
|
||||||
"must be between " UINTX_FORMAT " and " UINTX_FORMAT,
|
"must be between 1 and " SIZE_FORMAT,
|
||||||
MarkStackSize, (uintx) 1, MarkStackSizeMax);
|
MarkStackSize, MarkStackSizeMax);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
|
} else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
|
||||||
if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
|
if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
|
||||||
warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT ")"
|
warning("Invalid value specified for MarkStackSize (" SIZE_FORMAT ")"
|
||||||
" or for MarkStackSizeMax (" UINTX_FORMAT ")",
|
" or for MarkStackSizeMax (" SIZE_FORMAT ")",
|
||||||
MarkStackSize, MarkStackSizeMax);
|
MarkStackSize, MarkStackSizeMax);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -745,7 +745,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev
|
|||||||
// so that the assertion in MarkingTaskQueue::task_queue doesn't fail
|
// so that the assertion in MarkingTaskQueue::task_queue doesn't fail
|
||||||
_active_tasks = _max_worker_id;
|
_active_tasks = _max_worker_id;
|
||||||
|
|
||||||
size_t max_regions = (size_t) _g1h->max_regions();
|
uint max_regions = _g1h->max_regions();
|
||||||
for (uint i = 0; i < _max_worker_id; ++i) {
|
for (uint i = 0; i < _max_worker_id; ++i) {
|
||||||
CMTaskQueue* task_queue = new CMTaskQueue();
|
CMTaskQueue* task_queue = new CMTaskQueue();
|
||||||
task_queue->initialize();
|
task_queue->initialize();
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
class G1CollectedHeap;
|
class G1CollectedHeap;
|
||||||
class CMBitMap;
|
class CMBitMap;
|
||||||
class CMTask;
|
class CMTask;
|
||||||
|
class ConcurrentMark;
|
||||||
typedef GenericTaskQueue<oop, mtGC> CMTaskQueue;
|
typedef GenericTaskQueue<oop, mtGC> CMTaskQueue;
|
||||||
typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
|
typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
|
#include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
|
||||||
#include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
|
#include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
|
||||||
#include "gc_implementation/g1/g1RemSet.inline.hpp"
|
#include "gc_implementation/g1/g1RemSet.inline.hpp"
|
||||||
|
#include "gc_implementation/g1/g1RootProcessor.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedup.hpp"
|
#include "gc_implementation/g1/g1StringDedup.hpp"
|
||||||
#include "gc_implementation/g1/g1YCTypes.hpp"
|
#include "gc_implementation/g1/g1YCTypes.hpp"
|
||||||
#include "gc_implementation/g1/heapRegion.inline.hpp"
|
#include "gc_implementation/g1/heapRegion.inline.hpp"
|
||||||
@ -89,18 +90,6 @@ size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
|
|||||||
// apply to TLAB allocation, which is not part of this interface: it
|
// apply to TLAB allocation, which is not part of this interface: it
|
||||||
// is done by clients of this interface.)
|
// is done by clients of this interface.)
|
||||||
|
|
||||||
// Notes on implementation of parallelism in different tasks.
|
|
||||||
//
|
|
||||||
// G1ParVerifyTask uses heap_region_par_iterate() for parallelism.
|
|
||||||
// The number of GC workers is passed to heap_region_par_iterate().
|
|
||||||
// It does use run_task() which sets _n_workers in the task.
|
|
||||||
// G1ParTask executes g1_process_roots() ->
|
|
||||||
// SharedHeap::process_roots() which calls eventually to
|
|
||||||
// CardTableModRefBS::par_non_clean_card_iterate_work() which uses
|
|
||||||
// SequentialSubTasksDone. SharedHeap::process_roots() also
|
|
||||||
// directly uses SubTasksDone (_process_strong_tasks field in SharedHeap).
|
|
||||||
//
|
|
||||||
|
|
||||||
// Local to this file.
|
// Local to this file.
|
||||||
|
|
||||||
class RefineCardTableEntryClosure: public CardTableEntryClosure {
|
class RefineCardTableEntryClosure: public CardTableEntryClosure {
|
||||||
@ -1767,7 +1756,6 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
|
|||||||
_is_alive_closure_stw(this),
|
_is_alive_closure_stw(this),
|
||||||
_ref_processor_cm(NULL),
|
_ref_processor_cm(NULL),
|
||||||
_ref_processor_stw(NULL),
|
_ref_processor_stw(NULL),
|
||||||
_process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)),
|
|
||||||
_bot_shared(NULL),
|
_bot_shared(NULL),
|
||||||
_evac_failure_scan_stack(NULL),
|
_evac_failure_scan_stack(NULL),
|
||||||
_mark_in_progress(false),
|
_mark_in_progress(false),
|
||||||
@ -1801,9 +1789,6 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
|
|||||||
_gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) G1OldTracer()) {
|
_gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) G1OldTracer()) {
|
||||||
|
|
||||||
_g1h = this;
|
_g1h = this;
|
||||||
if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
|
|
||||||
vm_exit_during_initialization("Failed necessary allocation.");
|
|
||||||
}
|
|
||||||
|
|
||||||
_allocator = G1Allocator::create_allocator(_g1h);
|
_allocator = G1Allocator::create_allocator(_g1h);
|
||||||
_humongous_object_threshold_in_words = HeapRegion::GrainWords / 2;
|
_humongous_object_threshold_in_words = HeapRegion::GrainWords / 2;
|
||||||
@ -2026,10 +2011,6 @@ jint G1CollectedHeap::initialize() {
|
|||||||
Shared_DirtyCardQ_lock,
|
Shared_DirtyCardQ_lock,
|
||||||
&JavaThread::dirty_card_queue_set());
|
&JavaThread::dirty_card_queue_set());
|
||||||
|
|
||||||
// In case we're keeping closure specialization stats, initialize those
|
|
||||||
// counts and that mechanism.
|
|
||||||
SpecializationStats::clear();
|
|
||||||
|
|
||||||
// Here we allocate the dummy HeapRegion that is required by the
|
// Here we allocate the dummy HeapRegion that is required by the
|
||||||
// G1AllocRegion class.
|
// G1AllocRegion class.
|
||||||
HeapRegion* dummy_region = _hrm.get_dummy_region();
|
HeapRegion* dummy_region = _hrm.get_dummy_region();
|
||||||
@ -2206,11 +2187,11 @@ void G1CollectedHeap::iterate_dirty_card_closure(CardTableEntryClosure* cl,
|
|||||||
hot_card_cache->drain(worker_i, g1_rem_set(), into_cset_dcq);
|
hot_card_cache->drain(worker_i, g1_rem_set(), into_cset_dcq);
|
||||||
|
|
||||||
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
|
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
|
||||||
int n_completed_buffers = 0;
|
size_t n_completed_buffers = 0;
|
||||||
while (dcqs.apply_closure_to_completed_buffer(cl, worker_i, 0, true)) {
|
while (dcqs.apply_closure_to_completed_buffer(cl, worker_i, 0, true)) {
|
||||||
n_completed_buffers++;
|
n_completed_buffers++;
|
||||||
}
|
}
|
||||||
g1_policy()->phase_times()->record_update_rs_processed_buffers(worker_i, n_completed_buffers);
|
g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers);
|
||||||
dcqs.clear_n_completed_buffers();
|
dcqs.clear_n_completed_buffers();
|
||||||
assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
|
assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
|
||||||
}
|
}
|
||||||
@ -3111,11 +3092,12 @@ void G1CollectedHeap::verify(bool silent, VerifyOption vo) {
|
|||||||
G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
|
G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
|
||||||
G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
|
G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
|
||||||
|
|
||||||
process_all_roots(true, // activate StrongRootsScope
|
{
|
||||||
SO_AllCodeCache, // roots scanning options
|
G1RootProcessor root_processor(this);
|
||||||
&rootsCl,
|
root_processor.process_all_roots(&rootsCl,
|
||||||
&cldCl,
|
&cldCl,
|
||||||
&blobsCl);
|
&blobsCl);
|
||||||
|
}
|
||||||
|
|
||||||
bool failures = rootsCl.failures() || codeRootsCl.failures();
|
bool failures = rootsCl.failures() || codeRootsCl.failures();
|
||||||
|
|
||||||
@ -3321,7 +3303,6 @@ void G1CollectedHeap::print_tracing_info() const {
|
|||||||
concurrent_mark()->print_summary_info();
|
concurrent_mark()->print_summary_info();
|
||||||
}
|
}
|
||||||
g1_policy()->print_yg_surv_rate_info();
|
g1_policy()->print_yg_surv_rate_info();
|
||||||
SpecializationStats::print();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
@ -3751,9 +3732,9 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
|||||||
|
|
||||||
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
||||||
|
|
||||||
int active_workers = workers()->active_workers();
|
uint active_workers = workers()->active_workers();
|
||||||
double pause_start_sec = os::elapsedTime();
|
double pause_start_sec = os::elapsedTime();
|
||||||
g1_policy()->phase_times()->note_gc_start(active_workers);
|
g1_policy()->phase_times()->note_gc_start(active_workers, mark_in_progress());
|
||||||
log_gc_header();
|
log_gc_header();
|
||||||
|
|
||||||
TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
|
TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
|
||||||
@ -4365,60 +4346,11 @@ class G1KlassScanClosure : public KlassClosure {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class G1CodeBlobClosure : public CodeBlobClosure {
|
|
||||||
class HeapRegionGatheringOopClosure : public OopClosure {
|
|
||||||
G1CollectedHeap* _g1h;
|
|
||||||
OopClosure* _work;
|
|
||||||
nmethod* _nm;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void do_oop_work(T* p) {
|
|
||||||
_work->do_oop(p);
|
|
||||||
T oop_or_narrowoop = oopDesc::load_heap_oop(p);
|
|
||||||
if (!oopDesc::is_null(oop_or_narrowoop)) {
|
|
||||||
oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
|
|
||||||
HeapRegion* hr = _g1h->heap_region_containing_raw(o);
|
|
||||||
assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
|
|
||||||
hr->add_strong_code_root(_nm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
|
|
||||||
|
|
||||||
void do_oop(oop* o) {
|
|
||||||
do_oop_work(o);
|
|
||||||
}
|
|
||||||
|
|
||||||
void do_oop(narrowOop* o) {
|
|
||||||
do_oop_work(o);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_nm(nmethod* nm) {
|
|
||||||
_nm = nm;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
HeapRegionGatheringOopClosure _oc;
|
|
||||||
public:
|
|
||||||
G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
|
|
||||||
|
|
||||||
void do_code_blob(CodeBlob* cb) {
|
|
||||||
nmethod* nm = cb->as_nmethod_or_null();
|
|
||||||
if (nm != NULL) {
|
|
||||||
if (!nm->test_set_oops_do_mark()) {
|
|
||||||
_oc.set_nm(nm);
|
|
||||||
nm->oops_do(&_oc);
|
|
||||||
nm->fix_oop_relocations();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class G1ParTask : public AbstractGangTask {
|
class G1ParTask : public AbstractGangTask {
|
||||||
protected:
|
protected:
|
||||||
G1CollectedHeap* _g1h;
|
G1CollectedHeap* _g1h;
|
||||||
RefToScanQueueSet *_queues;
|
RefToScanQueueSet *_queues;
|
||||||
|
G1RootProcessor* _root_processor;
|
||||||
ParallelTaskTerminator _terminator;
|
ParallelTaskTerminator _terminator;
|
||||||
uint _n_workers;
|
uint _n_workers;
|
||||||
|
|
||||||
@ -4426,10 +4358,11 @@ protected:
|
|||||||
Mutex* stats_lock() { return &_stats_lock; }
|
Mutex* stats_lock() { return &_stats_lock; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues)
|
G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor)
|
||||||
: AbstractGangTask("G1 collection"),
|
: AbstractGangTask("G1 collection"),
|
||||||
_g1h(g1h),
|
_g1h(g1h),
|
||||||
_queues(task_queues),
|
_queues(task_queues),
|
||||||
|
_root_processor(root_processor),
|
||||||
_terminator(0, _queues),
|
_terminator(0, _queues),
|
||||||
_stats_lock(Mutex::leaf, "parallel G1 stats lock", true)
|
_stats_lock(Mutex::leaf, "parallel G1 stats lock", true)
|
||||||
{}
|
{}
|
||||||
@ -4443,13 +4376,7 @@ public:
|
|||||||
ParallelTaskTerminator* terminator() { return &_terminator; }
|
ParallelTaskTerminator* terminator() { return &_terminator; }
|
||||||
|
|
||||||
virtual void set_for_termination(int active_workers) {
|
virtual void set_for_termination(int active_workers) {
|
||||||
// This task calls set_n_termination() in par_non_clean_card_iterate_work()
|
_root_processor->set_num_workers(active_workers);
|
||||||
// in the young space (_par_seq_tasks) in the G1 heap
|
|
||||||
// for SequentialSubTasksDone.
|
|
||||||
// This task also uses SubTasksDone in SharedHeap and G1CollectedHeap
|
|
||||||
// both of which need setting by set_n_termination().
|
|
||||||
_g1h->SharedHeap::set_n_termination(active_workers);
|
|
||||||
_g1h->set_n_termination(active_workers);
|
|
||||||
terminator()->reset_for_reuse(active_workers);
|
terminator()->reset_for_reuse(active_workers);
|
||||||
_n_workers = active_workers;
|
_n_workers = active_workers;
|
||||||
}
|
}
|
||||||
@ -4486,8 +4413,7 @@ public:
|
|||||||
void work(uint worker_id) {
|
void work(uint worker_id) {
|
||||||
if (worker_id >= _n_workers) return; // no work needed this round
|
if (worker_id >= _n_workers) return; // no work needed this round
|
||||||
|
|
||||||
double start_time_ms = os::elapsedTime() * 1000.0;
|
_g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, os::elapsedTime());
|
||||||
_g1h->g1_policy()->phase_times()->record_gc_worker_start_time(worker_id, start_time_ms);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
@ -4519,24 +4445,21 @@ public:
|
|||||||
false, // Process all klasses.
|
false, // Process all klasses.
|
||||||
true); // Need to claim CLDs.
|
true); // Need to claim CLDs.
|
||||||
|
|
||||||
G1CodeBlobClosure scan_only_code_cl(&scan_only_root_cl);
|
|
||||||
G1CodeBlobClosure scan_mark_code_cl(&scan_mark_root_cl);
|
|
||||||
// IM Weak code roots are handled later.
|
|
||||||
|
|
||||||
OopClosure* strong_root_cl;
|
OopClosure* strong_root_cl;
|
||||||
OopClosure* weak_root_cl;
|
OopClosure* weak_root_cl;
|
||||||
CLDClosure* strong_cld_cl;
|
CLDClosure* strong_cld_cl;
|
||||||
CLDClosure* weak_cld_cl;
|
CLDClosure* weak_cld_cl;
|
||||||
CodeBlobClosure* strong_code_cl;
|
|
||||||
|
bool trace_metadata = false;
|
||||||
|
|
||||||
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
||||||
// We also need to mark copied objects.
|
// We also need to mark copied objects.
|
||||||
strong_root_cl = &scan_mark_root_cl;
|
strong_root_cl = &scan_mark_root_cl;
|
||||||
strong_cld_cl = &scan_mark_cld_cl;
|
strong_cld_cl = &scan_mark_cld_cl;
|
||||||
strong_code_cl = &scan_mark_code_cl;
|
|
||||||
if (ClassUnloadingWithConcurrentMark) {
|
if (ClassUnloadingWithConcurrentMark) {
|
||||||
weak_root_cl = &scan_mark_weak_root_cl;
|
weak_root_cl = &scan_mark_weak_root_cl;
|
||||||
weak_cld_cl = &scan_mark_weak_cld_cl;
|
weak_cld_cl = &scan_mark_weak_cld_cl;
|
||||||
|
trace_metadata = true;
|
||||||
} else {
|
} else {
|
||||||
weak_root_cl = &scan_mark_root_cl;
|
weak_root_cl = &scan_mark_root_cl;
|
||||||
weak_cld_cl = &scan_mark_cld_cl;
|
weak_cld_cl = &scan_mark_cld_cl;
|
||||||
@ -4546,31 +4469,32 @@ public:
|
|||||||
weak_root_cl = &scan_only_root_cl;
|
weak_root_cl = &scan_only_root_cl;
|
||||||
strong_cld_cl = &scan_only_cld_cl;
|
strong_cld_cl = &scan_only_cld_cl;
|
||||||
weak_cld_cl = &scan_only_cld_cl;
|
weak_cld_cl = &scan_only_cld_cl;
|
||||||
strong_code_cl = &scan_only_code_cl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
|
|
||||||
|
|
||||||
pss.start_strong_roots();
|
pss.start_strong_roots();
|
||||||
_g1h->g1_process_roots(strong_root_cl,
|
|
||||||
weak_root_cl,
|
|
||||||
&push_heap_rs_cl,
|
|
||||||
strong_cld_cl,
|
|
||||||
weak_cld_cl,
|
|
||||||
strong_code_cl,
|
|
||||||
worker_id);
|
|
||||||
|
|
||||||
|
_root_processor->evacuate_roots(strong_root_cl,
|
||||||
|
weak_root_cl,
|
||||||
|
strong_cld_cl,
|
||||||
|
weak_cld_cl,
|
||||||
|
trace_metadata,
|
||||||
|
worker_id);
|
||||||
|
|
||||||
|
G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
|
||||||
|
_root_processor->scan_remembered_sets(&push_heap_rs_cl,
|
||||||
|
weak_root_cl,
|
||||||
|
worker_id);
|
||||||
pss.end_strong_roots();
|
pss.end_strong_roots();
|
||||||
|
|
||||||
{
|
{
|
||||||
double start = os::elapsedTime();
|
double start = os::elapsedTime();
|
||||||
G1ParEvacuateFollowersClosure evac(_g1h, &pss, _queues, &_terminator);
|
G1ParEvacuateFollowersClosure evac(_g1h, &pss, _queues, &_terminator);
|
||||||
evac.do_void();
|
evac.do_void();
|
||||||
double elapsed_ms = (os::elapsedTime()-start)*1000.0;
|
double elapsed_sec = os::elapsedTime() - start;
|
||||||
double term_ms = pss.term_time()*1000.0;
|
double term_sec = pss.term_time();
|
||||||
_g1h->g1_policy()->phase_times()->add_obj_copy_time(worker_id, elapsed_ms-term_ms);
|
_g1h->g1_policy()->phase_times()->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec);
|
||||||
_g1h->g1_policy()->phase_times()->record_termination(worker_id, term_ms, pss.term_attempts());
|
_g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec);
|
||||||
|
_g1h->g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, pss.term_attempts());
|
||||||
}
|
}
|
||||||
_g1h->g1_policy()->record_thread_age_table(pss.age_table());
|
_g1h->g1_policy()->record_thread_age_table(pss.age_table());
|
||||||
_g1h->update_surviving_young_words(pss.surviving_young_words()+1);
|
_g1h->update_surviving_young_words(pss.surviving_young_words()+1);
|
||||||
@ -4586,100 +4510,10 @@ public:
|
|||||||
// destructors are executed here and are included as part of the
|
// destructors are executed here and are included as part of the
|
||||||
// "GC Worker Time".
|
// "GC Worker Time".
|
||||||
}
|
}
|
||||||
|
_g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerEnd, worker_id, os::elapsedTime());
|
||||||
double end_time_ms = os::elapsedTime() * 1000.0;
|
|
||||||
_g1h->g1_policy()->phase_times()->record_gc_worker_end_time(worker_id, end_time_ms);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// *** Common G1 Evacuation Stuff
|
|
||||||
|
|
||||||
// This method is run in a GC worker.
|
|
||||||
|
|
||||||
void
|
|
||||||
G1CollectedHeap::
|
|
||||||
g1_process_roots(OopClosure* scan_non_heap_roots,
|
|
||||||
OopClosure* scan_non_heap_weak_roots,
|
|
||||||
G1ParPushHeapRSClosure* scan_rs,
|
|
||||||
CLDClosure* scan_strong_clds,
|
|
||||||
CLDClosure* scan_weak_clds,
|
|
||||||
CodeBlobClosure* scan_strong_code,
|
|
||||||
uint worker_i) {
|
|
||||||
|
|
||||||
// First scan the shared roots.
|
|
||||||
double ext_roots_start = os::elapsedTime();
|
|
||||||
double closure_app_time_sec = 0.0;
|
|
||||||
|
|
||||||
bool during_im = _g1h->g1_policy()->during_initial_mark_pause();
|
|
||||||
bool trace_metadata = during_im && ClassUnloadingWithConcurrentMark;
|
|
||||||
|
|
||||||
BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
|
|
||||||
BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
|
|
||||||
|
|
||||||
process_roots(false, // no scoping; this is parallel code
|
|
||||||
SharedHeap::SO_None,
|
|
||||||
&buf_scan_non_heap_roots,
|
|
||||||
&buf_scan_non_heap_weak_roots,
|
|
||||||
scan_strong_clds,
|
|
||||||
// Unloading Initial Marks handle the weak CLDs separately.
|
|
||||||
(trace_metadata ? NULL : scan_weak_clds),
|
|
||||||
scan_strong_code);
|
|
||||||
|
|
||||||
// Now the CM ref_processor roots.
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) {
|
|
||||||
// We need to treat the discovered reference lists of the
|
|
||||||
// concurrent mark ref processor as roots and keep entries
|
|
||||||
// (which are added by the marking threads) on them live
|
|
||||||
// until they can be processed at the end of marking.
|
|
||||||
ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (trace_metadata) {
|
|
||||||
// Barrier to make sure all workers passed
|
|
||||||
// the strong CLD and strong nmethods phases.
|
|
||||||
active_strong_roots_scope()->wait_until_all_workers_done_with_threads(n_par_threads());
|
|
||||||
|
|
||||||
// Now take the complement of the strong CLDs.
|
|
||||||
ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finish up any enqueued closure apps (attributed as object copy time).
|
|
||||||
buf_scan_non_heap_roots.done();
|
|
||||||
buf_scan_non_heap_weak_roots.done();
|
|
||||||
|
|
||||||
double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
|
|
||||||
+ buf_scan_non_heap_weak_roots.closure_app_seconds();
|
|
||||||
|
|
||||||
g1_policy()->phase_times()->record_obj_copy_time(worker_i, obj_copy_time_sec * 1000.0);
|
|
||||||
|
|
||||||
double ext_root_time_ms =
|
|
||||||
((os::elapsedTime() - ext_roots_start) - obj_copy_time_sec) * 1000.0;
|
|
||||||
|
|
||||||
g1_policy()->phase_times()->record_ext_root_scan_time(worker_i, ext_root_time_ms);
|
|
||||||
|
|
||||||
// During conc marking we have to filter the per-thread SATB buffers
|
|
||||||
// to make sure we remove any oops into the CSet (which will show up
|
|
||||||
// as implicitly live).
|
|
||||||
double satb_filtering_ms = 0.0;
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(G1H_PS_filter_satb_buffers)) {
|
|
||||||
if (mark_in_progress()) {
|
|
||||||
double satb_filter_start = os::elapsedTime();
|
|
||||||
|
|
||||||
JavaThread::satb_mark_queue_set().filter_thread_buffers();
|
|
||||||
|
|
||||||
satb_filtering_ms = (os::elapsedTime() - satb_filter_start) * 1000.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g1_policy()->phase_times()->record_satb_filtering_time(worker_i, satb_filtering_ms);
|
|
||||||
|
|
||||||
// Now scan the complement of the collection set.
|
|
||||||
G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots);
|
|
||||||
|
|
||||||
g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
|
|
||||||
|
|
||||||
_process_strong_tasks->all_tasks_completed();
|
|
||||||
}
|
|
||||||
|
|
||||||
class G1StringSymbolTableUnlinkTask : public AbstractGangTask {
|
class G1StringSymbolTableUnlinkTask : public AbstractGangTask {
|
||||||
private:
|
private:
|
||||||
BoolObjectClosure* _is_alive;
|
BoolObjectClosure* _is_alive;
|
||||||
@ -5054,14 +4888,13 @@ class G1RedirtyLoggedCardsTask : public AbstractGangTask {
|
|||||||
G1RedirtyLoggedCardsTask(DirtyCardQueueSet* queue) : AbstractGangTask("Redirty Cards"), _queue(queue) { }
|
G1RedirtyLoggedCardsTask(DirtyCardQueueSet* queue) : AbstractGangTask("Redirty Cards"), _queue(queue) { }
|
||||||
|
|
||||||
virtual void work(uint worker_id) {
|
virtual void work(uint worker_id) {
|
||||||
double start_time = os::elapsedTime();
|
G1GCPhaseTimes* phase_times = G1CollectedHeap::heap()->g1_policy()->phase_times();
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::RedirtyCards, worker_id);
|
||||||
|
|
||||||
RedirtyLoggedCardTableEntryClosure cl;
|
RedirtyLoggedCardTableEntryClosure cl;
|
||||||
_queue->par_apply_closure_to_all_completed_buffers(&cl);
|
_queue->par_apply_closure_to_all_completed_buffers(&cl);
|
||||||
|
|
||||||
G1GCPhaseTimes* timer = G1CollectedHeap::heap()->g1_policy()->phase_times();
|
phase_times->record_thread_work_item(G1GCPhaseTimes::RedirtyCards, worker_id, cl.num_processed());
|
||||||
timer->record_redirty_logged_cards_time_ms(worker_id, (os::elapsedTime() - start_time) * 1000.0);
|
|
||||||
timer->record_redirty_logged_cards_processed_cards(worker_id, cl.num_processed());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -5608,7 +5441,6 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
|
|||||||
workers()->set_active_workers(n_workers);
|
workers()->set_active_workers(n_workers);
|
||||||
set_par_threads(n_workers);
|
set_par_threads(n_workers);
|
||||||
|
|
||||||
G1ParTask g1_par_task(this, _task_queues);
|
|
||||||
|
|
||||||
init_for_evac_failure(NULL);
|
init_for_evac_failure(NULL);
|
||||||
|
|
||||||
@ -5617,7 +5449,8 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
|
|||||||
double end_par_time_sec;
|
double end_par_time_sec;
|
||||||
|
|
||||||
{
|
{
|
||||||
StrongRootsScope srs(this);
|
G1RootProcessor root_processor(this);
|
||||||
|
G1ParTask g1_par_task(this, _task_queues, &root_processor);
|
||||||
// InitialMark needs claim bits to keep track of the marked-through CLDs.
|
// InitialMark needs claim bits to keep track of the marked-through CLDs.
|
||||||
if (g1_policy()->during_initial_mark_pause()) {
|
if (g1_policy()->during_initial_mark_pause()) {
|
||||||
ClassLoaderDataGraph::clear_claimed_marks();
|
ClassLoaderDataGraph::clear_claimed_marks();
|
||||||
@ -5633,18 +5466,20 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
|
|||||||
end_par_time_sec = os::elapsedTime();
|
end_par_time_sec = os::elapsedTime();
|
||||||
|
|
||||||
// Closing the inner scope will execute the destructor
|
// Closing the inner scope will execute the destructor
|
||||||
// for the StrongRootsScope object. We record the current
|
// for the G1RootProcessor object. We record the current
|
||||||
// elapsed time before closing the scope so that time
|
// elapsed time before closing the scope so that time
|
||||||
// taken for the SRS destructor is NOT included in the
|
// taken for the destructor is NOT included in the
|
||||||
// reported parallel time.
|
// reported parallel time.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
G1GCPhaseTimes* phase_times = g1_policy()->phase_times();
|
||||||
|
|
||||||
double par_time_ms = (end_par_time_sec - start_par_time_sec) * 1000.0;
|
double par_time_ms = (end_par_time_sec - start_par_time_sec) * 1000.0;
|
||||||
g1_policy()->phase_times()->record_par_time(par_time_ms);
|
phase_times->record_par_time(par_time_ms);
|
||||||
|
|
||||||
double code_root_fixup_time_ms =
|
double code_root_fixup_time_ms =
|
||||||
(os::elapsedTime() - end_par_time_sec) * 1000.0;
|
(os::elapsedTime() - end_par_time_sec) * 1000.0;
|
||||||
g1_policy()->phase_times()->record_code_root_fixup_time(code_root_fixup_time_ms);
|
phase_times->record_code_root_fixup_time(code_root_fixup_time_ms);
|
||||||
|
|
||||||
set_par_threads(0);
|
set_par_threads(0);
|
||||||
|
|
||||||
@ -5656,9 +5491,14 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
|
|||||||
process_discovered_references(n_workers);
|
process_discovered_references(n_workers);
|
||||||
|
|
||||||
if (G1StringDedup::is_enabled()) {
|
if (G1StringDedup::is_enabled()) {
|
||||||
|
double fixup_start = os::elapsedTime();
|
||||||
|
|
||||||
G1STWIsAliveClosure is_alive(this);
|
G1STWIsAliveClosure is_alive(this);
|
||||||
G1KeepAliveClosure keep_alive(this);
|
G1KeepAliveClosure keep_alive(this);
|
||||||
G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive);
|
G1StringDedup::unlink_or_oops_do(&is_alive, &keep_alive, true, phase_times);
|
||||||
|
|
||||||
|
double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
|
||||||
|
phase_times->record_string_dedup_fixup_time(fixup_time_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
_allocator->release_gc_alloc_regions(n_workers, evacuation_info);
|
_allocator->release_gc_alloc_regions(n_workers, evacuation_info);
|
||||||
|
@ -56,6 +56,7 @@ class HRRSCleanupTask;
|
|||||||
class GenerationSpec;
|
class GenerationSpec;
|
||||||
class OopsInHeapRegionClosure;
|
class OopsInHeapRegionClosure;
|
||||||
class G1KlassScanClosure;
|
class G1KlassScanClosure;
|
||||||
|
class G1ParScanThreadState;
|
||||||
class ObjectClosure;
|
class ObjectClosure;
|
||||||
class SpaceClosure;
|
class SpaceClosure;
|
||||||
class CompactibleSpaceClosure;
|
class CompactibleSpaceClosure;
|
||||||
@ -780,22 +781,6 @@ protected:
|
|||||||
// statistics or updating free lists.
|
// statistics or updating free lists.
|
||||||
void abandon_collection_set(HeapRegion* cs_head);
|
void abandon_collection_set(HeapRegion* cs_head);
|
||||||
|
|
||||||
// Applies "scan_non_heap_roots" to roots outside the heap,
|
|
||||||
// "scan_rs" to roots inside the heap (having done "set_region" to
|
|
||||||
// indicate the region in which the root resides),
|
|
||||||
// and does "scan_metadata" If "scan_rs" is
|
|
||||||
// NULL, then this step is skipped. The "worker_i"
|
|
||||||
// param is for use with parallel roots processing, and should be
|
|
||||||
// the "i" of the calling parallel worker thread's work(i) function.
|
|
||||||
// In the sequential case this param will be ignored.
|
|
||||||
void g1_process_roots(OopClosure* scan_non_heap_roots,
|
|
||||||
OopClosure* scan_non_heap_weak_roots,
|
|
||||||
G1ParPushHeapRSClosure* scan_rs,
|
|
||||||
CLDClosure* scan_strong_clds,
|
|
||||||
CLDClosure* scan_weak_clds,
|
|
||||||
CodeBlobClosure* scan_strong_code,
|
|
||||||
uint worker_i);
|
|
||||||
|
|
||||||
// The concurrent marker (and the thread it runs in.)
|
// The concurrent marker (and the thread it runs in.)
|
||||||
ConcurrentMark* _cm;
|
ConcurrentMark* _cm;
|
||||||
ConcurrentMarkThread* _cmThread;
|
ConcurrentMarkThread* _cmThread;
|
||||||
@ -982,21 +967,10 @@ protected:
|
|||||||
// of G1CollectedHeap::_gc_time_stamp.
|
// of G1CollectedHeap::_gc_time_stamp.
|
||||||
uint* _worker_cset_start_region_time_stamp;
|
uint* _worker_cset_start_region_time_stamp;
|
||||||
|
|
||||||
enum G1H_process_roots_tasks {
|
|
||||||
G1H_PS_filter_satb_buffers,
|
|
||||||
G1H_PS_refProcessor_oops_do,
|
|
||||||
// Leave this one last.
|
|
||||||
G1H_PS_NumElements
|
|
||||||
};
|
|
||||||
|
|
||||||
SubTasksDone* _process_strong_tasks;
|
|
||||||
|
|
||||||
volatile bool _free_regions_coming;
|
volatile bool _free_regions_coming;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
SubTasksDone* process_strong_tasks() { return _process_strong_tasks; }
|
|
||||||
|
|
||||||
void set_refine_cte_cl_concurrency(bool concurrent);
|
void set_refine_cte_cl_concurrency(bool concurrent);
|
||||||
|
|
||||||
RefToScanQueue *task_queue(int i) const;
|
RefToScanQueue *task_queue(int i) const;
|
||||||
@ -1029,21 +1003,11 @@ public:
|
|||||||
// Initialize weak reference processing.
|
// Initialize weak reference processing.
|
||||||
virtual void ref_processing_init();
|
virtual void ref_processing_init();
|
||||||
|
|
||||||
void set_par_threads(uint t) {
|
// Explicitly import set_par_threads into this scope
|
||||||
SharedHeap::set_par_threads(t);
|
using SharedHeap::set_par_threads;
|
||||||
// Done in SharedHeap but oddly there are
|
|
||||||
// two _process_strong_tasks's in a G1CollectedHeap
|
|
||||||
// so do it here too.
|
|
||||||
_process_strong_tasks->set_n_threads(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set _n_par_threads according to a policy TBD.
|
// Set _n_par_threads according to a policy TBD.
|
||||||
void set_par_threads();
|
void set_par_threads();
|
||||||
|
|
||||||
void set_n_termination(int t) {
|
|
||||||
_process_strong_tasks->set_n_threads(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual CollectedHeap::Name kind() const {
|
virtual CollectedHeap::Name kind() const {
|
||||||
return CollectedHeap::G1CollectedHeap;
|
return CollectedHeap::G1CollectedHeap;
|
||||||
}
|
}
|
||||||
@ -1118,6 +1082,10 @@ public:
|
|||||||
// The number of regions that are completely free.
|
// The number of regions that are completely free.
|
||||||
uint num_free_regions() const { return _hrm.num_free_regions(); }
|
uint num_free_regions() const { return _hrm.num_free_regions(); }
|
||||||
|
|
||||||
|
MemoryUsage get_auxiliary_data_memory_usage() const {
|
||||||
|
return _hrm.get_auxiliary_data_memory_usage();
|
||||||
|
}
|
||||||
|
|
||||||
// The number of regions that are not completely free.
|
// The number of regions that are not completely free.
|
||||||
uint num_used_regions() const { return num_regions() - num_free_regions(); }
|
uint num_used_regions() const { return num_regions() - num_free_regions(); }
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ void G1CollectorPolicy::initialize_alignments() {
|
|||||||
|
|
||||||
void G1CollectorPolicy::initialize_flags() {
|
void G1CollectorPolicy::initialize_flags() {
|
||||||
if (G1HeapRegionSize != HeapRegion::GrainBytes) {
|
if (G1HeapRegionSize != HeapRegion::GrainBytes) {
|
||||||
FLAG_SET_ERGO(uintx, G1HeapRegionSize, HeapRegion::GrainBytes);
|
FLAG_SET_ERGO(size_t, G1HeapRegionSize, HeapRegion::GrainBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SurvivorRatio < 1) {
|
if (SurvivorRatio < 1) {
|
||||||
@ -335,7 +335,7 @@ void G1CollectorPolicy::post_heap_initialize() {
|
|||||||
uintx max_regions = G1CollectedHeap::heap()->max_regions();
|
uintx max_regions = G1CollectedHeap::heap()->max_regions();
|
||||||
size_t max_young_size = (size_t)_young_gen_sizer->max_young_length(max_regions) * HeapRegion::GrainBytes;
|
size_t max_young_size = (size_t)_young_gen_sizer->max_young_length(max_regions) * HeapRegion::GrainBytes;
|
||||||
if (max_young_size != MaxNewSize) {
|
if (max_young_size != MaxNewSize) {
|
||||||
FLAG_SET_ERGO(uintx, MaxNewSize, max_young_size);
|
FLAG_SET_ERGO(size_t, MaxNewSize, max_young_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1073,7 +1073,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
|
|||||||
if (update_stats) {
|
if (update_stats) {
|
||||||
double cost_per_card_ms = 0.0;
|
double cost_per_card_ms = 0.0;
|
||||||
if (_pending_cards > 0) {
|
if (_pending_cards > 0) {
|
||||||
cost_per_card_ms = phase_times()->average_last_update_rs_time() / (double) _pending_cards;
|
cost_per_card_ms = phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS) / (double) _pending_cards;
|
||||||
_cost_per_card_ms_seq->add(cost_per_card_ms);
|
_cost_per_card_ms_seq->add(cost_per_card_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1081,7 +1081,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
|
|||||||
|
|
||||||
double cost_per_entry_ms = 0.0;
|
double cost_per_entry_ms = 0.0;
|
||||||
if (cards_scanned > 10) {
|
if (cards_scanned > 10) {
|
||||||
cost_per_entry_ms = phase_times()->average_last_scan_rs_time() / (double) cards_scanned;
|
cost_per_entry_ms = phase_times()->average_time_ms(G1GCPhaseTimes::ScanRS) / (double) cards_scanned;
|
||||||
if (_last_gc_was_young) {
|
if (_last_gc_was_young) {
|
||||||
_cost_per_entry_ms_seq->add(cost_per_entry_ms);
|
_cost_per_entry_ms_seq->add(cost_per_entry_ms);
|
||||||
} else {
|
} else {
|
||||||
@ -1123,7 +1123,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
|
|||||||
double cost_per_byte_ms = 0.0;
|
double cost_per_byte_ms = 0.0;
|
||||||
|
|
||||||
if (copied_bytes > 0) {
|
if (copied_bytes > 0) {
|
||||||
cost_per_byte_ms = phase_times()->average_last_obj_copy_time() / (double) copied_bytes;
|
cost_per_byte_ms = phase_times()->average_time_ms(G1GCPhaseTimes::ObjCopy) / (double) copied_bytes;
|
||||||
if (_in_marking_window) {
|
if (_in_marking_window) {
|
||||||
_cost_per_byte_ms_during_cm_seq->add(cost_per_byte_ms);
|
_cost_per_byte_ms_during_cm_seq->add(cost_per_byte_ms);
|
||||||
} else {
|
} else {
|
||||||
@ -1132,8 +1132,8 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
|
|||||||
}
|
}
|
||||||
|
|
||||||
double all_other_time_ms = pause_time_ms -
|
double all_other_time_ms = pause_time_ms -
|
||||||
(phase_times()->average_last_update_rs_time() + phase_times()->average_last_scan_rs_time()
|
(phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS) + phase_times()->average_time_ms(G1GCPhaseTimes::ScanRS) +
|
||||||
+ phase_times()->average_last_obj_copy_time() + phase_times()->average_last_termination_time());
|
phase_times()->average_time_ms(G1GCPhaseTimes::ObjCopy) + phase_times()->average_time_ms(G1GCPhaseTimes::Termination));
|
||||||
|
|
||||||
double young_other_time_ms = 0.0;
|
double young_other_time_ms = 0.0;
|
||||||
if (young_cset_region_length() > 0) {
|
if (young_cset_region_length() > 0) {
|
||||||
@ -1174,8 +1174,8 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua
|
|||||||
|
|
||||||
// Note that _mmu_tracker->max_gc_time() returns the time in seconds.
|
// Note that _mmu_tracker->max_gc_time() returns the time in seconds.
|
||||||
double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
|
double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
|
||||||
adjust_concurrent_refinement(phase_times()->average_last_update_rs_time(),
|
adjust_concurrent_refinement(phase_times()->average_time_ms(G1GCPhaseTimes::UpdateRS),
|
||||||
phase_times()->sum_last_update_rs_processed_buffers(), update_rs_time_goal_ms);
|
phase_times()->sum_thread_work_items(G1GCPhaseTimes::UpdateRS), update_rs_time_goal_ms);
|
||||||
|
|
||||||
_collectionSetChooser->verify();
|
_collectionSetChooser->verify();
|
||||||
}
|
}
|
||||||
@ -2114,19 +2114,19 @@ void TraceYoungGenTimeData::record_end_collection(double pause_time_ms, G1GCPhas
|
|||||||
_other.add(pause_time_ms - phase_times->accounted_time_ms());
|
_other.add(pause_time_ms - phase_times->accounted_time_ms());
|
||||||
_root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms());
|
_root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms());
|
||||||
_parallel.add(phase_times->cur_collection_par_time_ms());
|
_parallel.add(phase_times->cur_collection_par_time_ms());
|
||||||
_ext_root_scan.add(phase_times->average_last_ext_root_scan_time());
|
_ext_root_scan.add(phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan));
|
||||||
_satb_filtering.add(phase_times->average_last_satb_filtering_times_ms());
|
_satb_filtering.add(phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering));
|
||||||
_update_rs.add(phase_times->average_last_update_rs_time());
|
_update_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS));
|
||||||
_scan_rs.add(phase_times->average_last_scan_rs_time());
|
_scan_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::ScanRS));
|
||||||
_obj_copy.add(phase_times->average_last_obj_copy_time());
|
_obj_copy.add(phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy));
|
||||||
_termination.add(phase_times->average_last_termination_time());
|
_termination.add(phase_times->average_time_ms(G1GCPhaseTimes::Termination));
|
||||||
|
|
||||||
double parallel_known_time = phase_times->average_last_ext_root_scan_time() +
|
double parallel_known_time = phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan) +
|
||||||
phase_times->average_last_satb_filtering_times_ms() +
|
phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering) +
|
||||||
phase_times->average_last_update_rs_time() +
|
phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS) +
|
||||||
phase_times->average_last_scan_rs_time() +
|
phase_times->average_time_ms(G1GCPhaseTimes::ScanRS) +
|
||||||
phase_times->average_last_obj_copy_time() +
|
phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy) +
|
||||||
+ phase_times->average_last_termination_time();
|
phase_times->average_time_ms(G1GCPhaseTimes::Termination);
|
||||||
|
|
||||||
double parallel_other_time = phase_times->cur_collection_par_time_ms() - parallel_known_time;
|
double parallel_other_time = phase_times->cur_collection_par_time_ms() - parallel_known_time;
|
||||||
_parallel_other.add(parallel_other_time);
|
_parallel_other.add(parallel_other_time);
|
||||||
|
@ -22,13 +22,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
||||||
#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
|
#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
|
||||||
#include "gc_implementation/g1/g1Log.hpp"
|
#include "gc_implementation/g1/g1Log.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedup.hpp"
|
#include "gc_implementation/g1/g1StringDedup.hpp"
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "memory/allocation.hpp"
|
||||||
|
#include "runtime/os.hpp"
|
||||||
|
|
||||||
// Helper class for avoiding interleaved logging
|
// Helper class for avoiding interleaved logging
|
||||||
class LineBuffer: public StackObj {
|
class LineBuffer: public StackObj {
|
||||||
@ -71,184 +71,258 @@ public:
|
|||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_cr() {
|
||||||
|
gclog_or_tty->print_cr("%s", _buffer);
|
||||||
|
_cur = _indent_level * INDENT_CHARS;
|
||||||
|
}
|
||||||
|
|
||||||
void append_and_print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
|
void append_and_print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
vappend(format, ap);
|
vappend(format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
gclog_or_tty->print_cr("%s", _buffer);
|
print_cr();
|
||||||
_cur = _indent_level * INDENT_CHARS;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
PRAGMA_DIAG_PUSH
|
|
||||||
PRAGMA_FORMAT_NONLITERAL_IGNORED
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void WorkerDataArray<T>::print(int level, const char* title) {
|
class WorkerDataArray : public CHeapObj<mtGC> {
|
||||||
if (_length == 1) {
|
friend class G1GCParPhasePrinter;
|
||||||
// No need for min, max, average and sum for only one worker
|
T* _data;
|
||||||
LineBuffer buf(level);
|
uint _length;
|
||||||
buf.append("[%s: ", title);
|
const char* _title;
|
||||||
buf.append(_print_format, _data[0]);
|
bool _print_sum;
|
||||||
buf.append_and_print_cr("]");
|
int _log_level;
|
||||||
return;
|
uint _indent_level;
|
||||||
|
bool _enabled;
|
||||||
|
|
||||||
|
WorkerDataArray<size_t>* _thread_work_items;
|
||||||
|
|
||||||
|
NOT_PRODUCT(T uninitialized();)
|
||||||
|
|
||||||
|
// We are caching the sum and average to only have to calculate them once.
|
||||||
|
// This is not done in an MT-safe way. It is intended to allow single
|
||||||
|
// threaded code to call sum() and average() multiple times in any order
|
||||||
|
// without having to worry about the cost.
|
||||||
|
bool _has_new_data;
|
||||||
|
T _sum;
|
||||||
|
T _min;
|
||||||
|
T _max;
|
||||||
|
double _average;
|
||||||
|
|
||||||
|
public:
|
||||||
|
WorkerDataArray(uint length, const char* title, bool print_sum, int log_level, uint indent_level) :
|
||||||
|
_title(title), _length(0), _print_sum(print_sum), _log_level(log_level), _indent_level(indent_level),
|
||||||
|
_has_new_data(true), _thread_work_items(NULL), _enabled(true) {
|
||||||
|
assert(length > 0, "Must have some workers to store data for");
|
||||||
|
_length = length;
|
||||||
|
_data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
T min = _data[0];
|
~WorkerDataArray() {
|
||||||
T max = _data[0];
|
FREE_C_HEAP_ARRAY(T, _data);
|
||||||
T sum = 0;
|
}
|
||||||
|
|
||||||
LineBuffer buf(level);
|
void link_thread_work_items(WorkerDataArray<size_t>* thread_work_items) {
|
||||||
buf.append("[%s:", title);
|
_thread_work_items = thread_work_items;
|
||||||
for (uint i = 0; i < _length; ++i) {
|
}
|
||||||
T val = _data[i];
|
|
||||||
min = MIN2(val, min);
|
WorkerDataArray<size_t>* thread_work_items() { return _thread_work_items; }
|
||||||
max = MAX2(val, max);
|
|
||||||
sum += val;
|
void set(uint worker_i, T value) {
|
||||||
if (G1Log::finest()) {
|
assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
|
||||||
buf.append(" ");
|
assert(_data[worker_i] == WorkerDataArray<T>::uninitialized(), err_msg("Overwriting data for worker %d in %s", worker_i, _title));
|
||||||
buf.append(_print_format, val);
|
_data[worker_i] = value;
|
||||||
|
_has_new_data = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_thread_work_item(uint worker_i, size_t value) {
|
||||||
|
assert(_thread_work_items != NULL, "No sub count");
|
||||||
|
_thread_work_items->set(worker_i, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
T get(uint worker_i) {
|
||||||
|
assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
|
||||||
|
assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data added for worker %d", worker_i));
|
||||||
|
return _data[worker_i];
|
||||||
|
}
|
||||||
|
|
||||||
|
void add(uint worker_i, T value) {
|
||||||
|
assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
|
||||||
|
assert(_data[worker_i] != WorkerDataArray<T>::uninitialized(), err_msg("No data to add to for worker %d", worker_i));
|
||||||
|
_data[worker_i] += value;
|
||||||
|
_has_new_data = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
double average(){
|
||||||
|
calculate_totals();
|
||||||
|
return _average;
|
||||||
|
}
|
||||||
|
|
||||||
|
T sum() {
|
||||||
|
calculate_totals();
|
||||||
|
return _sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
T minimum() {
|
||||||
|
calculate_totals();
|
||||||
|
return _min;
|
||||||
|
}
|
||||||
|
|
||||||
|
T maximum() {
|
||||||
|
calculate_totals();
|
||||||
|
return _max;
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset() PRODUCT_RETURN;
|
||||||
|
void verify() PRODUCT_RETURN;
|
||||||
|
|
||||||
|
void set_enabled(bool enabled) { _enabled = enabled; }
|
||||||
|
|
||||||
|
int log_level() { return _log_level; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void calculate_totals(){
|
||||||
|
if (!_has_new_data) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (G1Log::finest()) {
|
_sum = (T)0;
|
||||||
buf.append_and_print_cr("%s", "");
|
_min = _data[0];
|
||||||
|
_max = _min;
|
||||||
|
for (uint i = 0; i < _length; ++i) {
|
||||||
|
T val = _data[i];
|
||||||
|
_sum += val;
|
||||||
|
_min = MIN2(_min, val);
|
||||||
|
_max = MAX2(_max, val);
|
||||||
|
}
|
||||||
|
_average = (double)_sum / (double)_length;
|
||||||
|
_has_new_data = false;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
double avg = (double)sum / (double)_length;
|
|
||||||
buf.append(" Min: ");
|
|
||||||
buf.append(_print_format, min);
|
|
||||||
buf.append(", Avg: ");
|
|
||||||
buf.append("%.1lf", avg); // Always print average as a double
|
|
||||||
buf.append(", Max: ");
|
|
||||||
buf.append(_print_format, max);
|
|
||||||
buf.append(", Diff: ");
|
|
||||||
buf.append(_print_format, max - min);
|
|
||||||
if (_print_sum) {
|
|
||||||
// for things like the start and end times the sum is not
|
|
||||||
// that relevant
|
|
||||||
buf.append(", Sum: ");
|
|
||||||
buf.append(_print_format, sum);
|
|
||||||
}
|
|
||||||
buf.append_and_print_cr("]");
|
|
||||||
}
|
|
||||||
PRAGMA_DIAG_POP
|
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
|
|
||||||
template <> const int WorkerDataArray<int>::_uninitialized = -1;
|
template <>
|
||||||
template <> const double WorkerDataArray<double>::_uninitialized = -1.0;
|
size_t WorkerDataArray<size_t>::uninitialized() {
|
||||||
template <> const size_t WorkerDataArray<size_t>::_uninitialized = (size_t)-1;
|
return (size_t)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
double WorkerDataArray<double>::uninitialized() {
|
||||||
|
return -1.0;
|
||||||
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void WorkerDataArray<T>::reset() {
|
void WorkerDataArray<T>::reset() {
|
||||||
for (uint i = 0; i < _length; i++) {
|
for (uint i = 0; i < _length; i++) {
|
||||||
_data[i] = (T)_uninitialized;
|
_data[i] = WorkerDataArray<T>::uninitialized();
|
||||||
|
}
|
||||||
|
if (_thread_work_items != NULL) {
|
||||||
|
_thread_work_items->reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void WorkerDataArray<T>::verify() {
|
void WorkerDataArray<T>::verify() {
|
||||||
|
if (!_enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (uint i = 0; i < _length; i++) {
|
for (uint i = 0; i < _length; i++) {
|
||||||
assert(_data[i] != _uninitialized,
|
assert(_data[i] != WorkerDataArray<T>::uninitialized(),
|
||||||
err_msg("Invalid data for worker %u, data: %lf, uninitialized: %lf",
|
err_msg("Invalid data for worker %u in '%s'", i, _title));
|
||||||
i, (double)_data[i], (double)_uninitialized));
|
}
|
||||||
|
if (_thread_work_items != NULL) {
|
||||||
|
_thread_work_items->verify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) :
|
G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) :
|
||||||
_max_gc_threads(max_gc_threads),
|
_max_gc_threads(max_gc_threads)
|
||||||
_last_gc_worker_start_times_ms(_max_gc_threads, "%.1lf", false),
|
|
||||||
_last_ext_root_scan_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_satb_filtering_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_update_rs_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_update_rs_processed_buffers(_max_gc_threads, "%d"),
|
|
||||||
_last_scan_rs_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_strong_code_root_scan_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_obj_copy_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_termination_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_termination_attempts(_max_gc_threads, SIZE_FORMAT),
|
|
||||||
_last_gc_worker_end_times_ms(_max_gc_threads, "%.1lf", false),
|
|
||||||
_last_gc_worker_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_gc_worker_other_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_redirty_logged_cards_time_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_last_redirty_logged_cards_processed_cards(_max_gc_threads, SIZE_FORMAT),
|
|
||||||
_cur_string_dedup_queue_fixup_worker_times_ms(_max_gc_threads, "%.1lf"),
|
|
||||||
_cur_string_dedup_table_fixup_worker_times_ms(_max_gc_threads, "%.1lf")
|
|
||||||
{
|
{
|
||||||
assert(max_gc_threads > 0, "Must have some GC threads");
|
assert(max_gc_threads > 0, "Must have some GC threads");
|
||||||
|
|
||||||
|
_gc_par_phases[GCWorkerStart] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Start (ms)", false, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[ExtRootScan] = new WorkerDataArray<double>(max_gc_threads, "Ext Root Scanning (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
|
||||||
|
// Root scanning phases
|
||||||
|
_gc_par_phases[ThreadRoots] = new WorkerDataArray<double>(max_gc_threads, "Thread Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[StringTableRoots] = new WorkerDataArray<double>(max_gc_threads, "StringTable Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[UniverseRoots] = new WorkerDataArray<double>(max_gc_threads, "Universe Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[JNIRoots] = new WorkerDataArray<double>(max_gc_threads, "JNI Handles Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray<double>(max_gc_threads, "ObjectSynchronizer Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[FlatProfilerRoots] = new WorkerDataArray<double>(max_gc_threads, "FlatProfiler Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[ManagementRoots] = new WorkerDataArray<double>(max_gc_threads, "Management Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray<double>(max_gc_threads, "SystemDictionary Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[CLDGRoots] = new WorkerDataArray<double>(max_gc_threads, "CLDG Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[JVMTIRoots] = new WorkerDataArray<double>(max_gc_threads, "JVMTI Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[CodeCacheRoots] = new WorkerDataArray<double>(max_gc_threads, "CodeCache Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[CMRefRoots] = new WorkerDataArray<double>(max_gc_threads, "CM RefProcessor Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[WaitForStrongCLD] = new WorkerDataArray<double>(max_gc_threads, "Wait For Strong CLD (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[WeakCLDRoots] = new WorkerDataArray<double>(max_gc_threads, "Weak CLD Roots (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[SATBFiltering] = new WorkerDataArray<double>(max_gc_threads, "SATB Filtering (ms)", true, G1Log::LevelFinest, 3);
|
||||||
|
|
||||||
|
_gc_par_phases[UpdateRS] = new WorkerDataArray<double>(max_gc_threads, "Update RS (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[ScanRS] = new WorkerDataArray<double>(max_gc_threads, "Scan RS (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[CodeRoots] = new WorkerDataArray<double>(max_gc_threads, "Code Root Scanning (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[ObjCopy] = new WorkerDataArray<double>(max_gc_threads, "Object Copy (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[Termination] = new WorkerDataArray<double>(max_gc_threads, "Termination (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[GCWorkerTotal] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Total (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[GCWorkerEnd] = new WorkerDataArray<double>(max_gc_threads, "GC Worker End (ms)", false, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[Other] = new WorkerDataArray<double>(max_gc_threads, "GC Worker Other (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
|
||||||
|
_update_rs_processed_buffers = new WorkerDataArray<size_t>(max_gc_threads, "Processed Buffers", true, G1Log::LevelFiner, 3);
|
||||||
|
_gc_par_phases[UpdateRS]->link_thread_work_items(_update_rs_processed_buffers);
|
||||||
|
|
||||||
|
_termination_attempts = new WorkerDataArray<size_t>(max_gc_threads, "Termination Attempts", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[Termination]->link_thread_work_items(_termination_attempts);
|
||||||
|
|
||||||
|
_gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray<double>(max_gc_threads, "Queue Fixup (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
_gc_par_phases[StringDedupTableFixup] = new WorkerDataArray<double>(max_gc_threads, "Table Fixup (ms)", true, G1Log::LevelFiner, 2);
|
||||||
|
|
||||||
|
_gc_par_phases[RedirtyCards] = new WorkerDataArray<double>(max_gc_threads, "Parallel Redirty", true, G1Log::LevelFinest, 3);
|
||||||
|
_redirtied_cards = new WorkerDataArray<size_t>(max_gc_threads, "Redirtied Cards", true, G1Log::LevelFinest, 3);
|
||||||
|
_gc_par_phases[RedirtyCards]->link_thread_work_items(_redirtied_cards);
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) {
|
void G1GCPhaseTimes::note_gc_start(uint active_gc_threads, bool mark_in_progress) {
|
||||||
assert(active_gc_threads > 0, "The number of threads must be > 0");
|
assert(active_gc_threads > 0, "The number of threads must be > 0");
|
||||||
assert(active_gc_threads <= _max_gc_threads, "The number of active threads must be <= the max nubmer of threads");
|
assert(active_gc_threads <= _max_gc_threads, "The number of active threads must be <= the max number of threads");
|
||||||
_active_gc_threads = active_gc_threads;
|
_active_gc_threads = active_gc_threads;
|
||||||
|
|
||||||
_last_gc_worker_start_times_ms.reset();
|
for (int i = 0; i < GCParPhasesSentinel; i++) {
|
||||||
_last_ext_root_scan_times_ms.reset();
|
_gc_par_phases[i]->reset();
|
||||||
_last_satb_filtering_times_ms.reset();
|
}
|
||||||
_last_update_rs_times_ms.reset();
|
|
||||||
_last_update_rs_processed_buffers.reset();
|
|
||||||
_last_scan_rs_times_ms.reset();
|
|
||||||
_last_strong_code_root_scan_times_ms.reset();
|
|
||||||
_last_obj_copy_times_ms.reset();
|
|
||||||
_last_termination_times_ms.reset();
|
|
||||||
_last_termination_attempts.reset();
|
|
||||||
_last_gc_worker_end_times_ms.reset();
|
|
||||||
_last_gc_worker_times_ms.reset();
|
|
||||||
_last_gc_worker_other_times_ms.reset();
|
|
||||||
|
|
||||||
_last_redirty_logged_cards_time_ms.reset();
|
|
||||||
_last_redirty_logged_cards_processed_cards.reset();
|
|
||||||
|
|
||||||
|
_gc_par_phases[StringDedupQueueFixup]->set_enabled(G1StringDedup::is_enabled());
|
||||||
|
_gc_par_phases[StringDedupTableFixup]->set_enabled(G1StringDedup::is_enabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1GCPhaseTimes::note_gc_end() {
|
void G1GCPhaseTimes::note_gc_end() {
|
||||||
_last_gc_worker_start_times_ms.verify();
|
|
||||||
_last_ext_root_scan_times_ms.verify();
|
|
||||||
_last_satb_filtering_times_ms.verify();
|
|
||||||
_last_update_rs_times_ms.verify();
|
|
||||||
_last_update_rs_processed_buffers.verify();
|
|
||||||
_last_scan_rs_times_ms.verify();
|
|
||||||
_last_strong_code_root_scan_times_ms.verify();
|
|
||||||
_last_obj_copy_times_ms.verify();
|
|
||||||
_last_termination_times_ms.verify();
|
|
||||||
_last_termination_attempts.verify();
|
|
||||||
_last_gc_worker_end_times_ms.verify();
|
|
||||||
|
|
||||||
for (uint i = 0; i < _active_gc_threads; i++) {
|
for (uint i = 0; i < _active_gc_threads; i++) {
|
||||||
double worker_time = _last_gc_worker_end_times_ms.get(i) - _last_gc_worker_start_times_ms.get(i);
|
double worker_time = _gc_par_phases[GCWorkerEnd]->get(i) - _gc_par_phases[GCWorkerStart]->get(i);
|
||||||
_last_gc_worker_times_ms.set(i, worker_time);
|
record_time_secs(GCWorkerTotal, i , worker_time);
|
||||||
|
|
||||||
double worker_known_time = _last_ext_root_scan_times_ms.get(i) +
|
double worker_known_time =
|
||||||
_last_satb_filtering_times_ms.get(i) +
|
_gc_par_phases[ExtRootScan]->get(i) +
|
||||||
_last_update_rs_times_ms.get(i) +
|
_gc_par_phases[SATBFiltering]->get(i) +
|
||||||
_last_scan_rs_times_ms.get(i) +
|
_gc_par_phases[UpdateRS]->get(i) +
|
||||||
_last_strong_code_root_scan_times_ms.get(i) +
|
_gc_par_phases[ScanRS]->get(i) +
|
||||||
_last_obj_copy_times_ms.get(i) +
|
_gc_par_phases[CodeRoots]->get(i) +
|
||||||
_last_termination_times_ms.get(i);
|
_gc_par_phases[ObjCopy]->get(i) +
|
||||||
|
_gc_par_phases[Termination]->get(i);
|
||||||
|
|
||||||
double worker_other_time = worker_time - worker_known_time;
|
record_time_secs(Other, i, worker_time - worker_known_time);
|
||||||
_last_gc_worker_other_times_ms.set(i, worker_other_time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_last_gc_worker_times_ms.verify();
|
for (int i = 0; i < GCParPhasesSentinel; i++) {
|
||||||
_last_gc_worker_other_times_ms.verify();
|
_gc_par_phases[i]->verify();
|
||||||
|
}
|
||||||
_last_redirty_logged_cards_time_ms.verify();
|
|
||||||
_last_redirty_logged_cards_processed_cards.verify();
|
|
||||||
}
|
|
||||||
|
|
||||||
void G1GCPhaseTimes::note_string_dedup_fixup_start() {
|
|
||||||
_cur_string_dedup_queue_fixup_worker_times_ms.reset();
|
|
||||||
_cur_string_dedup_table_fixup_worker_times_ms.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
void G1GCPhaseTimes::note_string_dedup_fixup_end() {
|
|
||||||
_cur_string_dedup_queue_fixup_worker_times_ms.verify();
|
|
||||||
_cur_string_dedup_table_fixup_worker_times_ms.verify();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1GCPhaseTimes::print_stats(int level, const char* str, double value) {
|
void G1GCPhaseTimes::print_stats(int level, const char* str, double value) {
|
||||||
@ -288,35 +362,172 @@ double G1GCPhaseTimes::accounted_time_ms() {
|
|||||||
return misc_time_ms;
|
return misc_time_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// record the time a phase took in seconds
|
||||||
|
void G1GCPhaseTimes::record_time_secs(GCParPhases phase, uint worker_i, double secs) {
|
||||||
|
_gc_par_phases[phase]->set(worker_i, secs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// add a number of seconds to a phase
|
||||||
|
void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_i, double secs) {
|
||||||
|
_gc_par_phases[phase]->add(worker_i, secs);
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1GCPhaseTimes::record_thread_work_item(GCParPhases phase, uint worker_i, size_t count) {
|
||||||
|
_gc_par_phases[phase]->set_thread_work_item(worker_i, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
// return the average time for a phase in milliseconds
|
||||||
|
double G1GCPhaseTimes::average_time_ms(GCParPhases phase) {
|
||||||
|
return _gc_par_phases[phase]->average() * 1000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double G1GCPhaseTimes::get_time_ms(GCParPhases phase, uint worker_i) {
|
||||||
|
return _gc_par_phases[phase]->get(worker_i) * 1000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double G1GCPhaseTimes::sum_time_ms(GCParPhases phase) {
|
||||||
|
return _gc_par_phases[phase]->sum() * 1000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double G1GCPhaseTimes::min_time_ms(GCParPhases phase) {
|
||||||
|
return _gc_par_phases[phase]->minimum() * 1000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double G1GCPhaseTimes::max_time_ms(GCParPhases phase) {
|
||||||
|
return _gc_par_phases[phase]->maximum() * 1000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t G1GCPhaseTimes::get_thread_work_item(GCParPhases phase, uint worker_i) {
|
||||||
|
assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
|
||||||
|
return _gc_par_phases[phase]->thread_work_items()->get(worker_i);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t G1GCPhaseTimes::sum_thread_work_items(GCParPhases phase) {
|
||||||
|
assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
|
||||||
|
return _gc_par_phases[phase]->thread_work_items()->sum();
|
||||||
|
}
|
||||||
|
|
||||||
|
double G1GCPhaseTimes::average_thread_work_items(GCParPhases phase) {
|
||||||
|
assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
|
||||||
|
return _gc_par_phases[phase]->thread_work_items()->average();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t G1GCPhaseTimes::min_thread_work_items(GCParPhases phase) {
|
||||||
|
assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
|
||||||
|
return _gc_par_phases[phase]->thread_work_items()->minimum();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t G1GCPhaseTimes::max_thread_work_items(GCParPhases phase) {
|
||||||
|
assert(_gc_par_phases[phase]->thread_work_items() != NULL, "No sub count");
|
||||||
|
return _gc_par_phases[phase]->thread_work_items()->maximum();
|
||||||
|
}
|
||||||
|
|
||||||
|
class G1GCParPhasePrinter : public StackObj {
|
||||||
|
G1GCPhaseTimes* _phase_times;
|
||||||
|
public:
|
||||||
|
G1GCParPhasePrinter(G1GCPhaseTimes* phase_times) : _phase_times(phase_times) {}
|
||||||
|
|
||||||
|
void print(G1GCPhaseTimes::GCParPhases phase_id) {
|
||||||
|
WorkerDataArray<double>* phase = _phase_times->_gc_par_phases[phase_id];
|
||||||
|
|
||||||
|
if (phase->_log_level > G1Log::level() || !phase->_enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (phase->_length == 1) {
|
||||||
|
print_single_length(phase_id, phase);
|
||||||
|
} else {
|
||||||
|
print_multi_length(phase_id, phase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void print_single_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
|
||||||
|
// No need for min, max, average and sum for only one worker
|
||||||
|
LineBuffer buf(phase->_indent_level);
|
||||||
|
buf.append_and_print_cr("[%s: %.1lf]", phase->_title, _phase_times->get_time_ms(phase_id, 0));
|
||||||
|
|
||||||
|
if (phase->_thread_work_items != NULL) {
|
||||||
|
LineBuffer buf2(phase->_thread_work_items->_indent_level);
|
||||||
|
buf2.append_and_print_cr("[%s: "SIZE_FORMAT"]", phase->_thread_work_items->_title, _phase_times->sum_thread_work_items(phase_id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_time_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
|
||||||
|
for (uint i = 0; i < phase->_length; ++i) {
|
||||||
|
buf.append(" %.1lf", _phase_times->get_time_ms(phase_id, i));
|
||||||
|
}
|
||||||
|
buf.print_cr();
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_count_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<size_t>* thread_work_items) {
|
||||||
|
for (uint i = 0; i < thread_work_items->_length; ++i) {
|
||||||
|
buf.append(" " SIZE_FORMAT, _phase_times->get_thread_work_item(phase_id, i));
|
||||||
|
}
|
||||||
|
buf.print_cr();
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_thread_work_items(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<size_t>* thread_work_items) {
|
||||||
|
LineBuffer buf(thread_work_items->_indent_level);
|
||||||
|
buf.append("[%s:", thread_work_items->_title);
|
||||||
|
|
||||||
|
if (G1Log::finest()) {
|
||||||
|
print_count_values(buf, phase_id, thread_work_items);
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(thread_work_items->_print_sum, err_msg("%s does not have print sum true even though it is a count", thread_work_items->_title));
|
||||||
|
|
||||||
|
buf.append_and_print_cr(" Min: " SIZE_FORMAT ", Avg: %.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT "]",
|
||||||
|
_phase_times->min_thread_work_items(phase_id), _phase_times->average_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id),
|
||||||
|
_phase_times->max_thread_work_items(phase_id) - _phase_times->min_thread_work_items(phase_id), _phase_times->sum_thread_work_items(phase_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_multi_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray<double>* phase) {
|
||||||
|
LineBuffer buf(phase->_indent_level);
|
||||||
|
buf.append("[%s:", phase->_title);
|
||||||
|
|
||||||
|
if (G1Log::finest()) {
|
||||||
|
print_time_values(buf, phase_id, phase);
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.append(" Min: %.1lf, Avg: %.1lf, Max: %.1lf, Diff: %.1lf",
|
||||||
|
_phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id),
|
||||||
|
_phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id));
|
||||||
|
|
||||||
|
if (phase->_print_sum) {
|
||||||
|
// for things like the start and end times the sum is not
|
||||||
|
// that relevant
|
||||||
|
buf.append(", Sum: %.1lf", _phase_times->sum_time_ms(phase_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.append_and_print_cr("]");
|
||||||
|
|
||||||
|
if (phase->_thread_work_items != NULL) {
|
||||||
|
print_thread_work_items(phase_id, phase->_thread_work_items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void G1GCPhaseTimes::print(double pause_time_sec) {
|
void G1GCPhaseTimes::print(double pause_time_sec) {
|
||||||
|
G1GCParPhasePrinter par_phase_printer(this);
|
||||||
|
|
||||||
if (_root_region_scan_wait_time_ms > 0.0) {
|
if (_root_region_scan_wait_time_ms > 0.0) {
|
||||||
print_stats(1, "Root Region Scan Waiting", _root_region_scan_wait_time_ms);
|
print_stats(1, "Root Region Scan Waiting", _root_region_scan_wait_time_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_stats(1, "Parallel Time", _cur_collection_par_time_ms, _active_gc_threads);
|
print_stats(1, "Parallel Time", _cur_collection_par_time_ms, _active_gc_threads);
|
||||||
_last_gc_worker_start_times_ms.print(2, "GC Worker Start (ms)");
|
for (int i = 0; i <= GCMainParPhasesLast; i++) {
|
||||||
_last_ext_root_scan_times_ms.print(2, "Ext Root Scanning (ms)");
|
par_phase_printer.print((GCParPhases) i);
|
||||||
if (_last_satb_filtering_times_ms.sum() > 0.0) {
|
|
||||||
_last_satb_filtering_times_ms.print(2, "SATB Filtering (ms)");
|
|
||||||
}
|
}
|
||||||
_last_update_rs_times_ms.print(2, "Update RS (ms)");
|
|
||||||
_last_update_rs_processed_buffers.print(3, "Processed Buffers");
|
|
||||||
_last_scan_rs_times_ms.print(2, "Scan RS (ms)");
|
|
||||||
_last_strong_code_root_scan_times_ms.print(2, "Code Root Scanning (ms)");
|
|
||||||
_last_obj_copy_times_ms.print(2, "Object Copy (ms)");
|
|
||||||
_last_termination_times_ms.print(2, "Termination (ms)");
|
|
||||||
if (G1Log::finest()) {
|
|
||||||
_last_termination_attempts.print(3, "Termination Attempts");
|
|
||||||
}
|
|
||||||
_last_gc_worker_other_times_ms.print(2, "GC Worker Other (ms)");
|
|
||||||
_last_gc_worker_times_ms.print(2, "GC Worker Total (ms)");
|
|
||||||
_last_gc_worker_end_times_ms.print(2, "GC Worker End (ms)");
|
|
||||||
|
|
||||||
print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms);
|
print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms);
|
||||||
print_stats(1, "Code Root Purge", _cur_strong_code_root_purge_time_ms);
|
print_stats(1, "Code Root Purge", _cur_strong_code_root_purge_time_ms);
|
||||||
if (G1StringDedup::is_enabled()) {
|
if (G1StringDedup::is_enabled()) {
|
||||||
print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads);
|
print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads);
|
||||||
_cur_string_dedup_queue_fixup_worker_times_ms.print(2, "Queue Fixup (ms)");
|
for (int i = StringDedupPhasesFirst; i <= StringDedupPhasesLast; i++) {
|
||||||
_cur_string_dedup_table_fixup_worker_times_ms.print(2, "Table Fixup (ms)");
|
par_phase_printer.print((GCParPhases) i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print_stats(1, "Clear CT", _cur_clear_ct_time_ms);
|
print_stats(1, "Clear CT", _cur_clear_ct_time_ms);
|
||||||
double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms();
|
double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms();
|
||||||
@ -340,10 +551,7 @@ void G1GCPhaseTimes::print(double pause_time_sec) {
|
|||||||
print_stats(2, "Ref Proc", _cur_ref_proc_time_ms);
|
print_stats(2, "Ref Proc", _cur_ref_proc_time_ms);
|
||||||
print_stats(2, "Ref Enq", _cur_ref_enq_time_ms);
|
print_stats(2, "Ref Enq", _cur_ref_enq_time_ms);
|
||||||
print_stats(2, "Redirty Cards", _recorded_redirty_logged_cards_time_ms);
|
print_stats(2, "Redirty Cards", _recorded_redirty_logged_cards_time_ms);
|
||||||
if (G1Log::finest()) {
|
par_phase_printer.print(RedirtyCards);
|
||||||
_last_redirty_logged_cards_time_ms.print(3, "Parallel Redirty");
|
|
||||||
_last_redirty_logged_cards_processed_cards.print(3, "Redirtied Cards");
|
|
||||||
}
|
|
||||||
if (G1EagerReclaimHumongousObjects) {
|
if (G1EagerReclaimHumongousObjects) {
|
||||||
print_stats(2, "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms);
|
print_stats(2, "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms);
|
||||||
if (G1Log::finest()) {
|
if (G1Log::finest()) {
|
||||||
@ -366,3 +574,17 @@ void G1GCPhaseTimes::print(double pause_time_sec) {
|
|||||||
print_stats(2, "Verify After", _cur_verify_after_time_ms);
|
print_stats(2, "Verify After", _cur_verify_after_time_ms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
|
||||||
|
_phase_times(phase_times), _phase(phase), _worker_id(worker_id) {
|
||||||
|
if (_phase_times != NULL) {
|
||||||
|
_start_time = os::elapsedTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() {
|
||||||
|
if (_phase_times != NULL) {
|
||||||
|
_phase_times->record_time_secs(_phase, _worker_id, os::elapsedTime() - _start_time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -26,106 +26,60 @@
|
|||||||
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
|
||||||
|
|
||||||
#include "memory/allocation.hpp"
|
#include "memory/allocation.hpp"
|
||||||
#include "gc_interface/gcCause.hpp"
|
|
||||||
|
|
||||||
template <class T>
|
class LineBuffer;
|
||||||
class WorkerDataArray : public CHeapObj<mtGC> {
|
|
||||||
T* _data;
|
|
||||||
uint _length;
|
|
||||||
const char* _print_format;
|
|
||||||
bool _print_sum;
|
|
||||||
|
|
||||||
NOT_PRODUCT(static const T _uninitialized;)
|
template <class T> class WorkerDataArray;
|
||||||
|
|
||||||
// We are caching the sum and average to only have to calculate them once.
|
|
||||||
// This is not done in an MT-safe way. It is intended to allow single
|
|
||||||
// threaded code to call sum() and average() multiple times in any order
|
|
||||||
// without having to worry about the cost.
|
|
||||||
bool _has_new_data;
|
|
||||||
T _sum;
|
|
||||||
double _average;
|
|
||||||
|
|
||||||
public:
|
|
||||||
WorkerDataArray(uint length, const char* print_format, bool print_sum = true) :
|
|
||||||
_length(length), _print_format(print_format), _print_sum(print_sum), _has_new_data(true) {
|
|
||||||
assert(length > 0, "Must have some workers to store data for");
|
|
||||||
_data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
|
|
||||||
}
|
|
||||||
|
|
||||||
~WorkerDataArray() {
|
|
||||||
FREE_C_HEAP_ARRAY(T, _data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set(uint worker_i, T value) {
|
|
||||||
assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
|
|
||||||
assert(_data[worker_i] == (T)-1, err_msg("Overwriting data for worker %d", worker_i));
|
|
||||||
_data[worker_i] = value;
|
|
||||||
_has_new_data = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
T get(uint worker_i) {
|
|
||||||
assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
|
|
||||||
assert(_data[worker_i] != (T)-1, err_msg("No data to add to for worker %d", worker_i));
|
|
||||||
return _data[worker_i];
|
|
||||||
}
|
|
||||||
|
|
||||||
void add(uint worker_i, T value) {
|
|
||||||
assert(worker_i < _length, err_msg("Worker %d is greater than max: %d", worker_i, _length));
|
|
||||||
assert(_data[worker_i] != (T)-1, err_msg("No data to add to for worker %d", worker_i));
|
|
||||||
_data[worker_i] += value;
|
|
||||||
_has_new_data = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
double average(){
|
|
||||||
if (_has_new_data) {
|
|
||||||
calculate_totals();
|
|
||||||
}
|
|
||||||
return _average;
|
|
||||||
}
|
|
||||||
|
|
||||||
T sum() {
|
|
||||||
if (_has_new_data) {
|
|
||||||
calculate_totals();
|
|
||||||
}
|
|
||||||
return _sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
void print(int level, const char* title);
|
|
||||||
|
|
||||||
void reset() PRODUCT_RETURN;
|
|
||||||
void verify() PRODUCT_RETURN;
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
void calculate_totals(){
|
|
||||||
_sum = (T)0;
|
|
||||||
for (uint i = 0; i < _length; ++i) {
|
|
||||||
_sum += _data[i];
|
|
||||||
}
|
|
||||||
_average = (double)_sum / (double)_length;
|
|
||||||
_has_new_data = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
||||||
|
friend class G1GCParPhasePrinter;
|
||||||
|
|
||||||
private:
|
|
||||||
uint _active_gc_threads;
|
uint _active_gc_threads;
|
||||||
uint _max_gc_threads;
|
uint _max_gc_threads;
|
||||||
|
|
||||||
WorkerDataArray<double> _last_gc_worker_start_times_ms;
|
public:
|
||||||
WorkerDataArray<double> _last_ext_root_scan_times_ms;
|
enum GCParPhases {
|
||||||
WorkerDataArray<double> _last_satb_filtering_times_ms;
|
GCWorkerStart,
|
||||||
WorkerDataArray<double> _last_update_rs_times_ms;
|
ExtRootScan,
|
||||||
WorkerDataArray<int> _last_update_rs_processed_buffers;
|
ThreadRoots,
|
||||||
WorkerDataArray<double> _last_scan_rs_times_ms;
|
StringTableRoots,
|
||||||
WorkerDataArray<double> _last_strong_code_root_scan_times_ms;
|
UniverseRoots,
|
||||||
WorkerDataArray<double> _last_obj_copy_times_ms;
|
JNIRoots,
|
||||||
WorkerDataArray<double> _last_termination_times_ms;
|
ObjectSynchronizerRoots,
|
||||||
WorkerDataArray<size_t> _last_termination_attempts;
|
FlatProfilerRoots,
|
||||||
WorkerDataArray<double> _last_gc_worker_end_times_ms;
|
ManagementRoots,
|
||||||
WorkerDataArray<double> _last_gc_worker_times_ms;
|
SystemDictionaryRoots,
|
||||||
WorkerDataArray<double> _last_gc_worker_other_times_ms;
|
CLDGRoots,
|
||||||
|
JVMTIRoots,
|
||||||
|
CodeCacheRoots,
|
||||||
|
CMRefRoots,
|
||||||
|
WaitForStrongCLD,
|
||||||
|
WeakCLDRoots,
|
||||||
|
SATBFiltering,
|
||||||
|
UpdateRS,
|
||||||
|
ScanRS,
|
||||||
|
CodeRoots,
|
||||||
|
ObjCopy,
|
||||||
|
Termination,
|
||||||
|
Other,
|
||||||
|
GCWorkerTotal,
|
||||||
|
GCWorkerEnd,
|
||||||
|
StringDedupQueueFixup,
|
||||||
|
StringDedupTableFixup,
|
||||||
|
RedirtyCards,
|
||||||
|
GCParPhasesSentinel
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Markers for grouping the phases in the GCPhases enum above
|
||||||
|
static const int GCMainParPhasesLast = GCWorkerEnd;
|
||||||
|
static const int StringDedupPhasesFirst = StringDedupQueueFixup;
|
||||||
|
static const int StringDedupPhasesLast = StringDedupTableFixup;
|
||||||
|
|
||||||
|
WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
|
||||||
|
WorkerDataArray<size_t>* _update_rs_processed_buffers;
|
||||||
|
WorkerDataArray<size_t>* _termination_attempts;
|
||||||
|
WorkerDataArray<size_t>* _redirtied_cards;
|
||||||
|
|
||||||
double _cur_collection_par_time_ms;
|
double _cur_collection_par_time_ms;
|
||||||
double _cur_collection_code_root_fixup_time_ms;
|
double _cur_collection_code_root_fixup_time_ms;
|
||||||
@ -135,9 +89,7 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
|||||||
double _cur_evac_fail_restore_remsets;
|
double _cur_evac_fail_restore_remsets;
|
||||||
double _cur_evac_fail_remove_self_forwards;
|
double _cur_evac_fail_remove_self_forwards;
|
||||||
|
|
||||||
double _cur_string_dedup_fixup_time_ms;
|
double _cur_string_dedup_fixup_time_ms;
|
||||||
WorkerDataArray<double> _cur_string_dedup_queue_fixup_worker_times_ms;
|
|
||||||
WorkerDataArray<double> _cur_string_dedup_table_fixup_worker_times_ms;
|
|
||||||
|
|
||||||
double _cur_clear_ct_time_ms;
|
double _cur_clear_ct_time_ms;
|
||||||
double _cur_ref_proc_time_ms;
|
double _cur_ref_proc_time_ms;
|
||||||
@ -149,8 +101,6 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
|||||||
double _recorded_young_cset_choice_time_ms;
|
double _recorded_young_cset_choice_time_ms;
|
||||||
double _recorded_non_young_cset_choice_time_ms;
|
double _recorded_non_young_cset_choice_time_ms;
|
||||||
|
|
||||||
WorkerDataArray<double> _last_redirty_logged_cards_time_ms;
|
|
||||||
WorkerDataArray<size_t> _last_redirty_logged_cards_processed_cards;
|
|
||||||
double _recorded_redirty_logged_cards_time_ms;
|
double _recorded_redirty_logged_cards_time_ms;
|
||||||
|
|
||||||
double _recorded_young_free_cset_time_ms;
|
double _recorded_young_free_cset_time_ms;
|
||||||
@ -172,54 +122,34 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
G1GCPhaseTimes(uint max_gc_threads);
|
G1GCPhaseTimes(uint max_gc_threads);
|
||||||
void note_gc_start(uint active_gc_threads);
|
void note_gc_start(uint active_gc_threads, bool mark_in_progress);
|
||||||
void note_gc_end();
|
void note_gc_end();
|
||||||
void print(double pause_time_sec);
|
void print(double pause_time_sec);
|
||||||
|
|
||||||
void record_gc_worker_start_time(uint worker_i, double ms) {
|
// record the time a phase took in seconds
|
||||||
_last_gc_worker_start_times_ms.set(worker_i, ms);
|
void record_time_secs(GCParPhases phase, uint worker_i, double secs);
|
||||||
}
|
|
||||||
|
|
||||||
void record_ext_root_scan_time(uint worker_i, double ms) {
|
// add a number of seconds to a phase
|
||||||
_last_ext_root_scan_times_ms.set(worker_i, ms);
|
void add_time_secs(GCParPhases phase, uint worker_i, double secs);
|
||||||
}
|
|
||||||
|
|
||||||
void record_satb_filtering_time(uint worker_i, double ms) {
|
void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count);
|
||||||
_last_satb_filtering_times_ms.set(worker_i, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_update_rs_time(uint worker_i, double ms) {
|
// return the average time for a phase in milliseconds
|
||||||
_last_update_rs_times_ms.set(worker_i, ms);
|
double average_time_ms(GCParPhases phase);
|
||||||
}
|
|
||||||
|
|
||||||
void record_update_rs_processed_buffers(uint worker_i, int processed_buffers) {
|
size_t sum_thread_work_items(GCParPhases phase);
|
||||||
_last_update_rs_processed_buffers.set(worker_i, processed_buffers);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_scan_rs_time(uint worker_i, double ms) {
|
private:
|
||||||
_last_scan_rs_times_ms.set(worker_i, ms);
|
double get_time_ms(GCParPhases phase, uint worker_i);
|
||||||
}
|
double sum_time_ms(GCParPhases phase);
|
||||||
|
double min_time_ms(GCParPhases phase);
|
||||||
|
double max_time_ms(GCParPhases phase);
|
||||||
|
size_t get_thread_work_item(GCParPhases phase, uint worker_i);
|
||||||
|
double average_thread_work_items(GCParPhases phase);
|
||||||
|
size_t min_thread_work_items(GCParPhases phase);
|
||||||
|
size_t max_thread_work_items(GCParPhases phase);
|
||||||
|
|
||||||
void record_strong_code_root_scan_time(uint worker_i, double ms) {
|
public:
|
||||||
_last_strong_code_root_scan_times_ms.set(worker_i, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_obj_copy_time(uint worker_i, double ms) {
|
|
||||||
_last_obj_copy_times_ms.set(worker_i, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void add_obj_copy_time(uint worker_i, double ms) {
|
|
||||||
_last_obj_copy_times_ms.add(worker_i, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_termination(uint worker_i, double ms, size_t attempts) {
|
|
||||||
_last_termination_times_ms.set(worker_i, ms);
|
|
||||||
_last_termination_attempts.set(worker_i, attempts);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_gc_worker_end_time(uint worker_i, double ms) {
|
|
||||||
_last_gc_worker_end_times_ms.set(worker_i, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_clear_ct_time(double ms) {
|
void record_clear_ct_time(double ms) {
|
||||||
_cur_clear_ct_time_ms = ms;
|
_cur_clear_ct_time_ms = ms;
|
||||||
@ -249,21 +179,10 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
|||||||
_cur_evac_fail_remove_self_forwards = ms;
|
_cur_evac_fail_remove_self_forwards = ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
void note_string_dedup_fixup_start();
|
|
||||||
void note_string_dedup_fixup_end();
|
|
||||||
|
|
||||||
void record_string_dedup_fixup_time(double ms) {
|
void record_string_dedup_fixup_time(double ms) {
|
||||||
_cur_string_dedup_fixup_time_ms = ms;
|
_cur_string_dedup_fixup_time_ms = ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
void record_string_dedup_queue_fixup_worker_time(uint worker_id, double ms) {
|
|
||||||
_cur_string_dedup_queue_fixup_worker_times_ms.set(worker_id, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_string_dedup_table_fixup_worker_time(uint worker_id, double ms) {
|
|
||||||
_cur_string_dedup_table_fixup_worker_times_ms.set(worker_id, ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_ref_proc_time(double ms) {
|
void record_ref_proc_time(double ms) {
|
||||||
_cur_ref_proc_time_ms = ms;
|
_cur_ref_proc_time_ms = ms;
|
||||||
}
|
}
|
||||||
@ -303,14 +222,6 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
|||||||
_recorded_non_young_cset_choice_time_ms = time_ms;
|
_recorded_non_young_cset_choice_time_ms = time_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
void record_redirty_logged_cards_time_ms(uint worker_i, double time_ms) {
|
|
||||||
_last_redirty_logged_cards_time_ms.set(worker_i, time_ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_redirty_logged_cards_processed_cards(uint worker_i, size_t processed_buffers) {
|
|
||||||
_last_redirty_logged_cards_processed_cards.set(worker_i, processed_buffers);
|
|
||||||
}
|
|
||||||
|
|
||||||
void record_redirty_logged_cards_time_ms(double time_ms) {
|
void record_redirty_logged_cards_time_ms(double time_ms) {
|
||||||
_recorded_redirty_logged_cards_time_ms = time_ms;
|
_recorded_redirty_logged_cards_time_ms = time_ms;
|
||||||
}
|
}
|
||||||
@ -364,38 +275,16 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
|||||||
double fast_reclaim_humongous_time_ms() {
|
double fast_reclaim_humongous_time_ms() {
|
||||||
return _cur_fast_reclaim_humongous_time_ms;
|
return _cur_fast_reclaim_humongous_time_ms;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
double average_last_update_rs_time() {
|
class G1GCParPhaseTimesTracker : public StackObj {
|
||||||
return _last_update_rs_times_ms.average();
|
double _start_time;
|
||||||
}
|
G1GCPhaseTimes::GCParPhases _phase;
|
||||||
|
G1GCPhaseTimes* _phase_times;
|
||||||
int sum_last_update_rs_processed_buffers() {
|
uint _worker_id;
|
||||||
return _last_update_rs_processed_buffers.sum();
|
public:
|
||||||
}
|
G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
|
||||||
|
~G1GCParPhaseTimesTracker();
|
||||||
double average_last_scan_rs_time(){
|
|
||||||
return _last_scan_rs_times_ms.average();
|
|
||||||
}
|
|
||||||
|
|
||||||
double average_last_strong_code_root_scan_time(){
|
|
||||||
return _last_strong_code_root_scan_times_ms.average();
|
|
||||||
}
|
|
||||||
|
|
||||||
double average_last_obj_copy_time() {
|
|
||||||
return _last_obj_copy_times_ms.average();
|
|
||||||
}
|
|
||||||
|
|
||||||
double average_last_termination_time() {
|
|
||||||
return _last_termination_times_ms.average();
|
|
||||||
}
|
|
||||||
|
|
||||||
double average_last_ext_root_scan_time() {
|
|
||||||
return _last_ext_root_scan_times_ms.average();
|
|
||||||
}
|
|
||||||
|
|
||||||
double average_last_satb_filtering_times_ms() {
|
|
||||||
return _last_satb_filtering_times_ms.average();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
|
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1GCPHASETIMESLOG_HPP
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "memory/allocation.hpp"
|
#include "memory/allocation.hpp"
|
||||||
|
|
||||||
class G1Log : public AllStatic {
|
class G1Log : public AllStatic {
|
||||||
|
public:
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LevelNone,
|
LevelNone,
|
||||||
LevelFine,
|
LevelFine,
|
||||||
@ -35,6 +36,7 @@ class G1Log : public AllStatic {
|
|||||||
LevelFinest
|
LevelFinest
|
||||||
} LogLevel;
|
} LogLevel;
|
||||||
|
|
||||||
|
private:
|
||||||
static LogLevel _level;
|
static LogLevel _level;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -50,6 +52,10 @@ class G1Log : public AllStatic {
|
|||||||
return _level == LevelFinest;
|
return _level == LevelFinest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LogLevel level() {
|
||||||
|
return _level;
|
||||||
|
}
|
||||||
|
|
||||||
static void init();
|
static void init();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "code/icBuffer.hpp"
|
#include "code/icBuffer.hpp"
|
||||||
#include "gc_implementation/g1/g1Log.hpp"
|
#include "gc_implementation/g1/g1Log.hpp"
|
||||||
#include "gc_implementation/g1/g1MarkSweep.hpp"
|
#include "gc_implementation/g1/g1MarkSweep.hpp"
|
||||||
|
#include "gc_implementation/g1/g1RootProcessor.hpp"
|
||||||
#include "gc_implementation/g1/g1StringDedup.hpp"
|
#include "gc_implementation/g1/g1StringDedup.hpp"
|
||||||
#include "gc_implementation/shared/gcHeapSummary.hpp"
|
#include "gc_implementation/shared/gcHeapSummary.hpp"
|
||||||
#include "gc_implementation/shared/gcTimer.hpp"
|
#include "gc_implementation/shared/gcTimer.hpp"
|
||||||
@ -125,21 +126,22 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
|
|||||||
GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
|
GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
|
||||||
GenMarkSweep::trace(" 1");
|
GenMarkSweep::trace(" 1");
|
||||||
|
|
||||||
SharedHeap* sh = SharedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
|
|
||||||
// Need cleared claim bits for the roots processing
|
// Need cleared claim bits for the roots processing
|
||||||
ClassLoaderDataGraph::clear_claimed_marks();
|
ClassLoaderDataGraph::clear_claimed_marks();
|
||||||
|
|
||||||
MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
|
MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
|
||||||
sh->process_strong_roots(true, // activate StrongRootsScope
|
{
|
||||||
SharedHeap::SO_None,
|
G1RootProcessor root_processor(g1h);
|
||||||
&GenMarkSweep::follow_root_closure,
|
root_processor.process_strong_roots(&GenMarkSweep::follow_root_closure,
|
||||||
&GenMarkSweep::follow_cld_closure,
|
&GenMarkSweep::follow_cld_closure,
|
||||||
&follow_code_closure);
|
&follow_code_closure);
|
||||||
|
}
|
||||||
|
|
||||||
// Process reference objects found during marking
|
// Process reference objects found during marking
|
||||||
ReferenceProcessor* rp = GenMarkSweep::ref_processor();
|
ReferenceProcessor* rp = GenMarkSweep::ref_processor();
|
||||||
assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Sanity");
|
assert(rp == g1h->ref_processor_stw(), "Sanity");
|
||||||
|
|
||||||
rp->setup_policy(clear_all_softrefs);
|
rp->setup_policy(clear_all_softrefs);
|
||||||
const ReferenceProcessorStats& stats =
|
const ReferenceProcessorStats& stats =
|
||||||
@ -225,6 +227,12 @@ class G1AdjustPointersClosure: public HeapRegionClosure {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class G1AlwaysTrueClosure: public BoolObjectClosure {
|
||||||
|
public:
|
||||||
|
bool do_object_b(oop p) { return true; }
|
||||||
|
};
|
||||||
|
static G1AlwaysTrueClosure always_true;
|
||||||
|
|
||||||
void G1MarkSweep::mark_sweep_phase3() {
|
void G1MarkSweep::mark_sweep_phase3() {
|
||||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
|
|
||||||
@ -232,24 +240,23 @@ void G1MarkSweep::mark_sweep_phase3() {
|
|||||||
GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
|
GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
|
||||||
GenMarkSweep::trace("3");
|
GenMarkSweep::trace("3");
|
||||||
|
|
||||||
SharedHeap* sh = SharedHeap::heap();
|
|
||||||
|
|
||||||
// Need cleared claim bits for the roots processing
|
// Need cleared claim bits for the roots processing
|
||||||
ClassLoaderDataGraph::clear_claimed_marks();
|
ClassLoaderDataGraph::clear_claimed_marks();
|
||||||
|
|
||||||
CodeBlobToOopClosure adjust_code_closure(&GenMarkSweep::adjust_pointer_closure, CodeBlobToOopClosure::FixRelocations);
|
CodeBlobToOopClosure adjust_code_closure(&GenMarkSweep::adjust_pointer_closure, CodeBlobToOopClosure::FixRelocations);
|
||||||
sh->process_all_roots(true, // activate StrongRootsScope
|
{
|
||||||
SharedHeap::SO_AllCodeCache,
|
G1RootProcessor root_processor(g1h);
|
||||||
&GenMarkSweep::adjust_pointer_closure,
|
root_processor.process_all_roots(&GenMarkSweep::adjust_pointer_closure,
|
||||||
&GenMarkSweep::adjust_cld_closure,
|
&GenMarkSweep::adjust_cld_closure,
|
||||||
&adjust_code_closure);
|
&adjust_code_closure);
|
||||||
|
}
|
||||||
|
|
||||||
assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
|
assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
|
||||||
g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
|
g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
|
||||||
|
|
||||||
// Now adjust pointers in remaining weak roots. (All of which should
|
// Now adjust pointers in remaining weak roots. (All of which should
|
||||||
// have been cleared if they pointed to non-surviving objects.)
|
// have been cleared if they pointed to non-surviving objects.)
|
||||||
sh->process_weak_roots(&GenMarkSweep::adjust_pointer_closure);
|
JNIHandles::weak_oops_do(&always_true, &GenMarkSweep::adjust_pointer_closure);
|
||||||
|
|
||||||
if (G1StringDedup::is_enabled()) {
|
if (G1StringDedup::is_enabled()) {
|
||||||
G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
|
G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
|
||||||
|
@ -109,6 +109,18 @@ protected:
|
|||||||
template <class T> void do_klass_barrier(T* p, oop new_obj);
|
template <class T> void do_klass_barrier(T* p, oop new_obj);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum G1Barrier {
|
||||||
|
G1BarrierNone,
|
||||||
|
G1BarrierEvac,
|
||||||
|
G1BarrierKlass
|
||||||
|
};
|
||||||
|
|
||||||
|
enum G1Mark {
|
||||||
|
G1MarkNone,
|
||||||
|
G1MarkFromRoot,
|
||||||
|
G1MarkPromotedFromRoot
|
||||||
|
};
|
||||||
|
|
||||||
template <G1Barrier barrier, G1Mark do_mark_object>
|
template <G1Barrier barrier, G1Mark do_mark_object>
|
||||||
class G1ParCopyClosure : public G1ParCopyHelper {
|
class G1ParCopyClosure : public G1ParCopyHelper {
|
||||||
private:
|
private:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -226,6 +226,8 @@ oop G1ParScanThreadState::copy_to_survivor_space(InCSetState const state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(obj_ptr != NULL, "when we get here, allocation should have succeeded");
|
assert(obj_ptr != NULL, "when we get here, allocation should have succeeded");
|
||||||
|
assert(_g1h->is_in_reserved(obj_ptr), "Allocated memory should be in the heap");
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
// Should this evacuation fail?
|
// Should this evacuation fail?
|
||||||
if (_g1h->evacuation_should_fail()) {
|
if (_g1h->evacuation_should_fail()) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -57,6 +57,9 @@ class G1RegionToSpaceMapper : public CHeapObj<mtGC> {
|
|||||||
public:
|
public:
|
||||||
MemRegion reserved() { return _storage.reserved(); }
|
MemRegion reserved() { return _storage.reserved(); }
|
||||||
|
|
||||||
|
size_t reserved_size() { return _storage.reserved_size(); }
|
||||||
|
size_t committed_size() { return _storage.committed_size(); }
|
||||||
|
|
||||||
void set_mapping_changed_listener(G1MappingChangedListener* listener) { _listener = listener; }
|
void set_mapping_changed_listener(G1MappingChangedListener* listener) { _listener = listener; }
|
||||||
|
|
||||||
virtual ~G1RegionToSpaceMapper() {
|
virtual ~G1RegionToSpaceMapper() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -79,7 +79,6 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs)
|
|||||||
_cards_scanned(NULL), _total_cards_scanned(0),
|
_cards_scanned(NULL), _total_cards_scanned(0),
|
||||||
_prev_period_summary()
|
_prev_period_summary()
|
||||||
{
|
{
|
||||||
_seq_task = new SubTasksDone(NumSeqTasks);
|
|
||||||
_cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC);
|
_cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC);
|
||||||
for (uint i = 0; i < n_workers(); i++) {
|
for (uint i = 0; i < n_workers(); i++) {
|
||||||
_cset_rs_update_cl[i] = NULL;
|
_cset_rs_update_cl[i] = NULL;
|
||||||
@ -90,7 +89,6 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
G1RemSet::~G1RemSet() {
|
G1RemSet::~G1RemSet() {
|
||||||
delete _seq_task;
|
|
||||||
for (uint i = 0; i < n_workers(); i++) {
|
for (uint i = 0; i < n_workers(); i++) {
|
||||||
assert(_cset_rs_update_cl[i] == NULL, "it should be");
|
assert(_cset_rs_update_cl[i] == NULL, "it should be");
|
||||||
}
|
}
|
||||||
@ -109,7 +107,7 @@ class ScanRSClosure : public HeapRegionClosure {
|
|||||||
|
|
||||||
double _strong_code_root_scan_time_sec;
|
double _strong_code_root_scan_time_sec;
|
||||||
uint _worker_i;
|
uint _worker_i;
|
||||||
int _block_size;
|
size_t _block_size;
|
||||||
bool _try_claimed;
|
bool _try_claimed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -127,7 +125,7 @@ public:
|
|||||||
_g1h = G1CollectedHeap::heap();
|
_g1h = G1CollectedHeap::heap();
|
||||||
_bot_shared = _g1h->bot_shared();
|
_bot_shared = _g1h->bot_shared();
|
||||||
_ct_bs = _g1h->g1_barrier_set();
|
_ct_bs = _g1h->g1_barrier_set();
|
||||||
_block_size = MAX2<int>(G1RSetScanBlockSize, 1);
|
_block_size = MAX2<size_t>(G1RSetScanBlockSize, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_try_claimed() { _try_claimed = true; }
|
void set_try_claimed() { _try_claimed = true; }
|
||||||
@ -248,9 +246,8 @@ void G1RemSet::scanRS(G1ParPushHeapRSClosure* oc,
|
|||||||
assert(_cards_scanned != NULL, "invariant");
|
assert(_cards_scanned != NULL, "invariant");
|
||||||
_cards_scanned[worker_i] = scanRScl.cards_done();
|
_cards_scanned[worker_i] = scanRScl.cards_done();
|
||||||
|
|
||||||
_g1p->phase_times()->record_scan_rs_time(worker_i, scan_rs_time_sec * 1000.0);
|
_g1p->phase_times()->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, scan_rs_time_sec);
|
||||||
_g1p->phase_times()->record_strong_code_root_scan_time(worker_i,
|
_g1p->phase_times()->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, scanRScl.strong_code_root_scan_time_sec());
|
||||||
scanRScl.strong_code_root_scan_time_sec() * 1000.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Closure used for updating RSets and recording references that
|
// Closure used for updating RSets and recording references that
|
||||||
@ -287,13 +284,11 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, uint worker_i) {
|
void G1RemSet::updateRS(DirtyCardQueue* into_cset_dcq, uint worker_i) {
|
||||||
double start = os::elapsedTime();
|
G1GCParPhaseTimesTracker x(_g1p->phase_times(), G1GCPhaseTimes::UpdateRS, worker_i);
|
||||||
// Apply the given closure to all remaining log entries.
|
// Apply the given closure to all remaining log entries.
|
||||||
RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq);
|
RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq);
|
||||||
|
|
||||||
_g1->iterate_dirty_card_closure(&into_cset_update_rs_cl, into_cset_dcq, false, worker_i);
|
_g1->iterate_dirty_card_closure(&into_cset_update_rs_cl, into_cset_dcq, false, worker_i);
|
||||||
|
|
||||||
_g1p->phase_times()->record_update_rs_time(worker_i, (os::elapsedTime() - start) * 1000.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1RemSet::cleanupHRRS() {
|
void G1RemSet::cleanupHRRS() {
|
||||||
|
@ -58,7 +58,6 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
CardTableModRefBS* _ct_bs;
|
CardTableModRefBS* _ct_bs;
|
||||||
SubTasksDone* _seq_task;
|
|
||||||
G1CollectorPolicy* _g1p;
|
G1CollectorPolicy* _g1p;
|
||||||
|
|
||||||
ConcurrentG1Refine* _cg1r;
|
ConcurrentG1Refine* _cg1r;
|
||||||
|
337
hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp
Normal file
337
hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp
Normal file
@ -0,0 +1,337 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precompiled.hpp"
|
||||||
|
|
||||||
|
#include "classfile/stringTable.hpp"
|
||||||
|
#include "classfile/systemDictionary.hpp"
|
||||||
|
#include "code/codeCache.hpp"
|
||||||
|
#include "gc_implementation/g1/bufferingOopClosure.hpp"
|
||||||
|
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
||||||
|
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
|
||||||
|
#include "gc_implementation/g1/g1GCPhaseTimes.hpp"
|
||||||
|
#include "gc_implementation/g1/g1RemSet.inline.hpp"
|
||||||
|
#include "gc_implementation/g1/g1RootProcessor.hpp"
|
||||||
|
#include "memory/allocation.inline.hpp"
|
||||||
|
#include "runtime/fprofiler.hpp"
|
||||||
|
#include "runtime/mutex.hpp"
|
||||||
|
#include "services/management.hpp"
|
||||||
|
|
||||||
|
class G1CodeBlobClosure : public CodeBlobClosure {
|
||||||
|
class HeapRegionGatheringOopClosure : public OopClosure {
|
||||||
|
G1CollectedHeap* _g1h;
|
||||||
|
OopClosure* _work;
|
||||||
|
nmethod* _nm;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void do_oop_work(T* p) {
|
||||||
|
_work->do_oop(p);
|
||||||
|
T oop_or_narrowoop = oopDesc::load_heap_oop(p);
|
||||||
|
if (!oopDesc::is_null(oop_or_narrowoop)) {
|
||||||
|
oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
|
||||||
|
HeapRegion* hr = _g1h->heap_region_containing_raw(o);
|
||||||
|
assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
|
||||||
|
hr->add_strong_code_root(_nm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
|
||||||
|
|
||||||
|
void do_oop(oop* o) {
|
||||||
|
do_oop_work(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
void do_oop(narrowOop* o) {
|
||||||
|
do_oop_work(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_nm(nmethod* nm) {
|
||||||
|
_nm = nm;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
HeapRegionGatheringOopClosure _oc;
|
||||||
|
public:
|
||||||
|
G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
|
||||||
|
|
||||||
|
void do_code_blob(CodeBlob* cb) {
|
||||||
|
nmethod* nm = cb->as_nmethod_or_null();
|
||||||
|
if (nm != NULL) {
|
||||||
|
if (!nm->test_set_oops_do_mark()) {
|
||||||
|
_oc.set_nm(nm);
|
||||||
|
nm->oops_do(&_oc);
|
||||||
|
nm->fix_oop_relocations();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void G1RootProcessor::worker_has_discovered_all_strong_classes() {
|
||||||
|
uint n_workers = _g1h->n_par_threads();
|
||||||
|
assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
|
||||||
|
|
||||||
|
uint new_value = (uint)Atomic::add(1, &_n_workers_discovered_strong_classes);
|
||||||
|
if (new_value == n_workers) {
|
||||||
|
// This thread is last. Notify the others.
|
||||||
|
MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
|
||||||
|
_lock.notify_all();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1RootProcessor::wait_until_all_strong_classes_discovered() {
|
||||||
|
uint n_workers = _g1h->n_par_threads();
|
||||||
|
assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
|
||||||
|
|
||||||
|
if ((uint)_n_workers_discovered_strong_classes != n_workers) {
|
||||||
|
MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
|
||||||
|
while ((uint)_n_workers_discovered_strong_classes != n_workers) {
|
||||||
|
_lock.wait(Mutex::_no_safepoint_check_flag, 0, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) :
|
||||||
|
_g1h(g1h),
|
||||||
|
_process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)),
|
||||||
|
_srs(g1h),
|
||||||
|
_lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
|
||||||
|
_n_workers_discovered_strong_classes(0) {}
|
||||||
|
|
||||||
|
void G1RootProcessor::evacuate_roots(OopClosure* scan_non_heap_roots,
|
||||||
|
OopClosure* scan_non_heap_weak_roots,
|
||||||
|
CLDClosure* scan_strong_clds,
|
||||||
|
CLDClosure* scan_weak_clds,
|
||||||
|
bool trace_metadata,
|
||||||
|
uint worker_i) {
|
||||||
|
// First scan the shared roots.
|
||||||
|
double ext_roots_start = os::elapsedTime();
|
||||||
|
G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
|
||||||
|
|
||||||
|
BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
|
||||||
|
BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
|
||||||
|
|
||||||
|
OopClosure* const weak_roots = &buf_scan_non_heap_weak_roots;
|
||||||
|
OopClosure* const strong_roots = &buf_scan_non_heap_roots;
|
||||||
|
|
||||||
|
// CodeBlobClosures are not interoperable with BufferingOopClosures
|
||||||
|
G1CodeBlobClosure root_code_blobs(scan_non_heap_roots);
|
||||||
|
|
||||||
|
process_java_roots(strong_roots,
|
||||||
|
trace_metadata ? scan_strong_clds : NULL,
|
||||||
|
scan_strong_clds,
|
||||||
|
trace_metadata ? NULL : scan_weak_clds,
|
||||||
|
&root_code_blobs,
|
||||||
|
phase_times,
|
||||||
|
worker_i);
|
||||||
|
|
||||||
|
// This is the point where this worker thread will not find more strong CLDs/nmethods.
|
||||||
|
// Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
|
||||||
|
if (trace_metadata) {
|
||||||
|
worker_has_discovered_all_strong_classes();
|
||||||
|
}
|
||||||
|
|
||||||
|
process_vm_roots(strong_roots, weak_roots, phase_times, worker_i);
|
||||||
|
|
||||||
|
{
|
||||||
|
// Now the CM ref_processor roots.
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CMRefRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_refProcessor_oops_do)) {
|
||||||
|
// We need to treat the discovered reference lists of the
|
||||||
|
// concurrent mark ref processor as roots and keep entries
|
||||||
|
// (which are added by the marking threads) on them live
|
||||||
|
// until they can be processed at the end of marking.
|
||||||
|
_g1h->ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trace_metadata) {
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WaitForStrongCLD, worker_i);
|
||||||
|
// Barrier to make sure all workers passed
|
||||||
|
// the strong CLD and strong nmethods phases.
|
||||||
|
wait_until_all_strong_classes_discovered();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now take the complement of the strong CLDs.
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WeakCLDRoots, worker_i);
|
||||||
|
ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
|
||||||
|
} else {
|
||||||
|
phase_times->record_time_secs(G1GCPhaseTimes::WaitForStrongCLD, worker_i, 0.0);
|
||||||
|
phase_times->record_time_secs(G1GCPhaseTimes::WeakCLDRoots, worker_i, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finish up any enqueued closure apps (attributed as object copy time).
|
||||||
|
buf_scan_non_heap_roots.done();
|
||||||
|
buf_scan_non_heap_weak_roots.done();
|
||||||
|
|
||||||
|
double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
|
||||||
|
+ buf_scan_non_heap_weak_roots.closure_app_seconds();
|
||||||
|
|
||||||
|
phase_times->record_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, obj_copy_time_sec);
|
||||||
|
|
||||||
|
double ext_root_time_sec = os::elapsedTime() - ext_roots_start - obj_copy_time_sec;
|
||||||
|
|
||||||
|
phase_times->record_time_secs(G1GCPhaseTimes::ExtRootScan, worker_i, ext_root_time_sec);
|
||||||
|
|
||||||
|
// During conc marking we have to filter the per-thread SATB buffers
|
||||||
|
// to make sure we remove any oops into the CSet (which will show up
|
||||||
|
// as implicitly live).
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SATBFiltering, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_filter_satb_buffers) && _g1h->mark_in_progress()) {
|
||||||
|
JavaThread::satb_mark_queue_set().filter_thread_buffers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_process_strong_tasks->all_tasks_completed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1RootProcessor::process_strong_roots(OopClosure* oops,
|
||||||
|
CLDClosure* clds,
|
||||||
|
CodeBlobClosure* blobs) {
|
||||||
|
|
||||||
|
process_java_roots(oops, clds, clds, NULL, blobs, NULL, 0);
|
||||||
|
process_vm_roots(oops, NULL, NULL, 0);
|
||||||
|
|
||||||
|
_process_strong_tasks->all_tasks_completed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1RootProcessor::process_all_roots(OopClosure* oops,
|
||||||
|
CLDClosure* clds,
|
||||||
|
CodeBlobClosure* blobs) {
|
||||||
|
|
||||||
|
process_java_roots(oops, NULL, clds, clds, NULL, NULL, 0);
|
||||||
|
process_vm_roots(oops, oops, NULL, 0);
|
||||||
|
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_CodeCache_oops_do)) {
|
||||||
|
CodeCache::blobs_do(blobs);
|
||||||
|
}
|
||||||
|
|
||||||
|
_process_strong_tasks->all_tasks_completed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1RootProcessor::process_java_roots(OopClosure* strong_roots,
|
||||||
|
CLDClosure* thread_stack_clds,
|
||||||
|
CLDClosure* strong_clds,
|
||||||
|
CLDClosure* weak_clds,
|
||||||
|
CodeBlobClosure* strong_code,
|
||||||
|
G1GCPhaseTimes* phase_times,
|
||||||
|
uint worker_i) {
|
||||||
|
assert(thread_stack_clds == NULL || weak_clds == NULL, "There is overlap between those, only one may be set");
|
||||||
|
// Iterating over the CLDG and the Threads are done early to allow us to
|
||||||
|
// first process the strong CLDs and nmethods and then, after a barrier,
|
||||||
|
// let the thread process the weak CLDs and nmethods.
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
|
||||||
|
ClassLoaderDataGraph::roots_cld_do(strong_clds, weak_clds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i);
|
||||||
|
Threads::possibly_parallel_oops_do(strong_roots, thread_stack_clds, strong_code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1RootProcessor::process_vm_roots(OopClosure* strong_roots,
|
||||||
|
OopClosure* weak_roots,
|
||||||
|
G1GCPhaseTimes* phase_times,
|
||||||
|
uint worker_i) {
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::UniverseRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Universe_oops_do)) {
|
||||||
|
Universe::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JNIRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_JNIHandles_oops_do)) {
|
||||||
|
JNIHandles::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ObjectSynchronizerRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks-> is_task_claimed(G1RP_PS_ObjectSynchronizer_oops_do)) {
|
||||||
|
ObjectSynchronizer::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::FlatProfilerRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_FlatProfiler_oops_do)) {
|
||||||
|
FlatProfiler::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ManagementRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Management_oops_do)) {
|
||||||
|
Management::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JVMTIRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_jvmti_oops_do)) {
|
||||||
|
JvmtiExport::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::SystemDictionaryRoots, worker_i);
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(G1RP_PS_SystemDictionary_oops_do)) {
|
||||||
|
SystemDictionary::roots_oops_do(strong_roots, weak_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
|
||||||
|
// All threads execute the following. A specific chunk of buckets
|
||||||
|
// from the StringTable are the individual tasks.
|
||||||
|
if (weak_roots != NULL) {
|
||||||
|
StringTable::possibly_parallel_oops_do(weak_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1RootProcessor::scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
|
||||||
|
OopClosure* scan_non_heap_weak_roots,
|
||||||
|
uint worker_i) {
|
||||||
|
G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
|
||||||
|
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CodeCacheRoots, worker_i);
|
||||||
|
|
||||||
|
// Now scan the complement of the collection set.
|
||||||
|
G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots);
|
||||||
|
|
||||||
|
_g1h->g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1RootProcessor::set_num_workers(int active_workers) {
|
||||||
|
_process_strong_tasks->set_n_threads(active_workers);
|
||||||
|
}
|
121
hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp
Normal file
121
hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
|
||||||
|
#define SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
|
||||||
|
|
||||||
|
#include "memory/allocation.hpp"
|
||||||
|
#include "memory/sharedHeap.hpp"
|
||||||
|
#include "runtime/mutex.hpp"
|
||||||
|
|
||||||
|
class CLDClosure;
|
||||||
|
class CodeBlobClosure;
|
||||||
|
class G1CollectedHeap;
|
||||||
|
class G1GCPhaseTimes;
|
||||||
|
class G1ParPushHeapRSClosure;
|
||||||
|
class Monitor;
|
||||||
|
class OopClosure;
|
||||||
|
class SubTasksDone;
|
||||||
|
|
||||||
|
// Scoped object to assist in applying oop, CLD and code blob closures to
|
||||||
|
// root locations. Handles claiming of different root scanning tasks
|
||||||
|
// and takes care of global state for root scanning via a StrongRootsScope.
|
||||||
|
// In the parallel case there is a shared G1RootProcessor object where all
|
||||||
|
// worker thread call the process_roots methods.
|
||||||
|
class G1RootProcessor : public StackObj {
|
||||||
|
G1CollectedHeap* _g1h;
|
||||||
|
SubTasksDone* _process_strong_tasks;
|
||||||
|
SharedHeap::StrongRootsScope _srs;
|
||||||
|
|
||||||
|
// Used to implement the Thread work barrier.
|
||||||
|
Monitor _lock;
|
||||||
|
volatile jint _n_workers_discovered_strong_classes;
|
||||||
|
|
||||||
|
enum G1H_process_roots_tasks {
|
||||||
|
G1RP_PS_Universe_oops_do,
|
||||||
|
G1RP_PS_JNIHandles_oops_do,
|
||||||
|
G1RP_PS_ObjectSynchronizer_oops_do,
|
||||||
|
G1RP_PS_FlatProfiler_oops_do,
|
||||||
|
G1RP_PS_Management_oops_do,
|
||||||
|
G1RP_PS_SystemDictionary_oops_do,
|
||||||
|
G1RP_PS_ClassLoaderDataGraph_oops_do,
|
||||||
|
G1RP_PS_jvmti_oops_do,
|
||||||
|
G1RP_PS_CodeCache_oops_do,
|
||||||
|
G1RP_PS_filter_satb_buffers,
|
||||||
|
G1RP_PS_refProcessor_oops_do,
|
||||||
|
// Leave this one last.
|
||||||
|
G1RP_PS_NumElements
|
||||||
|
};
|
||||||
|
|
||||||
|
void worker_has_discovered_all_strong_classes();
|
||||||
|
void wait_until_all_strong_classes_discovered();
|
||||||
|
|
||||||
|
void process_java_roots(OopClosure* scan_non_heap_roots,
|
||||||
|
CLDClosure* thread_stack_clds,
|
||||||
|
CLDClosure* scan_strong_clds,
|
||||||
|
CLDClosure* scan_weak_clds,
|
||||||
|
CodeBlobClosure* scan_strong_code,
|
||||||
|
G1GCPhaseTimes* phase_times,
|
||||||
|
uint worker_i);
|
||||||
|
|
||||||
|
void process_vm_roots(OopClosure* scan_non_heap_roots,
|
||||||
|
OopClosure* scan_non_heap_weak_roots,
|
||||||
|
G1GCPhaseTimes* phase_times,
|
||||||
|
uint worker_i);
|
||||||
|
|
||||||
|
public:
|
||||||
|
G1RootProcessor(G1CollectedHeap* g1h);
|
||||||
|
|
||||||
|
// Apply closures to the strongly and weakly reachable roots in the system
|
||||||
|
// in a single pass.
|
||||||
|
// Record and report timing measurements for sub phases using the worker_i
|
||||||
|
void evacuate_roots(OopClosure* scan_non_heap_roots,
|
||||||
|
OopClosure* scan_non_heap_weak_roots,
|
||||||
|
CLDClosure* scan_strong_clds,
|
||||||
|
CLDClosure* scan_weak_clds,
|
||||||
|
bool trace_metadata,
|
||||||
|
uint worker_i);
|
||||||
|
|
||||||
|
// Apply oops, clds and blobs to all strongly reachable roots in the system
|
||||||
|
void process_strong_roots(OopClosure* oops,
|
||||||
|
CLDClosure* clds,
|
||||||
|
CodeBlobClosure* blobs);
|
||||||
|
|
||||||
|
// Apply oops, clds and blobs to strongly and weakly reachable roots in the system
|
||||||
|
void process_all_roots(OopClosure* oops,
|
||||||
|
CLDClosure* clds,
|
||||||
|
CodeBlobClosure* blobs);
|
||||||
|
|
||||||
|
// Apply scan_rs to all locations in the union of the remembered sets for all
|
||||||
|
// regions in the collection set
|
||||||
|
// (having done "set_region" to indicate the region in which the root resides),
|
||||||
|
void scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
|
||||||
|
OopClosure* scan_non_heap_weak_roots,
|
||||||
|
uint worker_i);
|
||||||
|
|
||||||
|
// Inform the root processor about the number of worker threads
|
||||||
|
void set_num_workers(int active_workers);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP
|
@ -106,7 +106,7 @@ void G1StringDedup::deduplicate(oop java_string) {
|
|||||||
|
|
||||||
void G1StringDedup::oops_do(OopClosure* keep_alive) {
|
void G1StringDedup::oops_do(OopClosure* keep_alive) {
|
||||||
assert(is_enabled(), "String deduplication not enabled");
|
assert(is_enabled(), "String deduplication not enabled");
|
||||||
unlink_or_oops_do(NULL, keep_alive);
|
unlink_or_oops_do(NULL, keep_alive, true /* allow_resize_and_rehash */);
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1StringDedup::unlink(BoolObjectClosure* is_alive) {
|
void G1StringDedup::unlink(BoolObjectClosure* is_alive) {
|
||||||
@ -123,45 +123,39 @@ void G1StringDedup::unlink(BoolObjectClosure* is_alive) {
|
|||||||
class G1StringDedupUnlinkOrOopsDoTask : public AbstractGangTask {
|
class G1StringDedupUnlinkOrOopsDoTask : public AbstractGangTask {
|
||||||
private:
|
private:
|
||||||
G1StringDedupUnlinkOrOopsDoClosure _cl;
|
G1StringDedupUnlinkOrOopsDoClosure _cl;
|
||||||
|
G1GCPhaseTimes* _phase_times;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
G1StringDedupUnlinkOrOopsDoTask(BoolObjectClosure* is_alive,
|
G1StringDedupUnlinkOrOopsDoTask(BoolObjectClosure* is_alive,
|
||||||
OopClosure* keep_alive,
|
OopClosure* keep_alive,
|
||||||
bool allow_resize_and_rehash) :
|
bool allow_resize_and_rehash,
|
||||||
|
G1GCPhaseTimes* phase_times) :
|
||||||
AbstractGangTask("G1StringDedupUnlinkOrOopsDoTask"),
|
AbstractGangTask("G1StringDedupUnlinkOrOopsDoTask"),
|
||||||
_cl(is_alive, keep_alive, allow_resize_and_rehash) {
|
_cl(is_alive, keep_alive, allow_resize_and_rehash), _phase_times(phase_times) { }
|
||||||
}
|
|
||||||
|
|
||||||
virtual void work(uint worker_id) {
|
virtual void work(uint worker_id) {
|
||||||
double queue_fixup_start = os::elapsedTime();
|
{
|
||||||
G1StringDedupQueue::unlink_or_oops_do(&_cl);
|
G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupQueueFixup, worker_id);
|
||||||
|
G1StringDedupQueue::unlink_or_oops_do(&_cl);
|
||||||
double table_fixup_start = os::elapsedTime();
|
}
|
||||||
G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
|
{
|
||||||
|
G1GCParPhaseTimesTracker x(_phase_times, G1GCPhaseTimes::StringDedupTableFixup, worker_id);
|
||||||
double queue_fixup_time_ms = (table_fixup_start - queue_fixup_start) * 1000.0;
|
G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
|
||||||
double table_fixup_time_ms = (os::elapsedTime() - table_fixup_start) * 1000.0;
|
}
|
||||||
G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
|
|
||||||
g1p->phase_times()->record_string_dedup_queue_fixup_worker_time(worker_id, queue_fixup_time_ms);
|
|
||||||
g1p->phase_times()->record_string_dedup_table_fixup_worker_time(worker_id, table_fixup_time_ms);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool allow_resize_and_rehash) {
|
void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive,
|
||||||
|
OopClosure* keep_alive,
|
||||||
|
bool allow_resize_and_rehash,
|
||||||
|
G1GCPhaseTimes* phase_times) {
|
||||||
assert(is_enabled(), "String deduplication not enabled");
|
assert(is_enabled(), "String deduplication not enabled");
|
||||||
G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
|
|
||||||
g1p->phase_times()->note_string_dedup_fixup_start();
|
|
||||||
double fixup_start = os::elapsedTime();
|
|
||||||
|
|
||||||
G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash);
|
G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash, phase_times);
|
||||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
g1h->set_par_threads();
|
g1h->set_par_threads();
|
||||||
g1h->workers()->run_task(&task);
|
g1h->workers()->run_task(&task);
|
||||||
g1h->set_par_threads(0);
|
g1h->set_par_threads(0);
|
||||||
|
|
||||||
double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
|
|
||||||
g1p->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
|
|
||||||
g1p->phase_times()->note_string_dedup_fixup_end();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1StringDedup::threads_do(ThreadClosure* tc) {
|
void G1StringDedup::threads_do(ThreadClosure* tc) {
|
||||||
|
@ -91,6 +91,7 @@ class BoolObjectClosure;
|
|||||||
class ThreadClosure;
|
class ThreadClosure;
|
||||||
class outputStream;
|
class outputStream;
|
||||||
class G1StringDedupTable;
|
class G1StringDedupTable;
|
||||||
|
class G1GCPhaseTimes;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Main interface for interacting with string deduplication.
|
// Main interface for interacting with string deduplication.
|
||||||
@ -131,7 +132,7 @@ public:
|
|||||||
static void oops_do(OopClosure* keep_alive);
|
static void oops_do(OopClosure* keep_alive);
|
||||||
static void unlink(BoolObjectClosure* is_alive);
|
static void unlink(BoolObjectClosure* is_alive);
|
||||||
static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive,
|
static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive,
|
||||||
bool allow_resize_and_rehash = true);
|
bool allow_resize_and_rehash, G1GCPhaseTimes* phase_times = NULL);
|
||||||
|
|
||||||
static void threads_do(ThreadClosure* tc);
|
static void threads_do(ThreadClosure* tc);
|
||||||
static void print_worker_threads_on(outputStream* st);
|
static void print_worker_threads_on(outputStream* st);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -86,7 +86,7 @@
|
|||||||
"If true, enable reference discovery during concurrent " \
|
"If true, enable reference discovery during concurrent " \
|
||||||
"marking and reference processing at the end of remark.") \
|
"marking and reference processing at the end of remark.") \
|
||||||
\
|
\
|
||||||
product(intx, G1SATBBufferSize, 1*K, \
|
product(size_t, G1SATBBufferSize, 1*K, \
|
||||||
"Number of entries in an SATB log buffer.") \
|
"Number of entries in an SATB log buffer.") \
|
||||||
\
|
\
|
||||||
develop(intx, G1SATBProcessCompletedThreshold, 20, \
|
develop(intx, G1SATBProcessCompletedThreshold, 20, \
|
||||||
@ -112,7 +112,7 @@
|
|||||||
"Prints the liveness information for all regions in the heap " \
|
"Prints the liveness information for all regions in the heap " \
|
||||||
"at the end of a marking cycle.") \
|
"at the end of a marking cycle.") \
|
||||||
\
|
\
|
||||||
product(intx, G1UpdateBufferSize, 256, \
|
product(size_t, G1UpdateBufferSize, 256, \
|
||||||
"Size of an update buffer") \
|
"Size of an update buffer") \
|
||||||
\
|
\
|
||||||
product(intx, G1ConcRefinementYellowZone, 0, \
|
product(intx, G1ConcRefinementYellowZone, 0, \
|
||||||
@ -148,7 +148,7 @@
|
|||||||
"Select green, yellow and red zones adaptively to meet the " \
|
"Select green, yellow and red zones adaptively to meet the " \
|
||||||
"the pause requirements.") \
|
"the pause requirements.") \
|
||||||
\
|
\
|
||||||
product(uintx, G1ConcRSLogCacheSize, 10, \
|
product(size_t, G1ConcRSLogCacheSize, 10, \
|
||||||
"Log base 2 of the length of conc RS hot-card cache.") \
|
"Log base 2 of the length of conc RS hot-card cache.") \
|
||||||
\
|
\
|
||||||
product(uintx, G1ConcRSHotCardLimit, 4, \
|
product(uintx, G1ConcRSHotCardLimit, 4, \
|
||||||
@ -210,7 +210,7 @@
|
|||||||
"When set, G1 will fail when it encounters an FP 'error', " \
|
"When set, G1 will fail when it encounters an FP 'error', " \
|
||||||
"so as to allow debugging") \
|
"so as to allow debugging") \
|
||||||
\
|
\
|
||||||
product(uintx, G1HeapRegionSize, 0, \
|
product(size_t, G1HeapRegionSize, 0, \
|
||||||
"Size of the G1 regions.") \
|
"Size of the G1 regions.") \
|
||||||
\
|
\
|
||||||
product(uintx, G1ConcRefinementThreads, 0, \
|
product(uintx, G1ConcRefinementThreads, 0, \
|
||||||
@ -220,7 +220,7 @@
|
|||||||
develop(bool, G1VerifyCTCleanup, false, \
|
develop(bool, G1VerifyCTCleanup, false, \
|
||||||
"Verify card table cleanup.") \
|
"Verify card table cleanup.") \
|
||||||
\
|
\
|
||||||
product(uintx, G1RSetScanBlockSize, 64, \
|
product(size_t, G1RSetScanBlockSize, 64, \
|
||||||
"Size of a work unit of cards claimed by a worker thread" \
|
"Size of a work unit of cards claimed by a worker thread" \
|
||||||
"during RSet scanning.") \
|
"during RSet scanning.") \
|
||||||
\
|
\
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -30,23 +30,8 @@
|
|||||||
// non-virtually, using a mechanism defined in this file. Extend these
|
// non-virtually, using a mechanism defined in this file. Extend these
|
||||||
// macros in the obvious way to add specializations for new closures.
|
// macros in the obvious way to add specializations for new closures.
|
||||||
|
|
||||||
enum G1Barrier {
|
|
||||||
G1BarrierNone,
|
|
||||||
G1BarrierEvac,
|
|
||||||
G1BarrierKlass
|
|
||||||
};
|
|
||||||
|
|
||||||
enum G1Mark {
|
|
||||||
G1MarkNone,
|
|
||||||
G1MarkFromRoot,
|
|
||||||
G1MarkPromotedFromRoot
|
|
||||||
};
|
|
||||||
|
|
||||||
// Forward declarations.
|
// Forward declarations.
|
||||||
|
|
||||||
template<G1Barrier barrier, G1Mark do_mark_object>
|
|
||||||
class G1ParCopyClosure;
|
|
||||||
|
|
||||||
class G1ParScanClosure;
|
class G1ParScanClosure;
|
||||||
class G1ParPushHeapRSClosure;
|
class G1ParPushHeapRSClosure;
|
||||||
|
|
||||||
@ -61,26 +46,16 @@ class G1TriggerClosure;
|
|||||||
class G1InvokeIfNotTriggeredClosure;
|
class G1InvokeIfNotTriggeredClosure;
|
||||||
class G1UpdateRSOrPushRefOopClosure;
|
class G1UpdateRSOrPushRefOopClosure;
|
||||||
|
|
||||||
#ifdef FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES
|
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \
|
||||||
#error "FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES already defined."
|
f(G1ParScanClosure,_nv) \
|
||||||
#endif
|
f(G1ParPushHeapRSClosure,_nv) \
|
||||||
|
f(FilterIntoCSClosure,_nv) \
|
||||||
#define FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f) \
|
f(FilterOutOfRegionClosure,_nv) \
|
||||||
f(G1ParScanClosure,_nv) \
|
f(G1CMOopClosure,_nv) \
|
||||||
f(G1ParPushHeapRSClosure,_nv) \
|
f(G1RootRegionScanClosure,_nv) \
|
||||||
f(FilterIntoCSClosure,_nv) \
|
f(G1Mux2Closure,_nv) \
|
||||||
f(FilterOutOfRegionClosure,_nv) \
|
f(G1TriggerClosure,_nv) \
|
||||||
f(G1CMOopClosure,_nv) \
|
f(G1InvokeIfNotTriggeredClosure,_nv) \
|
||||||
f(G1RootRegionScanClosure,_nv) \
|
|
||||||
f(G1Mux2Closure,_nv) \
|
|
||||||
f(G1TriggerClosure,_nv) \
|
|
||||||
f(G1InvokeIfNotTriggeredClosure,_nv) \
|
|
||||||
f(G1UpdateRSOrPushRefOopClosure,_nv)
|
f(G1UpdateRSOrPushRefOopClosure,_nv)
|
||||||
|
|
||||||
#ifdef FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES
|
|
||||||
#error "FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES already defined."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
|
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP
|
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP
|
||||||
|
@ -106,18 +106,18 @@ size_t HeapRegion::max_region_size() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_heap_size) {
|
void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_heap_size) {
|
||||||
uintx region_size = G1HeapRegionSize;
|
size_t region_size = G1HeapRegionSize;
|
||||||
if (FLAG_IS_DEFAULT(G1HeapRegionSize)) {
|
if (FLAG_IS_DEFAULT(G1HeapRegionSize)) {
|
||||||
size_t average_heap_size = (initial_heap_size + max_heap_size) / 2;
|
size_t average_heap_size = (initial_heap_size + max_heap_size) / 2;
|
||||||
region_size = MAX2(average_heap_size / HeapRegionBounds::target_number(),
|
region_size = MAX2(average_heap_size / HeapRegionBounds::target_number(),
|
||||||
(uintx) HeapRegionBounds::min_size());
|
HeapRegionBounds::min_size());
|
||||||
}
|
}
|
||||||
|
|
||||||
int region_size_log = log2_long((jlong) region_size);
|
int region_size_log = log2_long((jlong) region_size);
|
||||||
// Recalculate the region size to make sure it's a power of
|
// Recalculate the region size to make sure it's a power of
|
||||||
// 2. This means that region_size is the largest power of 2 that's
|
// 2. This means that region_size is the largest power of 2 that's
|
||||||
// <= what we've calculated so far.
|
// <= what we've calculated so far.
|
||||||
region_size = ((uintx)1 << region_size_log);
|
region_size = ((size_t)1 << region_size_log);
|
||||||
|
|
||||||
// Now make sure that we don't go over or under our limits.
|
// Now make sure that we don't go over or under our limits.
|
||||||
if (region_size < HeapRegionBounds::min_size()) {
|
if (region_size < HeapRegionBounds::min_size()) {
|
||||||
@ -139,7 +139,7 @@ void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_hea
|
|||||||
guarantee(GrainBytes == 0, "we should only set it once");
|
guarantee(GrainBytes == 0, "we should only set it once");
|
||||||
// The cast to int is safe, given that we've bounded region_size by
|
// The cast to int is safe, given that we've bounded region_size by
|
||||||
// MIN_REGION_SIZE and MAX_REGION_SIZE.
|
// MIN_REGION_SIZE and MAX_REGION_SIZE.
|
||||||
GrainBytes = (size_t)region_size;
|
GrainBytes = region_size;
|
||||||
|
|
||||||
guarantee(GrainWords == 0, "we should only set it once");
|
guarantee(GrainWords == 0, "we should only set it once");
|
||||||
GrainWords = GrainBytes >> LogHeapWordSize;
|
GrainWords = GrainBytes >> LogHeapWordSize;
|
||||||
@ -933,6 +933,16 @@ void G1OffsetTableContigSpace::set_end(HeapWord* new_end) {
|
|||||||
_offsets.resize(new_end - bottom());
|
_offsets.resize(new_end - bottom());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef PRODUCT
|
||||||
|
void G1OffsetTableContigSpace::mangle_unused_area() {
|
||||||
|
mangle_unused_area_complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
void G1OffsetTableContigSpace::mangle_unused_area_complete() {
|
||||||
|
SpaceMangler::mangle_region(MemRegion(top(), end()));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void G1OffsetTableContigSpace::print() const {
|
void G1OffsetTableContigSpace::print() const {
|
||||||
print_short();
|
print_short();
|
||||||
gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
|
gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "gc_implementation/g1/g1AllocationContext.hpp"
|
#include "gc_implementation/g1/g1AllocationContext.hpp"
|
||||||
#include "gc_implementation/g1/g1BlockOffsetTable.hpp"
|
#include "gc_implementation/g1/g1BlockOffsetTable.hpp"
|
||||||
#include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
|
|
||||||
#include "gc_implementation/g1/heapRegionType.hpp"
|
#include "gc_implementation/g1/heapRegionType.hpp"
|
||||||
#include "gc_implementation/g1/survRateGroup.hpp"
|
#include "gc_implementation/g1/survRateGroup.hpp"
|
||||||
#include "gc_implementation/shared/ageTable.hpp"
|
#include "gc_implementation/shared/ageTable.hpp"
|
||||||
@ -155,6 +154,9 @@ class G1OffsetTableContigSpace: public CompactibleSpace {
|
|||||||
void set_bottom(HeapWord* value);
|
void set_bottom(HeapWord* value);
|
||||||
void set_end(HeapWord* value);
|
void set_end(HeapWord* value);
|
||||||
|
|
||||||
|
void mangle_unused_area() PRODUCT_RETURN;
|
||||||
|
void mangle_unused_area_complete() PRODUCT_RETURN;
|
||||||
|
|
||||||
HeapWord* scan_top() const;
|
HeapWord* scan_top() const;
|
||||||
void record_timestamp();
|
void record_timestamp();
|
||||||
void reset_gc_time_stamp() { _gc_time_stamp = 0; }
|
void reset_gc_time_stamp() { _gc_time_stamp = 0; }
|
||||||
|
@ -145,6 +145,24 @@ void HeapRegionManager::make_regions_available(uint start, uint num_regions) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MemoryUsage HeapRegionManager::get_auxiliary_data_memory_usage() const {
|
||||||
|
size_t used_sz =
|
||||||
|
_prev_bitmap_mapper->committed_size() +
|
||||||
|
_next_bitmap_mapper->committed_size() +
|
||||||
|
_bot_mapper->committed_size() +
|
||||||
|
_cardtable_mapper->committed_size() +
|
||||||
|
_card_counts_mapper->committed_size();
|
||||||
|
|
||||||
|
size_t committed_sz =
|
||||||
|
_prev_bitmap_mapper->reserved_size() +
|
||||||
|
_next_bitmap_mapper->reserved_size() +
|
||||||
|
_bot_mapper->reserved_size() +
|
||||||
|
_cardtable_mapper->reserved_size() +
|
||||||
|
_card_counts_mapper->reserved_size();
|
||||||
|
|
||||||
|
return MemoryUsage(0, used_sz, committed_sz, committed_sz);
|
||||||
|
}
|
||||||
|
|
||||||
uint HeapRegionManager::expand_by(uint num_regions) {
|
uint HeapRegionManager::expand_by(uint num_regions) {
|
||||||
return expand_at(0, num_regions);
|
return expand_at(0, num_regions);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -28,6 +28,7 @@
|
|||||||
#include "gc_implementation/g1/g1BiasedArray.hpp"
|
#include "gc_implementation/g1/g1BiasedArray.hpp"
|
||||||
#include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
|
#include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
|
||||||
#include "gc_implementation/g1/heapRegionSet.hpp"
|
#include "gc_implementation/g1/heapRegionSet.hpp"
|
||||||
|
#include "services/memoryUsage.hpp"
|
||||||
|
|
||||||
class HeapRegion;
|
class HeapRegion;
|
||||||
class HeapRegionClosure;
|
class HeapRegionClosure;
|
||||||
@ -196,6 +197,8 @@ public:
|
|||||||
// Return the maximum number of regions in the heap.
|
// Return the maximum number of regions in the heap.
|
||||||
uint max_length() const { return (uint)_regions.length(); }
|
uint max_length() const { return (uint)_regions.length(); }
|
||||||
|
|
||||||
|
MemoryUsage get_auxiliary_data_memory_usage() const;
|
||||||
|
|
||||||
MemRegion reserved() const { return MemRegion(heap_bottom(), heap_end()); }
|
MemRegion reserved() const { return MemRegion(heap_bottom(), heap_end()); }
|
||||||
|
|
||||||
// Expand the sequence to reflect that the heap has grown. Either create new
|
// Expand the sequence to reflect that the heap has grown. Either create new
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
|
#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
|
||||||
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
|
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
|
||||||
#include "gc_implementation/parNew/parNewGeneration.hpp"
|
#include "gc_implementation/parNew/parNewGeneration.hpp"
|
||||||
#include "gc_implementation/parNew/parOopClosures.inline.hpp"
|
#include "gc_implementation/parNew/parOopClosures.inline.hpp"
|
||||||
@ -325,7 +326,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
ParallelTaskTerminator& _term;
|
ParallelTaskTerminator& _term;
|
||||||
ParNewGeneration& _gen;
|
ParNewGeneration& _gen;
|
||||||
Generation& _next_gen;
|
Generation& _old_gen;
|
||||||
public:
|
public:
|
||||||
bool is_valid(int id) const { return id < length(); }
|
bool is_valid(int id) const { return id < length(); }
|
||||||
ParallelTaskTerminator* terminator() { return &_term; }
|
ParallelTaskTerminator* terminator() { return &_term; }
|
||||||
@ -338,7 +339,7 @@ ParScanThreadStateSet::ParScanThreadStateSet(
|
|||||||
Stack<oop, mtGC>* overflow_stacks,
|
Stack<oop, mtGC>* overflow_stacks,
|
||||||
size_t desired_plab_sz, ParallelTaskTerminator& term)
|
size_t desired_plab_sz, ParallelTaskTerminator& term)
|
||||||
: ResourceArray(sizeof(ParScanThreadState), num_threads),
|
: ResourceArray(sizeof(ParScanThreadState), num_threads),
|
||||||
_gen(gen), _next_gen(old_gen), _term(term)
|
_gen(gen), _old_gen(old_gen), _term(term)
|
||||||
{
|
{
|
||||||
assert(num_threads > 0, "sanity check!");
|
assert(num_threads > 0, "sanity check!");
|
||||||
assert(ParGCUseLocalOverflow == (overflow_stacks != NULL),
|
assert(ParGCUseLocalOverflow == (overflow_stacks != NULL),
|
||||||
@ -471,8 +472,8 @@ void ParScanThreadStateSet::flush()
|
|||||||
_gen.age_table()->merge(local_table);
|
_gen.age_table()->merge(local_table);
|
||||||
|
|
||||||
// Inform old gen that we're done.
|
// Inform old gen that we're done.
|
||||||
_next_gen.par_promote_alloc_done(i);
|
_old_gen.par_promote_alloc_done(i);
|
||||||
_next_gen.par_oop_since_save_marks_iterate_done(i);
|
_old_gen.par_oop_since_save_marks_iterate_done(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UseConcMarkSweepGC) {
|
if (UseConcMarkSweepGC) {
|
||||||
@ -574,10 +575,10 @@ void ParEvacuateFollowersClosure::do_void() {
|
|||||||
par_scan_state()->end_term_time();
|
par_scan_state()->end_term_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
ParNewGenTask::ParNewGenTask(ParNewGeneration* gen, Generation* next_gen,
|
ParNewGenTask::ParNewGenTask(ParNewGeneration* gen, Generation* old_gen,
|
||||||
HeapWord* young_old_boundary, ParScanThreadStateSet* state_set) :
|
HeapWord* young_old_boundary, ParScanThreadStateSet* state_set) :
|
||||||
AbstractGangTask("ParNewGeneration collection"),
|
AbstractGangTask("ParNewGeneration collection"),
|
||||||
_gen(gen), _next_gen(next_gen),
|
_gen(gen), _old_gen(old_gen),
|
||||||
_young_old_boundary(young_old_boundary),
|
_young_old_boundary(young_old_boundary),
|
||||||
_state_set(state_set)
|
_state_set(state_set)
|
||||||
{}
|
{}
|
||||||
@ -601,8 +602,6 @@ void ParNewGenTask::work(uint worker_id) {
|
|||||||
// We would need multiple old-gen queues otherwise.
|
// We would need multiple old-gen queues otherwise.
|
||||||
assert(gch->n_gens() == 2, "Par young collection currently only works with one older gen.");
|
assert(gch->n_gens() == 2, "Par young collection currently only works with one older gen.");
|
||||||
|
|
||||||
Generation* old_gen = gch->next_gen(_gen);
|
|
||||||
|
|
||||||
ParScanThreadState& par_scan_state = _state_set->thread_state(worker_id);
|
ParScanThreadState& par_scan_state = _state_set->thread_state(worker_id);
|
||||||
assert(_state_set->is_valid(worker_id), "Should not have been called");
|
assert(_state_set->is_valid(worker_id), "Should not have been called");
|
||||||
|
|
||||||
@ -619,7 +618,7 @@ void ParNewGenTask::work(uint worker_id) {
|
|||||||
true, // Process younger gens, if any,
|
true, // Process younger gens, if any,
|
||||||
// as strong roots.
|
// as strong roots.
|
||||||
false, // no scope; this is parallel code
|
false, // no scope; this is parallel code
|
||||||
SharedHeap::SO_ScavengeCodeCache,
|
GenCollectedHeap::SO_ScavengeCodeCache,
|
||||||
GenCollectedHeap::StrongAndWeakRoots,
|
GenCollectedHeap::StrongAndWeakRoots,
|
||||||
&par_scan_state.to_space_root_closure(),
|
&par_scan_state.to_space_root_closure(),
|
||||||
&par_scan_state.older_gen_closure(),
|
&par_scan_state.older_gen_closure(),
|
||||||
@ -763,8 +762,9 @@ void ScanClosureWithParBarrier::do_oop(narrowOop* p) { ScanClosureWithParBarrier
|
|||||||
class ParNewRefProcTaskProxy: public AbstractGangTask {
|
class ParNewRefProcTaskProxy: public AbstractGangTask {
|
||||||
typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
|
typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
|
||||||
public:
|
public:
|
||||||
ParNewRefProcTaskProxy(ProcessTask& task, ParNewGeneration& gen,
|
ParNewRefProcTaskProxy(ProcessTask& task,
|
||||||
Generation& next_gen,
|
ParNewGeneration& gen,
|
||||||
|
Generation& old_gen,
|
||||||
HeapWord* young_old_boundary,
|
HeapWord* young_old_boundary,
|
||||||
ParScanThreadStateSet& state_set);
|
ParScanThreadStateSet& state_set);
|
||||||
|
|
||||||
@ -776,20 +776,20 @@ private:
|
|||||||
private:
|
private:
|
||||||
ParNewGeneration& _gen;
|
ParNewGeneration& _gen;
|
||||||
ProcessTask& _task;
|
ProcessTask& _task;
|
||||||
Generation& _next_gen;
|
Generation& _old_gen;
|
||||||
HeapWord* _young_old_boundary;
|
HeapWord* _young_old_boundary;
|
||||||
ParScanThreadStateSet& _state_set;
|
ParScanThreadStateSet& _state_set;
|
||||||
};
|
};
|
||||||
|
|
||||||
ParNewRefProcTaskProxy::ParNewRefProcTaskProxy(
|
ParNewRefProcTaskProxy::ParNewRefProcTaskProxy(ProcessTask& task,
|
||||||
ProcessTask& task, ParNewGeneration& gen,
|
ParNewGeneration& gen,
|
||||||
Generation& next_gen,
|
Generation& old_gen,
|
||||||
HeapWord* young_old_boundary,
|
HeapWord* young_old_boundary,
|
||||||
ParScanThreadStateSet& state_set)
|
ParScanThreadStateSet& state_set)
|
||||||
: AbstractGangTask("ParNewGeneration parallel reference processing"),
|
: AbstractGangTask("ParNewGeneration parallel reference processing"),
|
||||||
_gen(gen),
|
_gen(gen),
|
||||||
_task(task),
|
_task(task),
|
||||||
_next_gen(next_gen),
|
_old_gen(old_gen),
|
||||||
_young_old_boundary(young_old_boundary),
|
_young_old_boundary(young_old_boundary),
|
||||||
_state_set(state_set)
|
_state_set(state_set)
|
||||||
{
|
{
|
||||||
@ -893,7 +893,7 @@ void ParNewGeneration::handle_promotion_failed(GenCollectedHeap* gch, ParScanThr
|
|||||||
from()->set_next_compaction_space(to());
|
from()->set_next_compaction_space(to());
|
||||||
gch->set_incremental_collection_failed();
|
gch->set_incremental_collection_failed();
|
||||||
// Inform the next generation that a promotion failure occurred.
|
// Inform the next generation that a promotion failure occurred.
|
||||||
_next_gen->promotion_failure_occurred();
|
_old_gen->promotion_failure_occurred();
|
||||||
|
|
||||||
// Trace promotion failure in the parallel GC threads
|
// Trace promotion failure in the parallel GC threads
|
||||||
thread_state_set.trace_promotion_failed(gc_tracer());
|
thread_state_set.trace_promotion_failed(gc_tracer());
|
||||||
@ -927,7 +927,7 @@ void ParNewGeneration::collect(bool full,
|
|||||||
workers->set_active_workers(active_workers);
|
workers->set_active_workers(active_workers);
|
||||||
assert(gch->n_gens() == 2,
|
assert(gch->n_gens() == 2,
|
||||||
"Par collection currently only works with single older gen.");
|
"Par collection currently only works with single older gen.");
|
||||||
_next_gen = gch->next_gen(this);
|
_old_gen = gch->old_gen();
|
||||||
|
|
||||||
// If the next generation is too full to accommodate worst-case promotion
|
// If the next generation is too full to accommodate worst-case promotion
|
||||||
// from this generation, pass on collection; let the next generation
|
// from this generation, pass on collection; let the next generation
|
||||||
@ -952,8 +952,6 @@ void ParNewGeneration::collect(bool full,
|
|||||||
// Capture heap used before collection (for printing).
|
// Capture heap used before collection (for printing).
|
||||||
size_t gch_prev_used = gch->used();
|
size_t gch_prev_used = gch->used();
|
||||||
|
|
||||||
SpecializationStats::clear();
|
|
||||||
|
|
||||||
age_table()->clear();
|
age_table()->clear();
|
||||||
to()->clear(SpaceDecorator::Mangle);
|
to()->clear(SpaceDecorator::Mangle);
|
||||||
|
|
||||||
@ -968,10 +966,10 @@ void ParNewGeneration::collect(bool full,
|
|||||||
// because only those workers go through the termination protocol.
|
// because only those workers go through the termination protocol.
|
||||||
ParallelTaskTerminator _term(n_workers, task_queues());
|
ParallelTaskTerminator _term(n_workers, task_queues());
|
||||||
ParScanThreadStateSet thread_state_set(workers->active_workers(),
|
ParScanThreadStateSet thread_state_set(workers->active_workers(),
|
||||||
*to(), *this, *_next_gen, *task_queues(),
|
*to(), *this, *_old_gen, *task_queues(),
|
||||||
_overflow_stacks, desired_plab_sz(), _term);
|
_overflow_stacks, desired_plab_sz(), _term);
|
||||||
|
|
||||||
ParNewGenTask tsk(this, _next_gen, reserved().end(), &thread_state_set);
|
ParNewGenTask tsk(this, _old_gen, reserved().end(), &thread_state_set);
|
||||||
gch->set_par_threads(n_workers);
|
gch->set_par_threads(n_workers);
|
||||||
gch->rem_set()->prepare_for_younger_refs_iterate(true);
|
gch->rem_set()->prepare_for_younger_refs_iterate(true);
|
||||||
// It turns out that even when we're using 1 thread, doing the work in a
|
// It turns out that even when we're using 1 thread, doing the work in a
|
||||||
@ -1073,8 +1071,6 @@ void ParNewGeneration::collect(bool full,
|
|||||||
jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
|
jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
|
||||||
update_time_of_last_gc(now);
|
update_time_of_last_gc(now);
|
||||||
|
|
||||||
SpecializationStats::print();
|
|
||||||
|
|
||||||
rp->set_enqueuing_is_done(true);
|
rp->set_enqueuing_is_done(true);
|
||||||
if (rp->processing_is_mt()) {
|
if (rp->processing_is_mt()) {
|
||||||
ParNewRefProcTaskExecutor task_executor(*this, thread_state_set);
|
ParNewRefProcTaskExecutor task_executor(*this, thread_state_set);
|
||||||
@ -1127,14 +1123,6 @@ oop ParNewGeneration::real_forwardee_slow(oop obj) {
|
|||||||
return forward_ptr;
|
return forward_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ASSERT
|
|
||||||
bool ParNewGeneration::is_legal_forward_ptr(oop p) {
|
|
||||||
return
|
|
||||||
(p == ClaimedForwardPtr)
|
|
||||||
|| Universe::heap()->is_in_reserved(p);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void ParNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) {
|
void ParNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) {
|
||||||
if (m->must_be_preserved_for_promotion_failure(obj)) {
|
if (m->must_be_preserved_for_promotion_failure(obj)) {
|
||||||
// We should really have separate per-worker stacks, rather
|
// We should really have separate per-worker stacks, rather
|
||||||
@ -1191,8 +1179,8 @@ oop ParNewGeneration::copy_to_survivor_space(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!_promotion_failed) {
|
if (!_promotion_failed) {
|
||||||
new_obj = _next_gen->par_promote(par_scan_state->thread_num(),
|
new_obj = _old_gen->par_promote(par_scan_state->thread_num(),
|
||||||
old, m, sz);
|
old, m, sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_obj == NULL) {
|
if (new_obj == NULL) {
|
||||||
@ -1209,6 +1197,7 @@ oop ParNewGeneration::copy_to_survivor_space(
|
|||||||
} else {
|
} else {
|
||||||
// Is in to-space; do copying ourselves.
|
// Is in to-space; do copying ourselves.
|
||||||
Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
|
Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
|
||||||
|
assert(Universe::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
|
||||||
forward_ptr = old->forward_to_atomic(new_obj);
|
forward_ptr = old->forward_to_atomic(new_obj);
|
||||||
// Restore the mark word copied above.
|
// Restore the mark word copied above.
|
||||||
new_obj->set_mark(m);
|
new_obj->set_mark(m);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -25,6 +25,7 @@
|
|||||||
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
|
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
|
||||||
#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
|
||||||
|
|
||||||
|
#include "gc_implementation/parNew/parOopClosures.hpp"
|
||||||
#include "gc_implementation/shared/gcTrace.hpp"
|
#include "gc_implementation/shared/gcTrace.hpp"
|
||||||
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
|
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
|
||||||
#include "gc_implementation/shared/copyFailedInfo.hpp"
|
#include "gc_implementation/shared/copyFailedInfo.hpp"
|
||||||
@ -233,13 +234,13 @@ class ParScanThreadState {
|
|||||||
class ParNewGenTask: public AbstractGangTask {
|
class ParNewGenTask: public AbstractGangTask {
|
||||||
private:
|
private:
|
||||||
ParNewGeneration* _gen;
|
ParNewGeneration* _gen;
|
||||||
Generation* _next_gen;
|
Generation* _old_gen;
|
||||||
HeapWord* _young_old_boundary;
|
HeapWord* _young_old_boundary;
|
||||||
class ParScanThreadStateSet* _state_set;
|
class ParScanThreadStateSet* _state_set;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ParNewGenTask(ParNewGeneration* gen,
|
ParNewGenTask(ParNewGeneration* gen,
|
||||||
Generation* next_gen,
|
Generation* old_gen,
|
||||||
HeapWord* young_old_boundary,
|
HeapWord* young_old_boundary,
|
||||||
ParScanThreadStateSet* state_set);
|
ParScanThreadStateSet* state_set);
|
||||||
|
|
||||||
@ -419,8 +420,6 @@ class ParNewGeneration: public DefNewGeneration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static oop real_forwardee(oop obj);
|
static oop real_forwardee(oop obj);
|
||||||
|
|
||||||
DEBUG_ONLY(static bool is_legal_forward_ptr(oop p);)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
|
#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARNEWGENERATION_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -29,6 +29,7 @@
|
|||||||
#include "gc_implementation/parNew/parOopClosures.hpp"
|
#include "gc_implementation/parNew/parOopClosures.hpp"
|
||||||
#include "memory/cardTableRS.hpp"
|
#include "memory/cardTableRS.hpp"
|
||||||
#include "memory/genCollectedHeap.hpp"
|
#include "memory/genCollectedHeap.hpp"
|
||||||
|
#include "memory/genOopClosures.inline.hpp"
|
||||||
|
|
||||||
template <class T> inline void ParScanWeakRefClosure::do_oop_work(T* p) {
|
template <class T> inline void ParScanWeakRefClosure::do_oop_work(T* p) {
|
||||||
assert (!oopDesc::is_null(*p), "null weak reference?");
|
assert (!oopDesc::is_null(*p), "null weak reference?");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -25,6 +25,7 @@
|
|||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
#include "code/codeCache.hpp"
|
#include "code/codeCache.hpp"
|
||||||
|
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
|
||||||
#include "gc_implementation/parallelScavenge/pcTasks.hpp"
|
#include "gc_implementation/parallelScavenge/pcTasks.hpp"
|
||||||
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
|
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
|
||||||
#include "gc_implementation/shared/gcTimer.hpp"
|
#include "gc_implementation/shared/gcTimer.hpp"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -26,7 +26,7 @@
|
|||||||
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
|
||||||
|
|
||||||
#include "gc_implementation/shared/collectorCounters.hpp"
|
#include "gc_implementation/shared/collectorCounters.hpp"
|
||||||
#include "gc_implementation/shared/markSweep.inline.hpp"
|
#include "gc_implementation/shared/markSweep.hpp"
|
||||||
#include "utilities/stack.hpp"
|
#include "utilities/stack.hpp"
|
||||||
|
|
||||||
class PSAdaptiveSizePolicy;
|
class PSAdaptiveSizePolicy;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -29,7 +29,6 @@
|
|||||||
#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
|
#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
|
||||||
#include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
|
#include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
|
||||||
#include "gc_implementation/shared/collectorCounters.hpp"
|
#include "gc_implementation/shared/collectorCounters.hpp"
|
||||||
#include "gc_implementation/shared/markSweep.hpp"
|
|
||||||
#include "gc_implementation/shared/mutableSpace.hpp"
|
#include "gc_implementation/shared/mutableSpace.hpp"
|
||||||
#include "memory/sharedHeap.hpp"
|
#include "memory/sharedHeap.hpp"
|
||||||
#include "oops/oop.hpp"
|
#include "oops/oop.hpp"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -34,6 +34,7 @@
|
|||||||
#include "memory/padded.inline.hpp"
|
#include "memory/padded.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/oop.psgc.inline.hpp"
|
#include "oops/oop.psgc.inline.hpp"
|
||||||
|
#include "utilities/stack.inline.hpp"
|
||||||
|
|
||||||
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "runtime/thread.hpp"
|
#include "runtime/thread.hpp"
|
||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
#include "services/management.hpp"
|
#include "services/management.hpp"
|
||||||
|
#include "utilities/stack.inline.hpp"
|
||||||
#include "utilities/taskqueue.hpp"
|
#include "utilities/taskqueue.hpp"
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -63,3 +63,20 @@ CSpaceCounters::CSpaceCounters(const char* name, int ordinal, size_t max_size,
|
|||||||
_space->capacity(), CHECK);
|
_space->capacity(), CHECK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSpaceCounters::update_capacity() {
|
||||||
|
_capacity->set_value(_space->capacity());
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSpaceCounters::update_used() {
|
||||||
|
_used->set_value(_space->used());
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSpaceCounters::update_all() {
|
||||||
|
update_used();
|
||||||
|
update_capacity();
|
||||||
|
}
|
||||||
|
|
||||||
|
jlong ContiguousSpaceUsedHelper::take_sample(){
|
||||||
|
return _space->used();
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -26,7 +26,7 @@
|
|||||||
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
|
||||||
|
|
||||||
#include "gc_implementation/shared/generationCounters.hpp"
|
#include "gc_implementation/shared/generationCounters.hpp"
|
||||||
#include "memory/space.inline.hpp"
|
#include "memory/space.hpp"
|
||||||
#include "runtime/perfData.hpp"
|
#include "runtime/perfData.hpp"
|
||||||
|
|
||||||
// A CSpaceCounters is a holder class for performance counters
|
// A CSpaceCounters is a holder class for performance counters
|
||||||
@ -56,18 +56,9 @@ class CSpaceCounters: public CHeapObj<mtGC> {
|
|||||||
if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
|
if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual inline void update_capacity() {
|
virtual void update_capacity();
|
||||||
_capacity->set_value(_space->capacity());
|
virtual void update_used();
|
||||||
}
|
virtual void update_all();
|
||||||
|
|
||||||
virtual inline void update_used() {
|
|
||||||
_used->set_value(_space->used());
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual inline void update_all() {
|
|
||||||
update_used();
|
|
||||||
update_capacity();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* name_space() const { return _name_space; }
|
const char* name_space() const { return _name_space; }
|
||||||
};
|
};
|
||||||
@ -79,9 +70,7 @@ class ContiguousSpaceUsedHelper : public PerfLongSampleHelper {
|
|||||||
public:
|
public:
|
||||||
ContiguousSpaceUsedHelper(ContiguousSpace* space) : _space(space) { }
|
ContiguousSpaceUsedHelper(ContiguousSpace* space) : _space(space) { }
|
||||||
|
|
||||||
inline jlong take_sample() {
|
jlong take_sample();
|
||||||
return _space->used();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
|
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_CSPACECOUNTERS_HPP
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -84,6 +84,14 @@ MarkSweep::FollowStackClosure MarkSweep::follow_stack_closure;
|
|||||||
|
|
||||||
void MarkSweep::FollowStackClosure::do_void() { follow_stack(); }
|
void MarkSweep::FollowStackClosure::do_void() { follow_stack(); }
|
||||||
|
|
||||||
|
void PreservedMark::adjust_pointer() {
|
||||||
|
MarkSweep::adjust_pointer(&_obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreservedMark::restore() {
|
||||||
|
_obj->set_mark(_mark);
|
||||||
|
}
|
||||||
|
|
||||||
// We preserve the mark which should be replaced at the end and the location
|
// We preserve the mark which should be replaced at the end and the location
|
||||||
// that it will go. Note that the object that this markOop belongs to isn't
|
// that it will go. Note that the object that this markOop belongs to isn't
|
||||||
// currently at that address but it will be after phase4
|
// currently at that address but it will be after phase4
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -26,7 +26,8 @@
|
|||||||
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
|
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
|
||||||
|
|
||||||
#include "gc_interface/collectedHeap.hpp"
|
#include "gc_interface/collectedHeap.hpp"
|
||||||
#include "memory/universe.hpp"
|
#include "memory/genOopClosures.hpp"
|
||||||
|
#include "memory/iterator.hpp"
|
||||||
#include "oops/markOop.hpp"
|
#include "oops/markOop.hpp"
|
||||||
#include "oops/oop.hpp"
|
#include "oops/oop.hpp"
|
||||||
#include "runtime/timer.hpp"
|
#include "runtime/timer.hpp"
|
||||||
@ -182,13 +183,8 @@ public:
|
|||||||
_mark = mark;
|
_mark = mark;
|
||||||
}
|
}
|
||||||
|
|
||||||
void adjust_pointer() {
|
void adjust_pointer();
|
||||||
MarkSweep::adjust_pointer(&_obj);
|
void restore();
|
||||||
}
|
|
||||||
|
|
||||||
void restore() {
|
|
||||||
_obj->set_mark(_mark);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
|
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_MARKSWEEP_HPP
|
||||||
|
@ -98,7 +98,7 @@ bool VM_GC_Operation::doit_prologue() {
|
|||||||
if (!is_init_completed()) {
|
if (!is_init_completed()) {
|
||||||
vm_exit_during_initialization(
|
vm_exit_during_initialization(
|
||||||
err_msg("GC triggered before VM initialization completed. Try increasing "
|
err_msg("GC triggered before VM initialization completed. Try increasing "
|
||||||
"NewSize, current value " UINTX_FORMAT "%s.",
|
"NewSize, current value " SIZE_FORMAT "%s.",
|
||||||
byte_size_in_proper_unit(NewSize),
|
byte_size_in_proper_unit(NewSize),
|
||||||
proper_unit_for_byte_size(NewSize)));
|
proper_unit_for_byte_size(NewSize)));
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "memory/cardTableRS.hpp"
|
#include "memory/cardTableRS.hpp"
|
||||||
#include "memory/genCollectedHeap.hpp"
|
#include "memory/genCollectedHeap.hpp"
|
||||||
#include "memory/generation.hpp"
|
#include "memory/generation.hpp"
|
||||||
#include "memory/space.hpp"
|
#include "memory/space.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
|
@ -104,15 +104,15 @@ void CollectorPolicy::initialize_flags() {
|
|||||||
|
|
||||||
// User inputs from -Xmx and -Xms must be aligned
|
// User inputs from -Xmx and -Xms must be aligned
|
||||||
_min_heap_byte_size = align_size_up(_min_heap_byte_size, _heap_alignment);
|
_min_heap_byte_size = align_size_up(_min_heap_byte_size, _heap_alignment);
|
||||||
uintx aligned_initial_heap_size = align_size_up(InitialHeapSize, _heap_alignment);
|
size_t aligned_initial_heap_size = align_size_up(InitialHeapSize, _heap_alignment);
|
||||||
uintx aligned_max_heap_size = align_size_up(MaxHeapSize, _heap_alignment);
|
size_t aligned_max_heap_size = align_size_up(MaxHeapSize, _heap_alignment);
|
||||||
|
|
||||||
// Write back to flags if the values changed
|
// Write back to flags if the values changed
|
||||||
if (aligned_initial_heap_size != InitialHeapSize) {
|
if (aligned_initial_heap_size != InitialHeapSize) {
|
||||||
FLAG_SET_ERGO(uintx, InitialHeapSize, aligned_initial_heap_size);
|
FLAG_SET_ERGO(size_t, InitialHeapSize, aligned_initial_heap_size);
|
||||||
}
|
}
|
||||||
if (aligned_max_heap_size != MaxHeapSize) {
|
if (aligned_max_heap_size != MaxHeapSize) {
|
||||||
FLAG_SET_ERGO(uintx, MaxHeapSize, aligned_max_heap_size);
|
FLAG_SET_ERGO(size_t, MaxHeapSize, aligned_max_heap_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FLAG_IS_CMDLINE(InitialHeapSize) && _min_heap_byte_size != 0 &&
|
if (FLAG_IS_CMDLINE(InitialHeapSize) && _min_heap_byte_size != 0 &&
|
||||||
@ -120,9 +120,9 @@ void CollectorPolicy::initialize_flags() {
|
|||||||
vm_exit_during_initialization("Incompatible minimum and initial heap sizes specified");
|
vm_exit_during_initialization("Incompatible minimum and initial heap sizes specified");
|
||||||
}
|
}
|
||||||
if (!FLAG_IS_DEFAULT(InitialHeapSize) && InitialHeapSize > MaxHeapSize) {
|
if (!FLAG_IS_DEFAULT(InitialHeapSize) && InitialHeapSize > MaxHeapSize) {
|
||||||
FLAG_SET_ERGO(uintx, MaxHeapSize, InitialHeapSize);
|
FLAG_SET_ERGO(size_t, MaxHeapSize, InitialHeapSize);
|
||||||
} else if (!FLAG_IS_DEFAULT(MaxHeapSize) && InitialHeapSize > MaxHeapSize) {
|
} else if (!FLAG_IS_DEFAULT(MaxHeapSize) && InitialHeapSize > MaxHeapSize) {
|
||||||
FLAG_SET_ERGO(uintx, InitialHeapSize, MaxHeapSize);
|
FLAG_SET_ERGO(size_t, InitialHeapSize, MaxHeapSize);
|
||||||
if (InitialHeapSize < _min_heap_byte_size) {
|
if (InitialHeapSize < _min_heap_byte_size) {
|
||||||
_min_heap_byte_size = InitialHeapSize;
|
_min_heap_byte_size = InitialHeapSize;
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ void CollectorPolicy::initialize_flags() {
|
|||||||
_initial_heap_byte_size = InitialHeapSize;
|
_initial_heap_byte_size = InitialHeapSize;
|
||||||
_max_heap_byte_size = MaxHeapSize;
|
_max_heap_byte_size = MaxHeapSize;
|
||||||
|
|
||||||
FLAG_SET_ERGO(uintx, MinHeapDeltaBytes, align_size_up(MinHeapDeltaBytes, _space_alignment));
|
FLAG_SET_ERGO(size_t, MinHeapDeltaBytes, align_size_up(MinHeapDeltaBytes, _space_alignment));
|
||||||
|
|
||||||
DEBUG_ONLY(CollectorPolicy::assert_flags();)
|
DEBUG_ONLY(CollectorPolicy::assert_flags();)
|
||||||
}
|
}
|
||||||
@ -282,18 +282,18 @@ void GenCollectorPolicy::initialize_flags() {
|
|||||||
// All generational heaps have a youngest gen; handle those flags here
|
// All generational heaps have a youngest gen; handle those flags here
|
||||||
|
|
||||||
// Make sure the heap is large enough for two generations
|
// Make sure the heap is large enough for two generations
|
||||||
uintx smallest_new_size = young_gen_size_lower_bound();
|
size_t smallest_new_size = young_gen_size_lower_bound();
|
||||||
uintx smallest_heap_size = align_size_up(smallest_new_size + align_size_up(_space_alignment, _gen_alignment),
|
size_t smallest_heap_size = align_size_up(smallest_new_size + align_size_up(_space_alignment, _gen_alignment),
|
||||||
_heap_alignment);
|
_heap_alignment);
|
||||||
if (MaxHeapSize < smallest_heap_size) {
|
if (MaxHeapSize < smallest_heap_size) {
|
||||||
FLAG_SET_ERGO(uintx, MaxHeapSize, smallest_heap_size);
|
FLAG_SET_ERGO(size_t, MaxHeapSize, smallest_heap_size);
|
||||||
_max_heap_byte_size = MaxHeapSize;
|
_max_heap_byte_size = MaxHeapSize;
|
||||||
}
|
}
|
||||||
// If needed, synchronize _min_heap_byte size and _initial_heap_byte_size
|
// If needed, synchronize _min_heap_byte size and _initial_heap_byte_size
|
||||||
if (_min_heap_byte_size < smallest_heap_size) {
|
if (_min_heap_byte_size < smallest_heap_size) {
|
||||||
_min_heap_byte_size = smallest_heap_size;
|
_min_heap_byte_size = smallest_heap_size;
|
||||||
if (InitialHeapSize < _min_heap_byte_size) {
|
if (InitialHeapSize < _min_heap_byte_size) {
|
||||||
FLAG_SET_ERGO(uintx, InitialHeapSize, smallest_heap_size);
|
FLAG_SET_ERGO(size_t, InitialHeapSize, smallest_heap_size);
|
||||||
_initial_heap_byte_size = smallest_heap_size;
|
_initial_heap_byte_size = smallest_heap_size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -306,8 +306,8 @@ void GenCollectorPolicy::initialize_flags() {
|
|||||||
|
|
||||||
// Now take the actual NewSize into account. We will silently increase NewSize
|
// Now take the actual NewSize into account. We will silently increase NewSize
|
||||||
// if the user specified a smaller or unaligned value.
|
// if the user specified a smaller or unaligned value.
|
||||||
uintx bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize);
|
size_t bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize);
|
||||||
bounded_new_size = MAX2(smallest_new_size, (uintx)align_size_down(bounded_new_size, _gen_alignment));
|
bounded_new_size = MAX2(smallest_new_size, (size_t)align_size_down(bounded_new_size, _gen_alignment));
|
||||||
if (bounded_new_size != NewSize) {
|
if (bounded_new_size != NewSize) {
|
||||||
// Do not use FLAG_SET_ERGO to update NewSize here, since this will override
|
// Do not use FLAG_SET_ERGO to update NewSize here, since this will override
|
||||||
// if NewSize was set on the command line or not. This information is needed
|
// if NewSize was set on the command line or not. This information is needed
|
||||||
@ -320,21 +320,21 @@ void GenCollectorPolicy::initialize_flags() {
|
|||||||
if (!FLAG_IS_DEFAULT(MaxNewSize)) {
|
if (!FLAG_IS_DEFAULT(MaxNewSize)) {
|
||||||
if (MaxNewSize >= MaxHeapSize) {
|
if (MaxNewSize >= MaxHeapSize) {
|
||||||
// Make sure there is room for an old generation
|
// Make sure there is room for an old generation
|
||||||
uintx smaller_max_new_size = MaxHeapSize - _gen_alignment;
|
size_t smaller_max_new_size = MaxHeapSize - _gen_alignment;
|
||||||
if (FLAG_IS_CMDLINE(MaxNewSize)) {
|
if (FLAG_IS_CMDLINE(MaxNewSize)) {
|
||||||
warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire "
|
warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire "
|
||||||
"heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.",
|
"heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.",
|
||||||
MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K);
|
MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K);
|
||||||
}
|
}
|
||||||
FLAG_SET_ERGO(uintx, MaxNewSize, smaller_max_new_size);
|
FLAG_SET_ERGO(size_t, MaxNewSize, smaller_max_new_size);
|
||||||
if (NewSize > MaxNewSize) {
|
if (NewSize > MaxNewSize) {
|
||||||
FLAG_SET_ERGO(uintx, NewSize, MaxNewSize);
|
FLAG_SET_ERGO(size_t, NewSize, MaxNewSize);
|
||||||
_initial_young_size = NewSize;
|
_initial_young_size = NewSize;
|
||||||
}
|
}
|
||||||
} else if (MaxNewSize < _initial_young_size) {
|
} else if (MaxNewSize < _initial_young_size) {
|
||||||
FLAG_SET_ERGO(uintx, MaxNewSize, _initial_young_size);
|
FLAG_SET_ERGO(size_t, MaxNewSize, _initial_young_size);
|
||||||
} else if (!is_size_aligned(MaxNewSize, _gen_alignment)) {
|
} else if (!is_size_aligned(MaxNewSize, _gen_alignment)) {
|
||||||
FLAG_SET_ERGO(uintx, MaxNewSize, align_size_down(MaxNewSize, _gen_alignment));
|
FLAG_SET_ERGO(size_t, MaxNewSize, align_size_down(MaxNewSize, _gen_alignment));
|
||||||
}
|
}
|
||||||
_max_young_size = MaxNewSize;
|
_max_young_size = MaxNewSize;
|
||||||
}
|
}
|
||||||
@ -347,7 +347,7 @@ void GenCollectorPolicy::initialize_flags() {
|
|||||||
"A new max generation size of " SIZE_FORMAT "k will be used.",
|
"A new max generation size of " SIZE_FORMAT "k will be used.",
|
||||||
NewSize/K, MaxNewSize/K, NewSize/K);
|
NewSize/K, MaxNewSize/K, NewSize/K);
|
||||||
}
|
}
|
||||||
FLAG_SET_ERGO(uintx, MaxNewSize, NewSize);
|
FLAG_SET_ERGO(size_t, MaxNewSize, NewSize);
|
||||||
_max_young_size = MaxNewSize;
|
_max_young_size = MaxNewSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,9 +369,9 @@ void GenCollectorPolicy::initialize_flags() {
|
|||||||
size_t calculated_heapsize = (OldSize / NewRatio) * (NewRatio + 1);
|
size_t calculated_heapsize = (OldSize / NewRatio) * (NewRatio + 1);
|
||||||
|
|
||||||
calculated_heapsize = align_size_up(calculated_heapsize, _heap_alignment);
|
calculated_heapsize = align_size_up(calculated_heapsize, _heap_alignment);
|
||||||
FLAG_SET_ERGO(uintx, MaxHeapSize, calculated_heapsize);
|
FLAG_SET_ERGO(size_t, MaxHeapSize, calculated_heapsize);
|
||||||
_max_heap_byte_size = MaxHeapSize;
|
_max_heap_byte_size = MaxHeapSize;
|
||||||
FLAG_SET_ERGO(uintx, InitialHeapSize, calculated_heapsize);
|
FLAG_SET_ERGO(size_t, InitialHeapSize, calculated_heapsize);
|
||||||
_initial_heap_byte_size = InitialHeapSize;
|
_initial_heap_byte_size = InitialHeapSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,19 +380,19 @@ void GenCollectorPolicy::initialize_flags() {
|
|||||||
if (_max_heap_size_cmdline) {
|
if (_max_heap_size_cmdline) {
|
||||||
// Somebody has set a maximum heap size with the intention that we should not
|
// Somebody has set a maximum heap size with the intention that we should not
|
||||||
// exceed it. Adjust New/OldSize as necessary.
|
// exceed it. Adjust New/OldSize as necessary.
|
||||||
uintx calculated_size = NewSize + OldSize;
|
size_t calculated_size = NewSize + OldSize;
|
||||||
double shrink_factor = (double) MaxHeapSize / calculated_size;
|
double shrink_factor = (double) MaxHeapSize / calculated_size;
|
||||||
uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment);
|
size_t smaller_new_size = align_size_down((size_t)(NewSize * shrink_factor), _gen_alignment);
|
||||||
FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size));
|
FLAG_SET_ERGO(size_t, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size));
|
||||||
_initial_young_size = NewSize;
|
_initial_young_size = NewSize;
|
||||||
|
|
||||||
// OldSize is already aligned because above we aligned MaxHeapSize to
|
// OldSize is already aligned because above we aligned MaxHeapSize to
|
||||||
// _heap_alignment, and we just made sure that NewSize is aligned to
|
// _heap_alignment, and we just made sure that NewSize is aligned to
|
||||||
// _gen_alignment. In initialize_flags() we verified that _heap_alignment
|
// _gen_alignment. In initialize_flags() we verified that _heap_alignment
|
||||||
// is a multiple of _gen_alignment.
|
// is a multiple of _gen_alignment.
|
||||||
FLAG_SET_ERGO(uintx, OldSize, MaxHeapSize - NewSize);
|
FLAG_SET_ERGO(size_t, OldSize, MaxHeapSize - NewSize);
|
||||||
} else {
|
} else {
|
||||||
FLAG_SET_ERGO(uintx, MaxHeapSize, align_size_up(NewSize + OldSize, _heap_alignment));
|
FLAG_SET_ERGO(size_t, MaxHeapSize, align_size_up(NewSize + OldSize, _heap_alignment));
|
||||||
_max_heap_byte_size = MaxHeapSize;
|
_max_heap_byte_size = MaxHeapSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -405,7 +405,7 @@ void GenCollectorPolicy::initialize_flags() {
|
|||||||
// Need to compare against the flag value for max since _max_young_size
|
// Need to compare against the flag value for max since _max_young_size
|
||||||
// might not have been set yet.
|
// might not have been set yet.
|
||||||
if (new_size >= _min_young_size && new_size <= MaxNewSize) {
|
if (new_size >= _min_young_size && new_size <= MaxNewSize) {
|
||||||
FLAG_SET_ERGO(uintx, NewSize, new_size);
|
FLAG_SET_ERGO(size_t, NewSize, new_size);
|
||||||
_initial_young_size = NewSize;
|
_initial_young_size = NewSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -561,15 +561,15 @@ void GenCollectorPolicy::initialize_size_info() {
|
|||||||
|
|
||||||
// Write back to flags if necessary.
|
// Write back to flags if necessary.
|
||||||
if (NewSize != _initial_young_size) {
|
if (NewSize != _initial_young_size) {
|
||||||
FLAG_SET_ERGO(uintx, NewSize, _initial_young_size);
|
FLAG_SET_ERGO(size_t, NewSize, _initial_young_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MaxNewSize != _max_young_size) {
|
if (MaxNewSize != _max_young_size) {
|
||||||
FLAG_SET_ERGO(uintx, MaxNewSize, _max_young_size);
|
FLAG_SET_ERGO(size_t, MaxNewSize, _max_young_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OldSize != _initial_old_size) {
|
if (OldSize != _initial_old_size) {
|
||||||
FLAG_SET_ERGO(uintx, OldSize, _initial_old_size);
|
FLAG_SET_ERGO(size_t, OldSize, _initial_old_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PrintGCDetails && Verbose) {
|
if (PrintGCDetails && Verbose) {
|
||||||
@ -601,7 +601,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
|||||||
HandleMark hm; // Discard any handles allocated in each iteration.
|
HandleMark hm; // Discard any handles allocated in each iteration.
|
||||||
|
|
||||||
// First allocation attempt is lock-free.
|
// First allocation attempt is lock-free.
|
||||||
Generation *young = gch->get_gen(0);
|
Generation *young = gch->young_gen();
|
||||||
assert(young->supports_inline_contig_alloc(),
|
assert(young->supports_inline_contig_alloc(),
|
||||||
"Otherwise, must do alloc within heap lock");
|
"Otherwise, must do alloc within heap lock");
|
||||||
if (young->should_allocate(size, is_tlab)) {
|
if (young->should_allocate(size, is_tlab)) {
|
||||||
@ -615,8 +615,8 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
|||||||
{
|
{
|
||||||
MutexLocker ml(Heap_lock);
|
MutexLocker ml(Heap_lock);
|
||||||
if (PrintGC && Verbose) {
|
if (PrintGC && Verbose) {
|
||||||
gclog_or_tty->print_cr("TwoGenerationCollectorPolicy::mem_allocate_work:"
|
gclog_or_tty->print_cr("GenCollectorPolicy::mem_allocate_work:"
|
||||||
" attempting locked slow path allocation");
|
" attempting locked slow path allocation");
|
||||||
}
|
}
|
||||||
// Note that only large objects get a shot at being
|
// Note that only large objects get a shot at being
|
||||||
// allocated in later generations.
|
// allocated in later generations.
|
||||||
@ -705,7 +705,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
|||||||
// Give a warning if we seem to be looping forever.
|
// Give a warning if we seem to be looping forever.
|
||||||
if ((QueuedAllocationWarningCount > 0) &&
|
if ((QueuedAllocationWarningCount > 0) &&
|
||||||
(try_count % QueuedAllocationWarningCount == 0)) {
|
(try_count % QueuedAllocationWarningCount == 0)) {
|
||||||
warning("TwoGenerationCollectorPolicy::mem_allocate_work retries %d times \n\t"
|
warning("GenCollectorPolicy::mem_allocate_work retries %d times \n\t"
|
||||||
" size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
|
" size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -715,10 +715,14 @@ HeapWord* GenCollectorPolicy::expand_heap_and_allocate(size_t size,
|
|||||||
bool is_tlab) {
|
bool is_tlab) {
|
||||||
GenCollectedHeap *gch = GenCollectedHeap::heap();
|
GenCollectedHeap *gch = GenCollectedHeap::heap();
|
||||||
HeapWord* result = NULL;
|
HeapWord* result = NULL;
|
||||||
for (int i = number_of_generations() - 1; i >= 0 && result == NULL; i--) {
|
Generation *old = gch->old_gen();
|
||||||
Generation *gen = gch->get_gen(i);
|
if (old->should_allocate(size, is_tlab)) {
|
||||||
if (gen->should_allocate(size, is_tlab)) {
|
result = old->expand_and_allocate(size, is_tlab);
|
||||||
result = gen->expand_and_allocate(size, is_tlab);
|
}
|
||||||
|
if (result == NULL) {
|
||||||
|
Generation *young = gch->young_gen();
|
||||||
|
if (young->should_allocate(size, is_tlab)) {
|
||||||
|
result = young->expand_and_allocate(size, is_tlab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(result == NULL || gch->is_in_reserved(result), "result not in heap");
|
assert(result == NULL || gch->is_in_reserved(result), "result not in heap");
|
||||||
@ -891,7 +895,7 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation(
|
|||||||
bool GenCollectorPolicy::should_try_older_generation_allocation(
|
bool GenCollectorPolicy::should_try_older_generation_allocation(
|
||||||
size_t word_size) const {
|
size_t word_size) const {
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
size_t young_capacity = gch->get_gen(0)->capacity_before_gc();
|
size_t young_capacity = gch->young_gen()->capacity_before_gc();
|
||||||
return (word_size > heap_word_size(young_capacity))
|
return (word_size > heap_word_size(young_capacity))
|
||||||
|| GC_locker::is_active_and_needs_gc()
|
|| GC_locker::is_active_and_needs_gc()
|
||||||
|| gch->incremental_collection_failed();
|
|| gch->incremental_collection_failed();
|
||||||
@ -903,7 +907,7 @@ bool GenCollectorPolicy::should_try_older_generation_allocation(
|
|||||||
//
|
//
|
||||||
|
|
||||||
void MarkSweepPolicy::initialize_alignments() {
|
void MarkSweepPolicy::initialize_alignments() {
|
||||||
_space_alignment = _gen_alignment = (uintx)Generation::GenGrain;
|
_space_alignment = _gen_alignment = (size_t)Generation::GenGrain;
|
||||||
_heap_alignment = compute_heap_alignment();
|
_heap_alignment = compute_heap_alignment();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -935,18 +939,18 @@ public:
|
|||||||
// for both min and initial young size if less than min heap.
|
// for both min and initial young size if less than min heap.
|
||||||
flag_value = 20 * M;
|
flag_value = 20 * M;
|
||||||
set_basic_flag_values();
|
set_basic_flag_values();
|
||||||
FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
|
FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
|
||||||
verify_young_min(flag_value);
|
verify_young_min(flag_value);
|
||||||
|
|
||||||
set_basic_flag_values();
|
set_basic_flag_values();
|
||||||
FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
|
FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
|
||||||
verify_young_initial(flag_value);
|
verify_young_initial(flag_value);
|
||||||
|
|
||||||
// If NewSize is set on command line, but is larger than the min
|
// If NewSize is set on command line, but is larger than the min
|
||||||
// heap size, it should only be used for initial young size.
|
// heap size, it should only be used for initial young size.
|
||||||
flag_value = 80 * M;
|
flag_value = 80 * M;
|
||||||
set_basic_flag_values();
|
set_basic_flag_values();
|
||||||
FLAG_SET_CMDLINE(uintx, NewSize, flag_value);
|
FLAG_SET_CMDLINE(size_t, NewSize, flag_value);
|
||||||
verify_young_initial(flag_value);
|
verify_young_initial(flag_value);
|
||||||
|
|
||||||
// If NewSize has been ergonomically set, the collector policy
|
// If NewSize has been ergonomically set, the collector policy
|
||||||
@ -954,11 +958,11 @@ public:
|
|||||||
// using NewRatio.
|
// using NewRatio.
|
||||||
flag_value = 20 * M;
|
flag_value = 20 * M;
|
||||||
set_basic_flag_values();
|
set_basic_flag_values();
|
||||||
FLAG_SET_ERGO(uintx, NewSize, flag_value);
|
FLAG_SET_ERGO(size_t, NewSize, flag_value);
|
||||||
verify_young_min(flag_value);
|
verify_young_min(flag_value);
|
||||||
|
|
||||||
set_basic_flag_values();
|
set_basic_flag_values();
|
||||||
FLAG_SET_ERGO(uintx, NewSize, flag_value);
|
FLAG_SET_ERGO(size_t, NewSize, flag_value);
|
||||||
verify_scaled_young_initial(InitialHeapSize);
|
verify_scaled_young_initial(InitialHeapSize);
|
||||||
|
|
||||||
restore_flags();
|
restore_flags();
|
||||||
@ -974,11 +978,11 @@ public:
|
|||||||
// for both min and initial old size if less than min heap.
|
// for both min and initial old size if less than min heap.
|
||||||
flag_value = 20 * M;
|
flag_value = 20 * M;
|
||||||
set_basic_flag_values();
|
set_basic_flag_values();
|
||||||
FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
|
FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
|
||||||
verify_old_min(flag_value);
|
verify_old_min(flag_value);
|
||||||
|
|
||||||
set_basic_flag_values();
|
set_basic_flag_values();
|
||||||
FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
|
FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
|
||||||
// Calculate what we expect the flag to be.
|
// Calculate what we expect the flag to be.
|
||||||
size_t expected_old_initial = align_size_up(InitialHeapSize, heap_alignment) - MaxNewSize;
|
size_t expected_old_initial = align_size_up(InitialHeapSize, heap_alignment) - MaxNewSize;
|
||||||
verify_old_initial(expected_old_initial);
|
verify_old_initial(expected_old_initial);
|
||||||
@ -989,10 +993,10 @@ public:
|
|||||||
// We intentionally set MaxNewSize + OldSize > MaxHeapSize (see over_size).
|
// We intentionally set MaxNewSize + OldSize > MaxHeapSize (see over_size).
|
||||||
flag_value = 30 * M;
|
flag_value = 30 * M;
|
||||||
set_basic_flag_values();
|
set_basic_flag_values();
|
||||||
FLAG_SET_CMDLINE(uintx, OldSize, flag_value);
|
FLAG_SET_CMDLINE(size_t, OldSize, flag_value);
|
||||||
size_t over_size = 20*M;
|
size_t over_size = 20*M;
|
||||||
size_t new_size_value = align_size_up(MaxHeapSize, heap_alignment) - flag_value + over_size;
|
size_t new_size_value = align_size_up(MaxHeapSize, heap_alignment) - flag_value + over_size;
|
||||||
FLAG_SET_CMDLINE(uintx, MaxNewSize, new_size_value);
|
FLAG_SET_CMDLINE(size_t, MaxNewSize, new_size_value);
|
||||||
// Calculate what we expect the flag to be.
|
// Calculate what we expect the flag to be.
|
||||||
expected_old_initial = align_size_up(MaxHeapSize, heap_alignment) - MaxNewSize;
|
expected_old_initial = align_size_up(MaxHeapSize, heap_alignment) - MaxNewSize;
|
||||||
verify_old_initial(expected_old_initial);
|
verify_old_initial(expected_old_initial);
|
||||||
@ -1053,11 +1057,11 @@ private:
|
|||||||
static size_t original_OldSize;
|
static size_t original_OldSize;
|
||||||
|
|
||||||
static void set_basic_flag_values() {
|
static void set_basic_flag_values() {
|
||||||
FLAG_SET_ERGO(uintx, MaxHeapSize, 180 * M);
|
FLAG_SET_ERGO(size_t, MaxHeapSize, 180 * M);
|
||||||
FLAG_SET_ERGO(uintx, InitialHeapSize, 100 * M);
|
FLAG_SET_ERGO(size_t, InitialHeapSize, 100 * M);
|
||||||
FLAG_SET_ERGO(uintx, OldSize, 4 * M);
|
FLAG_SET_ERGO(size_t, OldSize, 4 * M);
|
||||||
FLAG_SET_ERGO(uintx, NewSize, 1 * M);
|
FLAG_SET_ERGO(size_t, NewSize, 1 * M);
|
||||||
FLAG_SET_ERGO(uintx, MaxNewSize, 80 * M);
|
FLAG_SET_ERGO(size_t, MaxNewSize, 80 * M);
|
||||||
Arguments::set_min_heap_size(40 * M);
|
Arguments::set_min_heap_size(40 * M);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ DefNewGeneration::DefNewGeneration(ReservedSpace rs,
|
|||||||
|
|
||||||
compute_space_boundaries(0, SpaceDecorator::Clear, SpaceDecorator::Mangle);
|
compute_space_boundaries(0, SpaceDecorator::Clear, SpaceDecorator::Mangle);
|
||||||
update_counters();
|
update_counters();
|
||||||
_next_gen = NULL;
|
_old_gen = NULL;
|
||||||
_tenuring_threshold = MaxTenuringThreshold;
|
_tenuring_threshold = MaxTenuringThreshold;
|
||||||
_pretenure_size_threshold_words = PretenureSizeThreshold >> LogHeapWordSize;
|
_pretenure_size_threshold_words = PretenureSizeThreshold >> LogHeapWordSize;
|
||||||
|
|
||||||
@ -383,8 +383,8 @@ void DefNewGeneration::compute_new_size() {
|
|||||||
assert(next_level < gch->_n_gens,
|
assert(next_level < gch->_n_gens,
|
||||||
"DefNewGeneration cannot be an oldest gen");
|
"DefNewGeneration cannot be an oldest gen");
|
||||||
|
|
||||||
Generation* next_gen = gch->get_gen(next_level);
|
Generation* old_gen = gch->old_gen();
|
||||||
size_t old_size = next_gen->capacity();
|
size_t old_size = old_gen->capacity();
|
||||||
size_t new_size_before = _virtual_space.committed_size();
|
size_t new_size_before = _virtual_space.committed_size();
|
||||||
size_t min_new_size = spec()->init_size();
|
size_t min_new_size = spec()->init_size();
|
||||||
size_t max_new_size = reserved().byte_size();
|
size_t max_new_size = reserved().byte_size();
|
||||||
@ -568,7 +568,7 @@ void DefNewGeneration::collect(bool full,
|
|||||||
DefNewTracer gc_tracer;
|
DefNewTracer gc_tracer;
|
||||||
gc_tracer.report_gc_start(gch->gc_cause(), _gc_timer->gc_start());
|
gc_tracer.report_gc_start(gch->gc_cause(), _gc_timer->gc_start());
|
||||||
|
|
||||||
_next_gen = gch->next_gen(this);
|
_old_gen = gch->old_gen();
|
||||||
|
|
||||||
// If the next generation is too full to accommodate promotion
|
// If the next generation is too full to accommodate promotion
|
||||||
// from this generation, pass on collection; let the next generation
|
// from this generation, pass on collection; let the next generation
|
||||||
@ -590,8 +590,6 @@ void DefNewGeneration::collect(bool full,
|
|||||||
|
|
||||||
gch->trace_heap_before_gc(&gc_tracer);
|
gch->trace_heap_before_gc(&gc_tracer);
|
||||||
|
|
||||||
SpecializationStats::clear();
|
|
||||||
|
|
||||||
// These can be shared for all code paths
|
// These can be shared for all code paths
|
||||||
IsAliveClosure is_alive(this);
|
IsAliveClosure is_alive(this);
|
||||||
ScanWeakRefClosure scan_weak_ref(this);
|
ScanWeakRefClosure scan_weak_ref(this);
|
||||||
@ -628,7 +626,7 @@ void DefNewGeneration::collect(bool full,
|
|||||||
true, // Process younger gens, if any,
|
true, // Process younger gens, if any,
|
||||||
// as strong roots.
|
// as strong roots.
|
||||||
true, // activate StrongRootsScope
|
true, // activate StrongRootsScope
|
||||||
SharedHeap::SO_ScavengeCodeCache,
|
GenCollectedHeap::SO_ScavengeCodeCache,
|
||||||
GenCollectedHeap::StrongAndWeakRoots,
|
GenCollectedHeap::StrongAndWeakRoots,
|
||||||
&fsc_with_no_gc_barrier,
|
&fsc_with_no_gc_barrier,
|
||||||
&fsc_with_gc_barrier,
|
&fsc_with_gc_barrier,
|
||||||
@ -688,7 +686,7 @@ void DefNewGeneration::collect(bool full,
|
|||||||
gch->set_incremental_collection_failed();
|
gch->set_incremental_collection_failed();
|
||||||
|
|
||||||
// Inform the next generation that a promotion failure occurred.
|
// Inform the next generation that a promotion failure occurred.
|
||||||
_next_gen->promotion_failure_occurred();
|
_old_gen->promotion_failure_occurred();
|
||||||
gc_tracer.report_promotion_failed(_promotion_failed_info);
|
gc_tracer.report_promotion_failed(_promotion_failed_info);
|
||||||
|
|
||||||
// Reset the PromotionFailureALot counters.
|
// Reset the PromotionFailureALot counters.
|
||||||
@ -700,7 +698,6 @@ void DefNewGeneration::collect(bool full,
|
|||||||
// set new iteration safe limit for the survivor spaces
|
// set new iteration safe limit for the survivor spaces
|
||||||
from()->set_concurrent_iteration_safe_limit(from()->top());
|
from()->set_concurrent_iteration_safe_limit(from()->top());
|
||||||
to()->set_concurrent_iteration_safe_limit(to()->top());
|
to()->set_concurrent_iteration_safe_limit(to()->top());
|
||||||
SpecializationStats::print();
|
|
||||||
|
|
||||||
// We need to use a monotonically non-decreasing time in ms
|
// We need to use a monotonically non-decreasing time in ms
|
||||||
// or we will see time-warp warnings and os::javaTimeMillis()
|
// or we will see time-warp warnings and os::javaTimeMillis()
|
||||||
@ -793,7 +790,7 @@ oop DefNewGeneration::copy_to_survivor_space(oop old) {
|
|||||||
|
|
||||||
// Otherwise try allocating obj tenured
|
// Otherwise try allocating obj tenured
|
||||||
if (obj == NULL) {
|
if (obj == NULL) {
|
||||||
obj = _next_gen->promote(old, s);
|
obj = _old_gen->promote(old, s);
|
||||||
if (obj == NULL) {
|
if (obj == NULL) {
|
||||||
handle_promotion_failure(old);
|
handle_promotion_failure(old);
|
||||||
return old;
|
return old;
|
||||||
@ -898,11 +895,11 @@ bool DefNewGeneration::collection_attempt_is_safe() {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_next_gen == NULL) {
|
if (_old_gen == NULL) {
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
_next_gen = gch->next_gen(this);
|
_old_gen = gch->old_gen();
|
||||||
}
|
}
|
||||||
return _next_gen->promotion_attempt_is_safe(used());
|
return _old_gen->promotion_attempt_is_safe(used());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefNewGeneration::gc_epilogue(bool full) {
|
void DefNewGeneration::gc_epilogue(bool full) {
|
||||||
@ -1022,8 +1019,7 @@ CompactibleSpace* DefNewGeneration::first_compaction_space() const {
|
|||||||
return eden();
|
return eden();
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapWord* DefNewGeneration::allocate(size_t word_size,
|
HeapWord* DefNewGeneration::allocate(size_t word_size, bool is_tlab) {
|
||||||
bool is_tlab) {
|
|
||||||
// This is the slow-path allocation for the DefNewGeneration.
|
// This is the slow-path allocation for the DefNewGeneration.
|
||||||
// Most allocations are fast-path in compiled code.
|
// Most allocations are fast-path in compiled code.
|
||||||
// We try to allocate from the eden. If that works, we are happy.
|
// We try to allocate from the eden. If that works, we are happy.
|
||||||
@ -1031,8 +1027,8 @@ HeapWord* DefNewGeneration::allocate(size_t word_size,
|
|||||||
// have to use it here, as well.
|
// have to use it here, as well.
|
||||||
HeapWord* result = eden()->par_allocate(word_size);
|
HeapWord* result = eden()->par_allocate(word_size);
|
||||||
if (result != NULL) {
|
if (result != NULL) {
|
||||||
if (CMSEdenChunksRecordAlways && _next_gen != NULL) {
|
if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
|
||||||
_next_gen->sample_eden_chunk();
|
_old_gen->sample_eden_chunk();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If the eden is full and the last collection bailed out, we are running
|
// If the eden is full and the last collection bailed out, we are running
|
||||||
@ -1047,8 +1043,8 @@ HeapWord* DefNewGeneration::allocate(size_t word_size,
|
|||||||
HeapWord* DefNewGeneration::par_allocate(size_t word_size,
|
HeapWord* DefNewGeneration::par_allocate(size_t word_size,
|
||||||
bool is_tlab) {
|
bool is_tlab) {
|
||||||
HeapWord* res = eden()->par_allocate(word_size);
|
HeapWord* res = eden()->par_allocate(word_size);
|
||||||
if (CMSEdenChunksRecordAlways && _next_gen != NULL) {
|
if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
|
||||||
_next_gen->sample_eden_chunk();
|
_old_gen->sample_eden_chunk();
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -29,11 +29,14 @@
|
|||||||
#include "gc_implementation/shared/cSpaceCounters.hpp"
|
#include "gc_implementation/shared/cSpaceCounters.hpp"
|
||||||
#include "gc_implementation/shared/generationCounters.hpp"
|
#include "gc_implementation/shared/generationCounters.hpp"
|
||||||
#include "gc_implementation/shared/copyFailedInfo.hpp"
|
#include "gc_implementation/shared/copyFailedInfo.hpp"
|
||||||
|
#include "memory/generation.hpp"
|
||||||
#include "utilities/stack.hpp"
|
#include "utilities/stack.hpp"
|
||||||
|
|
||||||
class ContiguousSpace;
|
class ContiguousSpace;
|
||||||
class ScanClosure;
|
class ScanClosure;
|
||||||
class STWGCTimer;
|
class STWGCTimer;
|
||||||
|
class CSpaceCounters;
|
||||||
|
class ScanWeakRefClosure;
|
||||||
|
|
||||||
// DefNewGeneration is a young generation containing eden, from- and
|
// DefNewGeneration is a young generation containing eden, from- and
|
||||||
// to-space.
|
// to-space.
|
||||||
@ -42,7 +45,7 @@ class DefNewGeneration: public Generation {
|
|||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Generation* _next_gen;
|
Generation* _old_gen;
|
||||||
uint _tenuring_threshold; // Tenuring threshold for next collection.
|
uint _tenuring_threshold; // Tenuring threshold for next collection.
|
||||||
ageTable _age_table;
|
ageTable _age_table;
|
||||||
// Size of object to pretenure in words; command line provides bytes
|
// Size of object to pretenure in words; command line provides bytes
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -25,8 +25,10 @@
|
|||||||
#ifndef SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
|
#ifndef SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
|
||||||
#define SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
|
#define SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
|
||||||
|
|
||||||
|
#include "gc_interface/collectedHeap.hpp"
|
||||||
#include "memory/cardTableRS.hpp"
|
#include "memory/cardTableRS.hpp"
|
||||||
#include "memory/defNewGeneration.hpp"
|
#include "memory/defNewGeneration.hpp"
|
||||||
|
#include "memory/genOopClosures.inline.hpp"
|
||||||
#include "memory/space.hpp"
|
#include "memory/space.hpp"
|
||||||
|
|
||||||
// Methods of protected closure types
|
// Methods of protected closure types
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "classfile/symbolTable.hpp"
|
#include "classfile/symbolTable.hpp"
|
||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
#include "classfile/vmSymbols.hpp"
|
#include "classfile/vmSymbols.hpp"
|
||||||
|
#include "code/codeCache.hpp"
|
||||||
#include "code/icBuffer.hpp"
|
#include "code/icBuffer.hpp"
|
||||||
#include "gc_implementation/shared/collectorCounters.hpp"
|
#include "gc_implementation/shared/collectorCounters.hpp"
|
||||||
#include "gc_implementation/shared/gcTrace.hpp"
|
#include "gc_implementation/shared/gcTrace.hpp"
|
||||||
@ -47,6 +48,7 @@
|
|||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
|
#include "services/management.hpp"
|
||||||
#include "services/memoryService.hpp"
|
#include "services/memoryService.hpp"
|
||||||
#include "utilities/vmError.hpp"
|
#include "utilities/vmError.hpp"
|
||||||
#include "utilities/workgroup.hpp"
|
#include "utilities/workgroup.hpp"
|
||||||
@ -61,7 +63,15 @@ NOT_PRODUCT(size_t GenCollectedHeap::_skip_header_HeapWords = 0;)
|
|||||||
|
|
||||||
// The set of potentially parallel tasks in root scanning.
|
// The set of potentially parallel tasks in root scanning.
|
||||||
enum GCH_strong_roots_tasks {
|
enum GCH_strong_roots_tasks {
|
||||||
// We probably want to parallelize both of these internally, but for now...
|
GCH_PS_Universe_oops_do,
|
||||||
|
GCH_PS_JNIHandles_oops_do,
|
||||||
|
GCH_PS_ObjectSynchronizer_oops_do,
|
||||||
|
GCH_PS_FlatProfiler_oops_do,
|
||||||
|
GCH_PS_Management_oops_do,
|
||||||
|
GCH_PS_SystemDictionary_oops_do,
|
||||||
|
GCH_PS_ClassLoaderDataGraph_oops_do,
|
||||||
|
GCH_PS_jvmti_oops_do,
|
||||||
|
GCH_PS_CodeCache_oops_do,
|
||||||
GCH_PS_younger_gens,
|
GCH_PS_younger_gens,
|
||||||
// Leave this one last.
|
// Leave this one last.
|
||||||
GCH_PS_NumElements
|
GCH_PS_NumElements
|
||||||
@ -71,13 +81,9 @@ GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) :
|
|||||||
SharedHeap(policy),
|
SharedHeap(policy),
|
||||||
_rem_set(NULL),
|
_rem_set(NULL),
|
||||||
_gen_policy(policy),
|
_gen_policy(policy),
|
||||||
_gen_process_roots_tasks(new SubTasksDone(GCH_PS_NumElements)),
|
_process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)),
|
||||||
_full_collections_completed(0)
|
_full_collections_completed(0)
|
||||||
{
|
{
|
||||||
if (_gen_process_roots_tasks == NULL ||
|
|
||||||
!_gen_process_roots_tasks->valid()) {
|
|
||||||
vm_exit_during_initialization("Failed necessary allocation.");
|
|
||||||
}
|
|
||||||
assert(policy != NULL, "Sanity check");
|
assert(policy != NULL, "Sanity check");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,18 +183,17 @@ void GenCollectedHeap::post_initialize() {
|
|||||||
SharedHeap::post_initialize();
|
SharedHeap::post_initialize();
|
||||||
GenCollectorPolicy *policy = (GenCollectorPolicy *)collector_policy();
|
GenCollectorPolicy *policy = (GenCollectorPolicy *)collector_policy();
|
||||||
guarantee(policy->is_generation_policy(), "Illegal policy type");
|
guarantee(policy->is_generation_policy(), "Illegal policy type");
|
||||||
assert((get_gen(0)->kind() == Generation::DefNew) ||
|
assert((_young_gen->kind() == Generation::DefNew) ||
|
||||||
(get_gen(0)->kind() == Generation::ParNew),
|
(_young_gen->kind() == Generation::ParNew),
|
||||||
"Wrong youngest generation type");
|
"Wrong youngest generation type");
|
||||||
DefNewGeneration* def_new_gen = (DefNewGeneration*)get_gen(0);
|
DefNewGeneration* def_new_gen = (DefNewGeneration*)_young_gen;
|
||||||
|
|
||||||
Generation* old_gen = get_gen(1);
|
assert(_old_gen->kind() == Generation::ConcurrentMarkSweep ||
|
||||||
assert(old_gen->kind() == Generation::ConcurrentMarkSweep ||
|
_old_gen->kind() == Generation::MarkSweepCompact,
|
||||||
old_gen->kind() == Generation::MarkSweepCompact,
|
|
||||||
"Wrong generation kind");
|
"Wrong generation kind");
|
||||||
|
|
||||||
policy->initialize_size_policy(def_new_gen->eden()->capacity(),
|
policy->initialize_size_policy(def_new_gen->eden()->capacity(),
|
||||||
old_gen->capacity(),
|
_old_gen->capacity(),
|
||||||
def_new_gen->from()->capacity());
|
def_new_gen->from()->capacity());
|
||||||
policy->initialize_gc_policy_counters();
|
policy->initialize_gc_policy_counters();
|
||||||
}
|
}
|
||||||
@ -570,29 +575,137 @@ HeapWord* GenCollectedHeap::satisfy_failed_allocation(size_t size, bool is_tlab)
|
|||||||
|
|
||||||
void GenCollectedHeap::set_par_threads(uint t) {
|
void GenCollectedHeap::set_par_threads(uint t) {
|
||||||
SharedHeap::set_par_threads(t);
|
SharedHeap::set_par_threads(t);
|
||||||
_gen_process_roots_tasks->set_n_threads(t);
|
set_n_termination(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenCollectedHeap::
|
void GenCollectedHeap::set_n_termination(uint t) {
|
||||||
gen_process_roots(int level,
|
_process_strong_tasks->set_n_threads(t);
|
||||||
bool younger_gens_as_roots,
|
}
|
||||||
bool activate_scope,
|
|
||||||
SharedHeap::ScanningOption so,
|
#ifdef ASSERT
|
||||||
OopsInGenClosure* not_older_gens,
|
class AssertNonScavengableClosure: public OopClosure {
|
||||||
OopsInGenClosure* weak_roots,
|
public:
|
||||||
OopsInGenClosure* older_gens,
|
virtual void do_oop(oop* p) {
|
||||||
CLDClosure* cld_closure,
|
assert(!Universe::heap()->is_in_partial_collection(*p),
|
||||||
CLDClosure* weak_cld_closure,
|
"Referent should not be scavengable."); }
|
||||||
CodeBlobClosure* code_closure) {
|
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
|
||||||
|
};
|
||||||
|
static AssertNonScavengableClosure assert_is_non_scavengable_closure;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void GenCollectedHeap::process_roots(bool activate_scope,
|
||||||
|
ScanningOption so,
|
||||||
|
OopClosure* strong_roots,
|
||||||
|
OopClosure* weak_roots,
|
||||||
|
CLDClosure* strong_cld_closure,
|
||||||
|
CLDClosure* weak_cld_closure,
|
||||||
|
CodeBlobClosure* code_roots) {
|
||||||
|
StrongRootsScope srs(this, activate_scope);
|
||||||
|
|
||||||
// General roots.
|
// General roots.
|
||||||
SharedHeap::process_roots(activate_scope, so,
|
assert(_strong_roots_parity != 0, "must have called prologue code");
|
||||||
not_older_gens, weak_roots,
|
assert(code_roots != NULL, "code root closure should always be set");
|
||||||
cld_closure, weak_cld_closure,
|
// _n_termination for _process_strong_tasks should be set up stream
|
||||||
code_closure);
|
// in a method not running in a GC worker. Otherwise the GC worker
|
||||||
|
// could be trying to change the termination condition while the task
|
||||||
|
// is executing in another GC worker.
|
||||||
|
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_ClassLoaderDataGraph_oops_do)) {
|
||||||
|
ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Some CLDs contained in the thread frames should be considered strong.
|
||||||
|
// Don't process them if they will be processed during the ClassLoaderDataGraph phase.
|
||||||
|
CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
|
||||||
|
// Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
|
||||||
|
CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
|
||||||
|
|
||||||
|
Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
|
||||||
|
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {
|
||||||
|
Universe::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
// Global (strong) JNI handles
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_JNIHandles_oops_do)) {
|
||||||
|
JNIHandles::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_ObjectSynchronizer_oops_do)) {
|
||||||
|
ObjectSynchronizer::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_FlatProfiler_oops_do)) {
|
||||||
|
FlatProfiler::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_Management_oops_do)) {
|
||||||
|
Management::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_jvmti_oops_do)) {
|
||||||
|
JvmtiExport::oops_do(strong_roots);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_SystemDictionary_oops_do)) {
|
||||||
|
SystemDictionary::roots_oops_do(strong_roots, weak_roots);
|
||||||
|
}
|
||||||
|
|
||||||
|
// All threads execute the following. A specific chunk of buckets
|
||||||
|
// from the StringTable are the individual tasks.
|
||||||
|
if (weak_roots != NULL) {
|
||||||
|
if (CollectedHeap::use_parallel_gc_threads()) {
|
||||||
|
StringTable::possibly_parallel_oops_do(weak_roots);
|
||||||
|
} else {
|
||||||
|
StringTable::oops_do(weak_roots);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_CodeCache_oops_do)) {
|
||||||
|
if (so & SO_ScavengeCodeCache) {
|
||||||
|
assert(code_roots != NULL, "must supply closure for code cache");
|
||||||
|
|
||||||
|
// We only visit parts of the CodeCache when scavenging.
|
||||||
|
CodeCache::scavenge_root_nmethods_do(code_roots);
|
||||||
|
}
|
||||||
|
if (so & SO_AllCodeCache) {
|
||||||
|
assert(code_roots != NULL, "must supply closure for code cache");
|
||||||
|
|
||||||
|
// CMSCollector uses this to do intermediate-strength collections.
|
||||||
|
// We scan the entire code cache, since CodeCache::do_unloading is not called.
|
||||||
|
CodeCache::blobs_do(code_roots);
|
||||||
|
}
|
||||||
|
// Verify that the code cache contents are not subject to
|
||||||
|
// movement by a scavenging collection.
|
||||||
|
DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
|
||||||
|
DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenCollectedHeap::gen_process_roots(int level,
|
||||||
|
bool younger_gens_as_roots,
|
||||||
|
bool activate_scope,
|
||||||
|
ScanningOption so,
|
||||||
|
bool only_strong_roots,
|
||||||
|
OopsInGenClosure* not_older_gens,
|
||||||
|
OopsInGenClosure* older_gens,
|
||||||
|
CLDClosure* cld_closure) {
|
||||||
|
const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
|
||||||
|
|
||||||
|
bool is_moving_collection = false;
|
||||||
|
if (level == 0 || is_adjust_phase) {
|
||||||
|
// young collections are always moving
|
||||||
|
is_moving_collection = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
|
||||||
|
OopsInGenClosure* weak_roots = only_strong_roots ? NULL : not_older_gens;
|
||||||
|
CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
|
||||||
|
|
||||||
|
process_roots(activate_scope, so,
|
||||||
|
not_older_gens, weak_roots,
|
||||||
|
cld_closure, weak_cld_closure,
|
||||||
|
&mark_code_closure);
|
||||||
|
|
||||||
if (younger_gens_as_roots) {
|
if (younger_gens_as_roots) {
|
||||||
if (!_gen_process_roots_tasks->is_task_claimed(GCH_PS_younger_gens)) {
|
if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
|
||||||
if (level == 1) {
|
if (level == 1) {
|
||||||
not_older_gens->set_generation(_young_gen);
|
not_older_gens->set_generation(_young_gen);
|
||||||
_young_gen->oop_iterate(not_older_gens);
|
_young_gen->oop_iterate(not_older_gens);
|
||||||
@ -608,43 +721,18 @@ gen_process_roots(int level,
|
|||||||
older_gens->reset_generation();
|
older_gens->reset_generation();
|
||||||
}
|
}
|
||||||
|
|
||||||
_gen_process_roots_tasks->all_tasks_completed();
|
_process_strong_tasks->all_tasks_completed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenCollectedHeap::
|
|
||||||
gen_process_roots(int level,
|
|
||||||
bool younger_gens_as_roots,
|
|
||||||
bool activate_scope,
|
|
||||||
SharedHeap::ScanningOption so,
|
|
||||||
bool only_strong_roots,
|
|
||||||
OopsInGenClosure* not_older_gens,
|
|
||||||
OopsInGenClosure* older_gens,
|
|
||||||
CLDClosure* cld_closure) {
|
|
||||||
|
|
||||||
const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
|
class AlwaysTrueClosure: public BoolObjectClosure {
|
||||||
|
public:
|
||||||
bool is_moving_collection = false;
|
bool do_object_b(oop p) { return true; }
|
||||||
if (level == 0 || is_adjust_phase) {
|
};
|
||||||
// young collections are always moving
|
static AlwaysTrueClosure always_true;
|
||||||
is_moving_collection = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
|
|
||||||
CodeBlobClosure* code_closure = &mark_code_closure;
|
|
||||||
|
|
||||||
gen_process_roots(level,
|
|
||||||
younger_gens_as_roots,
|
|
||||||
activate_scope, so,
|
|
||||||
not_older_gens, only_strong_roots ? NULL : not_older_gens,
|
|
||||||
older_gens,
|
|
||||||
cld_closure, only_strong_roots ? NULL : cld_closure,
|
|
||||||
code_closure);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
|
void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
|
||||||
SharedHeap::process_weak_roots(root_closure);
|
JNIHandles::weak_oops_do(&always_true, root_closure);
|
||||||
// "Local" "weak" refs
|
|
||||||
_young_gen->ref_processor()->weak_oops_do(root_closure);
|
_young_gen->ref_processor()->weak_oops_do(root_closure);
|
||||||
_old_gen->ref_processor()->weak_oops_do(root_closure);
|
_old_gen->ref_processor()->weak_oops_do(root_closure);
|
||||||
}
|
}
|
||||||
@ -1113,10 +1201,10 @@ void GenCollectedHeap::print_on_error(outputStream* st) const {
|
|||||||
|
|
||||||
void GenCollectedHeap::print_tracing_info() const {
|
void GenCollectedHeap::print_tracing_info() const {
|
||||||
if (TraceYoungGenTime) {
|
if (TraceYoungGenTime) {
|
||||||
get_gen(0)->print_summary_info();
|
_young_gen->print_summary_info();
|
||||||
}
|
}
|
||||||
if (TraceOldGenTime) {
|
if (TraceOldGenTime) {
|
||||||
get_gen(1)->print_summary_info();
|
_old_gen->print_summary_info();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,8 +85,7 @@ public:
|
|||||||
|
|
||||||
// Data structure for claiming the (potentially) parallel tasks in
|
// Data structure for claiming the (potentially) parallel tasks in
|
||||||
// (gen-specific) roots processing.
|
// (gen-specific) roots processing.
|
||||||
SubTasksDone* _gen_process_roots_tasks;
|
SubTasksDone* _process_strong_tasks;
|
||||||
SubTasksDone* gen_process_roots_tasks() { return _gen_process_roots_tasks; }
|
|
||||||
|
|
||||||
// Collects the given generation.
|
// Collects the given generation.
|
||||||
void collect_generation(Generation* gen, bool full, size_t size, bool is_tlab,
|
void collect_generation(Generation* gen, bool full, size_t size, bool is_tlab,
|
||||||
@ -373,27 +372,6 @@ public:
|
|||||||
// collection.
|
// collection.
|
||||||
virtual bool is_maximal_no_gc() const;
|
virtual bool is_maximal_no_gc() const;
|
||||||
|
|
||||||
// Return the generation before "gen".
|
|
||||||
Generation* prev_gen(Generation* gen) const {
|
|
||||||
guarantee(gen->level() == 1, "Out of bounds");
|
|
||||||
return _young_gen;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the generation after "gen".
|
|
||||||
Generation* next_gen(Generation* gen) const {
|
|
||||||
guarantee(gen->level() == 0, "Out of bounds");
|
|
||||||
return _old_gen;
|
|
||||||
}
|
|
||||||
|
|
||||||
Generation* get_gen(int i) const {
|
|
||||||
guarantee(i == 0 || i == 1, "Out of bounds");
|
|
||||||
if (i == 0) {
|
|
||||||
return _young_gen;
|
|
||||||
} else {
|
|
||||||
return _old_gen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int n_gens() const {
|
int n_gens() const {
|
||||||
assert(_n_gens == gen_policy()->number_of_generations(), "Sanity");
|
assert(_n_gens == gen_policy()->number_of_generations(), "Sanity");
|
||||||
return _n_gens;
|
return _n_gens;
|
||||||
@ -408,6 +386,7 @@ public:
|
|||||||
static GenCollectedHeap* heap();
|
static GenCollectedHeap* heap();
|
||||||
|
|
||||||
void set_par_threads(uint t);
|
void set_par_threads(uint t);
|
||||||
|
void set_n_termination(uint t);
|
||||||
|
|
||||||
// Invoke the "do_oop" method of one of the closures "not_older_gens"
|
// Invoke the "do_oop" method of one of the closures "not_older_gens"
|
||||||
// or "older_gens" on root locations for the generation at
|
// or "older_gens" on root locations for the generation at
|
||||||
@ -421,11 +400,25 @@ public:
|
|||||||
// The "so" argument determines which of the roots
|
// The "so" argument determines which of the roots
|
||||||
// the closure is applied to:
|
// the closure is applied to:
|
||||||
// "SO_None" does none;
|
// "SO_None" does none;
|
||||||
|
enum ScanningOption {
|
||||||
|
SO_None = 0x0,
|
||||||
|
SO_AllCodeCache = 0x8,
|
||||||
|
SO_ScavengeCodeCache = 0x10
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void process_roots(bool activate_scope,
|
||||||
|
ScanningOption so,
|
||||||
|
OopClosure* strong_roots,
|
||||||
|
OopClosure* weak_roots,
|
||||||
|
CLDClosure* strong_cld_closure,
|
||||||
|
CLDClosure* weak_cld_closure,
|
||||||
|
CodeBlobClosure* code_roots);
|
||||||
|
|
||||||
void gen_process_roots(int level,
|
void gen_process_roots(int level,
|
||||||
bool younger_gens_as_roots,
|
bool younger_gens_as_roots,
|
||||||
bool activate_scope,
|
bool activate_scope,
|
||||||
SharedHeap::ScanningOption so,
|
ScanningOption so,
|
||||||
OopsInGenClosure* not_older_gens,
|
OopsInGenClosure* not_older_gens,
|
||||||
OopsInGenClosure* weak_roots,
|
OopsInGenClosure* weak_roots,
|
||||||
OopsInGenClosure* older_gens,
|
OopsInGenClosure* older_gens,
|
||||||
@ -440,7 +433,7 @@ public:
|
|||||||
void gen_process_roots(int level,
|
void gen_process_roots(int level,
|
||||||
bool younger_gens_as_roots,
|
bool younger_gens_as_roots,
|
||||||
bool activate_scope,
|
bool activate_scope,
|
||||||
SharedHeap::ScanningOption so,
|
ScanningOption so,
|
||||||
bool only_strong_roots,
|
bool only_strong_roots,
|
||||||
OopsInGenClosure* not_older_gens,
|
OopsInGenClosure* not_older_gens,
|
||||||
OopsInGenClosure* older_gens,
|
OopsInGenClosure* older_gens,
|
||||||
@ -486,7 +479,7 @@ public:
|
|||||||
assert(heap()->collector_policy()->is_generation_policy(),
|
assert(heap()->collector_policy()->is_generation_policy(),
|
||||||
"the following definition may not be suitable for an n(>2)-generation system");
|
"the following definition may not be suitable for an n(>2)-generation system");
|
||||||
return incremental_collection_failed() ||
|
return incremental_collection_failed() ||
|
||||||
(consult_young && !get_gen(0)->collection_attempt_is_safe());
|
(consult_young && !_young_gen->collection_attempt_is_safe());
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a generation bails out of an incremental collection,
|
// If a generation bails out of an incremental collection,
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
#include "utilities/copy.hpp"
|
#include "utilities/copy.hpp"
|
||||||
#include "utilities/events.hpp"
|
#include "utilities/events.hpp"
|
||||||
|
#include "utilities/stack.inline.hpp"
|
||||||
|
|
||||||
void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool clear_all_softrefs) {
|
void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool clear_all_softrefs) {
|
||||||
guarantee(level == 1, "We always collect both old and young.");
|
guarantee(level == 1, "We always collect both old and young.");
|
||||||
@ -109,20 +110,16 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool c
|
|||||||
|
|
||||||
deallocate_stacks();
|
deallocate_stacks();
|
||||||
|
|
||||||
// If compaction completely evacuated all generations younger than this
|
// If compaction completely evacuated the young generation then we
|
||||||
// one, then we can clear the card table. Otherwise, we must invalidate
|
// can clear the card table. Otherwise, we must invalidate
|
||||||
// it (consider all cards dirty). In the future, we might consider doing
|
// it (consider all cards dirty). In the future, we might consider doing
|
||||||
// compaction within generations only, and doing card-table sliding.
|
// compaction within generations only, and doing card-table sliding.
|
||||||
bool all_empty = true;
|
|
||||||
for (int i = 0; all_empty && i < level; i++) {
|
|
||||||
Generation* g = gch->get_gen(i);
|
|
||||||
all_empty = all_empty && gch->get_gen(i)->used() == 0;
|
|
||||||
}
|
|
||||||
GenRemSet* rs = gch->rem_set();
|
GenRemSet* rs = gch->rem_set();
|
||||||
Generation* old_gen = gch->get_gen(level);
|
Generation* old_gen = gch->old_gen();
|
||||||
|
|
||||||
// Clear/invalidate below make use of the "prev_used_regions" saved earlier.
|
// Clear/invalidate below make use of the "prev_used_regions" saved earlier.
|
||||||
if (all_empty) {
|
if (gch->young_gen()->used() == 0) {
|
||||||
// We've evacuated all generations below us.
|
// We've evacuated the young generation.
|
||||||
rs->clear_into_younger(old_gen);
|
rs->clear_into_younger(old_gen);
|
||||||
} else {
|
} else {
|
||||||
// Invalidate the cards corresponding to the currently used
|
// Invalidate the cards corresponding to the currently used
|
||||||
@ -157,9 +154,8 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool c
|
|||||||
|
|
||||||
void GenMarkSweep::allocate_stacks() {
|
void GenMarkSweep::allocate_stacks() {
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
// Scratch request on behalf of oldest generation; will do no
|
// Scratch request on behalf of old generation; will do no allocation.
|
||||||
// allocation.
|
ScratchBlock* scratch = gch->gather_scratch(gch->old_gen(), 0);
|
||||||
ScratchBlock* scratch = gch->gather_scratch(gch->get_gen(gch->_n_gens-1), 0);
|
|
||||||
|
|
||||||
// $$$ To cut a corner, we'll only use the first scratch block, and then
|
// $$$ To cut a corner, we'll only use the first scratch block, and then
|
||||||
// revert to malloc.
|
// revert to malloc.
|
||||||
@ -188,7 +184,7 @@ void GenMarkSweep::deallocate_stacks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GenMarkSweep::mark_sweep_phase1(int level,
|
void GenMarkSweep::mark_sweep_phase1(int level,
|
||||||
bool clear_all_softrefs) {
|
bool clear_all_softrefs) {
|
||||||
// Recursively traverse all live objects and mark them
|
// Recursively traverse all live objects and mark them
|
||||||
GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
|
GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id());
|
||||||
trace(" 1");
|
trace(" 1");
|
||||||
@ -199,7 +195,8 @@ void GenMarkSweep::mark_sweep_phase1(int level,
|
|||||||
// use OopsInGenClosure constructor which takes a generation,
|
// use OopsInGenClosure constructor which takes a generation,
|
||||||
// as the Universe has not been created when the static constructors
|
// as the Universe has not been created when the static constructors
|
||||||
// are run.
|
// are run.
|
||||||
follow_root_closure.set_orig_generation(gch->get_gen(level));
|
assert(level == 1, "We don't use mark-sweep on young generations");
|
||||||
|
follow_root_closure.set_orig_generation(gch->old_gen());
|
||||||
|
|
||||||
// Need new claim bits before marking starts.
|
// Need new claim bits before marking starts.
|
||||||
ClassLoaderDataGraph::clear_claimed_marks();
|
ClassLoaderDataGraph::clear_claimed_marks();
|
||||||
@ -207,7 +204,7 @@ void GenMarkSweep::mark_sweep_phase1(int level,
|
|||||||
gch->gen_process_roots(level,
|
gch->gen_process_roots(level,
|
||||||
false, // Younger gens are not roots.
|
false, // Younger gens are not roots.
|
||||||
true, // activate StrongRootsScope
|
true, // activate StrongRootsScope
|
||||||
SharedHeap::SO_None,
|
GenCollectedHeap::SO_None,
|
||||||
GenCollectedHeap::StrongRootsOnly,
|
GenCollectedHeap::StrongRootsOnly,
|
||||||
&follow_root_closure,
|
&follow_root_closure,
|
||||||
&follow_root_closure,
|
&follow_root_closure,
|
||||||
@ -287,12 +284,13 @@ void GenMarkSweep::mark_sweep_phase3(int level) {
|
|||||||
// use OopsInGenClosure constructor which takes a generation,
|
// use OopsInGenClosure constructor which takes a generation,
|
||||||
// as the Universe has not been created when the static constructors
|
// as the Universe has not been created when the static constructors
|
||||||
// are run.
|
// are run.
|
||||||
adjust_pointer_closure.set_orig_generation(gch->get_gen(level));
|
assert(level == 1, "We don't use mark-sweep on young generations.");
|
||||||
|
adjust_pointer_closure.set_orig_generation(gch->old_gen());
|
||||||
|
|
||||||
gch->gen_process_roots(level,
|
gch->gen_process_roots(level,
|
||||||
false, // Younger gens are not roots.
|
false, // Younger gens are not roots.
|
||||||
true, // activate StrongRootsScope
|
true, // activate StrongRootsScope
|
||||||
SharedHeap::SO_AllCodeCache,
|
GenCollectedHeap::SO_AllCodeCache,
|
||||||
GenCollectedHeap::StrongAndWeakRoots,
|
GenCollectedHeap::StrongAndWeakRoots,
|
||||||
&adjust_pointer_closure,
|
&adjust_pointer_closure,
|
||||||
&adjust_pointer_closure,
|
&adjust_pointer_closure,
|
||||||
|
@ -153,9 +153,8 @@ bool Generation::is_in(const void* p) const {
|
|||||||
|
|
||||||
Generation* Generation::next_gen() const {
|
Generation* Generation::next_gen() const {
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
int next = level() + 1;
|
if (level() == 0) {
|
||||||
if (next < gch->_n_gens) {
|
return gch->old_gen();
|
||||||
return gch->get_gen(next);
|
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "utilities/globalDefinitions.hpp"
|
#include "utilities/globalDefinitions.hpp"
|
||||||
#include "utilities/macros.hpp"
|
#include "utilities/macros.hpp"
|
||||||
|
#include "utilities/stack.inline.hpp"
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
|
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
|
||||||
#endif // INCLUDE_ALL_GCS
|
#endif // INCLUDE_ALL_GCS
|
||||||
|
@ -3131,7 +3131,7 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a
|
|||||||
void Metaspace::initialize_class_space(ReservedSpace rs) {
|
void Metaspace::initialize_class_space(ReservedSpace rs) {
|
||||||
// The reserved space size may be bigger because of alignment, esp with UseLargePages
|
// The reserved space size may be bigger because of alignment, esp with UseLargePages
|
||||||
assert(rs.size() >= CompressedClassSpaceSize,
|
assert(rs.size() >= CompressedClassSpaceSize,
|
||||||
err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), CompressedClassSpaceSize));
|
err_msg(SIZE_FORMAT " != " SIZE_FORMAT, rs.size(), CompressedClassSpaceSize));
|
||||||
assert(using_class_space(), "Must be using class space");
|
assert(using_class_space(), "Must be using class space");
|
||||||
_class_space_list = new VirtualSpaceList(rs);
|
_class_space_list = new VirtualSpaceList(rs);
|
||||||
_chunk_manager_class = new ChunkManager(SpecializedChunk, ClassSmallChunk, ClassMediumChunk);
|
_chunk_manager_class = new ChunkManager(SpecializedChunk, ClassSmallChunk, ClassMediumChunk);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -430,7 +430,7 @@ public:
|
|||||||
|
|
||||||
// Split up and initialize the misc code and data spaces
|
// Split up and initialize the misc code and data spaces
|
||||||
ReservedSpace* shared_rs = MetaspaceShared::shared_rs();
|
ReservedSpace* shared_rs = MetaspaceShared::shared_rs();
|
||||||
int metadata_size = SharedReadOnlySize+SharedReadWriteSize;
|
size_t metadata_size = SharedReadOnlySize + SharedReadWriteSize;
|
||||||
ReservedSpace shared_ro_rw = shared_rs->first_part(metadata_size);
|
ReservedSpace shared_ro_rw = shared_rs->first_part(metadata_size);
|
||||||
ReservedSpace misc_section = shared_rs->last_part(metadata_size);
|
ReservedSpace misc_section = shared_rs->last_part(metadata_size);
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/fprofiler.hpp"
|
#include "runtime/fprofiler.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
#include "services/management.hpp"
|
|
||||||
#include "utilities/copy.hpp"
|
#include "utilities/copy.hpp"
|
||||||
#include "utilities/workgroup.hpp"
|
#include "utilities/workgroup.hpp"
|
||||||
|
|
||||||
@ -40,32 +39,12 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
|||||||
|
|
||||||
SharedHeap* SharedHeap::_sh;
|
SharedHeap* SharedHeap::_sh;
|
||||||
|
|
||||||
// The set of potentially parallel tasks in root scanning.
|
|
||||||
enum SH_process_roots_tasks {
|
|
||||||
SH_PS_Universe_oops_do,
|
|
||||||
SH_PS_JNIHandles_oops_do,
|
|
||||||
SH_PS_ObjectSynchronizer_oops_do,
|
|
||||||
SH_PS_FlatProfiler_oops_do,
|
|
||||||
SH_PS_Management_oops_do,
|
|
||||||
SH_PS_SystemDictionary_oops_do,
|
|
||||||
SH_PS_ClassLoaderDataGraph_oops_do,
|
|
||||||
SH_PS_jvmti_oops_do,
|
|
||||||
SH_PS_CodeCache_oops_do,
|
|
||||||
// Leave this one last.
|
|
||||||
SH_PS_NumElements
|
|
||||||
};
|
|
||||||
|
|
||||||
SharedHeap::SharedHeap(CollectorPolicy* policy_) :
|
SharedHeap::SharedHeap(CollectorPolicy* policy_) :
|
||||||
CollectedHeap(),
|
CollectedHeap(),
|
||||||
_collector_policy(policy_),
|
_collector_policy(policy_),
|
||||||
_strong_roots_scope(NULL),
|
|
||||||
_strong_roots_parity(0),
|
_strong_roots_parity(0),
|
||||||
_process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
|
|
||||||
_workers(NULL)
|
_workers(NULL)
|
||||||
{
|
{
|
||||||
if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
|
|
||||||
vm_exit_during_initialization("Failed necessary allocation.");
|
|
||||||
}
|
|
||||||
_sh = this; // ch is static, should be set only once.
|
_sh = this; // ch is static, should be set only once.
|
||||||
if (UseConcMarkSweepGC || UseG1GC) {
|
if (UseConcMarkSweepGC || UseG1GC) {
|
||||||
_workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads,
|
_workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads,
|
||||||
@ -79,14 +58,6 @@ SharedHeap::SharedHeap(CollectorPolicy* policy_) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int SharedHeap::n_termination() {
|
|
||||||
return _process_strong_tasks->n_threads();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedHeap::set_n_termination(int t) {
|
|
||||||
_process_strong_tasks->set_n_threads(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SharedHeap::heap_lock_held_for_gc() {
|
bool SharedHeap::heap_lock_held_for_gc() {
|
||||||
Thread* t = Thread::current();
|
Thread* t = Thread::current();
|
||||||
return Heap_lock->owned_by_self()
|
return Heap_lock->owned_by_self()
|
||||||
@ -97,31 +68,6 @@ bool SharedHeap::heap_lock_held_for_gc() {
|
|||||||
void SharedHeap::set_par_threads(uint t) {
|
void SharedHeap::set_par_threads(uint t) {
|
||||||
assert(t == 0 || !UseSerialGC, "Cannot have parallel threads");
|
assert(t == 0 || !UseSerialGC, "Cannot have parallel threads");
|
||||||
_n_par_threads = t;
|
_n_par_threads = t;
|
||||||
_process_strong_tasks->set_n_threads(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ASSERT
|
|
||||||
class AssertNonScavengableClosure: public OopClosure {
|
|
||||||
public:
|
|
||||||
virtual void do_oop(oop* p) {
|
|
||||||
assert(!Universe::heap()->is_in_partial_collection(*p),
|
|
||||||
"Referent should not be scavengable."); }
|
|
||||||
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
|
|
||||||
};
|
|
||||||
static AssertNonScavengableClosure assert_is_non_scavengable_closure;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SharedHeap::StrongRootsScope* SharedHeap::active_strong_roots_scope() const {
|
|
||||||
return _strong_roots_scope;
|
|
||||||
}
|
|
||||||
void SharedHeap::register_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
|
|
||||||
assert(_strong_roots_scope == NULL, "Should only have one StrongRootsScope active");
|
|
||||||
assert(scope != NULL, "Illegal argument");
|
|
||||||
_strong_roots_scope = scope;
|
|
||||||
}
|
|
||||||
void SharedHeap::unregister_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
|
|
||||||
assert(_strong_roots_scope == scope, "Wrong scope unregistered");
|
|
||||||
_strong_roots_scope = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedHeap::change_strong_roots_parity() {
|
void SharedHeap::change_strong_roots_parity() {
|
||||||
@ -135,174 +81,15 @@ void SharedHeap::change_strong_roots_parity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
|
SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
|
||||||
: MarkScope(activate), _sh(heap), _n_workers_done_with_threads(0)
|
: MarkScope(activate), _sh(heap)
|
||||||
{
|
{
|
||||||
if (_active) {
|
if (_active) {
|
||||||
_sh->register_strong_roots_scope(this);
|
|
||||||
_sh->change_strong_roots_parity();
|
_sh->change_strong_roots_parity();
|
||||||
// Zero the claimed high water mark in the StringTable
|
// Zero the claimed high water mark in the StringTable
|
||||||
StringTable::clear_parallel_claimed_index();
|
StringTable::clear_parallel_claimed_index();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedHeap::StrongRootsScope::~StrongRootsScope() {
|
|
||||||
if (_active) {
|
|
||||||
_sh->unregister_strong_roots_scope(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Monitor* SharedHeap::StrongRootsScope::_lock = new Monitor(Mutex::leaf, "StrongRootsScope lock", false, Monitor::_safepoint_check_never);
|
|
||||||
|
|
||||||
void SharedHeap::StrongRootsScope::mark_worker_done_with_threads(uint n_workers) {
|
|
||||||
// The Thread work barrier is only needed by G1 Class Unloading.
|
|
||||||
// No need to use the barrier if this is single-threaded code.
|
|
||||||
if (UseG1GC && ClassUnloadingWithConcurrentMark && n_workers > 0) {
|
|
||||||
uint new_value = (uint)Atomic::add(1, &_n_workers_done_with_threads);
|
|
||||||
if (new_value == n_workers) {
|
|
||||||
// This thread is last. Notify the others.
|
|
||||||
MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
|
|
||||||
_lock->notify_all();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedHeap::StrongRootsScope::wait_until_all_workers_done_with_threads(uint n_workers) {
|
|
||||||
assert(UseG1GC, "Currently only used by G1");
|
|
||||||
assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
|
|
||||||
|
|
||||||
// No need to use the barrier if this is single-threaded code.
|
|
||||||
if (n_workers > 0 && (uint)_n_workers_done_with_threads != n_workers) {
|
|
||||||
MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
|
|
||||||
while ((uint)_n_workers_done_with_threads != n_workers) {
|
|
||||||
_lock->wait(Mutex::_no_safepoint_check_flag, 0, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedHeap::process_roots(bool activate_scope,
|
|
||||||
ScanningOption so,
|
|
||||||
OopClosure* strong_roots,
|
|
||||||
OopClosure* weak_roots,
|
|
||||||
CLDClosure* strong_cld_closure,
|
|
||||||
CLDClosure* weak_cld_closure,
|
|
||||||
CodeBlobClosure* code_roots) {
|
|
||||||
StrongRootsScope srs(this, activate_scope);
|
|
||||||
|
|
||||||
// General roots.
|
|
||||||
assert(_strong_roots_parity != 0, "must have called prologue code");
|
|
||||||
assert(code_roots != NULL, "code root closure should always be set");
|
|
||||||
// _n_termination for _process_strong_tasks should be set up stream
|
|
||||||
// in a method not running in a GC worker. Otherwise the GC worker
|
|
||||||
// could be trying to change the termination condition while the task
|
|
||||||
// is executing in another GC worker.
|
|
||||||
|
|
||||||
// Iterating over the CLDG and the Threads are done early to allow G1 to
|
|
||||||
// first process the strong CLDs and nmethods and then, after a barrier,
|
|
||||||
// let the thread process the weak CLDs and nmethods.
|
|
||||||
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(SH_PS_ClassLoaderDataGraph_oops_do)) {
|
|
||||||
ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Some CLDs contained in the thread frames should be considered strong.
|
|
||||||
// Don't process them if they will be processed during the ClassLoaderDataGraph phase.
|
|
||||||
CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
|
|
||||||
// Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
|
|
||||||
CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
|
|
||||||
|
|
||||||
Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
|
|
||||||
|
|
||||||
// This is the point where this worker thread will not find more strong CLDs/nmethods.
|
|
||||||
// Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
|
|
||||||
active_strong_roots_scope()->mark_worker_done_with_threads(n_par_threads());
|
|
||||||
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) {
|
|
||||||
Universe::oops_do(strong_roots);
|
|
||||||
}
|
|
||||||
// Global (strong) JNI handles
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
|
|
||||||
JNIHandles::oops_do(strong_roots);
|
|
||||||
|
|
||||||
if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
|
|
||||||
ObjectSynchronizer::oops_do(strong_roots);
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do))
|
|
||||||
FlatProfiler::oops_do(strong_roots);
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do))
|
|
||||||
Management::oops_do(strong_roots);
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(SH_PS_jvmti_oops_do))
|
|
||||||
JvmtiExport::oops_do(strong_roots);
|
|
||||||
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) {
|
|
||||||
SystemDictionary::roots_oops_do(strong_roots, weak_roots);
|
|
||||||
}
|
|
||||||
|
|
||||||
// All threads execute the following. A specific chunk of buckets
|
|
||||||
// from the StringTable are the individual tasks.
|
|
||||||
if (weak_roots != NULL) {
|
|
||||||
if (CollectedHeap::use_parallel_gc_threads()) {
|
|
||||||
StringTable::possibly_parallel_oops_do(weak_roots);
|
|
||||||
} else {
|
|
||||||
StringTable::oops_do(weak_roots);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) {
|
|
||||||
if (so & SO_ScavengeCodeCache) {
|
|
||||||
assert(code_roots != NULL, "must supply closure for code cache");
|
|
||||||
|
|
||||||
// We only visit parts of the CodeCache when scavenging.
|
|
||||||
CodeCache::scavenge_root_nmethods_do(code_roots);
|
|
||||||
}
|
|
||||||
if (so & SO_AllCodeCache) {
|
|
||||||
assert(code_roots != NULL, "must supply closure for code cache");
|
|
||||||
|
|
||||||
// CMSCollector uses this to do intermediate-strength collections.
|
|
||||||
// We scan the entire code cache, since CodeCache::do_unloading is not called.
|
|
||||||
CodeCache::blobs_do(code_roots);
|
|
||||||
}
|
|
||||||
// Verify that the code cache contents are not subject to
|
|
||||||
// movement by a scavenging collection.
|
|
||||||
DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
|
|
||||||
DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
|
|
||||||
}
|
|
||||||
|
|
||||||
_process_strong_tasks->all_tasks_completed();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedHeap::process_all_roots(bool activate_scope,
|
|
||||||
ScanningOption so,
|
|
||||||
OopClosure* roots,
|
|
||||||
CLDClosure* cld_closure,
|
|
||||||
CodeBlobClosure* code_closure) {
|
|
||||||
process_roots(activate_scope, so,
|
|
||||||
roots, roots,
|
|
||||||
cld_closure, cld_closure,
|
|
||||||
code_closure);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedHeap::process_strong_roots(bool activate_scope,
|
|
||||||
ScanningOption so,
|
|
||||||
OopClosure* roots,
|
|
||||||
CLDClosure* cld_closure,
|
|
||||||
CodeBlobClosure* code_closure) {
|
|
||||||
process_roots(activate_scope, so,
|
|
||||||
roots, NULL,
|
|
||||||
cld_closure, NULL,
|
|
||||||
code_closure);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class AlwaysTrueClosure: public BoolObjectClosure {
|
|
||||||
public:
|
|
||||||
bool do_object_b(oop p) { return true; }
|
|
||||||
};
|
|
||||||
static AlwaysTrueClosure always_true;
|
|
||||||
|
|
||||||
void SharedHeap::process_weak_roots(OopClosure* root_closure) {
|
|
||||||
// Global (weak) JNI handles
|
|
||||||
JNIHandles::weak_oops_do(&always_true, root_closure);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SharedHeap::set_barrier_set(BarrierSet* bs) {
|
void SharedHeap::set_barrier_set(BarrierSet* bs) {
|
||||||
_barrier_set = bs;
|
_barrier_set = bs;
|
||||||
// Cached barrier set for fast access in oops
|
// Cached barrier set for fast access in oops
|
||||||
|
@ -61,18 +61,18 @@ class KlassClosure;
|
|||||||
// counts the number of tasks that have been done and then reset
|
// counts the number of tasks that have been done and then reset
|
||||||
// the SubTasksDone so that it can be used again. When the number of
|
// the SubTasksDone so that it can be used again. When the number of
|
||||||
// tasks is set to the number of GC workers, then _n_threads must
|
// tasks is set to the number of GC workers, then _n_threads must
|
||||||
// be set to the number of active GC workers. G1CollectedHeap,
|
// be set to the number of active GC workers. G1RootProcessor and
|
||||||
// HRInto_G1RemSet, GenCollectedHeap and SharedHeap have SubTasksDone.
|
// GenCollectedHeap have SubTasksDone.
|
||||||
// This seems too many.
|
|
||||||
// 3) SequentialSubTasksDone has an _n_threads that is used in
|
// 3) SequentialSubTasksDone has an _n_threads that is used in
|
||||||
// a way similar to SubTasksDone and has the same dependency on the
|
// a way similar to SubTasksDone and has the same dependency on the
|
||||||
// number of active GC workers. CompactibleFreeListSpace and Space
|
// number of active GC workers. CompactibleFreeListSpace and Space
|
||||||
// have SequentialSubTasksDone's.
|
// have SequentialSubTasksDone's.
|
||||||
// Example of using SubTasksDone and SequentialSubTasksDone
|
//
|
||||||
// G1CollectedHeap::g1_process_roots()
|
// Examples of using SubTasksDone and SequentialSubTasksDone:
|
||||||
// to SharedHeap::process_roots() and uses
|
// G1RootProcessor and GenCollectedHeap::process_roots() use
|
||||||
// SubTasksDone* _process_strong_tasks to claim tasks.
|
// SubTasksDone* _process_strong_tasks to claim tasks for workers
|
||||||
// process_roots() calls
|
//
|
||||||
|
// GenCollectedHeap::gen_process_roots() calls
|
||||||
// rem_set()->younger_refs_iterate()
|
// rem_set()->younger_refs_iterate()
|
||||||
// to scan the card table and which eventually calls down into
|
// to scan the card table and which eventually calls down into
|
||||||
// CardTableModRefBS::par_non_clean_card_iterate_work(). This method
|
// CardTableModRefBS::par_non_clean_card_iterate_work(). This method
|
||||||
@ -104,10 +104,6 @@ class SharedHeap : public CollectedHeap {
|
|||||||
friend class VM_GC_Operation;
|
friend class VM_GC_Operation;
|
||||||
friend class VM_CGC_Operation;
|
friend class VM_CGC_Operation;
|
||||||
|
|
||||||
private:
|
|
||||||
// For claiming strong_roots tasks.
|
|
||||||
SubTasksDone* _process_strong_tasks;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// There should be only a single instance of "SharedHeap" in a program.
|
// There should be only a single instance of "SharedHeap" in a program.
|
||||||
// This is enforced with the protected constructor below, which will also
|
// This is enforced with the protected constructor below, which will also
|
||||||
@ -140,7 +136,6 @@ public:
|
|||||||
static SharedHeap* heap() { return _sh; }
|
static SharedHeap* heap() { return _sh; }
|
||||||
|
|
||||||
void set_barrier_set(BarrierSet* bs);
|
void set_barrier_set(BarrierSet* bs);
|
||||||
SubTasksDone* process_strong_tasks() { return _process_strong_tasks; }
|
|
||||||
|
|
||||||
// Does operations required after initialization has been done.
|
// Does operations required after initialization has been done.
|
||||||
virtual void post_initialize();
|
virtual void post_initialize();
|
||||||
@ -193,69 +188,19 @@ public:
|
|||||||
// strong_roots_prologue calls change_strong_roots_parity, if
|
// strong_roots_prologue calls change_strong_roots_parity, if
|
||||||
// parallel tasks are enabled.
|
// parallel tasks are enabled.
|
||||||
class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope {
|
class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope {
|
||||||
// Used to implement the Thread work barrier.
|
|
||||||
static Monitor* _lock;
|
|
||||||
|
|
||||||
SharedHeap* _sh;
|
SharedHeap* _sh;
|
||||||
volatile jint _n_workers_done_with_threads;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StrongRootsScope(SharedHeap* heap, bool activate = true);
|
StrongRootsScope(SharedHeap* heap, bool activate = true);
|
||||||
~StrongRootsScope();
|
|
||||||
|
|
||||||
// Mark that this thread is done with the Threads work.
|
|
||||||
void mark_worker_done_with_threads(uint n_workers);
|
|
||||||
// Wait until all n_workers are done with the Threads work.
|
|
||||||
void wait_until_all_workers_done_with_threads(uint n_workers);
|
|
||||||
};
|
};
|
||||||
friend class StrongRootsScope;
|
friend class StrongRootsScope;
|
||||||
|
|
||||||
// The current active StrongRootScope
|
|
||||||
StrongRootsScope* _strong_roots_scope;
|
|
||||||
|
|
||||||
StrongRootsScope* active_strong_roots_scope() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void register_strong_roots_scope(StrongRootsScope* scope);
|
|
||||||
void unregister_strong_roots_scope(StrongRootsScope* scope);
|
|
||||||
void change_strong_roots_parity();
|
void change_strong_roots_parity();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum ScanningOption {
|
|
||||||
SO_None = 0x0,
|
|
||||||
SO_AllCodeCache = 0x8,
|
|
||||||
SO_ScavengeCodeCache = 0x10
|
|
||||||
};
|
|
||||||
|
|
||||||
FlexibleWorkGang* workers() const { return _workers; }
|
FlexibleWorkGang* workers() const { return _workers; }
|
||||||
|
|
||||||
// Invoke the "do_oop" method the closure "roots" on all root locations.
|
|
||||||
// The "so" argument determines which roots the closure is applied to:
|
|
||||||
// "SO_None" does none;
|
|
||||||
// "SO_AllCodeCache" applies the closure to all elements of the CodeCache.
|
|
||||||
// "SO_ScavengeCodeCache" applies the closure to elements on the scavenge root list in the CodeCache.
|
|
||||||
void process_roots(bool activate_scope,
|
|
||||||
ScanningOption so,
|
|
||||||
OopClosure* strong_roots,
|
|
||||||
OopClosure* weak_roots,
|
|
||||||
CLDClosure* strong_cld_closure,
|
|
||||||
CLDClosure* weak_cld_closure,
|
|
||||||
CodeBlobClosure* code_roots);
|
|
||||||
void process_all_roots(bool activate_scope,
|
|
||||||
ScanningOption so,
|
|
||||||
OopClosure* roots,
|
|
||||||
CLDClosure* cld_closure,
|
|
||||||
CodeBlobClosure* code_roots);
|
|
||||||
void process_strong_roots(bool activate_scope,
|
|
||||||
ScanningOption so,
|
|
||||||
OopClosure* roots,
|
|
||||||
CLDClosure* cld_closure,
|
|
||||||
CodeBlobClosure* code_roots);
|
|
||||||
|
|
||||||
|
|
||||||
// Apply "root_closure" to the JNI weak roots..
|
|
||||||
void process_weak_roots(OopClosure* root_closure);
|
|
||||||
|
|
||||||
// The functions below are helper functions that a subclass of
|
// The functions below are helper functions that a subclass of
|
||||||
// "SharedHeap" can use in the implementation of its virtual
|
// "SharedHeap" can use in the implementation of its virtual
|
||||||
// functions.
|
// functions.
|
||||||
@ -270,9 +215,6 @@ public:
|
|||||||
// (such as process roots) subsequently.
|
// (such as process roots) subsequently.
|
||||||
virtual void set_par_threads(uint t);
|
virtual void set_par_threads(uint t);
|
||||||
|
|
||||||
int n_termination();
|
|
||||||
void set_n_termination(int t);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// New methods from CollectedHeap
|
// New methods from CollectedHeap
|
||||||
//
|
//
|
||||||
@ -284,8 +226,4 @@ public:
|
|||||||
size_t capacity);
|
size_t capacity);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline SharedHeap::ScanningOption operator|(SharedHeap::ScanningOption so0, SharedHeap::ScanningOption so1) {
|
|
||||||
return static_cast<SharedHeap::ScanningOption>(static_cast<int>(so0) | static_cast<int>(so1));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP
|
#endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "classfile/systemDictionary.hpp"
|
#include "classfile/systemDictionary.hpp"
|
||||||
#include "classfile/vmSymbols.hpp"
|
#include "classfile/vmSymbols.hpp"
|
||||||
#include "gc_implementation/shared/liveRange.hpp"
|
#include "gc_implementation/shared/liveRange.hpp"
|
||||||
#include "gc_implementation/shared/markSweep.hpp"
|
|
||||||
#include "gc_implementation/shared/spaceDecorator.hpp"
|
#include "gc_implementation/shared/spaceDecorator.hpp"
|
||||||
#include "gc_interface/collectedHeap.inline.hpp"
|
#include "gc_interface/collectedHeap.inline.hpp"
|
||||||
#include "memory/blockOffsetTable.inline.hpp"
|
#include "memory/blockOffsetTable.inline.hpp"
|
||||||
@ -353,15 +352,6 @@ void ContiguousSpace::mangle_unused_area() {
|
|||||||
void ContiguousSpace::mangle_unused_area_complete() {
|
void ContiguousSpace::mangle_unused_area_complete() {
|
||||||
mangler()->mangle_unused_area_complete();
|
mangler()->mangle_unused_area_complete();
|
||||||
}
|
}
|
||||||
void ContiguousSpace::mangle_region(MemRegion mr) {
|
|
||||||
// Although this method uses SpaceMangler::mangle_region() which
|
|
||||||
// is not specific to a space, the when the ContiguousSpace version
|
|
||||||
// is called, it is always with regard to a space and this
|
|
||||||
// bounds checking is appropriate.
|
|
||||||
MemRegion space_mr(bottom(), end());
|
|
||||||
assert(space_mr.contains(mr), "Mangling outside space");
|
|
||||||
SpaceMangler::mangle_region(mr);
|
|
||||||
}
|
|
||||||
#endif // NOT_PRODUCT
|
#endif // NOT_PRODUCT
|
||||||
|
|
||||||
void CompactibleSpace::initialize(MemRegion mr,
|
void CompactibleSpace::initialize(MemRegion mr,
|
||||||
@ -388,7 +378,7 @@ HeapWord* CompactibleSpace::forward(oop q, size_t size,
|
|||||||
cp->space->set_compaction_top(compact_top);
|
cp->space->set_compaction_top(compact_top);
|
||||||
cp->space = cp->space->next_compaction_space();
|
cp->space = cp->space->next_compaction_space();
|
||||||
if (cp->space == NULL) {
|
if (cp->space == NULL) {
|
||||||
cp->gen = GenCollectedHeap::heap()->prev_gen(cp->gen);
|
cp->gen = GenCollectedHeap::heap()->young_gen();
|
||||||
assert(cp->gen != NULL, "compaction must succeed");
|
assert(cp->gen != NULL, "compaction must succeed");
|
||||||
cp->space = cp->gen->first_compaction_space();
|
cp->space = cp->gen->first_compaction_space();
|
||||||
assert(cp->space != NULL, "generation must have a first compaction space");
|
assert(cp->space != NULL, "generation must have a first compaction space");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -128,11 +128,10 @@ class Space: public CHeapObj<mtGC> {
|
|||||||
|
|
||||||
// For detecting GC bugs. Should only be called at GC boundaries, since
|
// For detecting GC bugs. Should only be called at GC boundaries, since
|
||||||
// some unused space may be used as scratch space during GC's.
|
// some unused space may be used as scratch space during GC's.
|
||||||
// Default implementation does nothing. We also call this when expanding
|
// We also call this when expanding a space to satisfy an allocation
|
||||||
// a space to satisfy an allocation request. See bug #4668531
|
// request. See bug #4668531
|
||||||
virtual void mangle_unused_area() {}
|
virtual void mangle_unused_area() = 0;
|
||||||
virtual void mangle_unused_area_complete() {}
|
virtual void mangle_unused_area_complete() = 0;
|
||||||
virtual void mangle_region(MemRegion mr) {}
|
|
||||||
|
|
||||||
// Testers
|
// Testers
|
||||||
bool is_empty() const { return used() == 0; }
|
bool is_empty() const { return used() == 0; }
|
||||||
@ -196,7 +195,7 @@ class Space: public CHeapObj<mtGC> {
|
|||||||
// structure supporting these calls, possibly speeding up future calls.
|
// structure supporting these calls, possibly speeding up future calls.
|
||||||
// The default implementation, however, is simply to call the const
|
// The default implementation, however, is simply to call the const
|
||||||
// version.
|
// version.
|
||||||
inline virtual HeapWord* block_start(const void* p);
|
virtual HeapWord* block_start(const void* p);
|
||||||
|
|
||||||
// Requires "addr" to be the start of a chunk, and returns its size.
|
// Requires "addr" to be the start of a chunk, and returns its size.
|
||||||
// "addr + size" is required to be the start of a new chunk, or the end
|
// "addr + size" is required to be the start of a new chunk, or the end
|
||||||
@ -559,8 +558,6 @@ class ContiguousSpace: public CompactibleSpace {
|
|||||||
void mangle_unused_area() PRODUCT_RETURN;
|
void mangle_unused_area() PRODUCT_RETURN;
|
||||||
// Mangle [top, end)
|
// Mangle [top, end)
|
||||||
void mangle_unused_area_complete() PRODUCT_RETURN;
|
void mangle_unused_area_complete() PRODUCT_RETURN;
|
||||||
// Mangle the given MemRegion.
|
|
||||||
void mangle_region(MemRegion mr) PRODUCT_RETURN;
|
|
||||||
|
|
||||||
// Do some sparse checking on the area that should have been mangled.
|
// Do some sparse checking on the area that should have been mangled.
|
||||||
void check_mangled_unused_area(HeapWord* limit) PRODUCT_RETURN;
|
void check_mangled_unused_area(HeapWord* limit) PRODUCT_RETURN;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user