Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
44617907
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看板
提交
44617907
编写于
4月 05, 2011
作者:
N
never
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7032963: StoreCM shouldn't participate in store elimination
Reviewed-by: kvn
上级
50619040
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
88 addition
and
22 deletion
+88
-22
src/share/vm/opto/compile.cpp
src/share/vm/opto/compile.cpp
+57
-1
src/share/vm/opto/lcm.cpp
src/share/vm/opto/lcm.cpp
+12
-10
src/share/vm/opto/memnode.cpp
src/share/vm/opto/memnode.cpp
+6
-3
src/share/vm/opto/output.cpp
src/share/vm/opto/output.cpp
+13
-8
未找到文件。
src/share/vm/opto/compile.cpp
浏览文件 @
44617907
...
...
@@ -2050,6 +2050,52 @@ static bool oop_offset_is_sane(const TypeInstPtr* tp) {
// Note that OffsetBot and OffsetTop are very negative.
}
// Eliminate trivially redundant StoreCMs and accumulate their
// precedence edges.
static
void
eliminate_redundant_card_marks
(
Node
*
n
)
{
assert
(
n
->
Opcode
()
==
Op_StoreCM
,
"expected StoreCM"
);
if
(
n
->
in
(
MemNode
::
Address
)
->
outcnt
()
>
1
)
{
// There are multiple users of the same address so it might be
// possible to eliminate some of the StoreCMs
Node
*
mem
=
n
->
in
(
MemNode
::
Memory
);
Node
*
adr
=
n
->
in
(
MemNode
::
Address
);
Node
*
val
=
n
->
in
(
MemNode
::
ValueIn
);
Node
*
prev
=
n
;
bool
done
=
false
;
// Walk the chain of StoreCMs eliminating ones that match. As
// long as it's a chain of single users then the optimization is
// safe. Eliminating partially redundant StoreCMs would require
// cloning copies down the other paths.
while
(
mem
->
Opcode
()
==
Op_StoreCM
&&
mem
->
outcnt
()
==
1
&&
!
done
)
{
if
(
adr
==
mem
->
in
(
MemNode
::
Address
)
&&
val
==
mem
->
in
(
MemNode
::
ValueIn
))
{
// redundant StoreCM
if
(
mem
->
req
()
>
MemNode
::
OopStore
)
{
// Hasn't been processed by this code yet.
n
->
add_prec
(
mem
->
in
(
MemNode
::
OopStore
));
}
else
{
// Already converted to precedence edge
for
(
uint
i
=
mem
->
req
();
i
<
mem
->
len
();
i
++
)
{
// Accumulate any precedence edges
if
(
mem
->
in
(
i
)
!=
NULL
)
{
n
->
add_prec
(
mem
->
in
(
i
));
}
}
// Everything above this point has been processed.
done
=
true
;
}
// Eliminate the previous StoreCM
prev
->
set_req
(
MemNode
::
Memory
,
mem
->
in
(
MemNode
::
Memory
));
assert
(
mem
->
outcnt
()
==
0
,
"should be dead"
);
mem
->
disconnect_inputs
(
NULL
);
}
else
{
prev
=
mem
;
}
mem
=
prev
->
in
(
MemNode
::
Memory
);
}
}
}
//------------------------------final_graph_reshaping_impl----------------------
// Implement items 1-5 from final_graph_reshaping below.
static
void
final_graph_reshaping_impl
(
Node
*
n
,
Final_Reshape_Counts
&
frc
)
{
...
...
@@ -2176,9 +2222,19 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc ) {
frc
.
inc_float_count
();
goto
handle_mem
;
case
Op_StoreCM
:
{
// Convert OopStore dependence into precedence edge
Node
*
prec
=
n
->
in
(
MemNode
::
OopStore
);
n
->
del_req
(
MemNode
::
OopStore
);
n
->
add_prec
(
prec
);
eliminate_redundant_card_marks
(
n
);
}
// fall through
case
Op_StoreB
:
case
Op_StoreC
:
case
Op_StoreCM
:
case
Op_StorePConditional
:
case
Op_StoreI
:
case
Op_StoreL
:
...
...
src/share/vm/opto/lcm.cpp
浏览文件 @
44617907
...
...
@@ -685,20 +685,22 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, int *ready_cnt, Vect
}
ready_cnt
[
n
->
_idx
]
=
local
;
// Count em up
// A few node types require changing a required edge to a precedence edge
// before allocation.
#ifdef ASSERT
if
(
UseConcMarkSweepGC
||
UseG1GC
)
{
if
(
n
->
is_Mach
()
&&
n
->
as_Mach
()
->
ideal_Opcode
()
==
Op_StoreCM
)
{
// Note: Required edges with an index greater than oper_input_base
// are not supported by the allocator.
// Note2: Can only depend on unmatched edge being last,
// can not depend on its absolute position.
Node
*
oop_store
=
n
->
in
(
n
->
req
()
-
1
);
n
->
del_req
(
n
->
req
()
-
1
);
n
->
add_prec
(
oop_store
);
// Check the precedence edges
for
(
uint
prec
=
n
->
req
();
prec
<
n
->
len
();
prec
++
)
{
Node
*
oop_store
=
n
->
in
(
prec
);
if
(
oop_store
!=
NULL
)
{
assert
(
cfg
->
_bbs
[
oop_store
->
_idx
]
->
_dom_depth
<=
this
->
_dom_depth
,
"oop_store must dominate card-mark"
);
}
}
}
}
#endif
// A few node types require changing a required edge to a precedence edge
// before allocation.
if
(
n
->
is_Mach
()
&&
n
->
req
()
>
TypeFunc
::
Parms
&&
(
n
->
as_Mach
()
->
ideal_Opcode
()
==
Op_MemBarAcquire
||
n
->
as_Mach
()
->
ideal_Opcode
()
==
Op_MemBarVolatile
)
)
{
...
...
src/share/vm/opto/memnode.cpp
浏览文件 @
44617907
...
...
@@ -2159,9 +2159,12 @@ Node *StoreNode::Ideal(PhaseGVN *phase, bool can_reshape) {
Node
*
mem
=
in
(
MemNode
::
Memory
);
Node
*
address
=
in
(
MemNode
::
Address
);
// Back-to-back stores to same address? Fold em up.
// Generally unsafe if I have intervening uses...
if
(
mem
->
is_Store
()
&&
phase
->
eqv_uncast
(
mem
->
in
(
MemNode
::
Address
),
address
))
{
// Back-to-back stores to same address? Fold em up. Generally
// unsafe if I have intervening uses... Also disallowed for StoreCM
// since they must follow each StoreP operation. Redundant StoreCMs
// are eliminated just before matching in final_graph_reshape.
if
(
mem
->
is_Store
()
&&
phase
->
eqv_uncast
(
mem
->
in
(
MemNode
::
Address
),
address
)
&&
mem
->
Opcode
()
!=
Op_StoreCM
)
{
// Looking at a dead closed cycle of memory?
assert
(
mem
!=
mem
->
in
(
MemNode
::
Memory
),
"dead loop in StoreNode::Ideal"
);
...
...
src/share/vm/opto/output.cpp
浏览文件 @
44617907
...
...
@@ -1354,8 +1354,11 @@ void Compile::Fill_buffer() {
// Check that oop-store precedes the card-mark
else
if
(
mach
->
ideal_Opcode
()
==
Op_StoreCM
)
{
uint
storeCM_idx
=
j
;
Node
*
oop_store
=
mach
->
in
(
mach
->
_cnt
);
// First precedence edge
assert
(
oop_store
!=
NULL
,
"storeCM expects a precedence edge"
);
int
count
=
0
;
for
(
uint
prec
=
mach
->
req
();
prec
<
mach
->
len
();
prec
++
)
{
Node
*
oop_store
=
mach
->
in
(
prec
);
// Precedence edge
if
(
oop_store
==
NULL
)
continue
;
count
++
;
uint
i4
;
for
(
i4
=
0
;
i4
<
last_inst
;
++
i4
)
{
if
(
b
->
_nodes
[
i4
]
==
oop_store
)
break
;
...
...
@@ -1364,6 +1367,8 @@ void Compile::Fill_buffer() {
// edges have been added to the storeCMNode.
assert
(
i4
==
last_inst
||
i4
<
storeCM_idx
,
"CM card-mark executes before oop-store"
);
}
assert
(
count
>
0
,
"storeCM expects at least one precedence edge"
);
}
#endif
else
if
(
!
n
->
is_Proj
()
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录