Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
cce252f0
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看板
提交
cce252f0
编写于
11月 09, 2012
作者:
C
cjplummer
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
336aaf16
1e84375c
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
67 addition
and
35 deletion
+67
-35
src/os/bsd/vm/os_bsd.cpp
src/os/bsd/vm/os_bsd.cpp
+8
-4
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+8
-4
src/os/solaris/vm/os_solaris.cpp
src/os/solaris/vm/os_solaris.cpp
+8
-4
src/os/windows/vm/os_windows.cpp
src/os/windows/vm/os_windows.cpp
+9
-4
src/share/vm/classfile/classLoader.cpp
src/share/vm/classfile/classLoader.cpp
+4
-2
src/share/vm/prims/jvmtiExport.cpp
src/share/vm/prims/jvmtiExport.cpp
+8
-5
src/share/vm/runtime/os.cpp
src/share/vm/runtime/os.cpp
+13
-7
src/share/vm/runtime/os.hpp
src/share/vm/runtime/os.hpp
+2
-1
src/share/vm/runtime/thread.cpp
src/share/vm/runtime/thread.cpp
+7
-4
未找到文件。
src/os/bsd/vm/os_bsd.cpp
浏览文件 @
cce252f0
...
...
@@ -1198,19 +1198,20 @@ static bool file_exists(const char* filename) {
return
os
::
stat
(
filename
,
&
statbuf
)
==
0
;
}
void
os
::
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
bool
os
::
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
const
char
*
pname
,
const
char
*
fname
)
{
bool
retval
=
false
;
// Copied from libhpi
const
size_t
pnamelen
=
pname
?
strlen
(
pname
)
:
0
;
//
Quietly truncate on buffer overflow. Should be an error
.
//
Return error on buffer overflow
.
if
(
pnamelen
+
strlen
(
fname
)
+
strlen
(
JNI_LIB_PREFIX
)
+
strlen
(
JNI_LIB_SUFFIX
)
+
2
>
buflen
)
{
*
buffer
=
'\0'
;
return
;
return
retval
;
}
if
(
pnamelen
==
0
)
{
snprintf
(
buffer
,
buflen
,
JNI_LIB_PREFIX
"%s"
JNI_LIB_SUFFIX
,
fname
);
retval
=
true
;
}
else
if
(
strchr
(
pname
,
*
os
::
path_separator
())
!=
NULL
)
{
int
n
;
char
**
pelements
=
split_path
(
pname
,
&
n
);
...
...
@@ -1222,6 +1223,7 @@ void os::dll_build_name(char* buffer, size_t buflen,
snprintf
(
buffer
,
buflen
,
"%s/"
JNI_LIB_PREFIX
"%s"
JNI_LIB_SUFFIX
,
pelements
[
i
],
fname
);
if
(
file_exists
(
buffer
))
{
retval
=
true
;
break
;
}
}
...
...
@@ -1236,7 +1238,9 @@ void os::dll_build_name(char* buffer, size_t buflen,
}
}
else
{
snprintf
(
buffer
,
buflen
,
"%s/"
JNI_LIB_PREFIX
"%s"
JNI_LIB_SUFFIX
,
pname
,
fname
);
retval
=
true
;
}
return
retval
;
}
const
char
*
os
::
get_current_directory
(
char
*
buf
,
int
buflen
)
{
...
...
src/os/linux/vm/os_linux.cpp
浏览文件 @
cce252f0
...
...
@@ -1650,19 +1650,20 @@ static bool file_exists(const char* filename) {
return
os
::
stat
(
filename
,
&
statbuf
)
==
0
;
}
void
os
::
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
bool
os
::
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
const
char
*
pname
,
const
char
*
fname
)
{
bool
retval
=
false
;
// Copied from libhpi
const
size_t
pnamelen
=
pname
?
strlen
(
pname
)
:
0
;
//
Quietly truncate on buffer overflow. Should be an error
.
//
Return error on buffer overflow
.
if
(
pnamelen
+
strlen
(
fname
)
+
10
>
(
size_t
)
buflen
)
{
*
buffer
=
'\0'
;
return
;
return
retval
;
}
if
(
pnamelen
==
0
)
{
snprintf
(
buffer
,
buflen
,
"lib%s.so"
,
fname
);
retval
=
true
;
}
else
if
(
strchr
(
pname
,
*
os
::
path_separator
())
!=
NULL
)
{
int
n
;
char
**
pelements
=
split_path
(
pname
,
&
n
);
...
...
@@ -1673,6 +1674,7 @@ void os::dll_build_name(char* buffer, size_t buflen,
}
snprintf
(
buffer
,
buflen
,
"%s/lib%s.so"
,
pelements
[
i
],
fname
);
if
(
file_exists
(
buffer
))
{
retval
=
true
;
break
;
}
}
...
...
@@ -1687,7 +1689,9 @@ void os::dll_build_name(char* buffer, size_t buflen,
}
}
else
{
snprintf
(
buffer
,
buflen
,
"%s/lib%s.so"
,
pname
,
fname
);
retval
=
true
;
}
return
retval
;
}
const
char
*
os
::
get_current_directory
(
char
*
buf
,
int
buflen
)
{
...
...
src/os/solaris/vm/os_solaris.cpp
浏览文件 @
cce252f0
...
...
@@ -1894,18 +1894,19 @@ static bool file_exists(const char* filename) {
return
os
::
stat
(
filename
,
&
statbuf
)
==
0
;
}
void
os
::
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
bool
os
::
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
const
char
*
pname
,
const
char
*
fname
)
{
bool
retval
=
false
;
const
size_t
pnamelen
=
pname
?
strlen
(
pname
)
:
0
;
//
Quietly truncate on buffer overflow. Should be an error
.
//
Return error on buffer overflow
.
if
(
pnamelen
+
strlen
(
fname
)
+
10
>
(
size_t
)
buflen
)
{
*
buffer
=
'\0'
;
return
;
return
retval
;
}
if
(
pnamelen
==
0
)
{
snprintf
(
buffer
,
buflen
,
"lib%s.so"
,
fname
);
retval
=
true
;
}
else
if
(
strchr
(
pname
,
*
os
::
path_separator
())
!=
NULL
)
{
int
n
;
char
**
pelements
=
split_path
(
pname
,
&
n
);
...
...
@@ -1916,6 +1917,7 @@ void os::dll_build_name(char* buffer, size_t buflen,
}
snprintf
(
buffer
,
buflen
,
"%s/lib%s.so"
,
pelements
[
i
],
fname
);
if
(
file_exists
(
buffer
))
{
retval
=
true
;
break
;
}
}
...
...
@@ -1930,7 +1932,9 @@ void os::dll_build_name(char* buffer, size_t buflen,
}
}
else
{
snprintf
(
buffer
,
buflen
,
"%s/lib%s.so"
,
pname
,
fname
);
retval
=
true
;
}
return
retval
;
}
const
char
*
os
::
get_current_directory
(
char
*
buf
,
int
buflen
)
{
...
...
src/os/windows/vm/os_windows.cpp
浏览文件 @
cce252f0
...
...
@@ -1132,21 +1132,23 @@ static bool file_exists(const char* filename) {
return
GetFileAttributes
(
filename
)
!=
INVALID_FILE_ATTRIBUTES
;
}
void
os
::
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
bool
os
::
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
const
char
*
pname
,
const
char
*
fname
)
{
bool
retval
=
false
;
const
size_t
pnamelen
=
pname
?
strlen
(
pname
)
:
0
;
const
char
c
=
(
pnamelen
>
0
)
?
pname
[
pnamelen
-
1
]
:
0
;
//
Quietly truncates on buffer overflow. Should be an error
.
//
Return error on buffer overflow
.
if
(
pnamelen
+
strlen
(
fname
)
+
10
>
buflen
)
{
*
buffer
=
'\0'
;
return
;
return
retval
;
}
if
(
pnamelen
==
0
)
{
jio_snprintf
(
buffer
,
buflen
,
"%s.dll"
,
fname
);
retval
=
true
;
}
else
if
(
c
==
':'
||
c
==
'\\'
)
{
jio_snprintf
(
buffer
,
buflen
,
"%s%s.dll"
,
pname
,
fname
);
retval
=
true
;
}
else
if
(
strchr
(
pname
,
*
os
::
path_separator
())
!=
NULL
)
{
int
n
;
char
**
pelements
=
split_path
(
pname
,
&
n
);
...
...
@@ -1164,6 +1166,7 @@ void os::dll_build_name(char *buffer, size_t buflen,
jio_snprintf
(
buffer
,
buflen
,
"%s
\\
%s.dll"
,
path
,
fname
);
}
if
(
file_exists
(
buffer
))
{
retval
=
true
;
break
;
}
}
...
...
@@ -1178,7 +1181,9 @@ void os::dll_build_name(char *buffer, size_t buflen,
}
}
else
{
jio_snprintf
(
buffer
,
buflen
,
"%s
\\
%s.dll"
,
pname
,
fname
);
retval
=
true
;
}
return
retval
;
}
// Needs to be in os specific directory because windows requires another
...
...
src/share/vm/classfile/classLoader.cpp
浏览文件 @
cce252f0
...
...
@@ -605,8 +605,10 @@ void ClassLoader::load_zip_library() {
// Load zip library
char
path
[
JVM_MAXPATHLEN
];
char
ebuf
[
1024
];
os
::
dll_build_name
(
path
,
sizeof
(
path
),
Arguments
::
get_dll_dir
(),
"zip"
);
void
*
handle
=
os
::
dll_load
(
path
,
ebuf
,
sizeof
ebuf
);
void
*
handle
=
NULL
;
if
(
os
::
dll_build_name
(
path
,
sizeof
(
path
),
Arguments
::
get_dll_dir
(),
"zip"
))
{
handle
=
os
::
dll_load
(
path
,
ebuf
,
sizeof
ebuf
);
}
if
(
handle
==
NULL
)
{
vm_exit_during_initialization
(
"Unable to load ZIP library"
,
path
);
}
...
...
src/share/vm/prims/jvmtiExport.cpp
浏览文件 @
cce252f0
...
...
@@ -2177,7 +2177,7 @@ extern "C" {
jint
JvmtiExport
::
load_agent_library
(
AttachOperation
*
op
,
outputStream
*
st
)
{
char
ebuf
[
1024
];
char
buffer
[
JVM_MAXPATHLEN
];
void
*
library
;
void
*
library
=
NULL
;
jint
result
=
JNI_ERR
;
// get agent name and options
...
...
@@ -2196,15 +2196,18 @@ jint JvmtiExport::load_agent_library(AttachOperation* op, outputStream* st) {
library
=
os
::
dll_load
(
agent
,
ebuf
,
sizeof
ebuf
);
}
else
{
// Try to load the agent from the standard dll directory
os
::
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
agent
);
if
(
os
::
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
agent
))
{
library
=
os
::
dll_load
(
buffer
,
ebuf
,
sizeof
ebuf
);
}
if
(
library
==
NULL
)
{
// not found - try local path
char
ns
[
1
]
=
{
0
};
os
::
dll_build_name
(
buffer
,
sizeof
(
buffer
),
ns
,
agent
);
if
(
os
::
dll_build_name
(
buffer
,
sizeof
(
buffer
),
ns
,
agent
))
{
library
=
os
::
dll_load
(
buffer
,
ebuf
,
sizeof
ebuf
);
}
}
}
// If the library was loaded then we attempt to invoke the Agent_OnAttach
// function
...
...
src/share/vm/runtime/os.cpp
浏览文件 @
cce252f0
...
...
@@ -397,12 +397,16 @@ void* os::native_java_library() {
// Try to load verify dll first. In 1.3 java dll depends on it and is not
// always able to find it when the loading executable is outside the JDK.
// In order to keep working with 1.2 we ignore any loading errors.
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
"verify"
);
if
(
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
"verify"
))
{
dll_load
(
buffer
,
ebuf
,
sizeof
(
ebuf
));
}
// Load java dll
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
"java"
);
if
(
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
"java"
))
{
_native_java_library
=
dll_load
(
buffer
,
ebuf
,
sizeof
(
ebuf
));
}
if
(
_native_java_library
==
NULL
)
{
vm_exit_during_initialization
(
"Unable to load native library"
,
ebuf
);
}
...
...
@@ -410,8 +414,10 @@ void* os::native_java_library() {
#if defined(__OpenBSD__)
// Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
// ignore errors
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
"net"
);
if
(
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
"net"
))
{
dll_load
(
buffer
,
ebuf
,
sizeof
(
ebuf
));
}
#endif
}
static
jboolean
onLoaded
=
JNI_FALSE
;
...
...
@@ -1156,7 +1162,7 @@ char** os::split_path(const char* path, int* n) {
if
(
inpath
==
NULL
)
{
return
NULL
;
}
str
ncpy
(
inpath
,
path
,
strlen
(
path
)
);
str
cpy
(
inpath
,
path
);
int
count
=
1
;
char
*
p
=
strchr
(
inpath
,
psepchar
);
// Get a count of elements to allocate memory
...
...
src/share/vm/runtime/os.hpp
浏览文件 @
cce252f0
...
...
@@ -479,7 +479,8 @@ class os: AllStatic {
static
const
char
*
get_current_directory
(
char
*
buf
,
int
buflen
);
// Builds a platform-specific full library path given a ld path and lib name
static
void
dll_build_name
(
char
*
buffer
,
size_t
size
,
// Returns true if buffer contains full path to existing file, false otherwise
static
bool
dll_build_name
(
char
*
buffer
,
size_t
size
,
const
char
*
pathname
,
const
char
*
fname
);
// Symbol lookup, find nearest function name; basically it implements
...
...
src/share/vm/runtime/thread.cpp
浏览文件 @
cce252f0
...
...
@@ -3753,8 +3753,10 @@ static OnLoadEntry_t lookup_on_load(AgentLibrary* agent, const char *on_load_sym
}
}
else
{
// Try to load the agent from the standard dll directory
os
::
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
name
);
if
(
os
::
dll_build_name
(
buffer
,
sizeof
(
buffer
),
Arguments
::
get_dll_dir
(),
name
))
{
library
=
os
::
dll_load
(
buffer
,
ebuf
,
sizeof
ebuf
);
}
#ifdef KERNEL
// Download instrument dll
if
(
library
==
NULL
&&
strcmp
(
name
,
"instrument"
)
==
0
)
{
...
...
@@ -3779,8 +3781,9 @@ static OnLoadEntry_t lookup_on_load(AgentLibrary* agent, const char *on_load_sym
#endif // KERNEL
if
(
library
==
NULL
)
{
// Try the local directory
char
ns
[
1
]
=
{
0
};
os
::
dll_build_name
(
buffer
,
sizeof
(
buffer
),
ns
,
name
);
if
(
os
::
dll_build_name
(
buffer
,
sizeof
(
buffer
),
ns
,
name
))
{
library
=
os
::
dll_load
(
buffer
,
ebuf
,
sizeof
ebuf
);
}
if
(
library
==
NULL
)
{
const
char
*
sub_msg
=
" on the library path, with error: "
;
size_t
len
=
strlen
(
msg
)
+
strlen
(
name
)
+
strlen
(
sub_msg
)
+
strlen
(
ebuf
)
+
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录