Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
2eeebfd8
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看板
提交
2eeebfd8
编写于
3月 12, 2009
作者:
T
tonyp
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
00872c6d
db8ff9cc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
87 addition
and
35 deletion
+87
-35
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+52
-7
src/share/vm/gc_implementation/g1/g1RemSet.cpp
src/share/vm/gc_implementation/g1/g1RemSet.cpp
+0
-27
src/share/vm/gc_implementation/g1/g1RemSet.hpp
src/share/vm/gc_implementation/g1/g1RemSet.hpp
+24
-0
src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp
src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp
+9
-0
src/share/vm/gc_implementation/g1/heapRegion.hpp
src/share/vm/gc_implementation/g1/heapRegion.hpp
+2
-1
未找到文件。
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
浏览文件 @
2eeebfd8
...
...
@@ -820,6 +820,40 @@ public:
}
};
class
RebuildRSOutOfRegionClosure
:
public
HeapRegionClosure
{
G1CollectedHeap
*
_g1h
;
UpdateRSOopClosure
_cl
;
int
_worker_i
;
public:
RebuildRSOutOfRegionClosure
(
G1CollectedHeap
*
g1
,
int
worker_i
=
0
)
:
_cl
(
g1
->
g1_rem_set
()
->
as_HRInto_G1RemSet
(),
worker_i
),
_worker_i
(
worker_i
),
_g1h
(
g1
)
{
}
bool
doHeapRegion
(
HeapRegion
*
r
)
{
if
(
!
r
->
continuesHumongous
())
{
_cl
.
set_from
(
r
);
r
->
oop_iterate
(
&
_cl
);
}
return
false
;
}
};
class
ParRebuildRSTask
:
public
AbstractGangTask
{
G1CollectedHeap
*
_g1
;
public:
ParRebuildRSTask
(
G1CollectedHeap
*
g1
)
:
AbstractGangTask
(
"ParRebuildRSTask"
),
_g1
(
g1
)
{
}
void
work
(
int
i
)
{
RebuildRSOutOfRegionClosure
rebuild_rs
(
_g1
,
i
);
_g1
->
heap_region_par_iterate_chunked
(
&
rebuild_rs
,
i
,
HeapRegion
::
RebuildRSClaimValue
);
}
};
void
G1CollectedHeap
::
do_collection
(
bool
full
,
bool
clear_all_soft_refs
,
size_t
word_size
)
{
ResourceMark
rm
;
...
...
@@ -926,24 +960,35 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs,
reset_gc_time_stamp
();
// Since everything potentially moved, we will clear all remembered
// sets, and clear all cards. Later we will also cards in the used
// portion of the heap after the resizing (which could be a shrinking.)
// We will also reset the GC time stamps of the regions.
// sets, and clear all cards. Later we will rebuild remebered
// sets. We will also reset the GC time stamps of the regions.
PostMCRemSetClearClosure
rs_clear
(
mr_bs
());
heap_region_iterate
(
&
rs_clear
);
// Resize the heap if necessary.
resize_if_necessary_after_full_collection
(
full
?
0
:
word_size
);
// Since everything potentially moved, we will clear all remembered
// sets, but also dirty all cards corresponding to used regions.
PostMCRemSetInvalidateClosure
rs_invalidate
(
mr_bs
());
heap_region_iterate
(
&
rs_invalidate
);
if
(
_cg1r
->
use_cache
())
{
_cg1r
->
clear_and_record_card_counts
();
_cg1r
->
clear_hot_cache
();
}
// Rebuild remembered sets of all regions.
if
(
ParallelGCThreads
>
0
)
{
ParRebuildRSTask
rebuild_rs_task
(
this
);
assert
(
check_heap_region_claim_values
(
HeapRegion
::
InitialClaimValue
),
"sanity check"
);
set_par_threads
(
workers
()
->
total_workers
());
workers
()
->
run_task
(
&
rebuild_rs_task
);
set_par_threads
(
0
);
assert
(
check_heap_region_claim_values
(
HeapRegion
::
RebuildRSClaimValue
),
"sanity check"
);
reset_heap_region_claim_values
();
}
else
{
RebuildRSOutOfRegionClosure
rebuild_rs
(
this
);
heap_region_iterate
(
&
rebuild_rs
);
}
if
(
PrintGC
)
{
print_size_transition
(
gclog_or_tty
,
g1h_prev_used
,
used
(),
capacity
());
}
...
...
src/share/vm/gc_implementation/g1/g1RemSet.cpp
浏览文件 @
2eeebfd8
...
...
@@ -105,33 +105,6 @@ StupidG1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure* oc,
_g1
->
heap_region_iterate
(
&
rc
);
}
class
UpdateRSOopClosure
:
public
OopClosure
{
HeapRegion
*
_from
;
HRInto_G1RemSet
*
_rs
;
int
_worker_i
;
public:
UpdateRSOopClosure
(
HRInto_G1RemSet
*
rs
,
int
worker_i
=
0
)
:
_from
(
NULL
),
_rs
(
rs
),
_worker_i
(
worker_i
)
{
guarantee
(
_rs
!=
NULL
,
"Requires an HRIntoG1RemSet"
);
}
void
set_from
(
HeapRegion
*
from
)
{
assert
(
from
!=
NULL
,
"from region must be non-NULL"
);
_from
=
from
;
}
virtual
void
do_oop
(
narrowOop
*
p
)
{
guarantee
(
false
,
"NYI"
);
}
virtual
void
do_oop
(
oop
*
p
)
{
assert
(
_from
!=
NULL
,
"from region must be non-NULL"
);
_rs
->
par_write_ref
(
_from
,
p
,
_worker_i
);
}
// Override: this closure is idempotent.
// bool idempotent() { return true; }
bool
apply_to_weak_ref_discovered_field
()
{
return
true
;
}
};
class
UpdateRSOutOfRegionClosure
:
public
HeapRegionClosure
{
G1CollectedHeap
*
_g1h
;
ModRefBarrierSet
*
_mr_bs
;
...
...
src/share/vm/gc_implementation/g1/g1RemSet.hpp
浏览文件 @
2eeebfd8
...
...
@@ -215,3 +215,27 @@ public:
int
n
()
{
return
_n
;
};
HeapWord
*
start_first
()
{
return
_start_first
;
}
};
class
UpdateRSOopClosure
:
public
OopClosure
{
HeapRegion
*
_from
;
HRInto_G1RemSet
*
_rs
;
int
_worker_i
;
public:
UpdateRSOopClosure
(
HRInto_G1RemSet
*
rs
,
int
worker_i
=
0
)
:
_from
(
NULL
),
_rs
(
rs
),
_worker_i
(
worker_i
)
{
guarantee
(
_rs
!=
NULL
,
"Requires an HRIntoG1RemSet"
);
}
void
set_from
(
HeapRegion
*
from
)
{
assert
(
from
!=
NULL
,
"from region must be non-NULL"
);
_from
=
from
;
}
virtual
void
do_oop
(
narrowOop
*
p
);
virtual
void
do_oop
(
oop
*
p
);
// Override: this closure is idempotent.
// bool idempotent() { return true; }
bool
apply_to_weak_ref_discovered_field
()
{
return
true
;
}
};
src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp
浏览文件 @
2eeebfd8
...
...
@@ -94,3 +94,12 @@ inline void HRInto_G1RemSet::par_write_ref(HeapRegion* from, oop* p, int tid) {
}
}
}
inline
void
UpdateRSOopClosure
::
do_oop
(
narrowOop
*
p
)
{
guarantee
(
false
,
"NYI"
);
}
inline
void
UpdateRSOopClosure
::
do_oop
(
oop
*
p
)
{
assert
(
_from
!=
NULL
,
"from region must be non-NULL"
);
_rs
->
par_write_ref
(
_from
,
p
,
_worker_i
);
}
src/share/vm/gc_implementation/g1/heapRegion.hpp
浏览文件 @
2eeebfd8
...
...
@@ -318,7 +318,8 @@ class HeapRegion: public G1OffsetTableContigSpace {
FinalCountClaimValue
=
1
,
NoteEndClaimValue
=
2
,
ScrubRemSetClaimValue
=
3
,
ParVerifyClaimValue
=
4
ParVerifyClaimValue
=
4
,
RebuildRSClaimValue
=
5
};
// Concurrent refinement requires contiguous heap regions (in which TLABs
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录