Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
de9072f9
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看板
提交
de9072f9
编写于
8月 14, 2013
作者:
B
brutisso
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8022800: Use specific generations rather than generation iteration
Reviewed-by: jmasa, ehelin
上级
cf130033
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
41 addition
and
80 deletion
+41
-80
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+1
-3
src/share/vm/memory/cardTableRS.cpp
src/share/vm/memory/cardTableRS.cpp
+12
-22
src/share/vm/memory/cardTableRS.hpp
src/share/vm/memory/cardTableRS.hpp
+1
-1
src/share/vm/memory/defNewGeneration.cpp
src/share/vm/memory/defNewGeneration.cpp
+0
-4
src/share/vm/memory/genCollectedHeap.cpp
src/share/vm/memory/genCollectedHeap.cpp
+9
-22
src/share/vm/memory/genCollectedHeap.hpp
src/share/vm/memory/genCollectedHeap.hpp
+11
-13
src/share/vm/memory/genMarkSweep.cpp
src/share/vm/memory/genMarkSweep.cpp
+5
-10
src/share/vm/memory/genRemSet.hpp
src/share/vm/memory/genRemSet.hpp
+2
-5
未找到文件。
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
浏览文件 @
de9072f9
...
@@ -927,11 +927,9 @@ void ParNewGeneration::collect(bool full,
...
@@ -927,11 +927,9 @@ void ParNewGeneration::collect(bool full,
workers
->
active_workers
(),
workers
->
active_workers
(),
Threads
::
number_of_non_daemon_threads
());
Threads
::
number_of_non_daemon_threads
());
workers
->
set_active_workers
(
active_workers
);
workers
->
set_active_workers
(
active_workers
);
_next_gen
=
gch
->
next_gen
(
this
);
assert
(
_next_gen
!=
NULL
,
"This must be the youngest gen, and not the only gen"
);
assert
(
gch
->
n_gens
()
==
2
,
assert
(
gch
->
n_gens
()
==
2
,
"Par collection currently only works with single older gen."
);
"Par collection currently only works with single older gen."
);
_next_gen
=
gch
->
next_gen
(
this
);
// Do we have to avoid promotion_undo?
// Do we have to avoid promotion_undo?
if
(
gch
->
collector_policy
()
->
is_concurrent_mark_sweep_policy
())
{
if
(
gch
->
collector_policy
()
->
is_concurrent_mark_sweep_policy
())
{
set_avoid_promotion_undo
(
true
);
set_avoid_promotion_undo
(
true
);
...
...
src/share/vm/memory/cardTableRS.cpp
浏览文件 @
de9072f9
...
@@ -321,35 +321,25 @@ void CardTableRS::clear_into_younger(Generation* gen) {
...
@@ -321,35 +321,25 @@ void CardTableRS::clear_into_younger(Generation* gen) {
// below to avoid missing cards at the fringes. If clear() or
// below to avoid missing cards at the fringes. If clear() or
// invalidate() are changed in the future, this code should
// invalidate() are changed in the future, this code should
// be revisited. 20040107.ysr
// be revisited. 20040107.ysr
Generation
*
g
=
gen
;
Generation
*
old_gen
=
gen
;
for
(
Generation
*
prev_gen
=
gch
->
prev_gen
(
g
);
clear
(
old_gen
->
prev_used_region
());
prev_gen
!=
NULL
;
Generation
*
young_gen
=
gch
->
prev_gen
(
old_gen
);
g
=
prev_gen
,
prev_gen
=
gch
->
prev_gen
(
g
))
{
clear
(
young_gen
->
prev_used_region
());
MemRegion
to_be_cleared_mr
=
g
->
prev_used_region
();
clear
(
to_be_cleared_mr
);
}
}
}
void
CardTableRS
::
invalidate_or_clear
(
Generation
*
gen
,
bool
younger
)
{
void
CardTableRS
::
invalidate_or_clear
(
Generation
*
gen
)
{
GenCollectedHeap
*
gch
=
GenCollectedHeap
::
heap
();
// For generation gen invalidate the cards for the currently
// For each generation gen (and younger)
// occupied part of that generation and clear the cards for the
// invalidate the cards for the currently occupied part
// of that generation and clear the cards for the
// unoccupied part of the generation (if any, making use
// unoccupied part of the generation (if any, making use
// of that generation's prev_used_region to determine that
// of that generation's prev_used_region to determine that
// region). No need to do anything for the youngest
// region). No need to do anything for the youngest
// generation. Also see note#20040107.ysr above.
// generation. Also see note#20040107.ysr above.
Generation
*
g
=
gen
;
MemRegion
used_mr
=
gen
->
used_region
();
for
(
Generation
*
prev_gen
=
gch
->
prev_gen
(
g
);
prev_gen
!=
NULL
;
MemRegion
to_be_cleared_mr
=
gen
->
prev_used_region
().
minus
(
used_mr
);
g
=
prev_gen
,
prev_gen
=
gch
->
prev_gen
(
g
))
{
MemRegion
used_mr
=
g
->
used_region
();
MemRegion
to_be_cleared_mr
=
g
->
prev_used_region
().
minus
(
used_mr
);
if
(
!
to_be_cleared_mr
.
is_empty
())
{
if
(
!
to_be_cleared_mr
.
is_empty
())
{
clear
(
to_be_cleared_mr
);
clear
(
to_be_cleared_mr
);
}
}
invalidate
(
used_mr
);
invalidate
(
used_mr
);
if
(
!
younger
)
break
;
}
}
}
...
...
src/share/vm/memory/cardTableRS.hpp
浏览文件 @
de9072f9
...
@@ -147,7 +147,7 @@ public:
...
@@ -147,7 +147,7 @@ public:
void
invalidate
(
MemRegion
mr
,
bool
whole_heap
=
false
)
{
void
invalidate
(
MemRegion
mr
,
bool
whole_heap
=
false
)
{
_ct_bs
->
invalidate
(
mr
,
whole_heap
);
_ct_bs
->
invalidate
(
mr
,
whole_heap
);
}
}
void
invalidate_or_clear
(
Generation
*
gen
,
bool
younger
);
void
invalidate_or_clear
(
Generation
*
gen
);
static
uintx
ct_max_alignment_constraint
()
{
static
uintx
ct_max_alignment_constraint
()
{
return
CardTableModRefBS
::
ct_max_alignment_constraint
();
return
CardTableModRefBS
::
ct_max_alignment_constraint
();
...
...
src/share/vm/memory/defNewGeneration.cpp
浏览文件 @
de9072f9
...
@@ -567,8 +567,6 @@ void DefNewGeneration::collect(bool full,
...
@@ -567,8 +567,6 @@ void DefNewGeneration::collect(bool full,
gc_tracer
.
report_gc_start
(
gch
->
gc_cause
(),
_gc_timer
->
gc_start
());
gc_tracer
.
report_gc_start
(
gch
->
gc_cause
(),
_gc_timer
->
gc_start
());
_next_gen
=
gch
->
next_gen
(
this
);
_next_gen
=
gch
->
next_gen
(
this
);
assert
(
_next_gen
!=
NULL
,
"This must be the youngest gen, and not the only gen"
);
// If the next generation is too full to accommodate promotion
// If the next generation is too full to accommodate promotion
// from this generation, pass on collection; let the next generation
// from this generation, pass on collection; let the next generation
...
@@ -901,8 +899,6 @@ bool DefNewGeneration::collection_attempt_is_safe() {
...
@@ -901,8 +899,6 @@ bool DefNewGeneration::collection_attempt_is_safe() {
if
(
_next_gen
==
NULL
)
{
if
(
_next_gen
==
NULL
)
{
GenCollectedHeap
*
gch
=
GenCollectedHeap
::
heap
();
GenCollectedHeap
*
gch
=
GenCollectedHeap
::
heap
();
_next_gen
=
gch
->
next_gen
(
this
);
_next_gen
=
gch
->
next_gen
(
this
);
assert
(
_next_gen
!=
NULL
,
"This must be the youngest gen, and not the only gen"
);
}
}
return
_next_gen
->
promotion_attempt_is_safe
(
used
());
return
_next_gen
->
promotion_attempt_is_safe
(
used
());
}
}
...
...
src/share/vm/memory/genCollectedHeap.cpp
浏览文件 @
de9072f9
...
@@ -1070,13 +1070,13 @@ GenCollectedHeap* GenCollectedHeap::heap() {
...
@@ -1070,13 +1070,13 @@ GenCollectedHeap* GenCollectedHeap::heap() {
void
GenCollectedHeap
::
prepare_for_compaction
()
{
void
GenCollectedHeap
::
prepare_for_compaction
()
{
Generation
*
scanning_gen
=
_gens
[
_n_gens
-
1
];
guarantee
(
_n_gens
=
2
,
"Wrong number of generations"
);
Generation
*
old_gen
=
_gens
[
1
];
// Start by compacting into same gen.
// Start by compacting into same gen.
CompactPoint
cp
(
scanning_gen
,
NULL
,
NULL
);
CompactPoint
cp
(
old_gen
,
NULL
,
NULL
);
while
(
scanning_gen
!=
NULL
)
{
old_gen
->
prepare_for_compaction
(
&
cp
);
scanning_gen
->
prepare_for_compaction
(
&
cp
);
Generation
*
young_gen
=
_gens
[
0
];
scanning_gen
=
prev_gen
(
scanning_gen
);
young_gen
->
prepare_for_compaction
(
&
cp
);
}
}
}
GCStats
*
GenCollectedHeap
::
gc_stats
(
int
level
)
const
{
GCStats
*
GenCollectedHeap
::
gc_stats
(
int
level
)
const
{
...
@@ -1245,27 +1245,14 @@ void GenCollectedHeap::ensure_parsability(bool retire_tlabs) {
...
@@ -1245,27 +1245,14 @@ void GenCollectedHeap::ensure_parsability(bool retire_tlabs) {
generation_iterate
(
&
ep_cl
,
false
);
generation_iterate
(
&
ep_cl
,
false
);
}
}
oop
GenCollectedHeap
::
handle_failed_promotion
(
Generation
*
gen
,
oop
GenCollectedHeap
::
handle_failed_promotion
(
Generation
*
old_
gen
,
oop
obj
,
oop
obj
,
size_t
obj_size
)
{
size_t
obj_size
)
{
guarantee
(
old_gen
->
level
()
==
1
,
"We only get here with an old generation"
);
assert
(
obj_size
==
(
size_t
)
obj
->
size
(),
"bad obj_size passed in"
);
assert
(
obj_size
==
(
size_t
)
obj
->
size
(),
"bad obj_size passed in"
);
HeapWord
*
result
=
NULL
;
HeapWord
*
result
=
NULL
;
// First give each higher generation a chance to allocate the promoted object.
result
=
old_gen
->
expand_and_allocate
(
obj_size
,
false
);
Generation
*
allocator
=
next_gen
(
gen
);
if
(
allocator
!=
NULL
)
{
do
{
result
=
allocator
->
allocate
(
obj_size
,
false
);
}
while
(
result
==
NULL
&&
(
allocator
=
next_gen
(
allocator
))
!=
NULL
);
}
if
(
result
==
NULL
)
{
// Then give gen and higher generations a chance to expand and allocate the
// object.
do
{
result
=
gen
->
expand_and_allocate
(
obj_size
,
false
);
}
while
(
result
==
NULL
&&
(
gen
=
next_gen
(
gen
))
!=
NULL
);
}
if
(
result
!=
NULL
)
{
if
(
result
!=
NULL
)
{
Copy
::
aligned_disjoint_words
((
HeapWord
*
)
obj
,
result
,
obj_size
);
Copy
::
aligned_disjoint_words
((
HeapWord
*
)
obj
,
result
,
obj_size
);
...
...
src/share/vm/memory/genCollectedHeap.hpp
浏览文件 @
de9072f9
...
@@ -368,25 +368,23 @@ public:
...
@@ -368,25 +368,23 @@ public:
// collection.
// collection.
virtual
bool
is_maximal_no_gc
()
const
;
virtual
bool
is_maximal_no_gc
()
const
;
// Return the generation before "gen"
, or else NULL
.
// Return the generation before "gen".
Generation
*
prev_gen
(
Generation
*
gen
)
const
{
Generation
*
prev_gen
(
Generation
*
gen
)
const
{
int
l
=
gen
->
level
();
int
l
=
gen
->
level
();
if
(
l
==
0
)
return
NULL
;
guarantee
(
l
>
0
,
"Out of bounds"
)
;
else
return
_gens
[
l
-
1
];
return
_gens
[
l
-
1
];
}
}
// Return the generation after "gen"
, or else NULL
.
// Return the generation after "gen".
Generation
*
next_gen
(
Generation
*
gen
)
const
{
Generation
*
next_gen
(
Generation
*
gen
)
const
{
int
l
=
gen
->
level
()
+
1
;
int
l
=
gen
->
level
()
+
1
;
if
(
l
==
_n_gens
)
return
NULL
;
guarantee
(
l
<
_n_gens
,
"Out of bounds"
)
;
else
return
_gens
[
l
];
return
_gens
[
l
];
}
}
Generation
*
get_gen
(
int
i
)
const
{
Generation
*
get_gen
(
int
i
)
const
{
if
(
i
>=
0
&&
i
<
_n_gens
)
guarantee
(
i
>=
0
&&
i
<
_n_gens
,
"Out of bounds"
);
return
_gens
[
i
];
return
_gens
[
i
];
else
return
NULL
;
}
}
int
n_gens
()
const
{
int
n_gens
()
const
{
...
@@ -485,9 +483,9 @@ public:
...
@@ -485,9 +483,9 @@ public:
// Promotion of obj into gen failed. Try to promote obj to higher
// Promotion of obj into gen failed. Try to promote obj to higher
// gens in ascending order; return the new location of obj if successful.
// gens in ascending order; return the new location of obj if successful.
// Otherwise, try expand-and-allocate for obj in
each generation starting at
// Otherwise, try expand-and-allocate for obj in
both the young and old
// gen; return the new location of obj if successful. Otherwise, return NULL.
// gen
eration
; return the new location of obj if successful. Otherwise, return NULL.
oop
handle_failed_promotion
(
Generation
*
gen
,
oop
handle_failed_promotion
(
Generation
*
old_
gen
,
oop
obj
,
oop
obj
,
size_t
obj_size
);
size_t
obj_size
);
...
...
src/share/vm/memory/genMarkSweep.cpp
浏览文件 @
de9072f9
...
@@ -52,8 +52,8 @@
...
@@ -52,8 +52,8 @@
#include "utilities/copy.hpp"
#include "utilities/copy.hpp"
#include "utilities/events.hpp"
#include "utilities/events.hpp"
void
GenMarkSweep
::
invoke_at_safepoint
(
int
level
,
ReferenceProcessor
*
rp
,
void
GenMarkSweep
::
invoke_at_safepoint
(
int
level
,
ReferenceProcessor
*
rp
,
bool
clear_all_softrefs
)
{
bool
clear_all_softrefs
)
{
guarantee
(
level
==
1
,
"We always collect both old and young."
);
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"must be at a safepoint"
);
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"must be at a safepoint"
);
GenCollectedHeap
*
gch
=
GenCollectedHeap
::
heap
();
GenCollectedHeap
*
gch
=
GenCollectedHeap
::
heap
();
...
@@ -84,11 +84,6 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
...
@@ -84,11 +84,6 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
// Capture heap size before collection for printing.
// Capture heap size before collection for printing.
size_t
gch_prev_used
=
gch
->
used
();
size_t
gch_prev_used
=
gch
->
used
();
// Some of the card table updates below assume that the perm gen is
// also being collected.
assert
(
level
==
gch
->
n_gens
()
-
1
,
"All generations are being collected, ergo perm gen too."
);
// Capture used regions for each generation that will be
// Capture used regions for each generation that will be
// subject to collection, so that card table adjustments can
// subject to collection, so that card table adjustments can
// be made intelligently (see clear / invalidate further below).
// be made intelligently (see clear / invalidate further below).
...
@@ -134,9 +129,9 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
...
@@ -134,9 +129,9 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
}
else
{
}
else
{
// Invalidate the cards corresponding to the currently used
// Invalidate the cards corresponding to the currently used
// region and clear those corresponding to the evacuated region
// region and clear those corresponding to the evacuated region
// of all generations just collected
(i.e. level and younger)
.
// of all generations just collected.
rs
->
invalidate_or_clear
(
gch
->
get_gen
(
level
),
rs
->
invalidate_or_clear
(
gch
->
get_gen
(
1
));
true
/* younger */
);
rs
->
invalidate_or_clear
(
gch
->
get_gen
(
0
)
);
}
}
Threads
::
gc_epilogue
();
Threads
::
gc_epilogue
();
...
...
src/share/vm/memory/genRemSet.hpp
浏览文件 @
de9072f9
...
@@ -146,11 +146,8 @@ public:
...
@@ -146,11 +146,8 @@ public:
// Informs the RS that refs in this generation
// Informs the RS that refs in this generation
// may have changed arbitrarily, and therefore may contain
// may have changed arbitrarily, and therefore may contain
// old-to-young pointers in arbitrary locations. The parameter
// old-to-young pointers in arbitrary locations.
// younger indicates if the same should be done for younger generations
virtual
void
invalidate_or_clear
(
Generation
*
gen
)
=
0
;
// as well. The parameter perm indicates if the same should be done for
// perm gen as well.
virtual
void
invalidate_or_clear
(
Generation
*
gen
,
bool
younger
)
=
0
;
};
};
#endif // SHARE_VM_MEMORY_GENREMSET_HPP
#endif // SHARE_VM_MEMORY_GENREMSET_HPP
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录