Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
ef837e4b
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ef837e4b
编写于
2月 05, 2019
作者:
E
eosterlund
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8216541: CompiledICHolders of VM locked unloaded nmethods are released too late
Reviewed-by: kvn, thartmann
上级
a0cc7be2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
51 deletion
+13
-51
src/hotspot/share/code/compiledIC.cpp
src/hotspot/share/code/compiledIC.cpp
+0
-11
src/hotspot/share/code/compiledIC.hpp
src/hotspot/share/code/compiledIC.hpp
+0
-4
src/hotspot/share/code/compiledMethod.cpp
src/hotspot/share/code/compiledMethod.cpp
+4
-3
src/hotspot/share/code/compiledMethod.hpp
src/hotspot/share/code/compiledMethod.hpp
+1
-1
src/hotspot/share/code/nmethod.cpp
src/hotspot/share/code/nmethod.cpp
+4
-0
src/hotspot/share/runtime/sweeper.cpp
src/hotspot/share/runtime/sweeper.cpp
+4
-31
src/hotspot/share/runtime/sweeper.hpp
src/hotspot/share/runtime/sweeper.hpp
+0
-1
未找到文件。
src/hotspot/share/code/compiledIC.cpp
浏览文件 @
ef837e4b
...
...
@@ -539,17 +539,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site, const
return
is_icholder_entry
(
dest
);
}
// Release the CompiledICHolder* associated with this call site is there is one.
void
CompiledIC
::
cleanup_call_site
(
virtual_call_Relocation
*
call_site
,
const
CompiledMethod
*
cm
)
{
assert
(
cm
->
is_nmethod
(),
"must be nmethod"
);
// This call site might have become stale so inspect it carefully.
NativeCall
*
call
=
nativeCall_at
(
call_site
->
addr
());
if
(
is_icholder_entry
(
call
->
destination
()))
{
NativeMovConstReg
*
value
=
nativeMovConstReg_at
(
call_site
->
cached_value
());
InlineCacheBuffer
::
queue_for_release
((
CompiledICHolder
*
)
value
->
data
());
}
}
// ----------------------------------------------------------------------------
void
CompiledStaticCall
::
set_to_clean
(
bool
in_use
)
{
...
...
src/hotspot/share/code/compiledIC.hpp
浏览文件 @
ef837e4b
...
...
@@ -210,10 +210,6 @@ class CompiledIC: public ResourceObj {
friend
CompiledIC
*
CompiledIC_at
(
Relocation
*
call_site
);
friend
CompiledIC
*
CompiledIC_at
(
RelocIterator
*
reloc_iter
);
// This is used to release CompiledICHolder*s from nmethods that
// are about to be freed. The callsite might contain other stale
// values of other kinds so it must be careful.
static
void
cleanup_call_site
(
virtual_call_Relocation
*
call_site
,
const
CompiledMethod
*
cm
);
static
bool
is_icholder_call_site
(
virtual_call_Relocation
*
call_site
,
const
CompiledMethod
*
cm
);
// Return the cached_metadata/destination associated with this inline cache. If the cache currently points
...
...
src/hotspot/share/code/compiledMethod.cpp
浏览文件 @
ef837e4b
...
...
@@ -322,15 +322,16 @@ void CompiledMethod::clear_inline_caches() {
}
}
// Clear ICStubs of all compiled ICs
void
CompiledMethod
::
clear_ic_stubs
()
{
// Clear IC callsites, releasing ICStubs of all compiled ICs
// as well as any associated CompiledICHolders.
void
CompiledMethod
::
clear_ic_callsites
()
{
assert_locked_or_safepoint
(
CompiledIC_lock
);
ResourceMark
rm
;
RelocIterator
iter
(
this
);
while
(
iter
.
next
())
{
if
(
iter
.
type
()
==
relocInfo
::
virtual_call_type
)
{
CompiledIC
*
ic
=
CompiledIC_at
(
&
iter
);
ic
->
clear_ic_stub
(
);
ic
->
set_to_clean
(
false
);
}
}
}
...
...
src/hotspot/share/code/compiledMethod.hpp
浏览文件 @
ef837e4b
...
...
@@ -347,7 +347,7 @@ public:
}
virtual
void
clear_inline_caches
();
void
clear_ic_
stub
s
();
void
clear_ic_
callsite
s
();
// Verify and count cached icholder relocations.
int
verify_icholder_relocations
();
...
...
src/hotspot/share/code/nmethod.cpp
浏览文件 @
ef837e4b
...
...
@@ -1076,6 +1076,9 @@ void nmethod::make_unloaded(oop cause) {
CodeCache
::
set_needs_cache_clean
(
true
);
}
// Clear ICStubs and release any CompiledICHolders.
clear_ic_callsites
();
// Unregister must be done before the state change
Universe
::
heap
()
->
unregister_nmethod
(
this
);
...
...
@@ -1286,6 +1289,7 @@ bool nmethod::make_not_entrant_or_zombie(int state) {
}
void
nmethod
::
flush
()
{
MutexLockerEx
mu
(
CodeCache_lock
,
Mutex
::
_no_safepoint_check_flag
);
// Note that there are no valid oops in the nmethod anymore.
assert
(
!
is_osr_method
()
||
is_unloaded
()
||
is_zombie
(),
"osr nmethod must be unloaded or zombie before flushing"
);
...
...
src/hotspot/share/runtime/sweeper.cpp
浏览文件 @
ef837e4b
...
...
@@ -591,27 +591,6 @@ class CompiledMethodMarker: public StackObj {
}
};
void
NMethodSweeper
::
release_compiled_method
(
CompiledMethod
*
nm
)
{
// Make sure the released nmethod is no longer referenced by the sweeper thread
CodeCacheSweeperThread
*
thread
=
(
CodeCacheSweeperThread
*
)
JavaThread
::
current
();
thread
->
set_scanned_compiled_method
(
NULL
);
// Clean up any CompiledICHolders
{
ResourceMark
rm
;
MutexLocker
ml_patch
(
CompiledIC_lock
);
RelocIterator
iter
(
nm
);
while
(
iter
.
next
())
{
if
(
iter
.
type
()
==
relocInfo
::
virtual_call_type
)
{
CompiledIC
::
cleanup_call_site
(
iter
.
virtual_call_reloc
(),
nm
);
}
}
}
MutexLockerEx
mu
(
CodeCache_lock
,
Mutex
::
_no_safepoint_check_flag
);
nm
->
flush
();
}
NMethodSweeper
::
MethodStateChange
NMethodSweeper
::
process_compiled_method
(
CompiledMethod
*
cm
)
{
assert
(
cm
!=
NULL
,
"sanity"
);
assert
(
!
CodeCache_lock
->
owned_by_self
(),
"just checking"
);
...
...
@@ -638,7 +617,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil
// All inline caches that referred to this nmethod were cleaned in the
// previous sweeper cycle. Now flush the nmethod from the code cache.
assert
(
!
cm
->
is_locked_by_vm
(),
"must not flush locked Compiled Methods"
);
release_compiled_method
(
cm
);
cm
->
flush
(
);
assert
(
result
==
None
,
"sanity"
);
result
=
Flushed
;
}
else
if
(
cm
->
is_not_entrant
())
{
...
...
@@ -650,7 +629,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil
// nmethods during the next safepoint (see ICStub::finalize).
{
MutexLocker
cl
(
CompiledIC_lock
);
cm
->
clear_ic_
stub
s
();
cm
->
clear_ic_
callsite
s
();
}
// Code cache state change is tracked in make_zombie()
cm
->
make_zombie
();
...
...
@@ -663,7 +642,7 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil
// Make sure that we unregistered the nmethod with the heap and flushed all
// dependencies before removing the nmethod (done in make_zombie()).
assert
(
cm
->
is_zombie
(),
"nmethod must be unregistered"
);
release_compiled_method
(
cm
);
cm
->
flush
(
);
assert
(
result
==
None
,
"sanity"
);
result
=
Flushed
;
}
else
{
...
...
@@ -680,16 +659,10 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil
}
else
if
(
cm
->
is_unloaded
())
{
// Code is unloaded, so there are no activations on the stack.
// Convert the nmethod to zombie or flush it directly in the OSR case.
{
// Clean ICs of unloaded nmethods as well because they may reference other
// unloaded nmethods that may be flushed earlier in the sweeper cycle.
MutexLocker
cl
(
CompiledIC_lock
);
cm
->
cleanup_inline_caches
();
}
if
(
cm
->
is_osr_method
())
{
SWEEP
(
cm
);
// No inline caches will ever point to osr methods, so we can just remove it
release_compiled_method
(
cm
);
cm
->
flush
(
);
assert
(
result
==
None
,
"sanity"
);
result
=
Flushed
;
}
else
{
...
...
src/hotspot/share/runtime/sweeper.hpp
浏览文件 @
ef837e4b
...
...
@@ -91,7 +91,6 @@ class NMethodSweeper : public AllStatic {
static
Monitor
*
_stat_lock
;
static
MethodStateChange
process_compiled_method
(
CompiledMethod
*
nm
);
static
void
release_compiled_method
(
CompiledMethod
*
nm
);
static
void
init_sweeper_log
()
NOT_DEBUG_RETURN
;
static
bool
wait_for_stack_scanning
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录