Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4ebeac0e
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看板
提交
4ebeac0e
编写于
3月 14, 2016
作者:
V
vlivanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8141420: Compiler runtime entries don't hold Klass* from being GCed
Reviewed-by: kvn, coleenp
上级
efb66a69
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
11 deletion
+15
-11
src/share/vm/c1/c1_Runtime1.cpp
src/share/vm/c1/c1_Runtime1.cpp
+3
-0
src/share/vm/opto/runtime.cpp
src/share/vm/opto/runtime.cpp
+12
-11
未找到文件。
src/share/vm/c1/c1_Runtime1.cpp
浏览文件 @
4ebeac0e
...
@@ -312,6 +312,7 @@ JRT_ENTRY(void, Runtime1::new_instance(JavaThread* thread, Klass* klass))
...
@@ -312,6 +312,7 @@ JRT_ENTRY(void, Runtime1::new_instance(JavaThread* thread, Klass* klass))
NOT_PRODUCT
(
_new_instance_slowcase_cnt
++
;)
NOT_PRODUCT
(
_new_instance_slowcase_cnt
++
;)
assert
(
klass
->
is_klass
(),
"not a class"
);
assert
(
klass
->
is_klass
(),
"not a class"
);
Handle
holder
(
THREAD
,
klass
->
klass_holder
());
// keep the klass alive
instanceKlassHandle
h
(
thread
,
klass
);
instanceKlassHandle
h
(
thread
,
klass
);
h
->
check_valid_for_instantiation
(
true
,
CHECK
);
h
->
check_valid_for_instantiation
(
true
,
CHECK
);
// make sure klass is initialized
// make sure klass is initialized
...
@@ -347,6 +348,7 @@ JRT_ENTRY(void, Runtime1::new_object_array(JavaThread* thread, Klass* array_klas
...
@@ -347,6 +348,7 @@ JRT_ENTRY(void, Runtime1::new_object_array(JavaThread* thread, Klass* array_klas
// anymore after new_objArray() and no GC can happen before.
// anymore after new_objArray() and no GC can happen before.
// (This may have to change if this code changes!)
// (This may have to change if this code changes!)
assert
(
array_klass
->
is_klass
(),
"not a class"
);
assert
(
array_klass
->
is_klass
(),
"not a class"
);
Handle
holder
(
THREAD
,
array_klass
->
klass_holder
());
// keep the klass alive
Klass
*
elem_klass
=
ObjArrayKlass
::
cast
(
array_klass
)
->
element_klass
();
Klass
*
elem_klass
=
ObjArrayKlass
::
cast
(
array_klass
)
->
element_klass
();
objArrayOop
obj
=
oopFactory
::
new_objArray
(
elem_klass
,
length
,
CHECK
);
objArrayOop
obj
=
oopFactory
::
new_objArray
(
elem_klass
,
length
,
CHECK
);
thread
->
set_vm_result
(
obj
);
thread
->
set_vm_result
(
obj
);
...
@@ -363,6 +365,7 @@ JRT_ENTRY(void, Runtime1::new_multi_array(JavaThread* thread, Klass* klass, int
...
@@ -363,6 +365,7 @@ JRT_ENTRY(void, Runtime1::new_multi_array(JavaThread* thread, Klass* klass, int
assert
(
klass
->
is_klass
(),
"not a class"
);
assert
(
klass
->
is_klass
(),
"not a class"
);
assert
(
rank
>=
1
,
"rank must be nonzero"
);
assert
(
rank
>=
1
,
"rank must be nonzero"
);
Handle
holder
(
THREAD
,
klass
->
klass_holder
());
// keep the klass alive
oop
obj
=
ArrayKlass
::
cast
(
klass
)
->
multi_allocate
(
rank
,
dims
,
CHECK
);
oop
obj
=
ArrayKlass
::
cast
(
klass
)
->
multi_allocate
(
rank
,
dims
,
CHECK
);
thread
->
set_vm_result
(
obj
);
thread
->
set_vm_result
(
obj
);
JRT_END
JRT_END
...
...
src/share/vm/opto/runtime.cpp
浏览文件 @
4ebeac0e
...
@@ -231,22 +231,17 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, JavaThread* thre
...
@@ -231,22 +231,17 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, JavaThread* thre
// These checks are cheap to make and support reflective allocation.
// These checks are cheap to make and support reflective allocation.
int
lh
=
klass
->
layout_helper
();
int
lh
=
klass
->
layout_helper
();
if
(
Klass
::
layout_helper_needs_slow_path
(
lh
)
if
(
Klass
::
layout_helper_needs_slow_path
(
lh
)
||
!
InstanceKlass
::
cast
(
klass
)
->
is_initialized
())
{
||
!
InstanceKlass
::
cast
(
klass
)
->
is_initialized
())
{
Handle
holder
(
THREAD
,
klass
->
klass_holder
());
// keep the klass alive
KlassHandle
kh
(
THREAD
,
klass
);
klass
->
check_valid_for_instantiation
(
false
,
THREAD
);
kh
->
check_valid_for_instantiation
(
false
,
THREAD
);
if
(
!
HAS_PENDING_EXCEPTION
)
{
if
(
!
HAS_PENDING_EXCEPTION
)
{
InstanceKlass
::
cast
(
kh
())
->
initialize
(
THREAD
);
InstanceKlass
::
cast
(
klass
)
->
initialize
(
THREAD
);
}
if
(
!
HAS_PENDING_EXCEPTION
)
{
klass
=
kh
();
}
else
{
klass
=
NULL
;
}
}
}
}
if
(
klass
!=
NULL
)
{
if
(
!
HAS_PENDING_EXCEPTION
)
{
// Scavenge and allocate an instance.
// Scavenge and allocate an instance.
Handle
holder
(
THREAD
,
klass
->
klass_holder
());
// keep the klass alive
oop
result
=
InstanceKlass
::
cast
(
klass
)
->
allocate_instance
(
THREAD
);
oop
result
=
InstanceKlass
::
cast
(
klass
)
->
allocate_instance
(
THREAD
);
thread
->
set_vm_result
(
result
);
thread
->
set_vm_result
(
result
);
...
@@ -286,6 +281,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, JavaT
...
@@ -286,6 +281,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, JavaT
// Although the oopFactory likes to work with the elem_type,
// Although the oopFactory likes to work with the elem_type,
// the compiler prefers the array_type, since it must already have
// the compiler prefers the array_type, since it must already have
// that latter value in hand for the fast path.
// that latter value in hand for the fast path.
Handle
holder
(
THREAD
,
array_type
->
klass_holder
());
// keep the array klass alive
Klass
*
elem_type
=
ObjArrayKlass
::
cast
(
array_type
)
->
element_klass
();
Klass
*
elem_type
=
ObjArrayKlass
::
cast
(
array_type
)
->
element_klass
();
result
=
oopFactory
::
new_objArray
(
elem_type
,
len
,
THREAD
);
result
=
oopFactory
::
new_objArray
(
elem_type
,
len
,
THREAD
);
}
}
...
@@ -364,6 +360,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray2_C(Klass* elem_type, int len1, int l
...
@@ -364,6 +360,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray2_C(Klass* elem_type, int len1, int l
jint
dims
[
2
];
jint
dims
[
2
];
dims
[
0
]
=
len1
;
dims
[
0
]
=
len1
;
dims
[
1
]
=
len2
;
dims
[
1
]
=
len2
;
Handle
holder
(
THREAD
,
elem_type
->
klass_holder
());
// keep the klass alive
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
2
,
dims
,
THREAD
);
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
2
,
dims
,
THREAD
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
thread
->
set_vm_result
(
obj
);
thread
->
set_vm_result
(
obj
);
...
@@ -380,6 +377,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray3_C(Klass* elem_type, int len1, int l
...
@@ -380,6 +377,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray3_C(Klass* elem_type, int len1, int l
dims
[
0
]
=
len1
;
dims
[
0
]
=
len1
;
dims
[
1
]
=
len2
;
dims
[
1
]
=
len2
;
dims
[
2
]
=
len3
;
dims
[
2
]
=
len3
;
Handle
holder
(
THREAD
,
elem_type
->
klass_holder
());
// keep the klass alive
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
3
,
dims
,
THREAD
);
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
3
,
dims
,
THREAD
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
thread
->
set_vm_result
(
obj
);
thread
->
set_vm_result
(
obj
);
...
@@ -397,6 +395,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray4_C(Klass* elem_type, int len1, int l
...
@@ -397,6 +395,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray4_C(Klass* elem_type, int len1, int l
dims
[
1
]
=
len2
;
dims
[
1
]
=
len2
;
dims
[
2
]
=
len3
;
dims
[
2
]
=
len3
;
dims
[
3
]
=
len4
;
dims
[
3
]
=
len4
;
Handle
holder
(
THREAD
,
elem_type
->
klass_holder
());
// keep the klass alive
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
4
,
dims
,
THREAD
);
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
4
,
dims
,
THREAD
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
thread
->
set_vm_result
(
obj
);
thread
->
set_vm_result
(
obj
);
...
@@ -415,6 +414,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray5_C(Klass* elem_type, int len1, int l
...
@@ -415,6 +414,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarray5_C(Klass* elem_type, int len1, int l
dims
[
2
]
=
len3
;
dims
[
2
]
=
len3
;
dims
[
3
]
=
len4
;
dims
[
3
]
=
len4
;
dims
[
4
]
=
len5
;
dims
[
4
]
=
len5
;
Handle
holder
(
THREAD
,
elem_type
->
klass_holder
());
// keep the klass alive
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
5
,
dims
,
THREAD
);
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
5
,
dims
,
THREAD
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
thread
->
set_vm_result
(
obj
);
thread
->
set_vm_result
(
obj
);
...
@@ -432,6 +432,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* d
...
@@ -432,6 +432,7 @@ JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* d
jint
*
c_dims
=
NEW_RESOURCE_ARRAY
(
jint
,
len
);
jint
*
c_dims
=
NEW_RESOURCE_ARRAY
(
jint
,
len
);
Copy
::
conjoint_jints_atomic
(
j_dims
,
c_dims
,
len
);
Copy
::
conjoint_jints_atomic
(
j_dims
,
c_dims
,
len
);
Handle
holder
(
THREAD
,
elem_type
->
klass_holder
());
// keep the klass alive
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
len
,
c_dims
,
THREAD
);
oop
obj
=
ArrayKlass
::
cast
(
elem_type
)
->
multi_allocate
(
len
,
c_dims
,
THREAD
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
deoptimize_caller_frame
(
thread
,
HAS_PENDING_EXCEPTION
);
thread
->
set_vm_result
(
obj
);
thread
->
set_vm_result
(
obj
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录