Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
d8b131b4
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,发现更多精彩内容 >>
提交
d8b131b4
编写于
8月 08, 2013
作者:
R
rbackman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8022675: Redundant class init check
Reviewed-by: kvn, twisti
上级
2b9c5258
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
28 addition
and
11 deletion
+28
-11
src/share/vm/opto/library_call.cpp
src/share/vm/opto/library_call.cpp
+28
-11
未找到文件。
src/share/vm/opto/library_call.cpp
浏览文件 @
d8b131b4
...
@@ -213,6 +213,7 @@ class LibraryCallKit : public GraphKit {
...
@@ -213,6 +213,7 @@ class LibraryCallKit : public GraphKit {
void
insert_pre_barrier
(
Node
*
base_oop
,
Node
*
offset
,
Node
*
pre_val
,
bool
need_mem_bar
);
void
insert_pre_barrier
(
Node
*
base_oop
,
Node
*
offset
,
Node
*
pre_val
,
bool
need_mem_bar
);
bool
inline_unsafe_access
(
bool
is_native_ptr
,
bool
is_store
,
BasicType
type
,
bool
is_volatile
);
bool
inline_unsafe_access
(
bool
is_native_ptr
,
bool
is_store
,
BasicType
type
,
bool
is_volatile
);
bool
inline_unsafe_prefetch
(
bool
is_native_ptr
,
bool
is_store
,
bool
is_static
);
bool
inline_unsafe_prefetch
(
bool
is_native_ptr
,
bool
is_store
,
bool
is_static
);
static
bool
klass_needs_init_guard
(
Node
*
kls
);
bool
inline_unsafe_allocate
();
bool
inline_unsafe_allocate
();
bool
inline_unsafe_copyMemory
();
bool
inline_unsafe_copyMemory
();
bool
inline_native_currentThread
();
bool
inline_native_currentThread
();
...
@@ -2892,8 +2893,21 @@ bool LibraryCallKit::inline_unsafe_fence(vmIntrinsics::ID id) {
...
@@ -2892,8 +2893,21 @@ bool LibraryCallKit::inline_unsafe_fence(vmIntrinsics::ID id) {
}
}
}
}
bool
LibraryCallKit
::
klass_needs_init_guard
(
Node
*
kls
)
{
if
(
!
kls
->
is_Con
())
{
return
true
;
}
const
TypeKlassPtr
*
klsptr
=
kls
->
bottom_type
()
->
isa_klassptr
();
if
(
klsptr
==
NULL
)
{
return
true
;
}
ciInstanceKlass
*
ik
=
klsptr
->
klass
()
->
as_instance_klass
();
// don't need a guard for a klass that is already initialized
return
!
ik
->
is_initialized
();
}
//----------------------------inline_unsafe_allocate---------------------------
//----------------------------inline_unsafe_allocate---------------------------
// public native Object sun.mi
cs
.Unsafe.allocateInstance(Class<?> cls);
// public native Object sun.mi
sc
.Unsafe.allocateInstance(Class<?> cls);
bool
LibraryCallKit
::
inline_unsafe_allocate
()
{
bool
LibraryCallKit
::
inline_unsafe_allocate
()
{
if
(
callee
()
->
is_static
())
return
false
;
// caller must have the capability!
if
(
callee
()
->
is_static
())
return
false
;
// caller must have the capability!
...
@@ -2905,6 +2919,8 @@ bool LibraryCallKit::inline_unsafe_allocate() {
...
@@ -2905,6 +2919,8 @@ bool LibraryCallKit::inline_unsafe_allocate() {
kls
=
null_check
(
kls
);
kls
=
null_check
(
kls
);
if
(
stopped
())
return
true
;
// argument was like int.class
if
(
stopped
())
return
true
;
// argument was like int.class
Node
*
test
=
NULL
;
if
(
LibraryCallKit
::
klass_needs_init_guard
(
kls
))
{
// Note: The argument might still be an illegal value like
// Note: The argument might still be an illegal value like
// Serializable.class or Object[].class. The runtime will handle it.
// Serializable.class or Object[].class. The runtime will handle it.
// But we must make an explicit check for initialization.
// But we must make an explicit check for initialization.
...
@@ -2913,8 +2929,9 @@ bool LibraryCallKit::inline_unsafe_allocate() {
...
@@ -2913,8 +2929,9 @@ bool LibraryCallKit::inline_unsafe_allocate() {
// can generate code to load it as unsigned byte.
// can generate code to load it as unsigned byte.
Node
*
inst
=
make_load
(
NULL
,
insp
,
TypeInt
::
UBYTE
,
T_BOOLEAN
);
Node
*
inst
=
make_load
(
NULL
,
insp
,
TypeInt
::
UBYTE
,
T_BOOLEAN
);
Node
*
bits
=
intcon
(
InstanceKlass
::
fully_initialized
);
Node
*
bits
=
intcon
(
InstanceKlass
::
fully_initialized
);
Node
*
test
=
_gvn
.
transform
(
new
(
C
)
SubINode
(
inst
,
bits
));
test
=
_gvn
.
transform
(
new
(
C
)
SubINode
(
inst
,
bits
));
// The 'test' is non-zero if we need to take a slow path.
// The 'test' is non-zero if we need to take a slow path.
}
Node
*
obj
=
new_instance
(
kls
,
test
);
Node
*
obj
=
new_instance
(
kls
,
test
);
set_result
(
obj
);
set_result
(
obj
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录