Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
2f971923
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看板
提交
2f971923
编写于
4月 05, 2013
作者:
N
neliasso
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8006016: Memory leak at hotspot/src/share/vm/adlc/output_c.cpp
Reviewed-by: kvn, roland Contributed-by: niclas.adlertz@oracle.com
上级
c1ad8783
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
71 addition
and
47 deletion
+71
-47
src/share/vm/adlc/output_c.cpp
src/share/vm/adlc/output_c.cpp
+56
-44
src/share/vm/adlc/output_h.cpp
src/share/vm/adlc/output_h.cpp
+15
-3
未找到文件。
src/share/vm/adlc/output_c.cpp
浏览文件 @
2f971923
...
...
@@ -63,11 +63,10 @@ static void defineRegNames(FILE *fp, RegisterForm *registers) {
RegDef
*
reg_def
=
NULL
;
RegDef
*
next
=
NULL
;
registers
->
reset_RegDefs
();
for
(
reg_def
=
registers
->
iter_RegDefs
();
reg_def
!=
NULL
;
reg_def
=
next
)
{
for
(
reg_def
=
registers
->
iter_RegDefs
();
reg_def
!=
NULL
;
reg_def
=
next
)
{
next
=
registers
->
iter_RegDefs
();
const
char
*
comma
=
(
next
!=
NULL
)
?
","
:
" // no trailing comma"
;
fprintf
(
fp
,
"
\"
%s
\"
%s
\n
"
,
reg_def
->
_regname
,
comma
);
fprintf
(
fp
,
"
\"
%s
\"
%s
\n
"
,
reg_def
->
_regname
,
comma
);
}
// Finish defining enumeration
...
...
@@ -79,10 +78,10 @@ static void defineRegNames(FILE *fp, RegisterForm *registers) {
reg_def
=
NULL
;
next
=
NULL
;
registers
->
reset_RegDefs
();
for
(
reg_def
=
registers
->
iter_RegDefs
();
reg_def
!=
NULL
;
reg_def
=
next
)
{
for
(
reg_def
=
registers
->
iter_RegDefs
();
reg_def
!=
NULL
;
reg_def
=
next
)
{
next
=
registers
->
iter_RegDefs
();
const
char
*
comma
=
(
next
!=
NULL
)
?
","
:
" // no trailing comma"
;
fprintf
(
fp
,
"
\t
%s%s
\n
"
,
reg_def
->
_concrete
,
comma
);
fprintf
(
fp
,
"
\t
%s%s
\n
"
,
reg_def
->
_concrete
,
comma
);
}
// Finish defining array
fprintf
(
fp
,
"
\t
};
\n
"
);
...
...
@@ -104,19 +103,17 @@ static void defineRegEncodes(FILE *fp, RegisterForm *registers) {
RegDef
*
reg_def
=
NULL
;
RegDef
*
next
=
NULL
;
registers
->
reset_RegDefs
();
for
(
reg_def
=
registers
->
iter_RegDefs
();
reg_def
!=
NULL
;
reg_def
=
next
)
{
for
(
reg_def
=
registers
->
iter_RegDefs
();
reg_def
!=
NULL
;
reg_def
=
next
)
{
next
=
registers
->
iter_RegDefs
();
const
char
*
register_encode
=
reg_def
->
register_encode
();
const
char
*
comma
=
(
next
!=
NULL
)
?
","
:
" // no trailing comma"
;
int
encval
;
if
(
!
ADLParser
::
is_int_token
(
register_encode
,
encval
))
{
fprintf
(
fp
,
" %s%s // %s
\n
"
,
register_encode
,
comma
,
reg_def
->
_regname
);
fprintf
(
fp
,
" %s%s // %s
\n
"
,
register_encode
,
comma
,
reg_def
->
_regname
);
}
else
{
// Output known constants in hex char format (backward compatibility).
assert
(
encval
<
256
,
"Exceeded supported width for register encoding"
);
fprintf
(
fp
,
" (unsigned char)'
\\
x%X'%s // %s
\n
"
,
encval
,
comma
,
reg_def
->
_regname
);
fprintf
(
fp
,
" (unsigned char)'
\\
x%X'%s // %s
\n
"
,
encval
,
comma
,
reg_def
->
_regname
);
}
}
// Finish defining enumeration
...
...
@@ -133,9 +130,10 @@ static void defineRegClassEnum(FILE *fp, RegisterForm *registers) {
fprintf
(
fp
,
"// Enumeration of register class names
\n
"
);
fprintf
(
fp
,
"enum machRegisterClass {
\n
"
);
registers
->
_rclasses
.
reset
();
for
(
const
char
*
class_name
=
NULL
;
(
class_name
=
registers
->
_rclasses
.
iter
())
!=
NULL
;
)
{
fprintf
(
fp
,
" %s,
\n
"
,
toUpper
(
class_name
));
for
(
const
char
*
class_name
=
NULL
;
(
class_name
=
registers
->
_rclasses
.
iter
())
!=
NULL
;)
{
const
char
*
class_name_to_upper
=
toUpper
(
class_name
);
fprintf
(
fp
,
" %s,
\n
"
,
class_name_to_upper
);
delete
[]
class_name_to_upper
;
}
// Finish defining enumeration
fprintf
(
fp
,
" _last_Mach_Reg_Class
\n
"
);
...
...
@@ -148,7 +146,7 @@ static void defineRegClassEnum(FILE *fp, RegisterForm *registers) {
void
ArchDesc
::
declare_register_masks
(
FILE
*
fp_hpp
)
{
const
char
*
rc_name
;
if
(
_register
)
{
if
(
_register
)
{
// Build enumeration of user-defined register classes.
defineRegClassEnum
(
fp_hpp
,
_register
);
...
...
@@ -156,24 +154,27 @@ void ArchDesc::declare_register_masks(FILE *fp_hpp) {
fprintf
(
fp_hpp
,
"
\n
"
);
fprintf
(
fp_hpp
,
"// Register masks, one for each register class.
\n
"
);
_register
->
_rclasses
.
reset
();
for
(
rc_name
=
NULL
;
(
rc_name
=
_register
->
_rclasses
.
iter
())
!=
NULL
;
)
{
const
char
*
prefix
=
""
;
RegClass
*
reg_class
=
_register
->
getRegClass
(
rc_name
);
assert
(
reg_class
,
"Using an undefined register class"
);
for
(
rc_name
=
NULL
;
(
rc_name
=
_register
->
_rclasses
.
iter
())
!=
NULL
;)
{
const
char
*
prefix
=
""
;
RegClass
*
reg_class
=
_register
->
getRegClass
(
rc_name
);
assert
(
reg_class
,
"Using an undefined register class"
);
const
char
*
rc_name_to_upper
=
toUpper
(
rc_name
);
if
(
reg_class
->
_user_defined
==
NULL
)
{
fprintf
(
fp_hpp
,
"extern const RegMask _%s%s_mask;
\n
"
,
prefix
,
toUpper
(
rc_name
)
);
fprintf
(
fp_hpp
,
"inline const RegMask &%s%s_mask() { return _%s%s_mask; }
\n
"
,
prefix
,
toUpper
(
rc_name
),
prefix
,
toUpper
(
rc_name
)
);
fprintf
(
fp_hpp
,
"extern const RegMask _%s%s_mask;
\n
"
,
prefix
,
rc_name_to_upper
);
fprintf
(
fp_hpp
,
"inline const RegMask &%s%s_mask() { return _%s%s_mask; }
\n
"
,
prefix
,
rc_name_to_upper
,
prefix
,
rc_name_to_upper
);
}
else
{
fprintf
(
fp_hpp
,
"inline const RegMask &%s%s_mask() { %s }
\n
"
,
prefix
,
toUpper
(
rc_name
)
,
reg_class
->
_user_defined
);
fprintf
(
fp_hpp
,
"inline const RegMask &%s%s_mask() { %s }
\n
"
,
prefix
,
rc_name_to_upper
,
reg_class
->
_user_defined
);
}
if
(
reg_class
->
_stack_or_reg
)
{
if
(
reg_class
->
_stack_or_reg
)
{
assert
(
reg_class
->
_user_defined
==
NULL
,
"no user defined reg class here"
);
fprintf
(
fp_hpp
,
"extern const RegMask _%sSTACK_OR_%s_mask;
\n
"
,
prefix
,
toUpper
(
rc_name
)
);
fprintf
(
fp_hpp
,
"inline const RegMask &%sSTACK_OR_%s_mask() { return _%sSTACK_OR_%s_mask; }
\n
"
,
prefix
,
toUpper
(
rc_name
),
prefix
,
toUpper
(
rc_name
)
);
fprintf
(
fp_hpp
,
"extern const RegMask _%sSTACK_OR_%s_mask;
\n
"
,
prefix
,
rc_name_to_upper
);
fprintf
(
fp_hpp
,
"inline const RegMask &%sSTACK_OR_%s_mask() { return _%sSTACK_OR_%s_mask; }
\n
"
,
prefix
,
rc_name_to_upper
,
prefix
,
rc_name_to_upper
);
}
delete
[]
rc_name_to_upper
;
}
}
}
...
...
@@ -183,34 +184,41 @@ void ArchDesc::declare_register_masks(FILE *fp_hpp) {
void
ArchDesc
::
build_register_masks
(
FILE
*
fp_cpp
)
{
const
char
*
rc_name
;
if
(
_register
)
{
if
(
_register
)
{
// Generate a list of register masks, one for each class.
fprintf
(
fp_cpp
,
"
\n
"
);
fprintf
(
fp_cpp
,
"// Register masks, one for each register class.
\n
"
);
_register
->
_rclasses
.
reset
();
for
(
rc_name
=
NULL
;
(
rc_name
=
_register
->
_rclasses
.
iter
())
!=
NULL
;
)
{
const
char
*
prefix
=
""
;
RegClass
*
reg_class
=
_register
->
getRegClass
(
rc_name
);
assert
(
reg_class
,
"Using an undefined register class"
);
for
(
rc_name
=
NULL
;
(
rc_name
=
_register
->
_rclasses
.
iter
())
!=
NULL
;)
{
const
char
*
prefix
=
""
;
RegClass
*
reg_class
=
_register
->
getRegClass
(
rc_name
);
assert
(
reg_class
,
"Using an undefined register class"
);
if
(
reg_class
->
_user_defined
!=
NULL
)
continue
;
if
(
reg_class
->
_user_defined
!=
NULL
)
{
continue
;
}
int
len
=
RegisterForm
::
RegMask_Size
();
fprintf
(
fp_cpp
,
"const RegMask _%s%s_mask("
,
prefix
,
toUpper
(
rc_name
)
);
{
int
i
;
for
(
i
=
0
;
i
<
len
-
1
;
i
++
)
fprintf
(
fp_cpp
,
" 0x%x,"
,
reg_class
->
regs_in_word
(
i
,
false
));
fprintf
(
fp_cpp
,
" 0x%x );
\n
"
,
reg_class
->
regs_in_word
(
i
,
false
));
const
char
*
rc_name_to_upper
=
toUpper
(
rc_name
);
fprintf
(
fp_cpp
,
"const RegMask _%s%s_mask("
,
prefix
,
rc_name_to_upper
);
{
int
i
;
for
(
i
=
0
;
i
<
len
-
1
;
i
++
)
{
fprintf
(
fp_cpp
,
" 0x%x,"
,
reg_class
->
regs_in_word
(
i
,
false
));
}
fprintf
(
fp_cpp
,
" 0x%x );
\n
"
,
reg_class
->
regs_in_word
(
i
,
false
));
}
if
(
reg_class
->
_stack_or_reg
)
{
if
(
reg_class
->
_stack_or_reg
)
{
int
i
;
fprintf
(
fp_cpp
,
"const RegMask _%sSTACK_OR_%s_mask("
,
prefix
,
toUpper
(
rc_name
)
);
for
(
i
=
0
;
i
<
len
-
1
;
i
++
)
fprintf
(
fp_cpp
,
" 0x%x,"
,
reg_class
->
regs_in_word
(
i
,
true
));
fprintf
(
fp_cpp
,
" 0x%x );
\n
"
,
reg_class
->
regs_in_word
(
i
,
true
));
fprintf
(
fp_cpp
,
"const RegMask _%sSTACK_OR_%s_mask("
,
prefix
,
rc_name_to_upper
);
for
(
i
=
0
;
i
<
len
-
1
;
i
++
)
{
fprintf
(
fp_cpp
,
" 0x%x,"
,
reg_class
->
regs_in_word
(
i
,
true
));
}
fprintf
(
fp_cpp
,
" 0x%x );
\n
"
,
reg_class
->
regs_in_word
(
i
,
true
));
}
delete
[]
rc_name_to_upper
;
}
}
}
...
...
@@ -2676,7 +2684,9 @@ static void defineIn_RegMask(FILE *fp, FormDict &globals, OperandForm &oper) {
if
(
strcmp
(
first_reg_class
,
"stack_slots"
)
==
0
)
{
fprintf
(
fp
,
" return &(Compile::current()->FIRST_STACK_mask());
\n
"
);
}
else
{
fprintf
(
fp
,
" return &%s_mask();
\n
"
,
toUpper
(
first_reg_class
));
const
char
*
first_reg_class_to_upper
=
toUpper
(
first_reg_class
);
fprintf
(
fp
,
" return &%s_mask();
\n
"
,
first_reg_class_to_upper
);
delete
[]
first_reg_class_to_upper
;
}
}
else
{
// Build a switch statement to return the desired mask.
...
...
@@ -2688,7 +2698,9 @@ static void defineIn_RegMask(FILE *fp, FormDict &globals, OperandForm &oper) {
if
(
!
strcmp
(
reg_class
,
"stack_slots"
)
)
{
fprintf
(
fp
,
" case %d: return &(Compile::current()->FIRST_STACK_mask());
\n
"
,
index
);
}
else
{
fprintf
(
fp
,
" case %d: return &%s_mask();
\n
"
,
index
,
toUpper
(
reg_class
));
const
char
*
reg_class_to_upper
=
toUpper
(
reg_class
);
fprintf
(
fp
,
" case %d: return &%s_mask();
\n
"
,
index
,
reg_class_to_upper
);
delete
[]
reg_class_to_upper
;
}
}
fprintf
(
fp
,
" }
\n
"
);
...
...
src/share/vm/adlc/output_h.cpp
浏览文件 @
2f971923
...
...
@@ -2069,9 +2069,21 @@ public:
void
closing
()
{
fprintf
(
_cpp
,
" _LAST_MACH_OPER
\n
"
);
OutputMap
::
closing
();
}
void
map
(
OpClassForm
&
opc
)
{
fprintf
(
_cpp
,
" %s"
,
_AD
.
machOperEnum
(
opc
.
_ident
)
);
}
void
map
(
OperandForm
&
oper
)
{
fprintf
(
_cpp
,
" %s"
,
_AD
.
machOperEnum
(
oper
.
_ident
)
);
}
void
map
(
char
*
name
)
{
fprintf
(
_cpp
,
" %s"
,
_AD
.
machOperEnum
(
name
));
}
void
map
(
OpClassForm
&
opc
)
{
const
char
*
opc_ident_to_upper
=
_AD
.
machOperEnum
(
opc
.
_ident
);
fprintf
(
_cpp
,
" %s"
,
opc_ident_to_upper
);
delete
[]
opc_ident_to_upper
;
}
void
map
(
OperandForm
&
oper
)
{
const
char
*
oper_ident_to_upper
=
_AD
.
machOperEnum
(
oper
.
_ident
);
fprintf
(
_cpp
,
" %s"
,
oper_ident_to_upper
);
delete
[]
oper_ident_to_upper
;
}
void
map
(
char
*
name
)
{
const
char
*
name_to_upper
=
_AD
.
machOperEnum
(
name
);
fprintf
(
_cpp
,
" %s"
,
name_to_upper
);
delete
[]
name_to_upper
;
}
bool
do_instructions
()
{
return
false
;
}
void
map
(
InstructForm
&
inst
){
assert
(
false
,
"ShouldNotCallThis()"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录