Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
2214c52e
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看板
提交
2214c52e
编写于
12月 16, 2010
作者:
I
iveresov
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
6525ddb7
dc6f41d5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
90 addition
and
41 deletion
+90
-41
src/cpu/sparc/vm/assembler_sparc.cpp
src/cpu/sparc/vm/assembler_sparc.cpp
+42
-23
src/cpu/sparc/vm/assembler_sparc.hpp
src/cpu/sparc/vm/assembler_sparc.hpp
+7
-6
src/cpu/sparc/vm/sparc.ad
src/cpu/sparc/vm/sparc.ad
+33
-10
src/share/vm/compiler/compilerOracle.cpp
src/share/vm/compiler/compilerOracle.cpp
+8
-2
未找到文件。
src/cpu/sparc/vm/assembler_sparc.cpp
浏览文件 @
2214c52e
...
...
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "assembler_sparc.inline.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "interpreter/interpreter.hpp"
...
...
@@ -1327,37 +1328,38 @@ void MacroAssembler::patchable_sethi(const AddressLiteral& addrlit, Register d)
}
int
MacroAssembler
::
size_of
_sethi
(
address
a
,
bool
worst_case
)
{
int
MacroAssembler
::
insts_for
_sethi
(
address
a
,
bool
worst_case
)
{
#ifdef _LP64
if
(
worst_case
)
return
7
;
intptr_t
iaddr
=
(
intptr_t
)
a
;
int
hi32
=
(
int
)
(
iaddr
>>
32
);
int
l
o32
=
(
int
)
(
iaddr
);
int
inst_
count
;
if
(
hi32
==
0
&&
lo
32
>=
0
)
inst_
count
=
1
;
else
if
(
hi
32
==
-
1
)
inst_
count
=
2
;
if
(
worst_case
)
return
7
;
intptr_t
iaddr
=
(
intptr_t
)
a
;
int
msb32
=
(
int
)
(
iaddr
>>
32
);
int
l
sb32
=
(
int
)
(
iaddr
);
int
count
;
if
(
msb32
==
0
&&
lsb
32
>=
0
)
count
=
1
;
else
if
(
msb
32
==
-
1
)
count
=
2
;
else
{
inst_
count
=
2
;
if
(
hi32
&
0x3ff
)
inst_
count
++
;
if
(
lo
32
&
0xFFFFFC00
)
{
if
(
(
lo32
>>
20
)
&
0xfff
)
inst_
count
+=
2
;
if
(
(
lo32
>>
10
)
&
0x3ff
)
inst_
count
+=
2
;
count
=
2
;
if
(
msb32
&
0x3ff
)
count
++
;
if
(
lsb
32
&
0xFFFFFC00
)
{
if
((
lsb32
>>
20
)
&
0xfff
)
count
+=
2
;
if
((
lsb32
>>
10
)
&
0x3ff
)
count
+=
2
;
}
}
return
BytesPerInstWord
*
inst_
count
;
return
count
;
#else
return
BytesPerInstWord
;
return
1
;
#endif
}
int
MacroAssembler
::
worst_case_
size_of
_set
()
{
return
size_of
_sethi
(
NULL
,
true
)
+
1
;
int
MacroAssembler
::
worst_case_
insts_for
_set
()
{
return
insts_for
_sethi
(
NULL
,
true
)
+
1
;
}
// Keep in sync with MacroAssembler::insts_for_internal_set
void
MacroAssembler
::
internal_set
(
const
AddressLiteral
&
addrlit
,
Register
d
,
bool
ForceRelocatable
)
{
intptr_t
value
=
addrlit
.
value
();
...
...
@@ -1379,6 +1381,23 @@ void MacroAssembler::internal_set(const AddressLiteral& addrlit, Register d, boo
}
}
// Keep in sync with MacroAssembler::internal_set
int
MacroAssembler
::
insts_for_internal_set
(
intptr_t
value
)
{
// can optimize
if
(
-
4096
<=
value
&&
value
<=
4095
)
{
return
1
;
}
if
(
inv_hi22
(
hi22
(
value
))
==
value
)
{
return
insts_for_sethi
((
address
)
value
);
}
int
count
=
insts_for_sethi
((
address
)
value
);
AddressLiteral
al
(
value
);
if
(
al
.
low10
()
!=
0
)
{
count
++
;
}
return
count
;
}
void
MacroAssembler
::
set
(
const
AddressLiteral
&
al
,
Register
d
)
{
internal_set
(
al
,
d
,
false
);
}
...
...
@@ -1443,11 +1462,11 @@ void MacroAssembler::set64(jlong value, Register d, Register tmp) {
}
}
int
MacroAssembler
::
size_of
_set64
(
jlong
value
)
{
int
MacroAssembler
::
insts_for
_set64
(
jlong
value
)
{
v9_dep
();
int
hi
=
(
int
)(
value
>>
32
);
int
lo
=
(
int
)(
value
&
~
0
);
int
hi
=
(
int
)
(
value
>>
32
);
int
lo
=
(
int
)
(
value
&
~
0
);
int
count
=
0
;
// (Matcher::isSimpleConstant64 knows about the following optimizations.)
...
...
src/cpu/sparc/vm/assembler_sparc.hpp
浏览文件 @
2214c52e
...
...
@@ -1884,23 +1884,24 @@ public:
void
sethi
(
const
AddressLiteral
&
addrlit
,
Register
d
);
void
patchable_sethi
(
const
AddressLiteral
&
addrlit
,
Register
d
);
// compute the
size of
a sethi/set
static
int
size_of
_sethi
(
address
a
,
bool
worst_case
=
false
);
static
int
worst_case_
size_of
_set
();
// compute the
number of instructions for
a sethi/set
static
int
insts_for
_sethi
(
address
a
,
bool
worst_case
=
false
);
static
int
worst_case_
insts_for
_set
();
// set may be either setsw or setuw (high 32 bits may be zero or sign)
private:
void
internal_set
(
const
AddressLiteral
&
al
,
Register
d
,
bool
ForceRelocatable
);
static
int
insts_for_internal_set
(
intptr_t
value
);
public:
void
set
(
const
AddressLiteral
&
addrlit
,
Register
d
);
void
set
(
intptr_t
value
,
Register
d
);
void
set
(
address
addr
,
Register
d
,
RelocationHolder
const
&
rspec
);
static
int
insts_for_set
(
intptr_t
value
)
{
return
insts_for_internal_set
(
value
);
}
void
patchable_set
(
const
AddressLiteral
&
addrlit
,
Register
d
);
void
patchable_set
(
intptr_t
value
,
Register
d
);
void
set64
(
jlong
value
,
Register
d
,
Register
tmp
);
// Compute size of set64.
static
int
size_of_set64
(
jlong
value
);
static
int
insts_for_set64
(
jlong
value
);
// sign-extend 32 to 64
inline
void
signx
(
Register
s
,
Register
d
)
{
sra
(
s
,
G0
,
d
);
}
...
...
src/cpu/sparc/vm/sparc.ad
浏览文件 @
2214c52e
...
...
@@ -1086,9 +1086,9 @@ void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
uint MachConstantBaseNode::size(PhaseRegAlloc*) const {
if (UseRDPCForConstantTableBase) {
// This is really the worst case but generally it's only 1 instruction.
return
4 /*rdpc*/ + 4 /*sub*/ + MacroAssembler::worst_case_size_of_set()
;
return
(1 /*rdpc*/ + 1 /*sub*/ + MacroAssembler::worst_case_insts_for_set()) * BytesPerInstWord
;
} else {
return MacroAssembler::worst_case_
size_of_set()
;
return MacroAssembler::worst_case_
insts_for_set() * BytesPerInstWord
;
}
}
...
...
@@ -1240,7 +1240,7 @@ const Pipeline * MachEpilogNode::pipeline() const {
int MachEpilogNode::safepoint_offset() const {
assert( do_polling(), "no return for this epilog node");
return MacroAssembler::
size_of_sethi(os::get_polling_page())
;
return MacroAssembler::
insts_for_sethi(os::get_polling_page()) * BytesPerInstWord
;
}
//=============================================================================
...
...
@@ -3553,7 +3553,8 @@ operand immP() %{
interface(CONST_INTER);
%}
// Pointer Immediate: 32 or 64-bit
#ifdef _LP64
// Pointer Immediate: 64-bit
operand immP_set() %{
predicate(!VM_Version::is_niagara1_plus());
match(ConP);
...
...
@@ -3564,10 +3565,21 @@ operand immP_set() %{
interface(CONST_INTER);
%}
// Pointer Immediate:
32 or
64-bit
// Pointer Immediate: 64-bit
// From Niagara2 processors on a load should be better than materializing.
operand immP_load() %{
predicate(VM_Version::is_niagara1_plus());
predicate(VM_Version::is_niagara1_plus() && (n->bottom_type()->isa_oop_ptr() || (MacroAssembler::insts_for_set(n->get_ptr()) > 3)));
match(ConP);
op_cost(5);
// formats are generated automatically for constants and base registers
format %{ %}
interface(CONST_INTER);
%}
// Pointer Immediate: 64-bit
operand immP_no_oop_cheap() %{
predicate(VM_Version::is_niagara1_plus() && !n->bottom_type()->isa_oop_ptr() && (MacroAssembler::insts_for_set(n->get_ptr()) <= 3));
match(ConP);
op_cost(5);
...
...
@@ -3575,6 +3587,7 @@ operand immP_load() %{
format %{ %}
interface(CONST_INTER);
%}
#endif
operand immP13() %{
predicate((-4096 < n->get_ptr()) && (n->get_ptr() <= 4095));
...
...
@@ -3673,7 +3686,7 @@ operand immL_32bits() %{
// Long Immediate: cheap (materialize in <= 3 instructions)
operand immL_cheap() %{
predicate(!VM_Version::is_niagara1_plus() || MacroAssembler::
size_of
_set64(n->get_long()) <= 3);
predicate(!VM_Version::is_niagara1_plus() || MacroAssembler::
insts_for
_set64(n->get_long()) <= 3);
match(ConL);
op_cost(0);
...
...
@@ -3683,7 +3696,7 @@ operand immL_cheap() %{
// Long Immediate: expensive (materialize in > 3 instructions)
operand immL_expensive() %{
predicate(VM_Version::is_niagara1_plus() && MacroAssembler::
size_of
_set64(n->get_long()) > 3);
predicate(VM_Version::is_niagara1_plus() && MacroAssembler::
insts_for
_set64(n->get_long()) > 3);
match(ConL);
op_cost(0);
...
...
@@ -6094,8 +6107,18 @@ instruct loadConP_load(iRegP dst, immP_load con) %{
ins_cost(MEMORY_REF_COST);
format %{ "LD [$constanttablebase + $constantoffset],$dst\t! load from constant table: ptr=$con" %}
ins_encode %{
RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register);
__ ld_ptr($constanttablebase, con_offset, $dst$$Register);
RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register);
__ ld_ptr($constanttablebase, con_offset, $dst$$Register);
%}
ins_pipe(loadConP);
%}
instruct loadConP_no_oop_cheap(iRegP dst, immP_no_oop_cheap con) %{
match(Set dst con);
ins_cost(DEFAULT_COST * 3/2);
format %{ "SET $con,$dst\t! non-oop ptr" %}
ins_encode %{
__ set($con$$constant, $dst$$Register);
%}
ins_pipe(loadConP);
%}
...
...
src/share/vm/compiler/compilerOracle.cpp
浏览文件 @
2214c52e
...
...
@@ -332,7 +332,7 @@ static OracleCommand parse_command_name(const char * line, int* bytes_read) {
"command_names size mismatch"
);
*
bytes_read
=
0
;
char
command
[
3
2
];
char
command
[
3
3
];
int
result
=
sscanf
(
line
,
"%32[a-z]%n"
,
command
,
bytes_read
);
for
(
uint
i
=
0
;
i
<
ARRAY_SIZE
(
command_names
);
i
++
)
{
if
(
strcmp
(
command
,
command_names
[
i
])
==
0
)
{
...
...
@@ -470,6 +470,12 @@ void CompilerOracle::parse_from_line(char* line) {
OracleCommand
command
=
parse_command_name
(
line
,
&
bytes_read
);
line
+=
bytes_read
;
if
(
command
==
UnknownCommand
)
{
tty
->
print_cr
(
"CompilerOracle: unrecognized line"
);
tty
->
print_cr
(
"
\"
%s
\"
"
,
original_line
);
return
;
}
if
(
command
==
QuietCommand
)
{
_quiet
=
true
;
return
;
...
...
@@ -498,7 +504,7 @@ void CompilerOracle::parse_from_line(char* line) {
line
+=
bytes_read
;
// there might be a signature following the method.
// signatures always begin with ( so match that by hand
if
(
1
==
sscanf
(
line
,
"%*[
\t
](%254[);/"
RANGEBASE
"]%n"
,
sig
+
1
,
&
bytes_read
))
{
if
(
1
==
sscanf
(
line
,
"%*[
\t
](%254[
[
);/"
RANGEBASE
"]%n"
,
sig
+
1
,
&
bytes_read
))
{
sig
[
0
]
=
'('
;
line
+=
bytes_read
;
signature
=
oopFactory
::
new_symbol_handle
(
sig
,
CHECK
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录