Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
2d168ed3
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看板
提交
2d168ed3
编写于
10月 31, 2014
作者:
A
anoll
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
fffcec15
4a9cbe77
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
142 addition
and
68 deletion
+142
-68
src/share/vm/memory/collectorPolicy.cpp
src/share/vm/memory/collectorPolicy.cpp
+3
-7
src/share/vm/memory/metaspace.cpp
src/share/vm/memory/metaspace.cpp
+10
-0
src/share/vm/memory/metaspaceShared.hpp
src/share/vm/memory/metaspaceShared.hpp
+10
-5
src/share/vm/opto/c2_globals.hpp
src/share/vm/opto/c2_globals.hpp
+3
-0
src/share/vm/opto/escape.cpp
src/share/vm/opto/escape.cpp
+52
-22
src/share/vm/opto/escape.hpp
src/share/vm/opto/escape.hpp
+51
-27
src/share/vm/utilities/debug.cpp
src/share/vm/utilities/debug.cpp
+5
-3
src/share/vm/utilities/debug.hpp
src/share/vm/utilities/debug.hpp
+2
-1
test/runtime/SharedArchiveFile/LimitSharedSizes.java
test/runtime/SharedArchiveFile/LimitSharedSizes.java
+6
-3
未找到文件。
src/share/vm/memory/collectorPolicy.cpp
浏览文件 @
2d168ed3
...
@@ -183,13 +183,9 @@ size_t CollectorPolicy::compute_heap_alignment() {
...
@@ -183,13 +183,9 @@ size_t CollectorPolicy::compute_heap_alignment() {
// Requirements of any new remembered set implementations must be added here.
// Requirements of any new remembered set implementations must be added here.
size_t
alignment
=
GenRemSet
::
max_alignment_constraint
(
GenRemSet
::
CardTable
);
size_t
alignment
=
GenRemSet
::
max_alignment_constraint
(
GenRemSet
::
CardTable
);
// Parallel GC does its own alignment of the generations to avoid requiring a
if
(
UseLargePages
)
{
// large page (256M on some platforms) for the permanent generation. The
// In presence of large pages we have to make sure that our
// other collectors should also be updated to do their own alignment and then
// alignment is large page aware.
// this use of lcm() should be removed.
if
(
UseLargePages
&&
!
UseParallelGC
)
{
// in presence of large pages we have to make sure that our
// alignment is large page aware
alignment
=
lcm
(
os
::
large_page_size
(),
alignment
);
alignment
=
lcm
(
os
::
large_page_size
(),
alignment
);
}
}
...
...
src/share/vm/memory/metaspace.cpp
浏览文件 @
2d168ed3
...
@@ -3155,6 +3155,16 @@ void Metaspace::global_initialize() {
...
@@ -3155,6 +3155,16 @@ void Metaspace::global_initialize() {
SharedMiscDataSize
=
align_size_up
(
SharedMiscDataSize
,
max_alignment
);
SharedMiscDataSize
=
align_size_up
(
SharedMiscDataSize
,
max_alignment
);
SharedMiscCodeSize
=
align_size_up
(
SharedMiscCodeSize
,
max_alignment
);
SharedMiscCodeSize
=
align_size_up
(
SharedMiscCodeSize
,
max_alignment
);
// the min_misc_code_size estimate is based on MetaspaceShared::generate_vtable_methods()
uintx
min_misc_code_size
=
align_size_up
(
(
MetaspaceShared
::
num_virtuals
*
MetaspaceShared
::
vtbl_list_size
)
*
(
sizeof
(
void
*
)
+
MetaspaceShared
::
vtbl_method_size
)
+
MetaspaceShared
::
vtbl_common_code_size
,
max_alignment
);
if
(
SharedMiscCodeSize
<
min_misc_code_size
)
{
report_out_of_shared_space
(
SharedMiscCode
);
}
// Initialize with the sum of the shared space sizes. The read-only
// Initialize with the sum of the shared space sizes. The read-only
// and read write metaspace chunks will be allocated out of this and the
// and read write metaspace chunks will be allocated out of this and the
// remainder is the misc code and data chunks.
// remainder is the misc code and data chunks.
...
...
src/share/vm/memory/metaspaceShared.hpp
浏览文件 @
2d168ed3
...
@@ -57,11 +57,16 @@ class MetaspaceShared : AllStatic {
...
@@ -57,11 +57,16 @@ class MetaspaceShared : AllStatic {
static
bool
_archive_loading_failed
;
static
bool
_archive_loading_failed
;
public:
public:
enum
{
enum
{
vtbl_list_size
=
17
,
// number of entries in the shared space vtable list.
vtbl_list_size
=
17
,
// number of entries in the shared space vtable list.
num_virtuals
=
200
// maximum number of virtual functions
num_virtuals
=
200
,
// maximum number of virtual functions
// If virtual functions are added to Metadata,
// If virtual functions are added to Metadata,
// this number needs to be increased. Also,
// this number needs to be increased. Also,
// SharedMiscCodeSize will need to be increased.
// SharedMiscCodeSize will need to be increased.
// The following 2 sizes were based on
// MetaspaceShared::generate_vtable_methods()
vtbl_method_size
=
16
,
// conservative size of the mov1 and jmp instructions
// for the x64 platform
vtbl_common_code_size
=
(
1
*
K
)
// conservative size of the "common_code" for the x64 platform
};
};
enum
{
enum
{
...
...
src/share/vm/opto/c2_globals.hpp
浏览文件 @
2d168ed3
...
@@ -473,6 +473,9 @@
...
@@ -473,6 +473,9 @@
product(bool, DoEscapeAnalysis, true, \
product(bool, DoEscapeAnalysis, true, \
"Perform escape analysis") \
"Perform escape analysis") \
\
\
product(double, EscapeAnalysisTimeout, 20. DEBUG_ONLY(+40.), \
"Abort EA when it reaches time limit (in sec)") \
\
develop(bool, ExitEscapeAnalysisOnTimeout, true, \
develop(bool, ExitEscapeAnalysisOnTimeout, true, \
"Exit or throw assert in EA when it reaches time limit") \
"Exit or throw assert in EA when it reaches time limit") \
\
\
...
...
src/share/vm/opto/escape.cpp
浏览文件 @
2d168ed3
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
ConnectionGraph
::
ConnectionGraph
(
Compile
*
C
,
PhaseIterGVN
*
igvn
)
:
ConnectionGraph
::
ConnectionGraph
(
Compile
*
C
,
PhaseIterGVN
*
igvn
)
:
_nodes
(
C
->
comp_arena
(),
C
->
unique
(),
C
->
unique
(),
NULL
),
_nodes
(
C
->
comp_arena
(),
C
->
unique
(),
C
->
unique
(),
NULL
),
_in_worklist
(
C
->
comp_arena
()),
_next_pidx
(
0
),
_collecting
(
true
),
_collecting
(
true
),
_verify
(
false
),
_verify
(
false
),
_compile
(
C
),
_compile
(
C
),
...
@@ -124,13 +126,19 @@ bool ConnectionGraph::compute_escape() {
...
@@ -124,13 +126,19 @@ bool ConnectionGraph::compute_escape() {
if
(
C
->
root
()
!=
NULL
)
{
if
(
C
->
root
()
!=
NULL
)
{
ideal_nodes
.
push
(
C
->
root
());
ideal_nodes
.
push
(
C
->
root
());
}
}
// Processed ideal nodes are unique on ideal_nodes list
// but several ideal nodes are mapped to the phantom_obj.
// To avoid duplicated entries on the following worklists
// add the phantom_obj only once to them.
ptnodes_worklist
.
append
(
phantom_obj
);
java_objects_worklist
.
append
(
phantom_obj
);
for
(
uint
next
=
0
;
next
<
ideal_nodes
.
size
();
++
next
)
{
for
(
uint
next
=
0
;
next
<
ideal_nodes
.
size
();
++
next
)
{
Node
*
n
=
ideal_nodes
.
at
(
next
);
Node
*
n
=
ideal_nodes
.
at
(
next
);
// Create PointsTo nodes and add them to Connection Graph. Called
// Create PointsTo nodes and add them to Connection Graph. Called
// only once per ideal node since ideal_nodes is Unique_Node list.
// only once per ideal node since ideal_nodes is Unique_Node list.
add_node_to_connection_graph
(
n
,
&
delayed_worklist
);
add_node_to_connection_graph
(
n
,
&
delayed_worklist
);
PointsToNode
*
ptn
=
ptnode_adr
(
n
->
_idx
);
PointsToNode
*
ptn
=
ptnode_adr
(
n
->
_idx
);
if
(
ptn
!=
NULL
)
{
if
(
ptn
!=
NULL
&&
ptn
!=
phantom_obj
)
{
ptnodes_worklist
.
append
(
ptn
);
ptnodes_worklist
.
append
(
ptn
);
if
(
ptn
->
is_JavaObject
())
{
if
(
ptn
->
is_JavaObject
())
{
java_objects_worklist
.
append
(
ptn
->
as_JavaObject
());
java_objects_worklist
.
append
(
ptn
->
as_JavaObject
());
...
@@ -414,7 +422,7 @@ void ConnectionGraph::add_node_to_connection_graph(Node *n, Unique_Node_List *de
...
@@ -414,7 +422,7 @@ void ConnectionGraph::add_node_to_connection_graph(Node *n, Unique_Node_List *de
}
}
case
Op_CreateEx
:
{
case
Op_CreateEx
:
{
// assume that all exception objects globally escape
// assume that all exception objects globally escape
add_java_object
(
n
,
PointsToNode
::
GlobalEscape
);
map_ideal_node
(
n
,
phantom_obj
);
break
;
break
;
}
}
case
Op_LoadKlass
:
case
Op_LoadKlass
:
...
@@ -1065,13 +1073,8 @@ bool ConnectionGraph::complete_connection_graph(
...
@@ -1065,13 +1073,8 @@ bool ConnectionGraph::complete_connection_graph(
// on graph complexity. Observed 8 passes in jvm2008 compiler.compiler.
// on graph complexity. Observed 8 passes in jvm2008 compiler.compiler.
// Set limit to 20 to catch situation when something did go wrong and
// Set limit to 20 to catch situation when something did go wrong and
// bailout Escape Analysis.
// bailout Escape Analysis.
// Also limit build time to
30 sec (60 in debug VM)
.
// Also limit build time to
20 sec (60 in debug VM), EscapeAnalysisTimeout flag
.
#define CG_BUILD_ITER_LIMIT 20
#define CG_BUILD_ITER_LIMIT 20
#ifdef ASSERT
#define CG_BUILD_TIME_LIMIT 60.0
#else
#define CG_BUILD_TIME_LIMIT 30.0
#endif
// Propagate GlobalEscape and ArgEscape escape states and check that
// Propagate GlobalEscape and ArgEscape escape states and check that
// we still have non-escaping objects. The method pushs on _worklist
// we still have non-escaping objects. The method pushs on _worklist
...
@@ -1082,12 +1085,13 @@ bool ConnectionGraph::complete_connection_graph(
...
@@ -1082,12 +1085,13 @@ bool ConnectionGraph::complete_connection_graph(
// Now propagate references to all JavaObject nodes.
// Now propagate references to all JavaObject nodes.
int
java_objects_length
=
java_objects_worklist
.
length
();
int
java_objects_length
=
java_objects_worklist
.
length
();
elapsedTimer
time
;
elapsedTimer
time
;
bool
timeout
=
false
;
int
new_edges
=
1
;
int
new_edges
=
1
;
int
iterations
=
0
;
int
iterations
=
0
;
do
{
do
{
while
((
new_edges
>
0
)
&&
while
((
new_edges
>
0
)
&&
(
iterations
++
<
CG_BUILD_ITER_LIMIT
)
&&
(
iterations
++
<
CG_BUILD_ITER_LIMIT
))
{
(
time
.
seconds
()
<
CG_BUILD_TIME_LIMIT
))
{
double
start_time
=
time
.
seconds
();
time
.
start
();
time
.
start
();
new_edges
=
0
;
new_edges
=
0
;
// Propagate references to phantom_object for nodes pushed on _worklist
// Propagate references to phantom_object for nodes pushed on _worklist
...
@@ -1096,7 +1100,26 @@ bool ConnectionGraph::complete_connection_graph(
...
@@ -1096,7 +1100,26 @@ bool ConnectionGraph::complete_connection_graph(
for
(
int
next
=
0
;
next
<
java_objects_length
;
++
next
)
{
for
(
int
next
=
0
;
next
<
java_objects_length
;
++
next
)
{
JavaObjectNode
*
ptn
=
java_objects_worklist
.
at
(
next
);
JavaObjectNode
*
ptn
=
java_objects_worklist
.
at
(
next
);
new_edges
+=
add_java_object_edges
(
ptn
,
true
);
new_edges
+=
add_java_object_edges
(
ptn
,
true
);
#define SAMPLE_SIZE 4
if
((
next
%
SAMPLE_SIZE
)
==
0
)
{
// Each 4 iterations calculate how much time it will take
// to complete graph construction.
time
.
stop
();
double
stop_time
=
time
.
seconds
();
double
time_per_iter
=
(
stop_time
-
start_time
)
/
(
double
)
SAMPLE_SIZE
;
double
time_until_end
=
time_per_iter
*
(
double
)(
java_objects_length
-
next
);
if
((
start_time
+
time_until_end
)
>=
EscapeAnalysisTimeout
)
{
timeout
=
true
;
break
;
// Timeout
}
start_time
=
stop_time
;
time
.
start
();
}
#undef SAMPLE_SIZE
}
}
if
(
timeout
)
break
;
if
(
new_edges
>
0
)
{
if
(
new_edges
>
0
)
{
// Update escape states on each iteration if graph was updated.
// Update escape states on each iteration if graph was updated.
if
(
!
find_non_escaped_objects
(
ptnodes_worklist
,
non_escaped_worklist
))
{
if
(
!
find_non_escaped_objects
(
ptnodes_worklist
,
non_escaped_worklist
))
{
...
@@ -1104,9 +1127,12 @@ bool ConnectionGraph::complete_connection_graph(
...
@@ -1104,9 +1127,12 @@ bool ConnectionGraph::complete_connection_graph(
}
}
}
}
time
.
stop
();
time
.
stop
();
if
(
time
.
seconds
()
>=
EscapeAnalysisTimeout
)
{
timeout
=
true
;
break
;
}
}
}
if
((
iterations
<
CG_BUILD_ITER_LIMIT
)
&&
if
((
iterations
<
CG_BUILD_ITER_LIMIT
)
&&
!
timeout
)
{
(
time
.
seconds
()
<
CG_BUILD_TIME_LIMIT
))
{
time
.
start
();
time
.
start
();
// Find fields which have unknown value.
// Find fields which have unknown value.
int
fields_length
=
oop_fields_worklist
.
length
();
int
fields_length
=
oop_fields_worklist
.
length
();
...
@@ -1119,18 +1145,21 @@ bool ConnectionGraph::complete_connection_graph(
...
@@ -1119,18 +1145,21 @@ bool ConnectionGraph::complete_connection_graph(
}
}
}
}
time
.
stop
();
time
.
stop
();
if
(
time
.
seconds
()
>=
EscapeAnalysisTimeout
)
{
timeout
=
true
;
break
;
}
}
else
{
}
else
{
new_edges
=
0
;
// Bailout
new_edges
=
0
;
// Bailout
}
}
}
while
(
new_edges
>
0
);
}
while
(
new_edges
>
0
);
// Bailout if passed limits.
// Bailout if passed limits.
if
((
iterations
>=
CG_BUILD_ITER_LIMIT
)
||
if
((
iterations
>=
CG_BUILD_ITER_LIMIT
)
||
timeout
)
{
(
time
.
seconds
()
>=
CG_BUILD_TIME_LIMIT
))
{
Compile
*
C
=
_compile
;
Compile
*
C
=
_compile
;
if
(
C
->
log
()
!=
NULL
)
{
if
(
C
->
log
()
!=
NULL
)
{
C
->
log
()
->
begin_elem
(
"connectionGraph_bailout reason='reached "
);
C
->
log
()
->
begin_elem
(
"connectionGraph_bailout reason='reached "
);
C
->
log
()
->
text
(
"%s"
,
(
iterations
>=
CG_BUILD_ITER_LIMIT
)
?
"iterations"
:
"time
"
);
C
->
log
()
->
text
(
"%s"
,
timeout
?
"time"
:
"iterations
"
);
C
->
log
()
->
end_elem
(
" limit'"
);
C
->
log
()
->
end_elem
(
" limit'"
);
}
}
assert
(
ExitEscapeAnalysisOnTimeout
,
err_msg_res
(
"infinite EA connection graph build (%f sec, %d iterations) with %d nodes and worklist size %d"
,
assert
(
ExitEscapeAnalysisOnTimeout
,
err_msg_res
(
"infinite EA connection graph build (%f sec, %d iterations) with %d nodes and worklist size %d"
,
...
@@ -1147,7 +1176,6 @@ bool ConnectionGraph::complete_connection_graph(
...
@@ -1147,7 +1176,6 @@ bool ConnectionGraph::complete_connection_graph(
#endif
#endif
#undef CG_BUILD_ITER_LIMIT
#undef CG_BUILD_ITER_LIMIT
#undef CG_BUILD_TIME_LIMIT
// Find fields initialized by NULL for non-escaping Allocations.
// Find fields initialized by NULL for non-escaping Allocations.
int
non_escaped_length
=
non_escaped_worklist
.
length
();
int
non_escaped_length
=
non_escaped_worklist
.
length
();
...
@@ -1271,8 +1299,8 @@ int ConnectionGraph::add_java_object_edges(JavaObjectNode* jobj, bool populate_w
...
@@ -1271,8 +1299,8 @@ int ConnectionGraph::add_java_object_edges(JavaObjectNode* jobj, bool populate_w
}
}
}
}
}
}
while
(
_worklist
.
length
()
>
0
)
{
for
(
int
l
=
0
;
l
<
_worklist
.
length
();
l
++
)
{
PointsToNode
*
use
=
_worklist
.
pop
(
);
PointsToNode
*
use
=
_worklist
.
at
(
l
);
if
(
PointsToNode
::
is_base_use
(
use
))
{
if
(
PointsToNode
::
is_base_use
(
use
))
{
// Add reference from jobj to field and from field to jobj (field's base).
// Add reference from jobj to field and from field to jobj (field's base).
use
=
PointsToNode
::
get_use_node
(
use
)
->
as_Field
();
use
=
PointsToNode
::
get_use_node
(
use
)
->
as_Field
();
...
@@ -1319,6 +1347,8 @@ int ConnectionGraph::add_java_object_edges(JavaObjectNode* jobj, bool populate_w
...
@@ -1319,6 +1347,8 @@ int ConnectionGraph::add_java_object_edges(JavaObjectNode* jobj, bool populate_w
add_field_uses_to_worklist
(
use
->
as_Field
());
add_field_uses_to_worklist
(
use
->
as_Field
());
}
}
}
}
_worklist
.
clear
();
_in_worklist
.
Reset
();
return
new_edges
;
return
new_edges
;
}
}
...
@@ -1898,7 +1928,7 @@ void ConnectionGraph::add_local_var(Node *n, PointsToNode::EscapeState es) {
...
@@ -1898,7 +1928,7 @@ void ConnectionGraph::add_local_var(Node *n, PointsToNode::EscapeState es) {
return
;
return
;
}
}
Compile
*
C
=
_compile
;
Compile
*
C
=
_compile
;
ptadr
=
new
(
C
->
comp_arena
())
LocalVarNode
(
C
,
n
,
es
);
ptadr
=
new
(
C
->
comp_arena
())
LocalVarNode
(
this
,
n
,
es
);
_nodes
.
at_put
(
n
->
_idx
,
ptadr
);
_nodes
.
at_put
(
n
->
_idx
,
ptadr
);
}
}
...
@@ -1909,7 +1939,7 @@ void ConnectionGraph::add_java_object(Node *n, PointsToNode::EscapeState es) {
...
@@ -1909,7 +1939,7 @@ void ConnectionGraph::add_java_object(Node *n, PointsToNode::EscapeState es) {
return
;
return
;
}
}
Compile
*
C
=
_compile
;
Compile
*
C
=
_compile
;
ptadr
=
new
(
C
->
comp_arena
())
JavaObjectNode
(
C
,
n
,
es
);
ptadr
=
new
(
C
->
comp_arena
())
JavaObjectNode
(
this
,
n
,
es
);
_nodes
.
at_put
(
n
->
_idx
,
ptadr
);
_nodes
.
at_put
(
n
->
_idx
,
ptadr
);
}
}
...
@@ -1925,7 +1955,7 @@ void ConnectionGraph::add_field(Node *n, PointsToNode::EscapeState es, int offse
...
@@ -1925,7 +1955,7 @@ void ConnectionGraph::add_field(Node *n, PointsToNode::EscapeState es, int offse
es
=
PointsToNode
::
GlobalEscape
;
es
=
PointsToNode
::
GlobalEscape
;
}
}
Compile
*
C
=
_compile
;
Compile
*
C
=
_compile
;
FieldNode
*
field
=
new
(
C
->
comp_arena
())
FieldNode
(
C
,
n
,
es
,
offset
,
is_oop
);
FieldNode
*
field
=
new
(
C
->
comp_arena
())
FieldNode
(
this
,
n
,
es
,
offset
,
is_oop
);
_nodes
.
at_put
(
n
->
_idx
,
field
);
_nodes
.
at_put
(
n
->
_idx
,
field
);
}
}
...
@@ -1939,7 +1969,7 @@ void ConnectionGraph::add_arraycopy(Node *n, PointsToNode::EscapeState es,
...
@@ -1939,7 +1969,7 @@ void ConnectionGraph::add_arraycopy(Node *n, PointsToNode::EscapeState es,
return
;
return
;
}
}
Compile
*
C
=
_compile
;
Compile
*
C
=
_compile
;
ptadr
=
new
(
C
->
comp_arena
())
ArraycopyNode
(
C
,
n
,
es
);
ptadr
=
new
(
C
->
comp_arena
())
ArraycopyNode
(
this
,
n
,
es
);
_nodes
.
at_put
(
n
->
_idx
,
ptadr
);
_nodes
.
at_put
(
n
->
_idx
,
ptadr
);
// Add edge from arraycopy node to source object.
// Add edge from arraycopy node to source object.
(
void
)
add_edge
(
ptadr
,
src
);
(
void
)
add_edge
(
ptadr
,
src
);
...
...
src/share/vm/opto/escape.hpp
浏览文件 @
2d168ed3
...
@@ -125,6 +125,8 @@ class LocalVarNode;
...
@@ -125,6 +125,8 @@ class LocalVarNode;
class
FieldNode
;
class
FieldNode
;
class
ArraycopyNode
;
class
ArraycopyNode
;
class
ConnectionGraph
;
// ConnectionGraph nodes
// ConnectionGraph nodes
class
PointsToNode
:
public
ResourceObj
{
class
PointsToNode
:
public
ResourceObj
{
GrowableArray
<
PointsToNode
*>
_edges
;
// List of nodes this node points to
GrowableArray
<
PointsToNode
*>
_edges
;
// List of nodes this node points to
...
@@ -137,6 +139,7 @@ class PointsToNode : public ResourceObj {
...
@@ -137,6 +139,7 @@ class PointsToNode : public ResourceObj {
Node
*
const
_node
;
// Ideal node corresponding to this PointsTo node.
Node
*
const
_node
;
// Ideal node corresponding to this PointsTo node.
const
int
_idx
;
// Cached ideal node's _idx
const
int
_idx
;
// Cached ideal node's _idx
const
uint
_pidx
;
// Index of this node
public:
public:
typedef
enum
{
typedef
enum
{
...
@@ -165,17 +168,9 @@ public:
...
@@ -165,17 +168,9 @@ public:
}
NodeFlags
;
}
NodeFlags
;
PointsToNode
(
Compile
*
C
,
Node
*
n
,
EscapeState
es
,
NodeType
type
)
:
inline
PointsToNode
(
ConnectionGraph
*
CG
,
Node
*
n
,
EscapeState
es
,
NodeType
type
);
_edges
(
C
->
comp_arena
(),
2
,
0
,
NULL
),
_uses
(
C
->
comp_arena
(),
2
,
0
,
NULL
),
uint
pidx
()
const
{
return
_pidx
;
}
_node
(
n
),
_idx
(
n
->
_idx
),
_type
((
u1
)
type
),
_escape
((
u1
)
es
),
_fields_escape
((
u1
)
es
),
_flags
(
ScalarReplaceable
)
{
assert
(
n
!=
NULL
&&
es
!=
UnknownEscape
,
"sanity"
);
}
Node
*
ideal_node
()
const
{
return
_node
;
}
Node
*
ideal_node
()
const
{
return
_node
;
}
int
idx
()
const
{
return
_idx
;
}
int
idx
()
const
{
return
_idx
;
}
...
@@ -243,14 +238,14 @@ public:
...
@@ -243,14 +238,14 @@ public:
class
LocalVarNode
:
public
PointsToNode
{
class
LocalVarNode
:
public
PointsToNode
{
public:
public:
LocalVarNode
(
Co
mpile
*
C
,
Node
*
n
,
EscapeState
es
)
:
LocalVarNode
(
Co
nnectionGraph
*
CG
,
Node
*
n
,
EscapeState
es
)
:
PointsToNode
(
C
,
n
,
es
,
LocalVar
)
{}
PointsToNode
(
C
G
,
n
,
es
,
LocalVar
)
{}
};
};
class
JavaObjectNode
:
public
PointsToNode
{
class
JavaObjectNode
:
public
PointsToNode
{
public:
public:
JavaObjectNode
(
Co
mpile
*
C
,
Node
*
n
,
EscapeState
es
)
:
JavaObjectNode
(
Co
nnectionGraph
*
CG
,
Node
*
n
,
EscapeState
es
)
:
PointsToNode
(
C
,
n
,
es
,
JavaObject
)
{
PointsToNode
(
C
G
,
n
,
es
,
JavaObject
)
{
if
(
es
>
NoEscape
)
if
(
es
>
NoEscape
)
set_scalar_replaceable
(
false
);
set_scalar_replaceable
(
false
);
}
}
...
@@ -262,8 +257,8 @@ class FieldNode: public PointsToNode {
...
@@ -262,8 +257,8 @@ class FieldNode: public PointsToNode {
const
bool
_is_oop
;
// Field points to object
const
bool
_is_oop
;
// Field points to object
bool
_has_unknown_base
;
// Has phantom_object base
bool
_has_unknown_base
;
// Has phantom_object base
public:
public:
FieldNode
(
Co
mpile
*
C
,
Node
*
n
,
EscapeState
es
,
int
offs
,
bool
is_oop
)
:
FieldNode
(
Co
nnectionGraph
*
CG
,
Node
*
n
,
EscapeState
es
,
int
offs
,
bool
is_oop
)
:
PointsToNode
(
C
,
n
,
es
,
Field
),
PointsToNode
(
C
G
,
n
,
es
,
Field
),
_offset
(
offs
),
_is_oop
(
is_oop
),
_offset
(
offs
),
_is_oop
(
is_oop
),
_has_unknown_base
(
false
)
{}
_has_unknown_base
(
false
)
{}
...
@@ -284,8 +279,8 @@ public:
...
@@ -284,8 +279,8 @@ public:
class
ArraycopyNode
:
public
PointsToNode
{
class
ArraycopyNode
:
public
PointsToNode
{
public:
public:
ArraycopyNode
(
Co
mpile
*
C
,
Node
*
n
,
EscapeState
es
)
:
ArraycopyNode
(
Co
nnectionGraph
*
CG
,
Node
*
n
,
EscapeState
es
)
:
PointsToNode
(
C
,
n
,
es
,
Arraycopy
)
{}
PointsToNode
(
C
G
,
n
,
es
,
Arraycopy
)
{}
};
};
// Iterators for PointsTo node's edges:
// Iterators for PointsTo node's edges:
...
@@ -323,11 +318,14 @@ public:
...
@@ -323,11 +318,14 @@ public:
class
ConnectionGraph
:
public
ResourceObj
{
class
ConnectionGraph
:
public
ResourceObj
{
friend
class
PointsToNode
;
private:
private:
GrowableArray
<
PointsToNode
*>
_nodes
;
// Map from ideal nodes to
GrowableArray
<
PointsToNode
*>
_nodes
;
// Map from ideal nodes to
// ConnectionGraph nodes.
// ConnectionGraph nodes.
GrowableArray
<
PointsToNode
*>
_worklist
;
// Nodes to be processed
GrowableArray
<
PointsToNode
*>
_worklist
;
// Nodes to be processed
VectorSet
_in_worklist
;
uint
_next_pidx
;
bool
_collecting
;
// Indicates whether escape information
bool
_collecting
;
// Indicates whether escape information
// is still being collected. If false,
// is still being collected. If false,
...
@@ -353,6 +351,8 @@ private:
...
@@ -353,6 +351,8 @@ private:
}
}
uint
nodes_size
()
const
{
return
_nodes
.
length
();
}
uint
nodes_size
()
const
{
return
_nodes
.
length
();
}
uint
next_pidx
()
{
return
_next_pidx
++
;
}
// Add nodes to ConnectionGraph.
// Add nodes to ConnectionGraph.
void
add_local_var
(
Node
*
n
,
PointsToNode
::
EscapeState
es
);
void
add_local_var
(
Node
*
n
,
PointsToNode
::
EscapeState
es
);
void
add_java_object
(
Node
*
n
,
PointsToNode
::
EscapeState
es
);
void
add_java_object
(
Node
*
n
,
PointsToNode
::
EscapeState
es
);
...
@@ -396,15 +396,26 @@ private:
...
@@ -396,15 +396,26 @@ private:
int
add_java_object_edges
(
JavaObjectNode
*
jobj
,
bool
populate_worklist
);
int
add_java_object_edges
(
JavaObjectNode
*
jobj
,
bool
populate_worklist
);
// Put node on worklist if it is (or was) not there.
// Put node on worklist if it is (or was) not there.
void
add_to_worklist
(
PointsToNode
*
pt
)
{
inline
void
add_to_worklist
(
PointsToNode
*
pt
)
{
_worklist
.
push
(
pt
);
PointsToNode
*
ptf
=
pt
;
return
;
uint
pidx_bias
=
0
;
if
(
PointsToNode
::
is_base_use
(
pt
))
{
// Create a separate entry in _in_worklist for a marked base edge
// because _worklist may have an entry for a normal edge pointing
// to the same node. To separate them use _next_pidx as bias.
ptf
=
PointsToNode
::
get_use_node
(
pt
)
->
as_Field
();
pidx_bias
=
_next_pidx
;
}
if
(
!
_in_worklist
.
test_set
(
ptf
->
pidx
()
+
pidx_bias
))
{
_worklist
.
append
(
pt
);
}
}
}
// Put on worklist all uses of this node.
// Put on worklist all uses of this node.
void
add_uses_to_worklist
(
PointsToNode
*
pt
)
{
inline
void
add_uses_to_worklist
(
PointsToNode
*
pt
)
{
for
(
UseIterator
i
(
pt
);
i
.
has_next
();
i
.
next
())
for
(
UseIterator
i
(
pt
);
i
.
has_next
();
i
.
next
())
{
_worklist
.
push
(
i
.
get
());
add_to_worklist
(
i
.
get
());
}
}
}
// Put on worklist all field's uses and related field nodes.
// Put on worklist all field's uses and related field nodes.
...
@@ -517,8 +528,8 @@ private:
...
@@ -517,8 +528,8 @@ private:
}
}
// Helper functions
// Helper functions
bool
is_oop_field
(
Node
*
n
,
int
offset
,
bool
*
unsafe
);
bool
is_oop_field
(
Node
*
n
,
int
offset
,
bool
*
unsafe
);
static
Node
*
get_addp_base
(
Node
*
addp
);
static
Node
*
get_addp_base
(
Node
*
addp
);
static
Node
*
find_second_addp
(
Node
*
addp
,
Node
*
n
);
static
Node
*
find_second_addp
(
Node
*
addp
,
Node
*
n
);
// offset of a field reference
// offset of a field reference
int
address_offset
(
Node
*
adr
,
PhaseTransform
*
phase
);
int
address_offset
(
Node
*
adr
,
PhaseTransform
*
phase
);
...
@@ -587,4 +598,17 @@ public:
...
@@ -587,4 +598,17 @@ public:
#endif
#endif
};
};
inline
PointsToNode
::
PointsToNode
(
ConnectionGraph
*
CG
,
Node
*
n
,
EscapeState
es
,
NodeType
type
)
:
_edges
(
CG
->
_compile
->
comp_arena
(),
2
,
0
,
NULL
),
_uses
(
CG
->
_compile
->
comp_arena
(),
2
,
0
,
NULL
),
_node
(
n
),
_idx
(
n
->
_idx
),
_pidx
(
CG
->
next_pidx
()),
_type
((
u1
)
type
),
_escape
((
u1
)
es
),
_fields_escape
((
u1
)
es
),
_flags
(
ScalarReplaceable
)
{
assert
(
n
!=
NULL
&&
es
!=
UnknownEscape
,
"sanity"
);
}
#endif // SHARE_VM_OPTO_ESCAPE_HPP
#endif // SHARE_VM_OPTO_ESCAPE_HPP
src/share/vm/utilities/debug.cpp
浏览文件 @
2d168ed3
...
@@ -266,17 +266,19 @@ void report_out_of_shared_space(SharedSpaceType shared_space) {
...
@@ -266,17 +266,19 @@ void report_out_of_shared_space(SharedSpaceType shared_space) {
"native memory for metadata"
,
"native memory for metadata"
,
"shared read only space"
,
"shared read only space"
,
"shared read write space"
,
"shared read write space"
,
"shared miscellaneous data space"
"shared miscellaneous data space"
,
"shared miscellaneous code space"
};
};
static
const
char
*
flag
[]
=
{
static
const
char
*
flag
[]
=
{
"Metaspace"
,
"Metaspace"
,
"SharedReadOnlySize"
,
"SharedReadOnlySize"
,
"SharedReadWriteSize"
,
"SharedReadWriteSize"
,
"SharedMiscDataSize"
"SharedMiscDataSize"
,
"SharedMiscCodeSize"
};
};
warning
(
"
\n
The %s is not large enough
\n
"
warning
(
"
\n
The %s is not large enough
\n
"
"to preload requested classes. Use -XX:%s=
\n
"
"to preload requested classes. Use -XX:%s=
<size>
\n
"
"to increase the initial size of %s.
\n
"
,
"to increase the initial size of %s.
\n
"
,
name
[
shared_space
],
flag
[
shared_space
],
name
[
shared_space
]);
name
[
shared_space
],
flag
[
shared_space
],
name
[
shared_space
]);
exit
(
2
);
exit
(
2
);
...
...
src/share/vm/utilities/debug.hpp
浏览文件 @
2d168ed3
...
@@ -246,7 +246,8 @@ enum SharedSpaceType {
...
@@ -246,7 +246,8 @@ enum SharedSpaceType {
SharedPermGen
,
SharedPermGen
,
SharedReadOnly
,
SharedReadOnly
,
SharedReadWrite
,
SharedReadWrite
,
SharedMiscData
SharedMiscData
,
SharedMiscCode
};
};
void
report_out_of_shared_space
(
SharedSpaceType
space_type
);
void
report_out_of_shared_space
(
SharedSpaceType
space_type
);
...
...
test/runtime/SharedArchiveFile/LimitSharedSizes.java
浏览文件 @
2d168ed3
...
@@ -51,9 +51,12 @@ public class LimitSharedSizes {
...
@@ -51,9 +51,12 @@ public class LimitSharedSizes {
// Known issue, JDK-8038422 (assert() on Windows)
// Known issue, JDK-8038422 (assert() on Windows)
// new SharedSizeTestData("-XX:SharedMiscDataSize", "500k", "miscellaneous data"),
// new SharedSizeTestData("-XX:SharedMiscDataSize", "500k", "miscellaneous data"),
// This will cause a VM crash; commenting out for now; see bug JDK-8038268
// Too small of a misc code size should not cause a vm crash.
// @ignore JDK-8038268
// It should result in the following error message:
// new SharedSizeTestData("-XX:SharedMiscCodeSize", "20k", "miscellaneous code"),
// The shared miscellaneous code space is not large enough
// to preload requested classes. Use -XX:SharedMiscCodeSize=
// to increase the initial size of shared miscellaneous code space.
new
SharedSizeTestData
(
"-XX:SharedMiscCodeSize"
,
"20k"
,
"miscellaneous code"
),
// these values are larger than default ones, but should
// these values are larger than default ones, but should
// be acceptable and not cause failure
// be acceptable and not cause failure
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录