Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
aeb2371c
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看板
提交
aeb2371c
编写于
6月 02, 2010
作者:
N
never
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6956931: assert(SafepointSynchronize::is_at_safepoint()) failed: must be executed at a safepoint
Reviewed-by: kvn, dcubed
上级
759f87fb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
47 deletion
+58
-47
src/share/vm/code/nmethod.cpp
src/share/vm/code/nmethod.cpp
+8
-15
src/share/vm/prims/jvmtiExport.cpp
src/share/vm/prims/jvmtiExport.cpp
+45
-30
src/share/vm/prims/jvmtiExport.hpp
src/share/vm/prims/jvmtiExport.hpp
+5
-2
未找到文件。
src/share/vm/code/nmethod.cpp
浏览文件 @
aeb2371c
...
...
@@ -1342,19 +1342,7 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
// and it hasn't already been reported for this nmethod then report it now.
// (the event may have been reported earilier if the GC marked it for unloading).
if
(
state
==
zombie
)
{
DTRACE_METHOD_UNLOAD_PROBE
(
method
());
if
(
JvmtiExport
::
should_post_compiled_method_unload
()
&&
!
unload_reported
())
{
assert
(
method
()
!=
NULL
,
"checking"
);
{
HandleMark
hm
;
JvmtiExport
::
post_compiled_method_unload_at_safepoint
(
method
()
->
jmethod_id
(),
code_begin
());
}
set_unload_reported
();
}
post_compiled_method_unload
();
}
...
...
@@ -1506,6 +1494,12 @@ void nmethod::post_compiled_method_load_event() {
}
void
nmethod
::
post_compiled_method_unload
()
{
if
(
unload_reported
())
{
// During unloading we transition to unloaded and then to zombie
// and the unloading is reported during the first transition.
return
;
}
assert
(
_method
!=
NULL
&&
!
is_unloaded
(),
"just checking"
);
DTRACE_METHOD_UNLOAD_PROBE
(
method
());
...
...
@@ -1515,8 +1509,7 @@ void nmethod::post_compiled_method_unload() {
if
(
JvmtiExport
::
should_post_compiled_method_unload
())
{
assert
(
!
unload_reported
(),
"already unloaded"
);
HandleMark
hm
;
JvmtiExport
::
post_compiled_method_unload_at_safepoint
(
method
()
->
jmethod_id
(),
code_begin
());
JvmtiExport
::
post_compiled_method_unload
(
method
()
->
jmethod_id
(),
code_begin
());
}
// The JVMTI CompiledMethodUnload event can be enabled or disabled at
...
...
src/share/vm/prims/jvmtiExport.cpp
浏览文件 @
aeb2371c
...
...
@@ -726,6 +726,32 @@ GrowableArray<jmethodID>* JvmtiExport::_pending_compiled_method_unload_method_id
GrowableArray
<
const
void
*>*
JvmtiExport
::
_pending_compiled_method_unload_code_begins
;
JavaThread
*
JvmtiExport
::
_current_poster
;
void
JvmtiExport
::
post_compiled_method_unload_internal
(
JavaThread
*
self
,
jmethodID
method
,
const
void
*
code_begin
)
{
EVT_TRIG_TRACE
(
JVMTI_EVENT_COMPILED_METHOD_UNLOAD
,
(
"JVMTI [%s] method compile unload event triggered"
,
JvmtiTrace
::
safe_get_thread_name
(
self
)));
// post the event for each environment that has this event enabled.
JvmtiEnvIterator
it
;
for
(
JvmtiEnv
*
env
=
it
.
first
();
env
!=
NULL
;
env
=
it
.
next
(
env
))
{
if
(
env
->
is_enabled
(
JVMTI_EVENT_COMPILED_METHOD_UNLOAD
))
{
EVT_TRACE
(
JVMTI_EVENT_COMPILED_METHOD_UNLOAD
,
(
"JVMTI [%s] class compile method unload event sent jmethodID "
PTR_FORMAT
,
JvmtiTrace
::
safe_get_thread_name
(
self
),
method
));
ResourceMark
rm
(
self
);
JvmtiEventMark
jem
(
self
);
JvmtiJavaThreadEventTransition
jet
(
self
);
jvmtiEventCompiledMethodUnload
callback
=
env
->
callbacks
()
->
CompiledMethodUnload
;
if
(
callback
!=
NULL
)
{
(
*
callback
)(
env
->
jvmti_external
(),
method
,
code_begin
);
}
}
}
}
// post any pending CompiledMethodUnload events
void
JvmtiExport
::
post_pending_compiled_method_unload_events
()
{
...
...
@@ -788,26 +814,7 @@ void JvmtiExport::post_pending_compiled_method_unload_events() {
// flag, cleanup _current_poster to indicate that no thread is now servicing the
// pending events list, and finally notify any thread that might be waiting.
for
(;;)
{
EVT_TRIG_TRACE
(
JVMTI_EVENT_COMPILED_METHOD_UNLOAD
,
(
"JVMTI [%s] method compile unload event triggered"
,
JvmtiTrace
::
safe_get_thread_name
(
self
)));
// post the event for each environment that has this event enabled.
JvmtiEnvIterator
it
;
for
(
JvmtiEnv
*
env
=
it
.
first
();
env
!=
NULL
;
env
=
it
.
next
(
env
))
{
if
(
env
->
is_enabled
(
JVMTI_EVENT_COMPILED_METHOD_UNLOAD
))
{
EVT_TRACE
(
JVMTI_EVENT_COMPILED_METHOD_UNLOAD
,
(
"JVMTI [%s] class compile method unload event sent jmethodID "
PTR_FORMAT
,
JvmtiTrace
::
safe_get_thread_name
(
self
),
method
));
JvmtiEventMark
jem
(
self
);
JvmtiJavaThreadEventTransition
jet
(
self
);
jvmtiEventCompiledMethodUnload
callback
=
env
->
callbacks
()
->
CompiledMethodUnload
;
if
(
callback
!=
NULL
)
{
(
*
callback
)(
env
->
jvmti_external
(),
method
,
code_begin
);
}
}
}
post_compiled_method_unload_internal
(
self
,
method
,
code_begin
);
// event posted, now re-grab monitor and get the next event
// If there's no next event then we are done. If this is the first
...
...
@@ -1864,17 +1871,25 @@ void JvmtiExport::post_compiled_method_load(JvmtiEnv* env, const jmethodID metho
}
// used at a safepoint to post a CompiledMethodUnload event
void
JvmtiExport
::
post_compiled_method_unload_at_safepoint
(
jmethodID
mid
,
const
void
*
code_begin
)
{
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"must be executed at a safepoint"
);
// create list lazily
if
(
_pending_compiled_method_unload_method_ids
==
NULL
)
{
_pending_compiled_method_unload_method_ids
=
new
(
ResourceObj
::
C_HEAP
)
GrowableArray
<
jmethodID
>
(
10
,
true
);
_pending_compiled_method_unload_code_begins
=
new
(
ResourceObj
::
C_HEAP
)
GrowableArray
<
const
void
*>
(
10
,
true
);
void
JvmtiExport
::
post_compiled_method_unload
(
jmethodID
mid
,
const
void
*
code_begin
)
{
if
(
SafepointSynchronize
::
is_at_safepoint
())
{
// Class unloading can cause nmethod unloading which is reported
// by the VMThread. These must be batched to be processed later.
if
(
_pending_compiled_method_unload_method_ids
==
NULL
)
{
// create list lazily
_pending_compiled_method_unload_method_ids
=
new
(
ResourceObj
::
C_HEAP
)
GrowableArray
<
jmethodID
>
(
10
,
true
);
_pending_compiled_method_unload_code_begins
=
new
(
ResourceObj
::
C_HEAP
)
GrowableArray
<
const
void
*>
(
10
,
true
);
}
_pending_compiled_method_unload_method_ids
->
append
(
mid
);
_pending_compiled_method_unload_code_begins
->
append
(
code_begin
);
_have_pending_compiled_method_unload_events
=
true
;
}
else
{
// Unloading caused by the sweeper can be reported synchronously.
if
(
have_pending_compiled_method_unload_events
())
{
post_pending_compiled_method_unload_events
();
}
post_compiled_method_unload_internal
(
JavaThread
::
current
(),
mid
,
code_begin
);
}
_pending_compiled_method_unload_method_ids
->
append
(
mid
);
_pending_compiled_method_unload_code_begins
->
append
(
code_begin
);
_have_pending_compiled_method_unload_events
=
true
;
}
void
JvmtiExport
::
post_dynamic_code_generated_internal
(
const
char
*
name
,
const
void
*
code_begin
,
const
void
*
code_end
)
{
...
...
src/share/vm/prims/jvmtiExport.hpp
浏览文件 @
aeb2371c
...
...
@@ -144,6 +144,9 @@ class JvmtiExport : public AllStatic {
// posts any pending CompiledMethodUnload events.
static
void
post_pending_compiled_method_unload_events
();
// Perform the actual notification to interested JvmtiEnvs.
static
void
post_compiled_method_unload_internal
(
JavaThread
*
self
,
jmethodID
mid
,
const
void
*
code_begin
);
// posts a DynamicCodeGenerated event (internal/private implementation).
// The public post_dynamic_code_generated* functions make use of the
// internal implementation.
...
...
@@ -299,8 +302,8 @@ class JvmtiExport : public AllStatic {
static
void
post_compiled_method_load
(
nmethod
*
nm
)
KERNEL_RETURN
;
static
void
post_dynamic_code_generated
(
const
char
*
name
,
const
void
*
code_begin
,
const
void
*
code_end
)
KERNEL_RETURN
;
// used
at a safepoint
to post a CompiledMethodUnload event
static
void
post_compiled_method_unload
_at_safepoint
(
jmethodID
mid
,
const
void
*
code_begin
)
KERNEL_RETURN
;
// used to post a CompiledMethodUnload event
static
void
post_compiled_method_unload
(
jmethodID
mid
,
const
void
*
code_begin
)
KERNEL_RETURN
;
// similiar to post_dynamic_code_generated except that it can be used to
// post a DynamicCodeGenerated event while holding locks in the VM. Any event
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录