Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
258baabe
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看板
提交
258baabe
编写于
3月 20, 2015
作者:
V
vlivanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8074548: Never-taken branches cause repeated deopts in MHs.GWT case
Reviewed-by: jrose, kvn
上级
7ec7657b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
3 deletion
+37
-3
src/share/vm/opto/library_call.cpp
src/share/vm/opto/library_call.cpp
+37
-3
未找到文件。
src/share/vm/opto/library_call.cpp
浏览文件 @
258baabe
...
@@ -6576,12 +6576,46 @@ bool LibraryCallKit::inline_profileBoolean() {
...
@@ -6576,12 +6576,46 @@ bool LibraryCallKit::inline_profileBoolean() {
Deoptimization
::
Action_reinterpret
);
Deoptimization
::
Action_reinterpret
);
return
true
;
return
true
;
}
}
// result is a boolean (0 or 1) and its profile (false_cnt & true_cnt)
// is a number of each value occurrences.
Node
*
result
=
argument
(
0
);
if
(
false_cnt
==
0
||
true_cnt
==
0
)
{
// According to profile, one value has been never seen.
int
expected_val
=
(
false_cnt
==
0
)
?
1
:
0
;
Node
*
cmp
=
_gvn
.
transform
(
new
(
C
)
CmpINode
(
result
,
intcon
(
expected_val
)));
Node
*
test
=
_gvn
.
transform
(
new
(
C
)
BoolNode
(
cmp
,
BoolTest
::
eq
));
IfNode
*
check
=
create_and_map_if
(
control
(),
test
,
PROB_ALWAYS
,
COUNT_UNKNOWN
);
Node
*
fast_path
=
_gvn
.
transform
(
new
(
C
)
IfTrueNode
(
check
));
Node
*
slow_path
=
_gvn
.
transform
(
new
(
C
)
IfFalseNode
(
check
));
{
// Slow path: uncommon trap for never seen value and then reexecute
// MethodHandleImpl::profileBoolean() to bump the count, so JIT knows
// the value has been seen at least once.
PreserveJVMState
pjvms
(
this
);
PreserveReexecuteState
preexecs
(
this
);
jvms
()
->
set_should_reexecute
(
true
);
set_control
(
slow_path
);
set_i_o
(
i_o
());
uncommon_trap_exact
(
Deoptimization
::
Reason_intrinsic
,
Deoptimization
::
Action_reinterpret
);
}
// The guard for never seen value enables sharpening of the result and
// returning a constant. It allows to eliminate branches on the same value
// later on.
set_control
(
fast_path
);
result
=
intcon
(
expected_val
);
}
// Stop profiling.
// Stop profiling.
// MethodHandleImpl::profileBoolean() has profiling logic in it
'
s bytecode.
// MethodHandleImpl::profileBoolean() has profiling logic in its bytecode.
// By replacing method
's
body with profile data (represented as ProfileBooleanNode
// By replacing method body with profile data (represented as ProfileBooleanNode
// on IR level) we effectively disable profiling.
// on IR level) we effectively disable profiling.
// It enables full speed execution once optimized code is generated.
// It enables full speed execution once optimized code is generated.
Node
*
profile
=
_gvn
.
transform
(
new
(
C
)
ProfileBooleanNode
(
argument
(
0
)
,
false_cnt
,
true_cnt
));
Node
*
profile
=
_gvn
.
transform
(
new
(
C
)
ProfileBooleanNode
(
result
,
false_cnt
,
true_cnt
));
C
->
record_for_igvn
(
profile
);
C
->
record_for_igvn
(
profile
);
set_result
(
profile
);
set_result
(
profile
);
return
true
;
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录