Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
c6c7dc92
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看板
提交
c6c7dc92
编写于
7月 11, 2008
作者:
K
kvn
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
7e670d8d
571459e9
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
292 addition
and
287 deletion
+292
-287
src/share/vm/compiler/oopMap.cpp
src/share/vm/compiler/oopMap.cpp
+1
-20
src/share/vm/compiler/oopMap.hpp
src/share/vm/compiler/oopMap.hpp
+2
-6
src/share/vm/opto/bytecodeInfo.cpp
src/share/vm/opto/bytecodeInfo.cpp
+1
-1
src/share/vm/opto/c2_globals.hpp
src/share/vm/opto/c2_globals.hpp
+1
-1
src/share/vm/opto/compile.cpp
src/share/vm/opto/compile.cpp
+10
-6
src/share/vm/opto/escape.cpp
src/share/vm/opto/escape.cpp
+248
-230
src/share/vm/opto/escape.hpp
src/share/vm/opto/escape.hpp
+29
-23
未找到文件。
src/share/vm/compiler/oopMap.cpp
浏览文件 @
c6c7dc92
...
...
@@ -188,10 +188,6 @@ void OopMap::set_derived_oop(VMReg reg, VMReg derived_from_local_register ) {
}
}
void
OopMap
::
set_stack_obj
(
VMReg
reg
)
{
set_xxx
(
reg
,
OopMapValue
::
stack_obj
,
VMRegImpl
::
Bad
());
}
// OopMapSet
OopMapSet
::
OopMapSet
()
{
...
...
@@ -399,8 +395,7 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map,
if
(
loc
!=
NULL
)
{
if
(
omv
.
type
()
==
OopMapValue
::
oop_value
)
{
#ifdef ASSERT
if
(
COMPILER2_PRESENT
(
!
DoEscapeAnalysis
&&
)
(((
uintptr_t
)
loc
&
(
sizeof
(
*
loc
)
-
1
))
!=
0
)
||
if
((((
uintptr_t
)
loc
&
(
sizeof
(
*
loc
)
-
1
))
!=
0
)
||
!
Universe
::
heap
()
->
is_in_or_null
(
*
loc
))
{
tty
->
print_cr
(
"# Found non oop pointer. Dumping state at failure"
);
// try to dump out some helpful debugging information
...
...
@@ -431,17 +426,6 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map,
}
}
}
#ifdef COMPILER2
if
(
DoEscapeAnalysis
)
{
for
(
OopMapStream
oms
(
map
,
OopMapValue
::
stack_obj
);
!
oms
.
is_done
();
oms
.
next
())
{
omv
=
oms
.
current
();
assert
(
omv
.
is_stack_loc
(),
"should refer to stack location"
);
oop
loc
=
(
oop
)
fr
->
oopmapreg_to_location
(
omv
.
reg
(),
reg_map
);
oop_fn
->
do_oop
(
&
loc
);
}
}
#endif // COMPILER2
}
...
...
@@ -540,9 +524,6 @@ void print_register_type(OopMapValue::oop_types x, VMReg optional,
st
->
print
(
"Derived_oop_"
);
optional
->
print_on
(
st
);
break
;
case
OopMapValue
::
stack_obj
:
st
->
print
(
"Stack"
);
break
;
default:
ShouldNotReachHere
();
}
...
...
src/share/vm/compiler/oopMap.hpp
浏览文件 @
c6c7dc92
...
...
@@ -46,7 +46,7 @@ private:
public:
// Constants
enum
{
type_bits
=
6
,
enum
{
type_bits
=
5
,
register_bits
=
BitsPerShort
-
type_bits
};
enum
{
type_shift
=
0
,
...
...
@@ -63,8 +63,7 @@ public:
value_value
=
2
,
narrowoop_value
=
4
,
callee_saved_value
=
8
,
derived_oop_value
=
16
,
stack_obj
=
32
};
derived_oop_value
=
16
};
// Constructors
OopMapValue
()
{
set_value
(
0
);
set_content_reg
(
VMRegImpl
::
Bad
());
}
...
...
@@ -93,14 +92,12 @@ public:
bool
is_narrowoop
()
{
return
mask_bits
(
value
(),
type_mask_in_place
)
==
narrowoop_value
;
}
bool
is_callee_saved
()
{
return
mask_bits
(
value
(),
type_mask_in_place
)
==
callee_saved_value
;
}
bool
is_derived_oop
()
{
return
mask_bits
(
value
(),
type_mask_in_place
)
==
derived_oop_value
;
}
bool
is_stack_obj
()
{
return
mask_bits
(
value
(),
type_mask_in_place
)
==
stack_obj
;
}
void
set_oop
()
{
set_value
((
value
()
&
register_mask_in_place
)
|
oop_value
);
}
void
set_value
()
{
set_value
((
value
()
&
register_mask_in_place
)
|
value_value
);
}
void
set_narrowoop
()
{
set_value
((
value
()
&
register_mask_in_place
)
|
narrowoop_value
);
}
void
set_callee_saved
()
{
set_value
((
value
()
&
register_mask_in_place
)
|
callee_saved_value
);
}
void
set_derived_oop
()
{
set_value
((
value
()
&
register_mask_in_place
)
|
derived_oop_value
);
}
void
set_stack_obj
()
{
set_value
((
value
()
&
register_mask_in_place
)
|
stack_obj
);
}
VMReg
reg
()
const
{
return
VMRegImpl
::
as_VMReg
(
mask_bits
(
value
(),
register_mask_in_place
)
>>
register_shift
);
}
oop_types
type
()
const
{
return
(
oop_types
)
mask_bits
(
value
(),
type_mask_in_place
);
}
...
...
@@ -180,7 +177,6 @@ class OopMap: public ResourceObj {
void
set_dead
(
VMReg
local
);
void
set_callee_saved
(
VMReg
local
,
VMReg
caller_machine_register
);
void
set_derived_oop
(
VMReg
local
,
VMReg
derived_from_local_register
);
void
set_stack_obj
(
VMReg
local
);
void
set_xxx
(
VMReg
reg
,
OopMapValue
::
oop_types
x
,
VMReg
optional
);
int
heap_size
()
const
;
...
...
src/share/vm/opto/bytecodeInfo.cpp
浏览文件 @
c6c7dc92
...
...
@@ -83,7 +83,7 @@ static bool is_init_with_ea(ciMethod* callee_method,
ciMethod
*
caller_method
,
Compile
*
C
)
{
// True when EA is ON and a java constructor is called or
// a super constructor is called from an inlined java constructor.
return
DoEscapeAnalysis
&&
EliminateAllocations
&&
return
C
->
do_escape_analysis
()
&&
EliminateAllocations
&&
(
callee_method
->
is_initializer
()
||
(
caller_method
->
is_initializer
()
&&
caller_method
!=
C
->
method
()
&&
...
...
src/share/vm/opto/c2_globals.hpp
浏览文件 @
c6c7dc92
...
...
@@ -373,7 +373,7 @@
product(intx, AutoBoxCacheMax, 128, \
"Sets max value cached by the java.lang.Integer autobox cache") \
\
product(bool, DoEscapeAnalysis,
false,
\
product(bool, DoEscapeAnalysis,
true,
\
"Perform escape analysis") \
\
notproduct(bool, PrintEscapeAnalysis, false, \
...
...
src/share/vm/opto/compile.cpp
浏览文件 @
c6c7dc92
...
...
@@ -583,18 +583,22 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
NOT_PRODUCT
(
verify_graph_edges
();
)
// Perform escape analysis
if
(
_do_escape_analysis
)
_congraph
=
new
ConnectionGraph
(
this
);
if
(
_congraph
!=
NULL
)
{
NOT_PRODUCT
(
TracePhase
t2
(
"escapeAnalysis"
,
&
_t_escapeAnalysis
,
TimeCompiler
);
)
_congraph
->
compute_escape
();
if
(
failing
())
return
;
if
(
_do_escape_analysis
&&
ConnectionGraph
::
has_candidates
(
this
))
{
TracePhase
t2
(
"escapeAnalysis"
,
&
_t_escapeAnalysis
,
true
);
_congraph
=
new
(
comp_arena
())
ConnectionGraph
(
this
);
bool
has_non_escaping_obj
=
_congraph
->
compute_escape
();
#ifndef PRODUCT
if
(
PrintEscapeAnalysis
)
{
_congraph
->
dump
();
}
#endif
if
(
!
has_non_escaping_obj
)
{
_congraph
=
NULL
;
}
if
(
failing
())
return
;
}
// Now optimize
Optimize
();
...
...
src/share/vm/opto/escape.cpp
浏览文件 @
c6c7dc92
此差异已折叠。
点击以展开。
src/share/vm/opto/escape.hpp
浏览文件 @
c6c7dc92
...
...
@@ -178,14 +178,24 @@ public:
// count of outgoing edges
uint
edge_count
()
const
{
return
(
_edges
==
NULL
)
?
0
:
_edges
->
length
();
}
// node index of target of outgoing edge "e"
uint
edge_target
(
uint
e
)
const
;
uint
edge_target
(
uint
e
)
const
{
assert
(
_edges
!=
NULL
,
"valid edge index"
);
return
(
_edges
->
at
(
e
)
>>
EdgeShift
);
}
// type of outgoing edge "e"
EdgeType
edge_type
(
uint
e
)
const
;
EdgeType
edge_type
(
uint
e
)
const
{
assert
(
_edges
!=
NULL
,
"valid edge index"
);
return
(
EdgeType
)
(
_edges
->
at
(
e
)
&
EdgeMask
);
}
// add a edge of the specified type pointing to the specified target
void
add_edge
(
uint
targIdx
,
EdgeType
et
);
// remove an edge of the specified type pointing to the specified target
void
remove_edge
(
uint
targIdx
,
EdgeType
et
);
#ifndef PRODUCT
void
dump
()
const
;
#endif
...
...
@@ -194,7 +204,7 @@ public:
class
ConnectionGraph
:
public
ResourceObj
{
private:
GrowableArray
<
PointsToNode
>
*
_nodes
;
// Connection graph nodes indexed
GrowableArray
<
PointsToNode
>
_nodes
;
// Connection graph nodes indexed
// by ideal node index.
Unique_Node_List
_delayed_worklist
;
// Nodes to be processed before
...
...
@@ -207,9 +217,6 @@ private:
// is still being collected. If false,
// no new nodes will be processed.
bool
_has_allocations
;
// Indicates whether method has any
// non-escaping allocations.
uint
_phantom_object
;
// Index of globally escaping object
// that pointer values loaded from
// a field which has not been set
...
...
@@ -217,14 +224,13 @@ private:
Compile
*
_compile
;
// Compile object for current compilation
// address of an element in _nodes. Used when the element is to be modified
PointsToNode
*
ptnode_adr
(
uint
idx
)
{
if
((
uint
)
_nodes
->
length
()
<=
idx
)
{
// expand _nodes array
PointsToNode
dummy
=
_nodes
->
at_grow
(
idx
);
}
return
_nodes
->
adr_at
(
idx
);
// Address of an element in _nodes. Used when the element is to be modified
PointsToNode
*
ptnode_adr
(
uint
idx
)
const
{
// There should be no new ideal nodes during ConnectionGraph build,
// growableArray::adr_at() will throw assert otherwise.
return
_nodes
.
adr_at
(
idx
);
}
uint
nodes_size
()
const
{
return
_nodes
.
length
();
}
// Add node to ConnectionGraph.
void
add_node
(
Node
*
n
,
PointsToNode
::
NodeType
nt
,
PointsToNode
::
EscapeState
es
,
bool
done
);
...
...
@@ -307,30 +313,30 @@ private:
// Set the escape state of a node
void
set_escape_state
(
uint
ni
,
PointsToNode
::
EscapeState
es
);
// Get Compile object for current compilation.
Compile
*
C
()
const
{
return
_compile
;
}
public:
ConnectionGraph
(
Compile
*
C
);
// Check for non-escaping candidates
static
bool
has_candidates
(
Compile
*
C
);
// Compute the escape information
void
compute_escape
();
bool
compute_escape
();
// escape state of a node
PointsToNode
::
EscapeState
escape_state
(
Node
*
n
,
PhaseTransform
*
phase
);
// other information we have collected
bool
is_scalar_replaceable
(
Node
*
n
)
{
if
(
_collecting
)
if
(
_collecting
||
(
n
->
_idx
>=
nodes_size
())
)
return
false
;
PointsToNode
ptn
=
_nodes
->
at_grow
(
n
->
_idx
);
return
ptn
.
escape_state
()
==
PointsToNode
::
NoEscape
&&
ptn
.
_scalar_replaceable
;
PointsToNode
*
ptn
=
ptnode_adr
(
n
->
_idx
);
return
ptn
->
escape_state
()
==
PointsToNode
::
NoEscape
&&
ptn
->
_scalar_replaceable
;
}
bool
hidden_alias
(
Node
*
n
)
{
if
(
_collecting
)
if
(
_collecting
||
(
n
->
_idx
>=
nodes_size
())
)
return
true
;
PointsToNode
ptn
=
_nodes
->
at_grow
(
n
->
_idx
);
return
(
ptn
.
escape_state
()
!=
PointsToNode
::
NoEscape
)
||
ptn
.
_hidden_alias
;
PointsToNode
*
ptn
=
ptnode_adr
(
n
->
_idx
);
return
(
ptn
->
escape_state
()
!=
PointsToNode
::
NoEscape
)
||
ptn
->
_hidden_alias
;
}
#ifndef PRODUCT
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录