Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
b60b298c
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,体验更适合开发者的 AI 搜索 >>
提交
b60b298c
编写于
6月 21, 2010
作者:
N
never
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6656830: assert((*p)->is_oop(),"expected an oop while scanning weak refs")
Reviewed-by: dcubed, kvn, twisti
上级
2c3e720d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
12 deletion
+36
-12
src/share/vm/code/nmethod.cpp
src/share/vm/code/nmethod.cpp
+26
-4
src/share/vm/code/nmethod.hpp
src/share/vm/code/nmethod.hpp
+2
-0
src/share/vm/prims/jvmtiCodeBlobEvents.cpp
src/share/vm/prims/jvmtiCodeBlobEvents.cpp
+6
-8
src/share/vm/runtime/jniHandles.cpp
src/share/vm/runtime/jniHandles.cpp
+2
-0
未找到文件。
src/share/vm/code/nmethod.cpp
浏览文件 @
b60b298c
...
...
@@ -584,6 +584,7 @@ nmethod::nmethod(
_oops_do_mark_link
=
NULL
;
_method
=
method
;
_entry_bci
=
InvocationEntryBci
;
_jmethod_id
=
NULL
;
_osr_link
=
NULL
;
_scavenge_root_link
=
NULL
;
_scavenge_root_state
=
0
;
...
...
@@ -677,6 +678,7 @@ nmethod::nmethod(
_oops_do_mark_link
=
NULL
;
_method
=
method
;
_entry_bci
=
InvocationEntryBci
;
_jmethod_id
=
NULL
;
_osr_link
=
NULL
;
_scavenge_root_link
=
NULL
;
_scavenge_root_state
=
0
;
...
...
@@ -784,6 +786,7 @@ nmethod::nmethod(
NOT_PRODUCT
(
_has_debug_info
=
false
);
_oops_do_mark_link
=
NULL
;
_method
=
method
;
_jmethod_id
=
NULL
;
_compile_id
=
compile_id
;
_comp_level
=
comp_level
;
_entry_bci
=
entry_bci
;
...
...
@@ -1488,11 +1491,25 @@ void nmethod::post_compiled_method_load_event() {
moop
->
signature
()
->
utf8_length
(),
code_begin
(),
code_size
());
if
(
JvmtiExport
::
should_post_compiled_method_load
()
||
JvmtiExport
::
should_post_compiled_method_unload
())
{
get_and_cache_jmethod_id
();
}
if
(
JvmtiExport
::
should_post_compiled_method_load
())
{
JvmtiExport
::
post_compiled_method_load
(
this
);
}
}
jmethodID
nmethod
::
get_and_cache_jmethod_id
()
{
if
(
_jmethod_id
==
NULL
)
{
// Cache the jmethod_id since it can no longer be looked up once the
// method itself has been marked for unloading.
_jmethod_id
=
method
()
->
jmethod_id
();
}
return
_jmethod_id
;
}
void
nmethod
::
post_compiled_method_unload
()
{
if
(
unload_reported
())
{
// During unloading we transition to unloaded and then to zombie
...
...
@@ -1504,12 +1521,17 @@ void nmethod::post_compiled_method_unload() {
DTRACE_METHOD_UNLOAD_PROBE
(
method
());
// If a JVMTI agent has enabled the CompiledMethodUnload event then
// post the event. Sometime later this nmethod will be made a zombie by
// the sweeper but the methodOop will not be valid at that point.
if
(
JvmtiExport
::
should_post_compiled_method_unload
())
{
// post the event. Sometime later this nmethod will be made a zombie
// by the sweeper but the methodOop will not be valid at that point.
// If the _jmethod_id is null then no load event was ever requested
// so don't bother posting the unload. The main reason for this is
// that the jmethodID is a weak reference to the methodOop so if
// it's being unloaded there's no way to look it up since the weak
// ref will have been cleared.
if
(
_jmethod_id
!=
NULL
&&
JvmtiExport
::
should_post_compiled_method_unload
())
{
assert
(
!
unload_reported
(),
"already unloaded"
);
HandleMark
hm
;
JvmtiExport
::
post_compiled_method_unload
(
method
()
->
jmethod_id
()
,
code_begin
());
JvmtiExport
::
post_compiled_method_unload
(
_jmethod_id
,
code_begin
());
}
// The JVMTI CompiledMethodUnload event can be enabled or disabled at
...
...
src/share/vm/code/nmethod.hpp
浏览文件 @
b60b298c
...
...
@@ -135,6 +135,7 @@ class nmethod : public CodeBlob {
methodOop
_method
;
int
_entry_bci
;
// != InvocationEntryBci if this nmethod is an on-stack replacement method
jmethodID
_jmethod_id
;
// Cache of method()->jmethod_id()
// To support simple linked-list chaining of nmethods:
nmethod
*
_osr_link
;
// from instanceKlass::osr_nmethods_head
...
...
@@ -599,6 +600,7 @@ public:
// jvmti support:
void
post_compiled_method_load_event
();
jmethodID
get_and_cache_jmethod_id
();
// verify operations
void
verify
();
...
...
src/share/vm/prims/jvmtiCodeBlobEvents.cpp
浏览文件 @
b60b298c
...
...
@@ -217,21 +217,21 @@ jvmtiError JvmtiCodeBlobEvents::generate_dynamic_code_events(JvmtiEnv* env) {
class
nmethodDesc
:
public
CHeapObj
{
private:
methodHandle
_metho
d
;
jmethodID
_jmethod_i
d
;
address
_code_begin
;
address
_code_end
;
jvmtiAddrLocationMap
*
_map
;
jint
_map_length
;
public:
nmethodDesc
(
methodHandle
metho
d
,
address
code_begin
,
address
code_end
,
nmethodDesc
(
jmethodID
jmethod_i
d
,
address
code_begin
,
address
code_end
,
jvmtiAddrLocationMap
*
map
,
jint
map_length
)
{
_
method
=
metho
d
;
_
jmethod_id
=
jmethod_i
d
;
_code_begin
=
code_begin
;
_code_end
=
code_end
;
_map
=
map
;
_map_length
=
map_length
;
}
methodHandle
method
()
const
{
return
_metho
d
;
}
jmethodID
jmethod_id
()
const
{
return
_jmethod_i
d
;
}
address
code_begin
()
const
{
return
_code_begin
;
}
address
code_end
()
const
{
return
_code_end
;
}
jvmtiAddrLocationMap
*
map
()
const
{
return
_map
;
}
...
...
@@ -323,8 +323,7 @@ void nmethodCollector::do_nmethod(nmethod* nm) {
JvmtiCodeBlobEvents
::
build_jvmti_addr_location_map
(
nm
,
&
map
,
&
map_length
);
// record the nmethod details
methodHandle
mh
(
nm
->
method
());
nmethodDesc
*
snm
=
new
nmethodDesc
(
mh
,
nmethodDesc
*
snm
=
new
nmethodDesc
(
nm
->
get_and_cache_jmethod_id
(),
nm
->
code_begin
(),
nm
->
code_end
(),
map
,
...
...
@@ -367,8 +366,7 @@ jvmtiError JvmtiCodeBlobEvents::generate_compiled_method_load_events(JvmtiEnv* e
// iterate over the list and post an event for each nmethod
nmethodDesc
*
nm_desc
=
collector
.
first
();
while
(
nm_desc
!=
NULL
)
{
methodOop
method
=
nm_desc
->
method
()();
jmethodID
mid
=
method
->
jmethod_id
();
jmethodID
mid
=
nm_desc
->
jmethod_id
();
assert
(
mid
!=
NULL
,
"checking"
);
JvmtiExport
::
post_compiled_method_load
(
env
,
mid
,
(
jint
)(
nm_desc
->
code_end
()
-
nm_desc
->
code_begin
()),
...
...
src/share/vm/runtime/jniHandles.cpp
浏览文件 @
b60b298c
...
...
@@ -66,6 +66,7 @@ jobject JNIHandles::make_local(JNIEnv* env, oop obj) {
jobject
JNIHandles
::
make_global
(
Handle
obj
)
{
assert
(
!
Universe
::
heap
()
->
is_gc_active
(),
"can't extend the root set during GC"
);
jobject
res
=
NULL
;
if
(
!
obj
.
is_null
())
{
// ignore null handles
...
...
@@ -81,6 +82,7 @@ jobject JNIHandles::make_global(Handle obj) {
jobject
JNIHandles
::
make_weak_global
(
Handle
obj
)
{
assert
(
!
Universe
::
heap
()
->
is_gc_active
(),
"can't extend the root set during GC"
);
jobject
res
=
NULL
;
if
(
!
obj
.
is_null
())
{
// ignore null handles
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录