Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
ad1d0faf
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看板
提交
ad1d0faf
编写于
12月 17, 2009
作者:
J
jmasa
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
186d1e6d
747bc6f4
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
693 addition
and
222 deletion
+693
-222
src/share/vm/opto/compile.cpp
src/share/vm/opto/compile.cpp
+1
-0
src/share/vm/opto/escape.cpp
src/share/vm/opto/escape.cpp
+473
-212
src/share/vm/opto/escape.hpp
src/share/vm/opto/escape.hpp
+6
-2
src/share/vm/opto/graphKit.cpp
src/share/vm/opto/graphKit.cpp
+5
-0
src/share/vm/opto/lcm.cpp
src/share/vm/opto/lcm.cpp
+3
-2
src/share/vm/opto/macro.cpp
src/share/vm/opto/macro.cpp
+27
-0
src/share/vm/opto/memnode.cpp
src/share/vm/opto/memnode.cpp
+65
-1
src/share/vm/opto/memnode.hpp
src/share/vm/opto/memnode.hpp
+7
-1
src/share/vm/opto/node.hpp
src/share/vm/opto/node.hpp
+4
-1
src/share/vm/opto/parse3.cpp
src/share/vm/opto/parse3.cpp
+3
-3
test/compiler/6895383/Test.java
test/compiler/6895383/Test.java
+51
-0
test/compiler/6896727/Test.java
test/compiler/6896727/Test.java
+48
-0
未找到文件。
src/share/vm/opto/compile.cpp
浏览文件 @
ad1d0faf
...
...
@@ -1852,6 +1852,7 @@ void Compile::dump_asm(int *pcs, uint pc_limit) {
!
n
->
is_Phi
()
&&
// a few noisely useless nodes
!
n
->
is_Proj
()
&&
!
n
->
is_MachTemp
()
&&
!
n
->
is_SafePointScalarObject
()
&&
!
n
->
is_Catch
()
&&
// Would be nice to print exception table targets
!
n
->
is_MergeMem
()
&&
// Not very interesting
!
n
->
is_top
()
&&
// Debug info table constants
...
...
src/share/vm/opto/escape.cpp
浏览文件 @
ad1d0faf
此差异已折叠。
点击以展开。
src/share/vm/opto/escape.hpp
浏览文件 @
ad1d0faf
...
...
@@ -210,6 +210,8 @@ private:
Unique_Node_List
_delayed_worklist
;
// Nodes to be processed before
// the call build_connection_graph().
GrowableArray
<
MergeMemNode
*>
_mergemem_worklist
;
// List of all MergeMem nodes
VectorSet
_processed
;
// Records which nodes have been
// processed.
...
...
@@ -289,7 +291,7 @@ private:
bool
split_AddP
(
Node
*
addp
,
Node
*
base
,
PhaseGVN
*
igvn
);
PhiNode
*
create_split_phi
(
PhiNode
*
orig_phi
,
int
alias_idx
,
GrowableArray
<
PhiNode
*>
&
orig_phi_worklist
,
PhaseGVN
*
igvn
,
bool
&
new_created
);
PhiNode
*
split_memory_phi
(
PhiNode
*
orig_phi
,
int
alias_idx
,
GrowableArray
<
PhiNode
*>
&
orig_phi_worklist
,
PhaseGVN
*
igvn
);
Node
*
find_mem
(
Node
*
mem
,
int
alias_idx
,
PhaseGVN
*
igvn
);
void
move_inst_mem
(
Node
*
n
,
GrowableArray
<
PhiNode
*>
&
orig_phis
,
PhaseGVN
*
igvn
);
Node
*
find_inst_mem
(
Node
*
mem
,
int
alias_idx
,
GrowableArray
<
PhiNode
*>
&
orig_phi_worklist
,
PhaseGVN
*
igvn
);
// Propagate unique types created for unescaped allocated objects
...
...
@@ -298,7 +300,6 @@ private:
// manage entries in _node_map
void
set_map
(
int
idx
,
Node
*
n
)
{
_node_map
.
map
(
idx
,
n
);
}
void
set_map_phi
(
int
idx
,
PhiNode
*
p
)
{
_node_map
.
map
(
idx
,
(
Node
*
)
p
);
}
Node
*
get_map
(
int
idx
)
{
return
_node_map
[
idx
];
}
PhiNode
*
get_map_phi
(
int
idx
)
{
Node
*
phi
=
_node_map
[
idx
];
...
...
@@ -315,6 +316,9 @@ private:
// Set the escape state of a node
void
set_escape_state
(
uint
ni
,
PointsToNode
::
EscapeState
es
);
// Search for objects which are not scalar replaceable.
void
verify_escape_state
(
int
nidx
,
VectorSet
&
ptset
,
PhaseTransform
*
phase
);
public:
ConnectionGraph
(
Compile
*
C
);
...
...
src/share/vm/opto/graphKit.cpp
浏览文件 @
ad1d0faf
...
...
@@ -1714,6 +1714,11 @@ void GraphKit::replace_call(CallNode* call, Node* result) {
C
->
gvn_replace_by
(
callprojs
.
catchall_catchproj
,
C
->
top
());
C
->
gvn_replace_by
(
callprojs
.
catchall_memproj
,
C
->
top
());
C
->
gvn_replace_by
(
callprojs
.
catchall_ioproj
,
C
->
top
());
// Replace the old exception object with top
if
(
callprojs
.
exobj
!=
NULL
)
{
C
->
gvn_replace_by
(
callprojs
.
exobj
,
C
->
top
());
}
}
else
{
GraphKit
ekit
(
ejvms
);
...
...
src/share/vm/opto/lcm.cpp
浏览文件 @
ad1d0faf
...
...
@@ -616,8 +616,9 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, int *ready_cnt, Vect
assert
(
cfg
->
_bbs
[
oop_store
->
_idx
]
->
_dom_depth
<=
this
->
_dom_depth
,
"oop_store must dominate card-mark"
);
}
}
if
(
n
->
is_Mach
()
&&
n
->
as_Mach
()
->
ideal_Opcode
()
==
Op_MemBarAcquire
&&
n
->
req
()
>
TypeFunc
::
Parms
)
{
if
(
n
->
is_Mach
()
&&
n
->
req
()
>
TypeFunc
::
Parms
&&
(
n
->
as_Mach
()
->
ideal_Opcode
()
==
Op_MemBarAcquire
||
n
->
as_Mach
()
->
ideal_Opcode
()
==
Op_MemBarVolatile
)
)
{
// MemBarAcquire could be created without Precedent edge.
// del_req() replaces the specified edge with the last input edge
// and then removes the last edge. If the specified edge > number of
...
...
src/share/vm/opto/macro.cpp
浏览文件 @
ad1d0faf
...
...
@@ -316,6 +316,21 @@ static Node *scan_mem_chain(Node *mem, int alias_idx, int offset, Node *start_me
assert
(
adr_idx
==
Compile
::
AliasIdxRaw
,
"address must match or be raw"
);
}
mem
=
mem
->
in
(
MemNode
::
Memory
);
}
else
if
(
mem
->
is_ClearArray
())
{
if
(
!
ClearArrayNode
::
step_through
(
&
mem
,
alloc
->
_idx
,
phase
))
{
// Can not bypass initialization of the instance
// we are looking.
debug_only
(
intptr_t
offset
;)
assert
(
alloc
==
AllocateNode
::
Ideal_allocation
(
mem
->
in
(
3
),
phase
,
offset
),
"sanity"
);
InitializeNode
*
init
=
alloc
->
as_Allocate
()
->
initialization
();
// We are looking for stored value, return Initialize node
// or memory edge from Allocate node.
if
(
init
!=
NULL
)
return
init
;
else
return
alloc
->
in
(
TypeFunc
::
Memory
);
// It will produce zero value (see callers).
}
// Otherwise skip it (the call updated 'mem' value).
}
else
if
(
mem
->
Opcode
()
==
Op_SCMemProj
)
{
assert
(
mem
->
in
(
0
)
->
is_LoadStore
(),
"sanity"
);
const
TypePtr
*
atype
=
mem
->
in
(
0
)
->
in
(
MemNode
::
Address
)
->
bottom_type
()
->
is_ptr
();
...
...
@@ -823,6 +838,18 @@ void PhaseMacroExpand::process_users_of_allocation(AllocateNode *alloc) {
Node
*
n
=
use
->
last_out
(
k
);
uint
oc2
=
use
->
outcnt
();
if
(
n
->
is_Store
())
{
#ifdef ASSERT
// Verify that there is no dependent MemBarVolatile nodes,
// they should be removed during IGVN, see MemBarNode::Ideal().
for
(
DUIterator_Fast
pmax
,
p
=
n
->
fast_outs
(
pmax
);
p
<
pmax
;
p
++
)
{
Node
*
mb
=
n
->
fast_out
(
p
);
assert
(
mb
->
is_Initialize
()
||
!
mb
->
is_MemBar
()
||
mb
->
req
()
<=
MemBarNode
::
Precedent
||
mb
->
in
(
MemBarNode
::
Precedent
)
!=
n
,
"MemBarVolatile should be eliminated for non-escaping object"
);
}
#endif
_igvn
.
replace_node
(
n
,
n
->
in
(
MemNode
::
Memory
));
}
else
{
eliminate_card_mark
(
n
);
...
...
src/share/vm/opto/memnode.cpp
浏览文件 @
ad1d0faf
...
...
@@ -123,6 +123,13 @@ Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr,
}
else
{
assert
(
false
,
"unexpected projection"
);
}
}
else
if
(
result
->
is_ClearArray
())
{
if
(
!
ClearArrayNode
::
step_through
(
&
result
,
instance_id
,
phase
))
{
// Can not bypass initialization of the instance
// we are looking for.
break
;
}
// Otherwise skip it (the call updated 'result' value).
}
else
if
(
result
->
is_MergeMem
())
{
result
=
step_through_mergemem
(
phase
,
result
->
as_MergeMem
(),
t_adr
,
NULL
,
tty
);
}
...
...
@@ -537,6 +544,15 @@ Node* MemNode::find_previous_store(PhaseTransform* phase) {
}
else
if
(
mem
->
is_Proj
()
&&
mem
->
in
(
0
)
->
is_MemBar
())
{
mem
=
mem
->
in
(
0
)
->
in
(
TypeFunc
::
Memory
);
continue
;
// (a) advance through independent MemBar memory
}
else
if
(
mem
->
is_ClearArray
())
{
if
(
ClearArrayNode
::
step_through
(
&
mem
,
(
uint
)
addr_t
->
instance_id
(),
phase
))
{
// (the call updated 'mem' value)
continue
;
// (a) advance through independent allocation memory
}
else
{
// Can not bypass initialization of the instance
// we are looking for.
return
mem
;
}
}
else
if
(
mem
->
is_MergeMem
())
{
int
alias_idx
=
phase
->
C
->
get_alias_index
(
adr_type
());
mem
=
mem
->
as_MergeMem
()
->
memory_at
(
alias_idx
);
...
...
@@ -2454,6 +2470,31 @@ Node *ClearArrayNode::Ideal(PhaseGVN *phase, bool can_reshape){
return
mem
;
}
//----------------------------step_through----------------------------------
// Return allocation input memory edge if it is different instance
// or itself if it is the one we are looking for.
bool
ClearArrayNode
::
step_through
(
Node
**
np
,
uint
instance_id
,
PhaseTransform
*
phase
)
{
Node
*
n
=
*
np
;
assert
(
n
->
is_ClearArray
(),
"sanity"
);
intptr_t
offset
;
AllocateNode
*
alloc
=
AllocateNode
::
Ideal_allocation
(
n
->
in
(
3
),
phase
,
offset
);
// This method is called only before Allocate nodes are expanded during
// macro nodes expansion. Before that ClearArray nodes are only generated
// in LibraryCallKit::generate_arraycopy() which follows allocations.
assert
(
alloc
!=
NULL
,
"should have allocation"
);
if
(
alloc
->
_idx
==
instance_id
)
{
// Can not bypass initialization of the instance we are looking for.
return
false
;
}
// Otherwise skip it.
InitializeNode
*
init
=
alloc
->
initialization
();
if
(
init
!=
NULL
)
*
np
=
init
->
in
(
TypeFunc
::
Memory
);
else
*
np
=
alloc
->
in
(
TypeFunc
::
Memory
);
return
true
;
}
//----------------------------clear_memory-------------------------------------
// Generate code to initialize object storage to zero.
Node
*
ClearArrayNode
::
clear_memory
(
Node
*
ctl
,
Node
*
mem
,
Node
*
dest
,
...
...
@@ -2627,7 +2668,30 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) {
// Return a node which is more "ideal" than the current node. Strip out
// control copies
Node
*
MemBarNode
::
Ideal
(
PhaseGVN
*
phase
,
bool
can_reshape
)
{
return
remove_dead_region
(
phase
,
can_reshape
)
?
this
:
NULL
;
if
(
remove_dead_region
(
phase
,
can_reshape
))
return
this
;
// Eliminate volatile MemBars for scalar replaced objects.
if
(
can_reshape
&&
req
()
==
(
Precedent
+
1
)
&&
(
Opcode
()
==
Op_MemBarAcquire
||
Opcode
()
==
Op_MemBarVolatile
))
{
// Volatile field loads and stores.
Node
*
my_mem
=
in
(
MemBarNode
::
Precedent
);
if
(
my_mem
!=
NULL
&&
my_mem
->
is_Mem
())
{
const
TypeOopPtr
*
t_oop
=
my_mem
->
in
(
MemNode
::
Address
)
->
bottom_type
()
->
isa_oopptr
();
// Check for scalar replaced object reference.
if
(
t_oop
!=
NULL
&&
t_oop
->
is_known_instance_field
()
&&
t_oop
->
offset
()
!=
Type
::
OffsetBot
&&
t_oop
->
offset
()
!=
Type
::
OffsetTop
)
{
// Replace MemBar projections by its inputs.
PhaseIterGVN
*
igvn
=
phase
->
is_IterGVN
();
igvn
->
replace_node
(
proj_out
(
TypeFunc
::
Memory
),
in
(
TypeFunc
::
Memory
));
igvn
->
replace_node
(
proj_out
(
TypeFunc
::
Control
),
in
(
TypeFunc
::
Control
));
// Must return either the original node (now dead) or a new node
// (Do not return a top here, since that would break the uniqueness of top.)
return
new
(
phase
->
C
,
1
)
ConINode
(
TypeInt
::
ZERO
);
}
}
}
return
NULL
;
}
//------------------------------Value------------------------------------------
...
...
src/share/vm/opto/memnode.hpp
浏览文件 @
ad1d0faf
...
...
@@ -717,7 +717,10 @@ public:
//------------------------------ClearArray-------------------------------------
class
ClearArrayNode
:
public
Node
{
public:
ClearArrayNode
(
Node
*
ctrl
,
Node
*
arymem
,
Node
*
word_cnt
,
Node
*
base
)
:
Node
(
ctrl
,
arymem
,
word_cnt
,
base
)
{}
ClearArrayNode
(
Node
*
ctrl
,
Node
*
arymem
,
Node
*
word_cnt
,
Node
*
base
)
:
Node
(
ctrl
,
arymem
,
word_cnt
,
base
)
{
init_class_id
(
Class_ClearArray
);
}
virtual
int
Opcode
()
const
;
virtual
const
Type
*
bottom_type
()
const
{
return
Type
::
MEMORY
;
}
// ClearArray modifies array elements, and so affects only the
...
...
@@ -743,6 +746,9 @@ public:
Node
*
start_offset
,
Node
*
end_offset
,
PhaseGVN
*
phase
);
// Return allocation input memory edge if it is different instance
// or itself if it is the one we are looking for.
static
bool
step_through
(
Node
**
np
,
uint
instance_id
,
PhaseTransform
*
phase
);
};
//------------------------------StrComp-------------------------------------
...
...
src/share/vm/opto/node.hpp
浏览文件 @
ad1d0faf
...
...
@@ -47,6 +47,7 @@ class CallStaticJavaNode;
class
CatchNode
;
class
CatchProjNode
;
class
CheckCastPPNode
;
class
ClearArrayNode
;
class
CmpNode
;
class
CodeBuffer
;
class
ConstraintCastNode
;
...
...
@@ -599,8 +600,9 @@ public:
DEFINE_CLASS_ID
(
BoxLock
,
Node
,
10
)
DEFINE_CLASS_ID
(
Add
,
Node
,
11
)
DEFINE_CLASS_ID
(
Mul
,
Node
,
12
)
DEFINE_CLASS_ID
(
ClearArray
,
Node
,
13
)
_max_classes
=
ClassMask_
Mul
_max_classes
=
ClassMask_
ClearArray
};
#undef DEFINE_CLASS_ID
...
...
@@ -698,6 +700,7 @@ public:
DEFINE_CLASS_QUERY
(
CatchProj
)
DEFINE_CLASS_QUERY
(
CheckCastPP
)
DEFINE_CLASS_QUERY
(
ConstraintCast
)
DEFINE_CLASS_QUERY
(
ClearArray
)
DEFINE_CLASS_QUERY
(
CMove
)
DEFINE_CLASS_QUERY
(
Cmp
)
DEFINE_CLASS_QUERY
(
CountedLoop
)
...
...
src/share/vm/opto/parse3.cpp
浏览文件 @
ad1d0faf
...
...
@@ -240,19 +240,19 @@ void Parse::do_put_xxx(const TypePtr* obj_type, Node* obj, ciField* field, bool
// membar is dependent on the store, keeping any other membars generated
// below from floating up past the store.
int
adr_idx
=
C
->
get_alias_index
(
adr_type
);
insert_mem_bar_volatile
(
Op_MemBarVolatile
,
adr_idx
);
insert_mem_bar_volatile
(
Op_MemBarVolatile
,
adr_idx
,
store
);
// Now place a membar for AliasIdxBot for the unknown yet-to-be-parsed
// volatile alias indices. Skip this if the membar is redundant.
if
(
adr_idx
!=
Compile
::
AliasIdxBot
)
{
insert_mem_bar_volatile
(
Op_MemBarVolatile
,
Compile
::
AliasIdxBot
);
insert_mem_bar_volatile
(
Op_MemBarVolatile
,
Compile
::
AliasIdxBot
,
store
);
}
// Finally, place alias-index-specific membars for each volatile index
// that isn't the adr_idx membar. Typically there's only 1 or 2.
for
(
int
i
=
Compile
::
AliasIdxRaw
;
i
<
C
->
num_alias_types
();
i
++
)
{
if
(
i
!=
adr_idx
&&
C
->
alias_type
(
i
)
->
is_volatile
())
{
insert_mem_bar_volatile
(
Op_MemBarVolatile
,
i
);
insert_mem_bar_volatile
(
Op_MemBarVolatile
,
i
,
store
);
}
}
}
...
...
test/compiler/6895383/Test.java
0 → 100644
浏览文件 @
ad1d0faf
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
/**
* @test
* @bug 6895383
* @summary JCK test throws NPE for method compiled with Escape Analysis
*
* @run main/othervm -Xcomp Test
*/
public
class
Test
{
public
static
void
main
(
String
argv
[])
{
Test
test
=
new
Test
();
test
.
testRemove1_IndexOutOfBounds
();
test
.
testAddAll1_IndexOutOfBoundsException
();
}
public
void
testRemove1_IndexOutOfBounds
()
{
CopyOnWriteArrayList
c
=
new
CopyOnWriteArrayList
();
}
public
void
testAddAll1_IndexOutOfBoundsException
()
{
try
{
CopyOnWriteArrayList
c
=
new
CopyOnWriteArrayList
();
c
.
addAll
(-
1
,
new
LinkedList
());
// should throw IndexOutOfBoundsException
}
catch
(
IndexOutOfBoundsException
e
)
{
}
}
}
test/compiler/6896727/Test.java
0 → 100644
浏览文件 @
ad1d0faf
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
/*
* @test
* @bug 6896727
* @summary nsk/logging/LoggingPermission/LoggingPermission/logperm002 fails with G1, EscapeAnalisys w/o COOPs
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+DoEscapeAnalysis -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC Test
*/
public
class
Test
{
final
static
String
testString
=
"abracadabra"
;
public
static
void
main
(
String
args
[])
{
String
params
[][]
=
{
{
"control"
,
testString
}
};
for
(
int
i
=
0
;
i
<
params
.
length
;
i
++)
{
try
{
System
.
out
.
println
(
"Params :"
+
testString
+
" and "
+
params
[
i
][
0
]
+
", "
+
params
[
i
][
1
]);
if
(
params
[
i
][
1
]
==
null
)
{
System
.
exit
(
97
);
}
}
catch
(
Exception
e
)
{}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录