Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
c667a7a4
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 搜索 >>
提交
c667a7a4
编写于
2月 21, 2014
作者:
S
stefank
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8035412: Cleanup ClassLoaderData::is_alive
Reviewed-by: coleenp, mgerdin
上级
23be3758
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
11 deletion
+20
-11
src/share/vm/classfile/classLoaderData.cpp
src/share/vm/classfile/classLoaderData.cpp
+14
-8
src/share/vm/classfile/classLoaderData.hpp
src/share/vm/classfile/classLoaderData.hpp
+6
-3
未找到文件。
src/share/vm/classfile/classLoaderData.cpp
浏览文件 @
c667a7a4
...
...
@@ -73,7 +73,11 @@ ClassLoaderData * ClassLoaderData::_the_null_class_loader_data = NULL;
ClassLoaderData
::
ClassLoaderData
(
Handle
h_class_loader
,
bool
is_anonymous
,
Dependencies
dependencies
)
:
_class_loader
(
h_class_loader
()),
_is_anonymous
(
is_anonymous
),
_keep_alive
(
is_anonymous
),
// initially
_is_anonymous
(
is_anonymous
),
// An anonymous class loader data doesn't have anything to keep
// it from being unloaded during parsing of the anonymous class.
// The null-class-loader should always be kept alive.
_keep_alive
(
is_anonymous
||
h_class_loader
.
is_null
()),
_metaspace
(
NULL
),
_unloading
(
false
),
_klasses
(
NULL
),
_claimed
(
0
),
_jmethod_ids
(
NULL
),
_handles
(
NULL
),
_deallocate_list
(
NULL
),
_next
(
NULL
),
_dependencies
(
dependencies
),
...
...
@@ -317,11 +321,15 @@ void ClassLoaderData::unload() {
}
}
oop
ClassLoaderData
::
keep_alive_object
()
const
{
assert
(
!
keep_alive
(),
"Don't use with CLDs that are artificially kept alive"
);
return
is_anonymous
()
?
_klasses
->
java_mirror
()
:
class_loader
();
}
bool
ClassLoaderData
::
is_alive
(
BoolObjectClosure
*
is_alive_closure
)
const
{
bool
alive
=
is_anonymous
()
?
is_alive_closure
->
do_object_b
(
_klasses
->
java_mirror
())
:
class_loader
()
==
NULL
||
is_alive_closure
->
do_object_b
(
class_loader
());
bool
alive
=
keep_alive
()
// null class loader and incomplete anonymous klasses.
||
is_alive_closure
->
do_object_b
(
keep_alive_object
());
assert
(
!
alive
||
claimed
(),
"must be claimed"
);
return
alive
;
}
...
...
@@ -601,8 +609,6 @@ void ClassLoaderDataGraph::keep_alive_oops_do(OopClosure* f, KlassClosure* klass
void
ClassLoaderDataGraph
::
always_strong_oops_do
(
OopClosure
*
f
,
KlassClosure
*
klass_closure
,
bool
must_claim
)
{
if
(
ClassUnloading
)
{
ClassLoaderData
::
the_null_class_loader_data
()
->
oops_do
(
f
,
klass_closure
,
must_claim
);
// keep any special CLDs alive.
ClassLoaderDataGraph
::
keep_alive_oops_do
(
f
,
klass_closure
,
must_claim
);
}
else
{
ClassLoaderDataGraph
::
oops_do
(
f
,
klass_closure
,
must_claim
);
...
...
@@ -689,7 +695,7 @@ bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) {
bool
has_redefined_a_class
=
JvmtiExport
::
has_redefined_a_class
();
MetadataOnStackMark
md_on_stack
;
while
(
data
!=
NULL
)
{
if
(
data
->
keep_alive
()
||
data
->
is_alive
(
is_alive_closure
))
{
if
(
data
->
is_alive
(
is_alive_closure
))
{
if
(
has_redefined_a_class
)
{
data
->
classes_do
(
InstanceKlass
::
purge_previous_versions
);
}
...
...
src/share/vm/classfile/classLoaderData.hpp
浏览文件 @
c667a7a4
...
...
@@ -149,7 +149,7 @@ class ClassLoaderData : public CHeapObj<mtClass> {
// classes in the class loader are allocated.
Mutex
*
_metaspace_lock
;
// Locks the metaspace for allocations and setup.
bool
_unloading
;
// true if this class loader goes away
bool
_keep_alive
;
// if this CLD
can be unloaded for anonymous loaders
bool
_keep_alive
;
// if this CLD
is kept alive without a keep_alive_object().
bool
_is_anonymous
;
// if this CLD is for an anonymous class
volatile
int
_claimed
;
// true if claimed, for example during GC traces.
// To avoid applying oop closure more than once.
...
...
@@ -240,13 +240,16 @@ class ClassLoaderData : public CHeapObj<mtClass> {
oop
class_loader
()
const
{
return
_class_loader
;
}
// The object the GC is using to keep this ClassLoaderData alive.
oop
keep_alive_object
()
const
;
// Returns true if this class loader data is for a loader going away.
bool
is_unloading
()
const
{
assert
(
!
(
is_the_null_class_loader_data
()
&&
_unloading
),
"The null class loader can never be unloaded"
);
return
_unloading
;
}
// Anonymous class loader data doesn't have anything to keep them from
//
being unloaded during parsing the anonymous class
.
//
Used to make sure that this CLD is not unloaded
.
void
set_keep_alive
(
bool
value
)
{
_keep_alive
=
value
;
}
unsigned
int
identity_hash
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录