Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4012d550
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看板
提交
4012d550
编写于
2月 11, 2019
作者:
S
shade
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8214059: Undefined behaviour in ADLC
Reviewed-by: shade, kbarrett Contributed-by:
N
Simon Tooke
<
stooke@redhat.com
>
上级
2eb26991
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
25 addition
and
12 deletion
+25
-12
src/share/vm/adlc/adlparse.cpp
src/share/vm/adlc/adlparse.cpp
+4
-2
src/share/vm/adlc/dfa.cpp
src/share/vm/adlc/dfa.cpp
+15
-7
src/share/vm/adlc/formssel.cpp
src/share/vm/adlc/formssel.cpp
+6
-3
未找到文件。
src/share/vm/adlc/adlparse.cpp
浏览文件 @
4012d550
...
...
@@ -2868,7 +2868,8 @@ void ADLParser::ins_encode_parse_block(InstructForm& inst) {
const
char
*
param
=
NULL
;
inst
.
_parameters
.
reset
();
while
((
param
=
inst
.
_parameters
.
iter
())
!=
NULL
)
{
OperandForm
*
opForm
=
(
OperandForm
*
)
inst
.
_localNames
[
param
];
OpClassForm
*
opForm
=
inst
.
_localNames
[
param
]
->
is_opclass
();
assert
(
opForm
!=
NULL
,
"sanity"
);
encoding
->
add_parameter
(
opForm
->
_ident
,
param
);
}
...
...
@@ -3338,7 +3339,8 @@ void ADLParser::constant_parse(InstructForm& inst) {
const
char
*
param
=
NULL
;
inst
.
_parameters
.
reset
();
while
((
param
=
inst
.
_parameters
.
iter
())
!=
NULL
)
{
OperandForm
*
opForm
=
(
OperandForm
*
)
inst
.
_localNames
[
param
];
OpClassForm
*
opForm
=
inst
.
_localNames
[
param
]
->
is_opclass
();
assert
(
opForm
!=
NULL
,
"sanity"
);
encoding
->
add_parameter
(
opForm
->
_ident
,
param
);
}
...
...
src/share/vm/adlc/dfa.cpp
浏览文件 @
4012d550
...
...
@@ -757,19 +757,27 @@ const char *Expr::compute_expr(const Expr *c1, const Expr *c2) {
}
int
Expr
::
compute_min
(
const
Expr
*
c1
,
const
Expr
*
c2
)
{
int
result
=
c1
->
_min_value
+
c2
->
_min_value
;
assert
(
result
>=
0
,
"Invalid cost computation"
);
int
v1
=
c1
->
_min_value
;
int
v2
=
c2
->
_min_value
;
assert
(
0
<=
v2
&&
v2
<=
Expr
::
Max
,
"sanity"
);
assert
(
v1
<=
Expr
::
Max
-
v2
,
"Invalid cost computation"
);
return
result
;
return
v1
+
v2
;
}
int
Expr
::
compute_max
(
const
Expr
*
c1
,
const
Expr
*
c2
)
{
int
result
=
c1
->
_max_value
+
c2
->
_max_value
;
if
(
result
<
0
)
{
// check for overflow
result
=
Expr
::
Max
;
int
v1
=
c1
->
_max_value
;
int
v2
=
c2
->
_max_value
;
// Check for overflow without producing UB. If v2 is positive
// and not larger than Max, the subtraction cannot underflow.
assert
(
0
<=
v2
&&
v2
<=
Expr
::
Max
,
"sanity"
);
if
(
v1
>
Expr
::
Max
-
v2
)
{
return
Expr
::
Max
;
}
return
result
;
return
v1
+
v2
;
}
void
Expr
::
print
()
const
{
...
...
src/share/vm/adlc/formssel.cpp
浏览文件 @
4012d550
...
...
@@ -921,7 +921,8 @@ void InstructForm::build_components() {
const
char
*
name
;
const
char
*
kill_name
=
NULL
;
for
(
_parameters
.
reset
();
(
name
=
_parameters
.
iter
())
!=
NULL
;)
{
OperandForm
*
opForm
=
(
OperandForm
*
)
_localNames
[
name
];
OpClassForm
*
opForm
=
_localNames
[
name
]
->
is_opclass
();
assert
(
opForm
!=
NULL
,
"sanity"
);
Effect
*
e
=
NULL
;
{
...
...
@@ -938,7 +939,8 @@ void InstructForm::build_components() {
// complex so simply enforce the restriction during parse.
if
(
kill_name
!=
NULL
&&
e
->
isa
(
Component
::
TEMP
)
&&
!
e
->
isa
(
Component
::
DEF
))
{
OperandForm
*
kill
=
(
OperandForm
*
)
_localNames
[
kill_name
];
OpClassForm
*
kill
=
_localNames
[
kill_name
]
->
is_opclass
();
assert
(
kill
!=
NULL
,
"sanity"
);
globalAD
->
syntax_err
(
_linenum
,
"%s: %s %s must be at the end of the argument list
\n
"
,
_ident
,
kill
->
_ident
,
kill_name
);
}
else
if
(
e
->
isa
(
Component
::
KILL
)
&&
!
e
->
isa
(
Component
::
USE
))
{
...
...
@@ -2339,7 +2341,8 @@ void OperandForm::build_components() {
// Add parameters that "do not appear in match rule".
const
char
*
name
;
for
(
_parameters
.
reset
();
(
name
=
_parameters
.
iter
())
!=
NULL
;)
{
OperandForm
*
opForm
=
(
OperandForm
*
)
_localNames
[
name
];
OpClassForm
*
opForm
=
_localNames
[
name
]
->
is_opclass
();
assert
(
opForm
!=
NULL
,
"sanity"
);
if
(
_components
.
operand_position
(
name
)
==
-
1
)
{
_components
.
insert
(
name
,
opForm
->
_ident
,
Component
::
INVALID
,
false
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录