Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
f8f9e561
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f8f9e561
编写于
5月 22, 2015
作者:
P
poonam
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
149203ed
fa33fb21
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
16 addition
and
9 deletion
+16
-9
src/share/vm/prims/jniCheck.cpp
src/share/vm/prims/jniCheck.cpp
+16
-9
未找到文件。
src/share/vm/prims/jniCheck.cpp
浏览文件 @
f8f9e561
...
...
@@ -185,6 +185,9 @@ static void NativeReportJNIWarning(JavaThread* thr, const char *msg) {
* throw an ArrayIndexOutOfBoundsException or ArrayStoreException.
*
* In all other cases, a non-error return value guarantees that no exceptions have been thrown.
*
* Programmers often defend against ArrayIndexOutOfBoundsException, so warning
* for these functions would be pedantic.
*/
static
inline
void
check_pending_exception
(
JavaThread
*
thr
)
{
...
...
@@ -201,6 +204,16 @@ check_pending_exception(JavaThread* thr) {
}
}
/**
* Add to the planned number of handles. I.e. plus current live & warning threshold
*/
static
inline
void
add_planned_handle_capacity
(
JNIHandleBlock
*
handles
,
size_t
capacity
)
{
handles
->
set_planned_capacity
(
capacity
+
handles
->
get_number_of_live_handles
()
+
CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD
);
}
static
inline
void
functionEnterCritical
(
JavaThread
*
thr
)
...
...
@@ -243,7 +256,7 @@ functionExit(JavaThread* thr)
thr
->
print_stack
();
)
// Complain just the once, reset to current + warn threshold
handles
->
set_planned_capacity
(
live_handles
+
CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD
);
add_planned_handle_capacity
(
handles
,
0
);
}
}
...
...
@@ -720,7 +733,7 @@ JNI_ENTRY_CHECKED(jint,
NativeReportJNIFatalError
(
thr
,
"negative capacity"
);
jint
result
=
UNCHECKED
()
->
PushLocalFrame
(
env
,
capacity
);
if
(
result
==
JNI_OK
)
{
thr
->
active_handles
()
->
set_planned_capacity
(
capacity
+
CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD
);
add_planned_handle_capacity
(
thr
->
active_handles
(),
capacity
);
}
functionExit
(
thr
);
return
result
;
...
...
@@ -824,7 +837,7 @@ JNI_ENTRY_CHECKED(jint,
}
jint
result
=
UNCHECKED
()
->
EnsureLocalCapacity
(
env
,
capacity
);
if
(
result
==
JNI_OK
)
{
thr
->
active_handles
()
->
set_planned_capacity
(
capacity
+
CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD
);
add_planned_handle_capacity
(
thr
->
active_handles
(),
capacity
);
}
functionExit
(
thr
);
return
result
;
...
...
@@ -1628,7 +1641,6 @@ JNI_ENTRY_CHECKED(jobject,
check_is_obj_array
(
thr
,
array
);
)
jobject
result
=
UNCHECKED
()
->
GetObjectArrayElement
(
env
,
array
,
index
);
thr
->
set_pending_jni_exception_check
(
"GetObjectArrayElement"
);
functionExit
(
thr
);
return
result
;
JNI_END
...
...
@@ -1643,7 +1655,6 @@ JNI_ENTRY_CHECKED(void,
check_is_obj_array
(
thr
,
array
);
)
UNCHECKED
()
->
SetObjectArrayElement
(
env
,
array
,
index
,
val
);
thr
->
set_pending_jni_exception_check
(
"SetObjectArrayElement"
);
functionExit
(
thr
);
JNI_END
...
...
@@ -1733,7 +1744,6 @@ JNI_ENTRY_CHECKED(void, \
check_primitive_array_type(thr, array, ElementTag); \
) \
UNCHECKED()->Get##Result##ArrayRegion(env,array,start,len,buf); \
thr->set_pending_jni_exception_check("Get"#Result"ArrayRegion"); \
functionExit(thr); \
JNI_END
...
...
@@ -1758,7 +1768,6 @@ JNI_ENTRY_CHECKED(void, \
check_primitive_array_type(thr, array, ElementTag); \
) \
UNCHECKED()->Set##Result##ArrayRegion(env,array,start,len,buf); \
thr->set_pending_jni_exception_check("Set"#Result"ArrayRegion"); \
functionExit(thr); \
JNI_END
...
...
@@ -1835,7 +1844,6 @@ JNI_ENTRY_CHECKED(void,
checkString
(
thr
,
str
);
)
UNCHECKED
()
->
GetStringRegion
(
env
,
str
,
start
,
len
,
buf
);
thr
->
set_pending_jni_exception_check
(
"GetStringRegion"
);
functionExit
(
thr
);
JNI_END
...
...
@@ -1850,7 +1858,6 @@ JNI_ENTRY_CHECKED(void,
checkString
(
thr
,
str
);
)
UNCHECKED
()
->
GetStringUTFRegion
(
env
,
str
,
start
,
len
,
buf
);
thr
->
set_pending_jni_exception_check
(
"GetStringUTFRegion"
);
functionExit
(
thr
);
JNI_END
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录