Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
8668cf5f
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看板
提交
8668cf5f
编写于
1月 13, 2012
作者:
K
kvn
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
90a7dcec
ac0ef1e7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
42 addition
and
50 deletion
+42
-50
src/share/vm/opto/callnode.cpp
src/share/vm/opto/callnode.cpp
+5
-6
src/share/vm/opto/locknode.cpp
src/share/vm/opto/locknode.cpp
+8
-24
src/share/vm/opto/locknode.hpp
src/share/vm/opto/locknode.hpp
+6
-4
src/share/vm/opto/macro.cpp
src/share/vm/opto/macro.cpp
+11
-9
src/share/vm/opto/parse1.cpp
src/share/vm/opto/parse1.cpp
+12
-7
未找到文件。
src/share/vm/opto/callnode.cpp
浏览文件 @
8668cf5f
...
...
@@ -1625,21 +1625,20 @@ Node *LockNode::Ideal(PhaseGVN *phase, bool can_reshape) {
//=============================================================================
bool
LockNode
::
is_nested_lock_region
()
{
Node
*
box
=
box_node
();
if
(
!
box
->
is_BoxLock
()
||
box
->
as_BoxLock
()
->
stack_slot
()
<=
0
)
BoxLockNode
*
box
=
box_node
()
->
as_BoxLock
();
int
stk_slot
=
box
->
stack_slot
();
if
(
stk_slot
<=
0
)
return
false
;
// External lock or it is not Box (Phi node).
// Ignore complex cases: merged locks or multiple locks.
BoxLockNode
*
box_lock
=
box
->
as_BoxLock
();
Node
*
obj
=
obj_node
();
LockNode
*
unique_lock
=
NULL
;
if
(
!
box
_lock
->
is_simple_lock_region
(
&
unique_lock
,
obj
)
||
if
(
!
box
->
is_simple_lock_region
(
&
unique_lock
,
obj
)
||
(
unique_lock
!=
this
))
{
return
false
;
}
// Look for external lock for the same object.
int
stk_slot
=
box_lock
->
stack_slot
();
SafePointNode
*
sfn
=
this
->
as_SafePoint
();
JVMState
*
youngest_jvms
=
sfn
->
jvms
();
int
max_depth
=
youngest_jvms
->
depth
();
...
...
@@ -1649,7 +1648,7 @@ bool LockNode::is_nested_lock_region() {
// Loop over monitors
for
(
int
idx
=
0
;
idx
<
num_mon
;
idx
++
)
{
Node
*
obj_node
=
sfn
->
monitor_obj
(
jvms
,
idx
);
BoxLockNode
*
box_node
=
BoxLockNode
::
box_node
(
sfn
->
monitor_box
(
jvms
,
idx
)
);
BoxLockNode
*
box_node
=
sfn
->
monitor_box
(
jvms
,
idx
)
->
as_BoxLock
(
);
if
((
box_node
->
stack_slot
()
<
stk_slot
)
&&
obj_node
->
eqv_uncast
(
obj
))
{
return
true
;
}
...
...
src/share/vm/opto/locknode.cpp
浏览文件 @
8668cf5f
...
...
@@ -63,7 +63,7 @@ uint BoxLockNode::cmp( const Node &n ) const {
}
BoxLockNode
*
BoxLockNode
::
box_node
(
Node
*
box
)
{
// Chase down the BoxNode
// Chase down the BoxNode
after RA which may spill box nodes.
while
(
!
box
->
is_BoxLock
())
{
// if (box_node->is_SpillCopy()) {
// Node *m = box_node->in(1);
...
...
@@ -84,18 +84,13 @@ OptoReg::Name BoxLockNode::reg(Node* box) {
return
box_node
(
box
)
->
in_RegMask
(
0
).
find_first_elem
();
}
bool
BoxLockNode
::
same_slot
(
Node
*
box1
,
Node
*
box2
)
{
return
box_node
(
box1
)
->
_slot
==
box_node
(
box2
)
->
_slot
;
}
// Is BoxLock node used for one simple lock region (same box and obj)?
bool
BoxLockNode
::
is_simple_lock_region
(
LockNode
**
unique_lock
,
Node
*
obj
)
{
LockNode
*
lock
=
NULL
;
bool
has_one_lock
=
false
;
for
(
uint
i
=
0
;
i
<
this
->
outcnt
();
i
++
)
{
Node
*
n
=
this
->
raw_out
(
i
);
if
(
n
->
is_Phi
())
return
false
;
// Merged regions
assert
(
!
n
->
is_Phi
(),
"should not merge BoxLock nodes"
);
if
(
n
->
is_AbstractLock
())
{
AbstractLockNode
*
alock
=
n
->
as_AbstractLock
();
// Check lock's box since box could be referenced by Lock's debug info.
...
...
@@ -123,23 +118,12 @@ bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) {
FastLockNode
*
flock
=
n
->
as_FastLock
();
assert
((
flock
->
box_node
()
==
this
)
&&
flock
->
obj_node
()
->
eqv_uncast
(
obj
),
""
);
}
if
(
n
->
is_SafePoint
()
&&
n
->
as_SafePoint
()
->
jvms
())
{
SafePointNode
*
sfn
=
n
->
as_SafePoint
();
JVMState
*
youngest_jvms
=
sfn
->
jvms
();
int
max_depth
=
youngest_jvms
->
depth
();
for
(
int
depth
=
1
;
depth
<=
max_depth
;
depth
++
)
{
JVMState
*
jvms
=
youngest_jvms
->
of_depth
(
depth
);
int
num_mon
=
jvms
->
nof_monitors
();
// Loop over monitors
for
(
int
idx
=
0
;
idx
<
num_mon
;
idx
++
)
{
Node
*
obj_node
=
sfn
->
monitor_obj
(
jvms
,
idx
);
Node
*
box_node
=
sfn
->
monitor_box
(
jvms
,
idx
);
if
(
box_node
==
this
)
{
assert
(
obj_node
->
eqv_uncast
(
obj
),
""
);
}
}
}
}
// Don't check monitor info in safepoints since the referenced object could
// be different from the locked object. It could be Phi node of different
// cast nodes which point to this locked object.
// We assume that no other objects could be referenced in monitor info
// associated with this BoxLock node because all associated locks and
// unlocks are reference only this one object.
}
#endif
if
(
unique_lock
!=
NULL
&&
has_one_lock
)
{
...
...
src/share/vm/opto/locknode.hpp
浏览文件 @
8668cf5f
...
...
@@ -49,9 +49,9 @@
//------------------------------BoxLockNode------------------------------------
class
BoxLockNode
:
public
Node
{
const
int
_slot
;
RegMask
_inmask
;
bool
_is_eliminated
;
// indicates this lock was
safely eliminated
const
int
_slot
;
// stack slot
RegMask
_inmask
;
// OptoReg corresponding to stack slot
bool
_is_eliminated
;
// Associated locks were
safely eliminated
public:
BoxLockNode
(
int
lock
);
...
...
@@ -68,7 +68,9 @@ public:
static
OptoReg
::
Name
reg
(
Node
*
box_node
);
static
BoxLockNode
*
box_node
(
Node
*
box_node
);
static
bool
same_slot
(
Node
*
box1
,
Node
*
box2
);
static
bool
same_slot
(
Node
*
box1
,
Node
*
box2
)
{
return
box1
->
as_BoxLock
()
->
_slot
==
box2
->
as_BoxLock
()
->
_slot
;
}
int
stack_slot
()
const
{
return
_slot
;
}
bool
is_eliminated
()
const
{
return
_is_eliminated
;
}
...
...
src/share/vm/opto/macro.cpp
浏览文件 @
8668cf5f
...
...
@@ -1802,10 +1802,14 @@ void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
// Mark all associated (same box and obj) lock and unlock nodes for
// elimination if some of them marked already.
void
PhaseMacroExpand
::
mark_eliminated_box
(
Node
*
oldbox
,
Node
*
obj
)
{
if
(
oldbox
->
is_BoxLock
()
&&
oldbox
->
as_BoxLock
()
->
is_eliminated
())
return
;
if
(
oldbox
->
is_BoxLock
()
&&
if
(
oldbox
->
as_BoxLock
()
->
is_eliminated
())
return
;
// This BoxLock node was processed already.
// New implementation (EliminateNestedLocks) has separate BoxLock
// node for each locked region so mark all associated locks/unlocks as
// eliminated even if different objects are referenced in one locked region
// (for example, OSR compilation of nested loop inside locked scope).
if
(
EliminateNestedLocks
||
oldbox
->
as_BoxLock
()
->
is_simple_lock_region
(
NULL
,
obj
))
{
// Box is used only in one lock region. Mark this box as eliminated.
_igvn
.
hash_delete
(
oldbox
);
...
...
@@ -1818,7 +1822,6 @@ void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
AbstractLockNode
*
alock
=
u
->
as_AbstractLock
();
// Check lock's box since box could be referenced by Lock's debug info.
if
(
alock
->
box_node
()
==
oldbox
)
{
assert
(
alock
->
obj_node
()
->
eqv_uncast
(
obj
),
""
);
// Mark eliminated all related locks and unlocks.
alock
->
set_non_esc_obj
();
}
...
...
@@ -1829,8 +1832,7 @@ void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
// Create new "eliminated" BoxLock node and use it in monitor debug info
// instead of oldbox for the same object.
BoxLockNode
*
box
=
BoxLockNode
::
box_node
(
oldbox
);
BoxLockNode
*
newbox
=
box
->
clone
()
->
as_BoxLock
();
BoxLockNode
*
newbox
=
oldbox
->
clone
()
->
as_BoxLock
();
// Note: BoxLock node is marked eliminated only here and it is used
// to indicate that all associated lock and unlock nodes are marked
...
...
@@ -2047,7 +2049,7 @@ void PhaseMacroExpand::expand_lock_node(LockNode *lock) {
Node
*
box
=
lock
->
box_node
();
Node
*
flock
=
lock
->
fastlock_node
();
assert
(
!
BoxLockNode
::
box_node
(
box
)
->
is_eliminated
(),
"sanity"
);
assert
(
!
box
->
as_BoxLock
(
)
->
is_eliminated
(),
"sanity"
);
// Make the merge point
Node
*
region
;
...
...
@@ -2283,7 +2285,7 @@ void PhaseMacroExpand::expand_unlock_node(UnlockNode *unlock) {
Node
*
obj
=
unlock
->
obj_node
();
Node
*
box
=
unlock
->
box_node
();
assert
(
!
BoxLockNode
::
box_node
(
box
)
->
is_eliminated
(),
"sanity"
);
assert
(
!
box
->
as_BoxLock
(
)
->
is_eliminated
(),
"sanity"
);
// No need for a null check on unlock
...
...
src/share/vm/opto/parse1.cpp
浏览文件 @
8668cf5f
...
...
@@ -1604,7 +1604,16 @@ void Parse::merge_common(Parse::Block* target, int pnum) {
continue
;
default:
// All normal stuff
if
(
phi
==
NULL
)
{
if
(
!
check_elide_phi
||
!
target
->
can_elide_SEL_phi
(
j
))
{
const
JVMState
*
jvms
=
map
()
->
jvms
();
if
(
EliminateNestedLocks
&&
jvms
->
is_mon
(
j
)
&&
jvms
->
is_monitor_box
(
j
))
{
// BoxLock nodes are not commoning.
// Use old BoxLock node as merged box.
assert
(
newin
->
jvms
()
->
is_monitor_box
(
j
),
"sanity"
);
// This assert also tests that nodes are BoxLock.
assert
(
BoxLockNode
::
same_slot
(
n
,
m
),
"sanity"
);
C
->
gvn_replace_by
(
n
,
m
);
}
else
if
(
!
check_elide_phi
||
!
target
->
can_elide_SEL_phi
(
j
))
{
phi
=
ensure_phi
(
j
,
nophi
);
}
}
...
...
@@ -1819,12 +1828,8 @@ PhiNode *Parse::ensure_phi(int idx, bool nocreate) {
}
else
if
(
jvms
->
is_stk
(
idx
))
{
t
=
block
()
->
stack_type_at
(
idx
-
jvms
->
stkoff
());
}
else
if
(
jvms
->
is_mon
(
idx
))
{
if
(
EliminateNestedLocks
&&
jvms
->
is_monitor_box
(
idx
))
{
// BoxLock nodes are not commoning. Create Phi.
t
=
o
->
bottom_type
();
// TypeRawPtr::BOTTOM
}
else
{
t
=
TypeInstPtr
::
BOTTOM
;
// this is sufficient for a lock object
}
assert
(
!
jvms
->
is_monitor_box
(
idx
),
"no phis for boxes"
);
t
=
TypeInstPtr
::
BOTTOM
;
// this is sufficient for a lock object
}
else
if
((
uint
)
idx
<
TypeFunc
::
Parms
)
{
t
=
o
->
bottom_type
();
// Type::RETURN_ADDRESS or such-like.
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录