Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
05014695
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
05014695
编写于
1月 25, 2012
作者:
K
kamg
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
fc51d03e
657aa7f5
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
345 addition
and
86 deletion
+345
-86
make/bsd/Makefile
make/bsd/Makefile
+1
-1
make/bsd/makefiles/buildtree.make
make/bsd/makefiles/buildtree.make
+70
-28
make/bsd/makefiles/defs.make
make/bsd/makefiles/defs.make
+1
-1
make/bsd/makefiles/launcher.make
make/bsd/makefiles/launcher.make
+18
-1
make/bsd/makefiles/vm.make
make/bsd/makefiles/vm.make
+2
-2
make/jprt.properties
make/jprt.properties
+32
-0
make/linux/makefiles/buildtree.make
make/linux/makefiles/buildtree.make
+70
-12
make/solaris/makefiles/buildtree.make
make/solaris/makefiles/buildtree.make
+75
-15
src/os/bsd/vm/os_bsd.cpp
src/os/bsd/vm/os_bsd.cpp
+32
-13
src/os/posix/launcher/java_md.c
src/os/posix/launcher/java_md.c
+9
-1
src/share/vm/prims/jvmtiThreadState.cpp
src/share/vm/prims/jvmtiThreadState.cpp
+18
-0
src/share/vm/prims/jvmtiThreadState.hpp
src/share/vm/prims/jvmtiThreadState.hpp
+4
-0
src/share/vm/services/gcNotifier.cpp
src/share/vm/services/gcNotifier.cpp
+2
-1
src/share/vm/services/management.cpp
src/share/vm/services/management.cpp
+8
-8
src/share/vm/services/memoryManager.cpp
src/share/vm/services/memoryManager.cpp
+2
-2
src/share/vm/services/memoryManager.hpp
src/share/vm/services/memoryManager.hpp
+1
-1
未找到文件。
make/bsd/Makefile
浏览文件 @
05014695
...
...
@@ -208,7 +208,7 @@ TARGETS_ZERO = $(addsuffix zero,$(TARGETS))
TARGETS_SHARK
=
$(
addsuffix
shark,
$(TARGETS)
)
BUILDTREE_MAKE
=
$(GAMMADIR)
/make/
$(OSNAME)
/makefiles/buildtree.make
BUILDTREE_VARS
=
GAMMADIR
=
$(GAMMADIR)
OS_FAMILY
=
$(OSNAME)
SRCARCH
=
$(SRCARCH)
BUILDARCH
=
$(BUILDARCH)
LIBARCH
=
$(LIBARCH)
BUILDTREE_VARS
=
GAMMADIR
=
$(GAMMADIR)
OS_FAMILY
=
$(OSNAME)
SRCARCH
=
$(SRCARCH)
BUILDARCH
=
$(BUILDARCH)
LIBARCH
=
$(LIBARCH)
LIBRARY_SUFFIX
=
$(LIBRARY_SUFFIX)
BUILDTREE_VARS
+=
HOTSPOT_RELEASE_VERSION
=
$(HOTSPOT_RELEASE_VERSION)
HOTSPOT_BUILD_VERSION
=
$(HOTSPOT_BUILD_VERSION)
JRE_RELEASE_VERSION
=
$(JRE_RELEASE_VERSION)
BUILDTREE
=
$(MAKE)
-f
$(BUILDTREE_MAKE)
$(BUILDTREE_VARS)
...
...
make/bsd/makefiles/buildtree.make
浏览文件 @
05014695
...
...
@@ -162,20 +162,6 @@ ifndef HOTSPOT_VM_DISTRO
endif
endif
ifeq
($(OS_VENDOR), Darwin)
# MACOSX FIXME: we should be able to run test_gamma (see MACOSX_PORT-214)
ifeq
($(ALWAYS_PASS_TEST_GAMMA),)
# ALWAYS_PASS_TEST_GAMMA wasn't set so we default to true on MacOS X
# until MACOSX_PORT-214 is fixed
ALWAYS_PASS_TEST_GAMMA
=
true
endif
endif
ifeq
($(ALWAYS_PASS_TEST_GAMMA), true)
TEST_GAMMA_STATUS
=
echo
'exit 0'
;
else
TEST_GAMMA_STATUS
=
endif
BUILDTREE_VARS
+=
HOTSPOT_RELEASE_VERSION
=
$(HS_BUILD_VER)
HOTSPOT_BUILD_VERSION
=
JRE_RELEASE_VERSION
=
$(JRE_RELEASE_VERSION)
BUILDTREE
=
\
...
...
@@ -353,12 +339,10 @@ env.sh: $(BUILDTREE_MAKE)
$(BUILDTREE_COMMENT)
;
\
[
-n
"
$$
JAVA_HOME"
]
&&
{
echo
":
\$
${
JAVA_HOME
:
=
$
${JAVA_HOME}
}
"
;
}
;
\
{
\
echo
"LD_LIBRARY_PATH=.:
$
${
LD_LIBRARY_PATH
:+
$$LD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
"DYLD_LIBRARY_PATH=.:
$
${
DYLD_LIBRARY_PATH
:+
$$DYLD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
"CLASSPATH=
$
${
CLASSPATH
:+
$$CLASSPATH
:
}
.:
\$
${JAVA_HOME}
/jre/lib/rt.jar:
\$
${JAVA_HOME}
/jre/lib/i18n.jar"
;
\
}
|
sed
s:
$
${
JAVA_HOME
:-
-------
}
:
\$
${JAVA_HOME}
:g
;
\
echo
"HOTSPOT_BUILD_USER=
\"
$
${
LOGNAME
:-
$$USER
}
in
`
basename
$(GAMMADIR)
`
\"
"
;
\
echo
"export JAVA_HOME
LD_LIBRARY_PATH DYLD_LIBRARY_PATH
CLASSPATH HOTSPOT_BUILD_USER"
;
\
echo
"export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"
;
\
)
>
$@
env.csh
:
env.sh
...
...
@@ -412,7 +396,7 @@ JAVA_FLAG/32 = -d32
JAVA_FLAG/
64
=
-d64
WRONG_DATA_MODE_MSG
=
\
echo
"JAVA_HOME must point to
$(DATA_MODE)
bit
JDK."
echo
"JAVA_HOME must point to
a
$(DATA_MODE)
-bit Open
JDK."
CROSS_COMPILING_MSG
=
\
echo
"Cross compiling for ARCH
$(CROSS_COMPILE_ARCH)
, skipping gamma run."
...
...
@@ -420,20 +404,78 @@ CROSS_COMPILING_MSG = \
test_gamma
:
$(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
@
echo
Creating
$@
...
$(QUIETLY)
(
\
echo
'#!/bin/sh'
;
\
echo
"#!/bin/sh"
;
\
echo
""
;
\
$(BUILDTREE_COMMENT)
;
\
echo
'. ./env.sh'
;
\
echo
"if [
\"
$(CROSS_COMPILE_ARCH)
\"
!=
\"\"
]; then {
$(CROSS_COMPILING_MSG)
; exit 0; }; fi"
;
\
echo
"if [ -z
\$
$JAVA_HOME
]; then {
$(NO_JAVA_HOME_MSG)
; exit 0; }; fi"
;
\
echo
"if !
\$
${JAVA_HOME}
/bin/java
$(JAVA_FLAG)
-fullversion 2>&1 > /dev/null"
;
\
echo
"then"
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
; exit 0;"
;
\
echo
""
;
\
echo
"# Include environment settings for gamma run"
;
\
echo
""
;
\
echo
". ./env.sh"
;
\
echo
""
;
\
echo
"# Do not run gamma test for cross compiles"
;
\
echo
""
;
\
echo
"if [ -n
\"
$(CROSS_COMPILE_ARCH)
\"
]; then "
;
\
echo
"
$(CROSS_COMPILING_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Make sure JAVA_HOME is set as it is required for gamma"
;
\
echo
""
;
\
echo
"if [ -z
\"\$
${JAVA_HOME}
\"
]; then "
;
\
echo
"
$(NO_JAVA_HOME_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Check JAVA_HOME version to be used for the test"
;
\
echo
""
;
\
echo
"
\$
${JAVA_HOME}
/bin/java
$(JAVA_FLAG)
-fullversion > /dev/null 2>&1"
;
\
echo
"if [
\$
$?
-ne 0 ]; then "
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Use gamma_g if it exists"
;
\
echo
""
;
\
echo
"GAMMA_PROG=gamma"
;
\
echo
"if [ -f gamma_g ]; then "
;
\
echo
" GAMMA_PROG=gamma_g"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"if [
\"
$(OS_VENDOR)
\"
=
\"
Darwin
\"
]; then "
;
\
echo
" # Ensure architecture for gamma and JAVA_HOME is the same."
;
\
echo
" # NOTE: gamma assumes the OpenJDK directory layout."
;
\
echo
""
;
\
echo
" GAMMA_ARCH=
\"\`
file
\$
${GAMMA_PROG}
| awk '{print
\$
$NF
}'
\`\"
"
;
\
echo
" JVM_LIB=
\"\$
${JAVA_HOME}
/jre/lib/libjava.
$(LIBRARY_SUFFIX)
\"
"
;
\
echo
" if [ ! -f
\$
${JVM_LIB}
]; then"
;
\
echo
" JVM_LIB=
\"\$
${JAVA_HOME}
/jre/lib/
$
${LIBARCH}
/libjava.
$(LIBRARY_SUFFIX)
\"
"
;
\
echo
" fi"
;
\
echo
" if [ ! -f
\$
${JVM_LIB}
] || [ -z
\"\`
file
\$
${JVM_LIB}
| grep
\$
${GAMMA_ARCH}
\`\"
]; then "
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
"
;
\
echo
" exit 0"
;
\
echo
" fi"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Compile Queens program for test"
;
\
echo
""
;
\
echo
"rm -f Queens.class"
;
\
echo
"
\$
${JAVA_HOME}
/bin/javac -d .
$(GAMMADIR)
/make/test/Queens.java"
;
\
echo
'[ -f gamma_g ] && { gamma=gamma_g; }'
;
\
echo
'./$${gamma:-gamma}
$(TESTFLAGS)
Queens < /dev/null'
;
\
$(TEST_GAMMA_STATUS)
\
echo
""
;
\
echo
"# Set library path solely for gamma launcher test run"
;
\
echo
""
;
\
echo
"LD_LIBRARY_PATH=.:
$
${
LD_LIBRARY_PATH
:+
$$LD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
"export LD_LIBRARY_PATH"
;
\
echo
"unset LD_LIBRARY_PATH_32"
;
\
echo
"unset LD_LIBRARY_PATH_64"
;
\
echo
""
;
\
echo
"if [
\"
$(OS_VENDOR)
\"
=
\"
Darwin
\"
]; then "
;
\
echo
" DYLD_LIBRARY_PATH=.:
$
${
DYLD_LIBRARY_PATH
:+
$$DYLD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/native_threads:
\$
${JAVA_HOME}
/jre/lib:
$
${
DYLD_LIBRARY_PATH
:+
$$DYLD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
" export DYLD_LIBRARY_PATH"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Use the gamma launcher and JAVA_HOME to run the test"
;
\
echo
""
;
\
echo
"./
\$
${GAMMA_PROG}
$(TESTFLAGS)
Queens < /dev/null"
;
\
)
>
$@
$(QUIETLY)
chmod
+x
$@
...
...
make/bsd/makefiles/defs.make
浏览文件 @
05014695
...
...
@@ -142,6 +142,7 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so
EXPORT_LIST
+=
$(EXPORT_JRE_LIB_ARCH_DIR)
/libjsig.
$(LIBRARY_SUFFIX)
EXPORT_SERVER_DIR
=
$(EXPORT_JRE_LIB_ARCH_DIR)
/server
EXPORT_CLIENT_DIR
=
$(EXPORT_JRE_LIB_ARCH_DIR)
/client
ifndef
BUILD_CLIENT_ONLY
EXPORT_LIST
+=
$(EXPORT_SERVER_DIR)
/Xusage.txt
...
...
@@ -150,7 +151,6 @@ endif
ifneq
($(ZERO_BUILD), true)
ifeq
($(ARCH_DATA_MODEL), 32)
EXPORT_CLIENT_DIR
=
$(EXPORT_JRE_LIB_ARCH_DIR)
/client
EXPORT_LIST
+=
$(EXPORT_CLIENT_DIR)
/Xusage.txt
EXPORT_LIST
+=
$(EXPORT_CLIENT_DIR)
/libjvm.
$(LIBRARY_SUFFIX)
endif
...
...
make/bsd/makefiles/launcher.make
浏览文件 @
05014695
...
...
@@ -50,7 +50,24 @@ ifeq ($(LINK_INTO),AOUT)
LIBS_LAUNCHER
+=
$(STATIC_STDCXX)
$(LIBS)
else
LAUNCHER.o
=
launcher.o
LFLAGS_LAUNCHER
+=
-L
`
pwd
`
LFLAGS_LAUNCHER
+=
-L
`
pwd
`
# The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a
# freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting
# the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM
# first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is
# statically linked with CoreFoundation framework libs. Unfortunately, gamma's
# unique searchpath results in some unresolved symbols in the framework
# libraries, because JDK libraries are inadvertently discovered first on the
# searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*.
# So, the actual filename collision is libjpeg.dylib and libJPEG.dylib.
# To resolve this, gamma needs to also statically link with the CoreFoundation
# framework libraries.
ifeq
($(OS_VENDOR),Darwin)
LFLAGS_LAUNCHER
+=
-framework
CoreFoundation
endif
LIBS_LAUNCHER
+=
-l
$(JVM)
$(LIBS)
endif
...
...
make/bsd/makefiles/vm.make
浏览文件 @
05014695
...
...
@@ -337,8 +337,8 @@ ifeq ($(OS_VENDOR), Darwin)
$(LIBJVM).dSYM
:
$(LIBJVM)
dsymutil
$(LIBJVM)
# no l
auncher or l
ibjvm_db for macosx
build
:
$(LIBJVM) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(LIBJVM).dSYM
# no libjvm_db for macosx
build
:
$(LIBJVM) $(L
AUNCHER) $(L
IBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(LIBJVM).dSYM
echo
"Doing vm.make build:"
else
build
:
$(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
...
...
make/jprt.properties
浏览文件 @
05014695
...
...
@@ -174,6 +174,10 @@ jprt.my.linux.armsflt.ejdk6=linux_armsflt_2.6
jprt.my.linux.armsflt.ejdk7
=
linux_armsflt_2.6
jprt.my.linux.armsflt
=
${jprt.my.linux.armsflt.${jprt.tools.default.release}}
jprt.my.macosx.x64.jdk8
=
macosx_x64_10.7
jprt.my.macosx.x64.jdk7
=
macosx_x64_10.7
jprt.my.macosx.x64
=
${jprt.my.macosx.x64.${jprt.tools.default.release}}
jprt.my.windows.i586.jdk8
=
windows_i586_5.1
jprt.my.windows.i586.jdk7
=
windows_i586_5.1
jprt.my.windows.i586.jdk7b107
=
windows_i586_5.0
...
...
@@ -211,6 +215,7 @@ jprt.build.targets.standard= \
${jprt.my.solaris.x64}-{product|fastdebug|debug},
\
${jprt.my.linux.i586}-{product|fastdebug|debug},
\
${jprt.my.linux.x64}-{product|fastdebug},
\
${jprt.my.macosx.x64}-{product|fastdebug|debug},
\
${jprt.my.windows.i586}-{product|fastdebug|debug},
\
${jprt.my.windows.x64}-{product|fastdebug|debug}
...
...
@@ -416,6 +421,30 @@ jprt.my.linux.x64.test.targets = \
${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_G1,
\
${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParOldGC
jprt.my.macosx.x64.test.targets
=
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jvm98,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jvm98_nontiered,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-scimark,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_default,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_SerialGC,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_CMS,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_G1,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCBasher_ParOldGC,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_default,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_SerialGC,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParallelGC,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParNewGC,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_CMS,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_G1,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParOldGC
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default_tiered,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParallelGC,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_G1,
\
${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParOldGC
jprt.my.windows.i586.test.targets
=
\
${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98,
\
${jprt.my.windows.i586}-{product|fastdebug}-c2-jvm98_nontiered,
\
...
...
@@ -492,6 +521,7 @@ jprt.test.targets.standard = \
${jprt.my.solaris.x64.test.targets},
\
${jprt.my.linux.i586.test.targets},
\
${jprt.my.linux.x64.test.targets},
\
${jprt.my.macosx.x64.test.targets},
\
${jprt.my.windows.i586.test.targets},
\
${jprt.my.windows.x64.test.targets},
\
${jprt.test.targets.open}
...
...
@@ -538,6 +568,7 @@ jprt.make.rule.test.targets.standard.server = \
${jprt.my.solaris.x64}-*-c2-servertest,
\
${jprt.my.linux.i586}-*-c2-servertest,
\
${jprt.my.linux.x64}-*-c2-servertest,
\
${jprt.my.macosx.x64}-*-c2-servertest,
\
${jprt.my.windows.i586}-*-c2-servertest,
\
${jprt.my.windows.x64}-*-c2-servertest
...
...
@@ -548,6 +579,7 @@ jprt.make.rule.test.targets.standard.internalvmtests = \
${jprt.my.solaris.x64}-fastdebug-c2-internalvmtests,
\
${jprt.my.linux.i586}-fastdebug-c2-internalvmtests,
\
${jprt.my.linux.x64}-fastdebug-c2-internalvmtests,
\
${jprt.my.macosx.x64}-fastdebug-c2-internalvmtests,
\
${jprt.my.windows.i586}-fastdebug-c2-internalvmtests,
\
${jprt.my.windows.x64}-fastdebug-c2-internalvmtests
...
...
make/linux/makefiles/buildtree.make
浏览文件 @
05014695
...
...
@@ -326,11 +326,10 @@ env.sh: $(BUILDTREE_MAKE)
$(BUILDTREE_COMMENT)
;
\
[
-n
"
$$
JAVA_HOME"
]
&&
{
echo
":
\$
${
JAVA_HOME
:
=
$
${JAVA_HOME}
}
"
;
}
;
\
{
\
echo
"LD_LIBRARY_PATH=.:
$
${
LD_LIBRARY_PATH
:+
$$LD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
"CLASSPATH=
$
${
CLASSPATH
:+
$$CLASSPATH
:
}
.:
\$
${JAVA_HOME}
/jre/lib/rt.jar:
\$
${JAVA_HOME}
/jre/lib/i18n.jar"
;
\
}
|
sed
s:
$
${
JAVA_HOME
:-
-------
}
:
\$
${JAVA_HOME}
:g
;
\
echo
"HOTSPOT_BUILD_USER=
\"
$
${
LOGNAME
:-
$$USER
}
in
`
basename
$(GAMMADIR)
`
\"
"
;
\
echo
"export JAVA_HOME
LD_LIBRARY_PATH
CLASSPATH HOTSPOT_BUILD_USER"
;
\
echo
"export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"
;
\
)
>
$@
env.csh
:
env.sh
...
...
@@ -384,7 +383,7 @@ JAVA_FLAG/32 = -d32
JAVA_FLAG/
64
=
-d64
WRONG_DATA_MODE_MSG
=
\
echo
"JAVA_HOME must point to
$(DATA_MODE)
bit
JDK."
echo
"JAVA_HOME must point to
a
$(DATA_MODE)
-bit Open
JDK."
CROSS_COMPILING_MSG
=
\
echo
"Cross compiling for ARCH
$(CROSS_COMPILE_ARCH)
, skipping gamma run."
...
...
@@ -392,19 +391,78 @@ CROSS_COMPILING_MSG = \
test_gamma
:
$(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
@
echo
Creating
$@
...
$(QUIETLY)
(
\
echo
'#!/bin/sh'
;
\
echo
"#!/bin/sh"
;
\
echo
""
;
\
$(BUILDTREE_COMMENT)
;
\
echo
'. ./env.sh'
;
\
echo
"if [
\"
$(CROSS_COMPILE_ARCH)
\"
!=
\"\"
]; then {
$(CROSS_COMPILING_MSG)
; exit 0; }; fi"
;
\
echo
"if [ -z
\$
$JAVA_HOME
]; then {
$(NO_JAVA_HOME_MSG)
; exit 0; }; fi"
;
\
echo
"if !
\$
${JAVA_HOME}
/bin/java
$(JAVA_FLAG)
-fullversion 2>&1 > /dev/null"
;
\
echo
"then"
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
; exit 0;"
;
\
echo
""
;
\
echo
"# Include environment settings for gamma run"
;
\
echo
""
;
\
echo
". ./env.sh"
;
\
echo
""
;
\
echo
"# Do not run gamma test for cross compiles"
;
\
echo
""
;
\
echo
"if [ -n
\"
$(CROSS_COMPILE_ARCH)
\"
]; then "
;
\
echo
"
$(CROSS_COMPILING_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Make sure JAVA_HOME is set as it is required for gamma"
;
\
echo
""
;
\
echo
"if [ -z
\"\$
${JAVA_HOME}
\"
]; then "
;
\
echo
"
$(NO_JAVA_HOME_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Check JAVA_HOME version to be used for the test"
;
\
echo
""
;
\
echo
"
\$
${JAVA_HOME}
/bin/java
$(JAVA_FLAG)
-fullversion > /dev/null 2>&1"
;
\
echo
"if [
\$
$?
-ne 0 ]; then "
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Use gamma_g if it exists"
;
\
echo
""
;
\
echo
"GAMMA_PROG=gamma"
;
\
echo
"if [ -f gamma_g ]; then "
;
\
echo
" GAMMA_PROG=gamma_g"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"if [
\"
$(OS_VENDOR)
\"
=
\"
Darwin
\"
]; then "
;
\
echo
" # Ensure architecture for gamma and JAVA_HOME is the same."
;
\
echo
" # NOTE: gamma assumes the OpenJDK directory layout."
;
\
echo
""
;
\
echo
" GAMMA_ARCH=
\"\`
file
\$
${GAMMA_PROG}
| awk '{print
\$
$NF
}'
\`\"
"
;
\
echo
" JVM_LIB=
\"\$
${JAVA_HOME}
/jre/lib/libjava.
$(LIBRARY_SUFFIX)
\"
"
;
\
echo
" if [ ! -f
\$
${JVM_LIB}
]; then"
;
\
echo
" JVM_LIB=
\"\$
${JAVA_HOME}
/jre/lib/
$
${LIBARCH}
/libjava.
$(LIBRARY_SUFFIX)
\"
"
;
\
echo
" fi"
;
\
echo
" if [ ! -f
\$
${JVM_LIB}
] || [ -z
\"\`
file
\$
${JVM_LIB}
| grep
\$
${GAMMA_ARCH}
\`\"
]; then "
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
"
;
\
echo
" exit 0"
;
\
echo
" fi"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Compile Queens program for test"
;
\
echo
""
;
\
echo
"rm -f Queens.class"
;
\
echo
"
\$
${JAVA_HOME}
/bin/javac -d .
$(GAMMADIR)
/make/test/Queens.java"
;
\
echo
'[ -f gamma_g ] && { gamma=gamma_g; }'
;
\
echo
'./$${gamma:-gamma}
$(TESTFLAGS)
Queens < /dev/null'
;
\
echo
""
;
\
echo
"# Set library path solely for gamma launcher test run"
;
\
echo
""
;
\
echo
"LD_LIBRARY_PATH=.:
$
${
LD_LIBRARY_PATH
:+
$$LD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
"export LD_LIBRARY_PATH"
;
\
echo
"unset LD_LIBRARY_PATH_32"
;
\
echo
"unset LD_LIBRARY_PATH_64"
;
\
echo
""
;
\
echo
"if [
\"
$(OS_VENDOR)
\"
=
\"
Darwin
\"
]; then "
;
\
echo
" DYLD_LIBRARY_PATH=.:
$
${
DYLD_LIBRARY_PATH
:+
$$DYLD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/native_threads:
\$
${JAVA_HOME}
/jre/lib:
$
${
DYLD_LIBRARY_PATH
:+
$$DYLD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
" export DYLD_LIBRARY_PATH"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Use the gamma launcher and JAVA_HOME to run the test"
;
\
echo
""
;
\
echo
"./
\$
${GAMMA_PROG}
$(TESTFLAGS)
Queens < /dev/null"
;
\
)
>
$@
$(QUIETLY)
chmod
+x
$@
...
...
make/solaris/makefiles/buildtree.make
浏览文件 @
05014695
...
...
@@ -118,7 +118,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
BUILDTREE_MAKE
=
$(GAMMADIR)
/make/
$(OS_FAMILY)
/makefiles/buildtree.make
BUILDTREE_TARGETS
=
Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make
\
env.
k
sh env.csh jdkpath.sh .dbxrc test_gamma
env.sh env.csh jdkpath.sh .dbxrc test_gamma
BUILDTREE_VARS
=
GAMMADIR
=
$(GAMMADIR)
OS_FAMILY
=
$(OS_FAMILY)
\
ARCH
=
$(ARCH)
BUILDARCH
=
$(BUILDARCH)
LIBARCH
=
$(LIBARCH)
VARIANT
=
$(VARIANT)
...
...
@@ -313,22 +313,19 @@ sa.make: $(BUILDTREE_MAKE)
echo
"include
\$
$(GAMMADIR)
/make/
$(OS_FAMILY)
/makefiles/
$
(@F)"
;
\
)
>
$@
env.
k
sh
:
$(BUILDTREE_MAKE)
env.sh
:
$(BUILDTREE_MAKE)
@
echo
Creating
$@
...
$(QUIETLY)
(
\
$(BUILDTREE_COMMENT)
;
\
[
-n
"
$$
JAVA_HOME"
]
&&
{
echo
":
\$
${
JAVA_HOME
:
=
$
${JAVA_HOME}
}
"
;
}
;
\
{
\
echo
"LD_LIBRARY_PATH=.:
$
${
LD_LIBRARY_PATH
:+
$$LD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
"unset LD_LIBRARY_PATH_32"
;
\
echo
"unset LD_LIBRARY_PATH_64"
;
\
echo
"CLASSPATH=
$
${
CLASSPATH
:+
$$CLASSPATH
:
}
.:
\$
${JAVA_HOME}
/jre/lib/rt.jar:
\$
${JAVA_HOME}
/jre/lib/i18n.jar"
;
\
}
|
sed
s:
$
${
JAVA_HOME
:-
-------
}
:
\$
${JAVA_HOME}
:g
;
\
echo
"HOTSPOT_BUILD_USER=
\"
$
${
LOGNAME
:-
$$USER
}
in
`
basename
$(GAMMADIR)
`
\"
"
;
\
echo
"export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"
;
\
)
>
$@
env.csh
:
env.
k
sh
env.csh
:
env.sh
@
echo
Creating
$@
...
$(QUIETLY)
(
\
$(BUILDTREE_COMMENT)
;
\
...
...
@@ -384,23 +381,86 @@ JAVA_FLAG/32 = -d32
JAVA_FLAG/
64
=
-d64
WRONG_DATA_MODE_MSG
=
\
echo
"JAVA_HOME must point to
$(DATA_MODE)
bit JDK."
echo
"JAVA_HOME must point to a
$(DATA_MODE)
-bit OpenJDK."
CROSS_COMPILING_MSG
=
\
echo
"Cross compiling for ARCH
$(CROSS_COMPILE_ARCH)
, skipping gamma run."
test_gamma
:
$(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
@
echo
Creating
$@
...
$(QUIETLY)
(
\
echo
'#!/bin/ksh'
;
\
echo
"#!/bin/sh"
;
\
echo
""
;
\
$(BUILDTREE_COMMENT)
;
\
echo
'. ./env.ksh'
;
\
echo
"if [ -z
\$
$JAVA_HOME
]; then {
$(NO_JAVA_HOME_MSG)
; exit 0; }; fi"
;
\
echo
"if !
\$
${JAVA_HOME}
/bin/java
$(JAVA_FLAG)
-fullversion 2>&1 > /dev/null"
;
\
echo
"then"
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
; exit 0;"
;
\
echo
""
;
\
echo
"# Include environment settings for gamma run"
;
\
echo
""
;
\
echo
". ./env.sh"
;
\
echo
""
;
\
echo
"# Do not run gamma test for cross compiles"
;
\
echo
""
;
\
echo
"if [ -n
\"
$(CROSS_COMPILE_ARCH)
\"
]; then "
;
\
echo
"
$(CROSS_COMPILING_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Make sure JAVA_HOME is set as it is required for gamma"
;
\
echo
""
;
\
echo
"if [ -z
\"\$
${JAVA_HOME}
\"
]; then "
;
\
echo
"
$(NO_JAVA_HOME_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Check JAVA_HOME version to be used for the test"
;
\
echo
""
;
\
echo
"
\$
${JAVA_HOME}
/bin/java
$(JAVA_FLAG)
-fullversion > /dev/null 2>&1"
;
\
echo
"if [
\$
$?
-ne 0 ]; then "
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
"
;
\
echo
" exit 0"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Use gamma_g if it exists"
;
\
echo
""
;
\
echo
"GAMMA_PROG=gamma"
;
\
echo
"if [ -f gamma_g ]; then "
;
\
echo
" GAMMA_PROG=gamma_g"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"if [
\"
$(OS_VENDOR)
\"
=
\"
Darwin
\"
]; then "
;
\
echo
" # Ensure architecture for gamma and JAVA_HOME is the same."
;
\
echo
" # NOTE: gamma assumes the OpenJDK directory layout."
;
\
echo
""
;
\
echo
" GAMMA_ARCH=
\"\`
file
\$
${GAMMA_PROG}
| awk '{print
\$
$NF
}'
\`\"
"
;
\
echo
" JVM_LIB=
\"\$
${JAVA_HOME}
/jre/lib/libjava.
$(LIBRARY_SUFFIX)
\"
"
;
\
echo
" if [ ! -f
\$
${JVM_LIB}
]; then"
;
\
echo
" JVM_LIB=
\"\$
${JAVA_HOME}
/jre/lib/
$
${LIBARCH}
/libjava.
$(LIBRARY_SUFFIX)
\"
"
;
\
echo
" fi"
;
\
echo
" if [ ! -f
\$
${JVM_LIB}
] || [ -z
\"\`
file
\$
${JVM_LIB}
| grep
\$
${GAMMA_ARCH}
\`\"
]; then "
;
\
echo
"
$(WRONG_DATA_MODE_MSG)
"
;
\
echo
" exit 0"
;
\
echo
" fi"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Compile Queens program for test"
;
\
echo
""
;
\
echo
"rm -f Queens.class"
;
\
echo
"
\$
${JAVA_HOME}
/bin/javac -d .
$(GAMMADIR)
/make/test/Queens.java"
;
\
echo
'[ -f gamma_g ] && { gamma=gamma_g; }'
;
\
echo
'./$${gamma:-gamma}
$(TESTFLAGS)
Queens < /dev/null'
;
\
echo
""
;
\
echo
"# Set library path solely for gamma launcher test run"
;
\
echo
""
;
\
echo
"LD_LIBRARY_PATH=.:
$
${
LD_LIBRARY_PATH
:+
$$LD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
"export LD_LIBRARY_PATH"
;
\
echo
"unset LD_LIBRARY_PATH_32"
;
\
echo
"unset LD_LIBRARY_PATH_64"
;
\
echo
""
;
\
echo
"if [
\"
$(OS_VENDOR)
\"
=
\"
Darwin
\"
]; then "
;
\
echo
" DYLD_LIBRARY_PATH=.:
$
${
DYLD_LIBRARY_PATH
:+
$$DYLD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/native_threads:
\$
${JAVA_HOME}
/jre/lib:
$
${
DYLD_LIBRARY_PATH
:+
$$DYLD_LIBRARY_PATH
:
}
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
/native_threads:
\$
${JAVA_HOME}
/jre/lib/
${LIBARCH}
:
${GCC_LIB}
"
;
\
echo
" export DYLD_LIBRARY_PATH"
;
\
echo
"fi"
;
\
echo
""
;
\
echo
"# Use the gamma launcher and JAVA_HOME to run the test"
;
\
echo
""
;
\
echo
"./
\$
${GAMMA_PROG}
$(TESTFLAGS)
Queens < /dev/null"
;
\
)
>
$@
$(QUIETLY)
chmod
+x
$@
...
...
src/os/bsd/vm/os_bsd.cpp
浏览文件 @
05014695
...
...
@@ -301,6 +301,12 @@ static char cpu_arch[] = "sparc";
#error Add appropriate cpu_arch setting
#endif
// Compiler variant
#ifdef COMPILER2
#define COMPILER_VARIANT "server"
#else
#define COMPILER_VARIANT "client"
#endif
#ifndef _ALLBSD_SOURCE
// pid_t gettid()
...
...
@@ -2507,7 +2513,7 @@ void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
static
char
saved_jvm_path
[
MAXPATHLEN
]
=
{
0
};
// Find the full path to the current module, libjvm
.so or libjvm_g.so
// Find the full path to the current module, libjvm
or libjvm_g
void
os
::
jvm_path
(
char
*
buf
,
jint
buflen
)
{
// Error checking.
if
(
buflen
<
MAXPATHLEN
)
{
...
...
@@ -2532,11 +2538,11 @@ void os::jvm_path(char *buf, jint buflen) {
if
(
Arguments
::
created_by_gamma_launcher
())
{
// Support for the gamma launcher. Typical value for buf is
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm
.so
". If "/jre/lib/" appears at
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm". If "/jre/lib/" appears at
// the right place in the string, then assume we are installed in a JDK and
// we're done. Otherwise, check for a JAVA_HOME environment variable and
fix
//
up the path so it looks like libjvm.so is installed there (append a
// fake suffix hotspot/libjvm.so).
// we're done. Otherwise, check for a JAVA_HOME environment variable and
//
construct a path to the JVM being overridden.
const
char
*
p
=
buf
+
strlen
(
buf
)
-
1
;
for
(
int
count
=
0
;
p
>
buf
&&
count
<
5
;
++
count
)
{
for
(
--
p
;
p
>
buf
&&
*
p
!=
'/'
;
--
p
)
...
...
@@ -2550,7 +2556,7 @@ void os::jvm_path(char *buf, jint buflen) {
char
*
jrelib_p
;
int
len
;
// Check the current module name "libjvm
.so" or "libjvm_g.so
".
// Check the current module name "libjvm
" or "libjvm_g
".
p
=
strrchr
(
buf
,
'/'
);
assert
(
strstr
(
p
,
"/libjvm"
)
==
p
,
"invalid library name"
);
p
=
strstr
(
p
,
"_g"
)
?
"_g"
:
""
;
...
...
@@ -2563,19 +2569,32 @@ void os::jvm_path(char *buf, jint buflen) {
// modules image doesn't have "jre" subdirectory
len
=
strlen
(
buf
);
jrelib_p
=
buf
+
len
;
snprintf
(
jrelib_p
,
buflen
-
len
,
"/jre/lib/%s"
,
cpu_arch
);
// Add the appropriate library subdir
snprintf
(
jrelib_p
,
buflen
-
len
,
"/jre/lib"
);
if
(
0
!=
access
(
buf
,
F_OK
))
{
snprintf
(
jrelib_p
,
buflen
-
len
,
"/lib"
);
}
// Add the appropriate client or server subdir
len
=
strlen
(
buf
);
jrelib_p
=
buf
+
len
;
snprintf
(
jrelib_p
,
buflen
-
len
,
"/%s"
,
COMPILER_VARIANT
);
if
(
0
!=
access
(
buf
,
F_OK
))
{
snprintf
(
jrelib_p
,
buflen
-
len
,
"
/lib/%s"
,
cpu_arch
);
snprintf
(
jrelib_p
,
buflen
-
len
,
"
"
);
}
// If the path exists within JAVA_HOME, add the JVM library name
// to complete the path to JVM being overridden. Otherwise fallback
// to the path to the current library.
if
(
0
==
access
(
buf
,
F_OK
))
{
// Use current module name "libjvm[_g]
.so
" instead of
// "libjvm"debug_only("_g")"
.so
" since for fastdebug version
// we should have "libjvm
.so
" but debug_only("_g") adds "_g"!
// Use current module name "libjvm[_g]" instead of
// "libjvm"debug_only("_g")"" since for fastdebug version
// we should have "libjvm" but debug_only("_g") adds "_g"!
len
=
strlen
(
buf
);
snprintf
(
buf
+
len
,
buflen
-
len
,
"/
hotspot/libjvm%s.so"
,
p
);
snprintf
(
buf
+
len
,
buflen
-
len
,
"/
libjvm%s%s"
,
p
,
JNI_LIB_SUFFIX
);
}
else
{
//
Go back to path of .so
//
Fall back to path of current library
rp
=
realpath
(
dli_fname
,
buf
);
if
(
rp
==
NULL
)
return
;
...
...
src/os/posix/launcher/java_md.c
浏览文件 @
05014695
...
...
@@ -701,6 +701,14 @@ GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative)
char
libjava
[
MAXPATHLEN
];
if
(
GetApplicationHome
(
path
,
pathsize
))
{
/* Is the JRE universal, i.e. no arch dir? */
sprintf
(
libjava
,
"%s/jre/lib/"
JAVA_DLL
,
path
);
if
(
access
(
libjava
,
F_OK
)
==
0
)
{
strcat
(
path
,
"/jre"
);
goto
found
;
}
/* Is JRE co-located with the application? */
sprintf
(
libjava
,
"%s/lib/%s/"
JAVA_DLL
,
path
,
arch
);
if
(
access
(
libjava
,
F_OK
)
==
0
)
{
...
...
@@ -734,7 +742,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
ifn
->
GetDefaultJavaVMInitArgs
=
JNI_GetDefaultJavaVMInitArgs
;
return
JNI_TRUE
;
#else
Dl_info
dlinfo
;
Dl_info
dlinfo
;
void
*
libjvm
;
if
(
_launcher_debug
)
{
...
...
src/share/vm/prims/jvmtiThreadState.cpp
浏览文件 @
05014695
...
...
@@ -319,6 +319,15 @@ void JvmtiThreadState::process_pending_step_for_popframe() {
// clearing the flag indicates we are done with the PopFrame() dance
clr_pending_step_for_popframe
();
// If exception was thrown in this frame, need to reset jvmti thread state.
// Single stepping may not get enabled correctly by the agent since
// exception state is passed in MethodExit event which may be sent at some
// time in the future. JDWP agent ignores MethodExit events if caused by
// an exception.
//
if
(
is_exception_detected
())
{
clear_exception_detected
();
}
// If step is pending for popframe then it may not be
// a repeat step. The new_bci and method_id is same as current_bci
// and current method_id after pop and step for recursive calls.
...
...
@@ -385,6 +394,15 @@ void JvmtiThreadState::process_pending_step_for_earlyret() {
// the ForceEarlyReturn() dance
clr_pending_step_for_earlyret
();
// If exception was thrown in this frame, need to reset jvmti thread state.
// Single stepping may not get enabled correctly by the agent since
// exception state is passed in MethodExit event which may be sent at some
// time in the future. JDWP agent ignores MethodExit events if caused by
// an exception.
//
if
(
is_exception_detected
())
{
clear_exception_detected
();
}
// If step is pending for earlyret then it may not be a repeat step.
// The new_bci and method_id is same as current_bci and current
// method_id after earlyret and step for recursive calls.
...
...
src/share/vm/prims/jvmtiThreadState.hpp
浏览文件 @
05014695
...
...
@@ -165,6 +165,10 @@ class JvmtiThreadState : public CHeapObj {
inline
bool
is_exception_caught
()
{
return
_exception_caught
;
}
inline
void
set_exception_detected
()
{
_exception_detected
=
true
;
_exception_caught
=
false
;
}
inline
void
clear_exception_detected
()
{
_exception_detected
=
false
;
assert
(
_exception_caught
==
false
,
"_exception_caught is out of phase"
);
}
inline
void
set_exception_caught
()
{
_exception_caught
=
true
;
_exception_detected
=
false
;
}
...
...
src/share/vm/services/gcNotifier.cpp
浏览文件 @
05014695
...
...
@@ -44,7 +44,8 @@ void GCNotifier::pushNotification(GCMemoryManager *mgr, const char *action, cons
// Make a copy of the last GC statistics
// GC may occur between now and the creation of the notification
int
num_pools
=
MemoryService
::
num_memory_pools
();
GCStatInfo
*
stat
=
new
GCStatInfo
(
num_pools
);
// stat is deallocated inside GCNotificationRequest
GCStatInfo
*
stat
=
new
(
ResourceObj
::
C_HEAP
)
GCStatInfo
(
num_pools
);
mgr
->
get_last_gc_stat
(
stat
);
GCNotificationRequest
*
request
=
new
GCNotificationRequest
(
os
::
javaTimeMillis
(),
mgr
,
action
,
cause
,
stat
);
addRequest
(
request
);
...
...
src/share/vm/services/management.cpp
浏览文件 @
05014695
...
...
@@ -2047,15 +2047,15 @@ JVM_ENTRY(void, jmm_GetLastGCStat(JNIEnv *env, jobject obj, jmmGCStat *gc_stat))
// Make a copy of the last GC statistics
// GC may occur while constructing the last GC information
int
num_pools
=
MemoryService
::
num_memory_pools
();
GCStatInfo
*
stat
=
new
GCStatInfo
(
num_pools
);
if
(
mgr
->
get_last_gc_stat
(
stat
)
==
0
)
{
GCStatInfo
stat
(
num_pools
);
if
(
mgr
->
get_last_gc_stat
(
&
stat
)
==
0
)
{
gc_stat
->
gc_index
=
0
;
return
;
}
gc_stat
->
gc_index
=
stat
->
gc_index
();
gc_stat
->
start_time
=
Management
::
ticks_to_ms
(
stat
->
start_time
());
gc_stat
->
end_time
=
Management
::
ticks_to_ms
(
stat
->
end_time
());
gc_stat
->
gc_index
=
stat
.
gc_index
();
gc_stat
->
start_time
=
Management
::
ticks_to_ms
(
stat
.
start_time
());
gc_stat
->
end_time
=
Management
::
ticks_to_ms
(
stat
.
end_time
());
// Current implementation does not have GC extension attributes
gc_stat
->
num_gc_ext_attributes
=
0
;
...
...
@@ -2073,17 +2073,17 @@ JVM_ENTRY(void, jmm_GetLastGCStat(JNIEnv *env, jobject obj, jmmGCStat *gc_stat))
objArrayHandle
usage_after_gc_ah
(
THREAD
,
au
);
for
(
int
i
=
0
;
i
<
num_pools
;
i
++
)
{
Handle
before_usage
=
MemoryService
::
create_MemoryUsage_obj
(
stat
->
before_gc_usage_for_pool
(
i
),
CHECK
);
Handle
before_usage
=
MemoryService
::
create_MemoryUsage_obj
(
stat
.
before_gc_usage_for_pool
(
i
),
CHECK
);
Handle
after_usage
;
MemoryUsage
u
=
stat
->
after_gc_usage_for_pool
(
i
);
MemoryUsage
u
=
stat
.
after_gc_usage_for_pool
(
i
);
if
(
u
.
max_size
()
==
0
&&
u
.
used
()
>
0
)
{
// If max size == 0, this pool is a survivor space.
// Set max size = -1 since the pools will be swapped after GC.
MemoryUsage
usage
(
u
.
init_size
(),
u
.
used
(),
u
.
committed
(),
(
size_t
)
-
1
);
after_usage
=
MemoryService
::
create_MemoryUsage_obj
(
usage
,
CHECK
);
}
else
{
after_usage
=
MemoryService
::
create_MemoryUsage_obj
(
stat
->
after_gc_usage_for_pool
(
i
),
CHECK
);
after_usage
=
MemoryService
::
create_MemoryUsage_obj
(
stat
.
after_gc_usage_for_pool
(
i
),
CHECK
);
}
usage_before_gc_ah
->
obj_at_put
(
i
,
before_usage
());
usage_after_gc_ah
->
obj_at_put
(
i
,
after_usage
());
...
...
src/share/vm/services/memoryManager.cpp
浏览文件 @
05014695
...
...
@@ -214,8 +214,8 @@ GCMemoryManager::~GCMemoryManager() {
void
GCMemoryManager
::
initialize_gc_stat_info
()
{
assert
(
MemoryService
::
num_memory_pools
()
>
0
,
"should have one or more memory pools"
);
_last_gc_stat
=
new
GCStatInfo
(
MemoryService
::
num_memory_pools
());
_current_gc_stat
=
new
GCStatInfo
(
MemoryService
::
num_memory_pools
());
_last_gc_stat
=
new
(
ResourceObj
::
C_HEAP
)
GCStatInfo
(
MemoryService
::
num_memory_pools
());
_current_gc_stat
=
new
(
ResourceObj
::
C_HEAP
)
GCStatInfo
(
MemoryService
::
num_memory_pools
());
// tracking concurrent collections we need two objects: one to update, and one to
// hold the publicly available "last (completed) gc" information.
}
...
...
src/share/vm/services/memoryManager.hpp
浏览文件 @
05014695
...
...
@@ -108,7 +108,7 @@ public:
const
char
*
name
()
{
return
"CodeCacheManager"
;
}
};
class
GCStatInfo
:
public
CHeap
Obj
{
class
GCStatInfo
:
public
Resource
Obj
{
private:
size_t
_index
;
jlong
_start_time
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录