Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
e55ff1ed
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看板
提交
e55ff1ed
编写于
4月 03, 2014
作者:
V
vkempik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8016302: Change type of the number of GC workers to unsigned int (2)
Reviewed-by: tschatzl, jwilhelm
上级
36c4936d
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
96 addition
and
98 deletion
+96
-98
src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp
src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp
+11
-11
src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp
src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp
+5
-5
src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp
...hare/vm/gc_implementation/g1/concurrentG1RefineThread.cpp
+1
-1
src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp
...hare/vm/gc_implementation/g1/concurrentG1RefineThread.hpp
+3
-3
src/share/vm/gc_implementation/g1/concurrentMark.cpp
src/share/vm/gc_implementation/g1/concurrentMark.cpp
+2
-4
src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp
src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp
+15
-15
src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp
src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp
+8
-8
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+7
-7
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+3
-3
src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
+2
-2
src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
+1
-1
src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
+5
-5
src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
+1
-1
src/share/vm/gc_implementation/g1/g1OopClosures.hpp
src/share/vm/gc_implementation/g1/g1OopClosures.hpp
+2
-2
src/share/vm/gc_implementation/g1/g1RemSet.cpp
src/share/vm/gc_implementation/g1/g1RemSet.cpp
+12
-12
src/share/vm/gc_implementation/g1/g1RemSet.hpp
src/share/vm/gc_implementation/g1/g1RemSet.hpp
+6
-6
src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
+1
-1
src/share/vm/gc_implementation/g1/satbQueue.cpp
src/share/vm/gc_implementation/g1/satbQueue.cpp
+2
-2
src/share/vm/gc_implementation/g1/satbQueue.hpp
src/share/vm/gc_implementation/g1/satbQueue.hpp
+3
-3
src/share/vm/runtime/thread.cpp
src/share/vm/runtime/thread.cpp
+2
-2
src/share/vm/runtime/thread.hpp
src/share/vm/runtime/thread.hpp
+4
-4
未找到文件。
src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp
浏览文件 @
e55ff1ed
...
...
@@ -57,10 +57,10 @@ ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) :
_threads
=
NEW_C_HEAP_ARRAY
(
ConcurrentG1RefineThread
*
,
_n_threads
,
mtGC
);
int
worker_id_offset
=
(
int
)
DirtyCardQueueSet
::
num_par_ids
();
uint
worker_id_offset
=
DirtyCardQueueSet
::
num_par_ids
();
ConcurrentG1RefineThread
*
next
=
NULL
;
for
(
int
i
=
_n_threads
-
1
;
i
>=
0
;
i
--
)
{
for
(
uint
i
=
_n_threads
-
1
;
i
!=
UINT_MAX
;
i
--
)
{
ConcurrentG1RefineThread
*
t
=
new
ConcurrentG1RefineThread
(
this
,
next
,
worker_id_offset
,
i
);
assert
(
t
!=
NULL
,
"Conc refine should have been created"
);
if
(
t
->
osthread
()
==
NULL
)
{
...
...
@@ -87,7 +87,7 @@ void ConcurrentG1Refine::init() {
void
ConcurrentG1Refine
::
stop
()
{
if
(
_threads
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
_n_threads
;
i
++
)
{
for
(
u
int
i
=
0
;
i
<
_n_threads
;
i
++
)
{
_threads
[
i
]
->
stop
();
}
}
...
...
@@ -96,7 +96,7 @@ void ConcurrentG1Refine::stop() {
void
ConcurrentG1Refine
::
reinitialize_threads
()
{
reset_threshold_step
();
if
(
_threads
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
_n_threads
;
i
++
)
{
for
(
u
int
i
=
0
;
i
<
_n_threads
;
i
++
)
{
_threads
[
i
]
->
initialize
();
}
}
...
...
@@ -104,7 +104,7 @@ void ConcurrentG1Refine::reinitialize_threads() {
ConcurrentG1Refine
::~
ConcurrentG1Refine
()
{
if
(
_threads
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
_n_threads
;
i
++
)
{
for
(
u
int
i
=
0
;
i
<
_n_threads
;
i
++
)
{
delete
_threads
[
i
];
}
FREE_C_HEAP_ARRAY
(
ConcurrentG1RefineThread
*
,
_threads
,
mtGC
);
...
...
@@ -113,7 +113,7 @@ ConcurrentG1Refine::~ConcurrentG1Refine() {
void
ConcurrentG1Refine
::
threads_do
(
ThreadClosure
*
tc
)
{
if
(
_threads
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
_n_threads
;
i
++
)
{
for
(
u
int
i
=
0
;
i
<
_n_threads
;
i
++
)
{
tc
->
do_thread
(
_threads
[
i
]);
}
}
...
...
@@ -121,20 +121,20 @@ void ConcurrentG1Refine::threads_do(ThreadClosure *tc) {
void
ConcurrentG1Refine
::
worker_threads_do
(
ThreadClosure
*
tc
)
{
if
(
_threads
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
worker_thread_num
();
i
++
)
{
for
(
u
int
i
=
0
;
i
<
worker_thread_num
();
i
++
)
{
tc
->
do_thread
(
_threads
[
i
]);
}
}
}
int
ConcurrentG1Refine
::
thread_num
()
{
int
n_threads
=
(
G1ConcRefinementThreads
>
0
)
?
G1ConcRefinementThreads
u
int
ConcurrentG1Refine
::
thread_num
()
{
u
int
n_threads
=
(
G1ConcRefinementThreads
>
0
)
?
G1ConcRefinementThreads
:
ParallelGCThreads
;
return
MAX2
<
int
>
(
n_threads
,
1
);
return
MAX2
<
u
int
>
(
n_threads
,
1
);
}
void
ConcurrentG1Refine
::
print_worker_threads_on
(
outputStream
*
st
)
const
{
for
(
int
i
=
0
;
i
<
_n_threads
;
++
i
)
{
for
(
u
int
i
=
0
;
i
<
_n_threads
;
++
i
)
{
_threads
[
i
]
->
print_on
(
st
);
st
->
cr
();
}
...
...
src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp
浏览文件 @
e55ff1ed
...
...
@@ -39,8 +39,8 @@ class DirtyCardQueue;
class
ConcurrentG1Refine
:
public
CHeapObj
<
mtGC
>
{
ConcurrentG1RefineThread
**
_threads
;
int
_n_threads
;
int
_n_worker_threads
;
u
int
_n_threads
;
u
int
_n_worker_threads
;
/*
* The value of the update buffer queue length falls into one of 3 zones:
* green, yellow, red. If the value is in [0, green) nothing is
...
...
@@ -88,7 +88,7 @@ class ConcurrentG1Refine: public CHeapObj<mtGC> {
// The RS sampling thread
ConcurrentG1RefineThread
*
sampling_thread
()
const
;
static
int
thread_num
();
static
u
int
thread_num
();
void
print_worker_threads_on
(
outputStream
*
st
)
const
;
...
...
@@ -100,8 +100,8 @@ class ConcurrentG1Refine: public CHeapObj<mtGC> {
int
yellow_zone
()
const
{
return
_yellow_zone
;
}
int
red_zone
()
const
{
return
_red_zone
;
}
int
total_thread_num
()
const
{
return
_n_threads
;
}
int
worker_thread_num
()
const
{
return
_n_worker_threads
;
}
u
int
total_thread_num
()
const
{
return
_n_threads
;
}
u
int
worker_thread_num
()
const
{
return
_n_worker_threads
;
}
int
thread_threshold_step
()
const
{
return
_thread_threshold_step
;
}
...
...
src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp
浏览文件 @
e55ff1ed
...
...
@@ -33,7 +33,7 @@
ConcurrentG1RefineThread
::
ConcurrentG1RefineThread
(
ConcurrentG1Refine
*
cg1r
,
ConcurrentG1RefineThread
*
next
,
int
worker_id_offset
,
int
worker_id
)
:
uint
worker_id_offset
,
u
int
worker_id
)
:
ConcurrentGCThread
(),
_worker_id_offset
(
worker_id_offset
),
_worker_id
(
worker_id
),
...
...
src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp
浏览文件 @
e55ff1ed
...
...
@@ -38,8 +38,8 @@ class ConcurrentG1RefineThread: public ConcurrentGCThread {
double
_vtime_start
;
// Initial virtual time.
double
_vtime_accum
;
// Initial virtual time.
int
_worker_id
;
int
_worker_id_offset
;
u
int
_worker_id
;
u
int
_worker_id_offset
;
// The refinement threads collection is linked list. A predecessor can activate a successor
// when the number of the rset update buffer crosses a certain threshold. A successor
...
...
@@ -71,7 +71,7 @@ public:
virtual
void
run
();
// Constructor
ConcurrentG1RefineThread
(
ConcurrentG1Refine
*
cg1r
,
ConcurrentG1RefineThread
*
next
,
int
worker_id_offset
,
int
worker_id
);
uint
worker_id_offset
,
u
int
worker_id
);
void
initialize
();
...
...
src/share/vm/gc_implementation/g1/concurrentMark.cpp
浏览文件 @
e55ff1ed
...
...
@@ -1804,7 +1804,6 @@ class G1ParNoteEndTask;
class
G1NoteEndOfConcMarkClosure
:
public
HeapRegionClosure
{
G1CollectedHeap
*
_g1
;
int
_worker_num
;
size_t
_max_live_bytes
;
uint
_regions_claimed
;
size_t
_freed_bytes
;
...
...
@@ -1817,10 +1816,9 @@ class G1NoteEndOfConcMarkClosure : public HeapRegionClosure {
public:
G1NoteEndOfConcMarkClosure
(
G1CollectedHeap
*
g1
,
int
worker_num
,
FreeRegionList
*
local_cleanup_list
,
HRRSCleanupTask
*
hrrs_cleanup_task
)
:
_g1
(
g1
),
_worker_num
(
worker_num
),
_g1
(
g1
),
_max_live_bytes
(
0
),
_regions_claimed
(
0
),
_freed_bytes
(
0
),
_claimed_region_time
(
0.0
),
_max_region_time
(
0.0
),
...
...
@@ -1893,7 +1891,7 @@ public:
double
start
=
os
::
elapsedTime
();
FreeRegionList
local_cleanup_list
(
"Local Cleanup List"
);
HRRSCleanupTask
hrrs_cleanup_task
;
G1NoteEndOfConcMarkClosure
g1_note_end
(
_g1h
,
worker_id
,
&
local_cleanup_list
,
G1NoteEndOfConcMarkClosure
g1_note_end
(
_g1h
,
&
local_cleanup_list
,
&
hrrs_cleanup_task
);
if
(
G1CollectedHeap
::
use_parallel_gc_threads
())
{
_g1h
->
heap_region_par_iterate_chunked
(
&
g1_note_end
,
worker_id
,
...
...
src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp
浏览文件 @
e55ff1ed
...
...
@@ -34,12 +34,12 @@
bool
DirtyCardQueue
::
apply_closure
(
CardTableEntryClosure
*
cl
,
bool
consume
,
size_
t
worker_i
)
{
uin
t
worker_i
)
{
bool
res
=
true
;
if
(
_buf
!=
NULL
)
{
res
=
apply_closure_to_buffer
(
cl
,
_buf
,
_index
,
_sz
,
consume
,
(
int
)
worker_i
);
worker_i
);
if
(
res
&&
consume
)
_index
=
_sz
;
}
return
res
;
...
...
@@ -49,7 +49,7 @@ bool DirtyCardQueue::apply_closure_to_buffer(CardTableEntryClosure* cl,
void
**
buf
,
size_t
index
,
size_t
sz
,
bool
consume
,
int
worker_i
)
{
u
int
worker_i
)
{
if
(
cl
==
NULL
)
return
true
;
for
(
size_t
i
=
index
;
i
<
sz
;
i
+=
oopSize
)
{
int
ind
=
byte_index_to_index
((
int
)
i
);
...
...
@@ -79,8 +79,8 @@ DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
}
// Determines how many mutator threads can process the buffers in parallel.
size_
t
DirtyCardQueueSet
::
num_par_ids
()
{
return
os
::
processor_count
();
uin
t
DirtyCardQueueSet
::
num_par_ids
()
{
return
(
uint
)
os
::
processor_count
();
}
void
DirtyCardQueueSet
::
initialize
(
Monitor
*
cbl_mon
,
Mutex
*
fl_lock
,
...
...
@@ -103,7 +103,7 @@ void DirtyCardQueueSet::set_closure(CardTableEntryClosure* closure) {
}
void
DirtyCardQueueSet
::
iterate_closure_all_threads
(
bool
consume
,
size_
t
worker_i
)
{
uin
t
worker_i
)
{
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"Must be at safepoint."
);
for
(
JavaThread
*
t
=
Threads
::
first
();
t
;
t
=
t
->
next
())
{
bool
b
=
t
->
dirty_card_queue
().
apply_closure
(
_closure
,
consume
);
...
...
@@ -126,11 +126,11 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
// We get the the number of any par_id that this thread
// might have already claimed.
int
worker_i
=
thread
->
get_claimed_par_id
();
u
int
worker_i
=
thread
->
get_claimed_par_id
();
// If worker_i is not
-1
then the thread has already claimed
// If worker_i is not
UINT_MAX
then the thread has already claimed
// a par_id. We make note of it using the already_claimed value
if
(
worker_i
!=
-
1
)
{
if
(
worker_i
!=
UINT_MAX
)
{
already_claimed
=
true
;
}
else
{
...
...
@@ -142,7 +142,7 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
}
bool
b
=
false
;
if
(
worker_i
!=
-
1
)
{
if
(
worker_i
!=
UINT_MAX
)
{
b
=
DirtyCardQueue
::
apply_closure_to_buffer
(
_closure
,
buf
,
0
,
_sz
,
true
,
worker_i
);
if
(
b
)
Atomic
::
inc
(
&
_processed_buffers_mut
);
...
...
@@ -154,8 +154,8 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
// we release the id
_free_ids
->
release_par_id
(
worker_i
);
// and set the claimed_id in the thread to
-1
thread
->
set_claimed_par_id
(
-
1
);
// and set the claimed_id in the thread to
UINT_MAX
thread
->
set_claimed_par_id
(
UINT_MAX
);
}
}
return
b
;
...
...
@@ -186,7 +186,7 @@ DirtyCardQueueSet::get_completed_buffer(int stop_at) {
bool
DirtyCardQueueSet
::
apply_closure_to_completed_buffer_helper
(
CardTableEntryClosure
*
cl
,
int
worker_i
,
u
int
worker_i
,
BufferNode
*
nd
)
{
if
(
nd
!=
NULL
)
{
void
**
buf
=
BufferNode
::
make_buffer_from_node
(
nd
);
...
...
@@ -208,7 +208,7 @@ apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl,
}
bool
DirtyCardQueueSet
::
apply_closure_to_completed_buffer
(
CardTableEntryClosure
*
cl
,
int
worker_i
,
u
int
worker_i
,
int
stop_at
,
bool
during_pause
)
{
assert
(
!
during_pause
||
stop_at
==
0
,
"Should not leave any completed buffers during a pause"
);
...
...
@@ -218,7 +218,7 @@ bool DirtyCardQueueSet::apply_closure_to_completed_buffer(CardTableEntryClosure*
return
res
;
}
bool
DirtyCardQueueSet
::
apply_closure_to_completed_buffer
(
int
worker_i
,
bool
DirtyCardQueueSet
::
apply_closure_to_completed_buffer
(
u
int
worker_i
,
int
stop_at
,
bool
during_pause
)
{
return
apply_closure_to_completed_buffer
(
_closure
,
worker_i
,
...
...
src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp
浏览文件 @
e55ff1ed
...
...
@@ -36,7 +36,7 @@ class CardTableEntryClosure: public CHeapObj<mtGC> {
public:
// Process the card whose card table entry is "card_ptr". If returns
// "false", terminate the iteration early.
virtual
bool
do_card_ptr
(
jbyte
*
card_ptr
,
int
worker_i
=
0
)
=
0
;
virtual
bool
do_card_ptr
(
jbyte
*
card_ptr
,
u
int
worker_i
=
0
)
=
0
;
};
// A ptrQueue whose elements are "oops", pointers to object heads.
...
...
@@ -53,7 +53,7 @@ public:
// deletes processed entries from logs.
bool
apply_closure
(
CardTableEntryClosure
*
cl
,
bool
consume
=
true
,
size_
t
worker_i
=
0
);
uin
t
worker_i
=
0
);
// Apply the closure to all elements of "buf", down to "index"
// (inclusive.) If returns "false", then a closure application returned
...
...
@@ -63,7 +63,7 @@ public:
static
bool
apply_closure_to_buffer
(
CardTableEntryClosure
*
cl
,
void
**
buf
,
size_t
index
,
size_t
sz
,
bool
consume
=
true
,
int
worker_i
=
0
);
u
int
worker_i
=
0
);
void
**
get_buf
()
{
return
_buf
;}
void
set_buf
(
void
**
buf
)
{
_buf
=
buf
;}
size_t
get_index
()
{
return
_index
;}
...
...
@@ -98,7 +98,7 @@ public:
// The number of parallel ids that can be claimed to allow collector or
// mutator threads to do card-processing work.
static
size_
t
num_par_ids
();
static
uin
t
num_par_ids
();
static
void
handle_zero_index_for_thread
(
JavaThread
*
t
);
...
...
@@ -115,7 +115,7 @@ public:
// change in the future.) If "consume" is true, processed entries are
// discarded.
void
iterate_closure_all_threads
(
bool
consume
=
true
,
size_
t
worker_i
=
0
);
uin
t
worker_i
=
0
);
// If there exists some completed buffer, pop it, then apply the
// registered closure to all its elements, nulling out those elements
...
...
@@ -124,7 +124,7 @@ public:
// but is only partially completed before a "yield" happens, the
// partially completed buffer (with its processed elements set to NULL)
// is returned to the completed buffer set, and this call returns false.
bool
apply_closure_to_completed_buffer
(
int
worker_i
=
0
,
bool
apply_closure_to_completed_buffer
(
u
int
worker_i
=
0
,
int
stop_at
=
0
,
bool
during_pause
=
false
);
...
...
@@ -136,13 +136,13 @@ public:
// partially completed buffer (with its processed elements set to NULL)
// is returned to the completed buffer set, and this call returns false.
bool
apply_closure_to_completed_buffer
(
CardTableEntryClosure
*
cl
,
int
worker_i
=
0
,
u
int
worker_i
=
0
,
int
stop_at
=
0
,
bool
during_pause
=
false
);
// Helper routine for the above.
bool
apply_closure_to_completed_buffer_helper
(
CardTableEntryClosure
*
cl
,
int
worker_i
,
u
int
worker_i
,
BufferNode
*
nd
);
BufferNode
*
get_completed_buffer
(
int
stop_at
);
...
...
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
浏览文件 @
e55ff1ed
...
...
@@ -102,7 +102,7 @@ public:
ConcurrentG1Refine
*
cg1r
)
:
_sts
(
sts
),
_g1rs
(
g1rs
),
_cg1r
(
cg1r
),
_concurrent
(
true
)
{}
bool
do_card_ptr
(
jbyte
*
card_ptr
,
int
worker_i
)
{
bool
do_card_ptr
(
jbyte
*
card_ptr
,
u
int
worker_i
)
{
bool
oops_into_cset
=
_g1rs
->
refine_card
(
card_ptr
,
worker_i
,
false
);
// This path is executed by the concurrent refine or mutator threads,
// concurrently, and so we do not care if card_ptr contains references
...
...
@@ -131,7 +131,7 @@ public:
{
for
(
int
i
=
0
;
i
<
256
;
i
++
)
_histo
[
i
]
=
0
;
}
bool
do_card_ptr
(
jbyte
*
card_ptr
,
int
worker_i
)
{
bool
do_card_ptr
(
jbyte
*
card_ptr
,
u
int
worker_i
)
{
if
(
_g1h
->
is_in_reserved
(
_ctbs
->
addr_for
(
card_ptr
)))
{
_calls
++
;
unsigned
char
*
ujb
=
(
unsigned
char
*
)
card_ptr
;
...
...
@@ -160,7 +160,7 @@ public:
RedirtyLoggedCardTableEntryClosure
()
:
_calls
(
0
),
_g1h
(
G1CollectedHeap
::
heap
()),
_ctbs
(
_g1h
->
g1_barrier_set
())
{}
bool
do_card_ptr
(
jbyte
*
card_ptr
,
int
worker_i
)
{
bool
do_card_ptr
(
jbyte
*
card_ptr
,
u
int
worker_i
)
{
if
(
_g1h
->
is_in_reserved
(
_ctbs
->
addr_for
(
card_ptr
)))
{
_calls
++
;
*
card_ptr
=
0
;
...
...
@@ -2314,7 +2314,7 @@ void G1CollectedHeap::check_gc_time_stamps() {
void
G1CollectedHeap
::
iterate_dirty_card_closure
(
CardTableEntryClosure
*
cl
,
DirtyCardQueue
*
into_cset_dcq
,
bool
concurrent
,
int
worker_i
)
{
u
int
worker_i
)
{
// Clean cards in the hot card cache
G1HotCardCache
*
hot_card_cache
=
_cg1r
->
hot_card_cache
();
hot_card_cache
->
drain
(
worker_i
,
g1_rem_set
(),
into_cset_dcq
);
...
...
@@ -2862,7 +2862,7 @@ void G1CollectedHeap::clear_cset_start_regions() {
// Given the id of a worker, obtain or calculate a suitable
// starting region for iterating over the current collection set.
HeapRegion
*
G1CollectedHeap
::
start_cset_region_for_worker
(
int
worker_i
)
{
HeapRegion
*
G1CollectedHeap
::
start_cset_region_for_worker
(
u
int
worker_i
)
{
assert
(
get_gc_time_stamp
()
>
0
,
"should have been updated by now"
);
HeapRegion
*
result
=
NULL
;
...
...
@@ -5121,7 +5121,7 @@ g1_process_strong_roots(bool is_scavenging,
OopClosure
*
scan_non_heap_roots
,
OopsInHeapRegionClosure
*
scan_rs
,
G1KlassScanClosure
*
scan_klasses
,
int
worker_i
)
{
u
int
worker_i
)
{
// First scan the strong roots
double
ext_roots_start
=
os
::
elapsedTime
();
...
...
@@ -5305,7 +5305,7 @@ void G1CollectedHeap::unlink_string_and_symbol_table(BoolObjectClosure* is_alive
class
RedirtyLoggedCardTableEntryFastClosure
:
public
CardTableEntryClosure
{
public:
bool
do_card_ptr
(
jbyte
*
card_ptr
,
int
worker_i
)
{
bool
do_card_ptr
(
jbyte
*
card_ptr
,
u
int
worker_i
)
{
*
card_ptr
=
CardTableModRefBS
::
dirty_card_val
();
return
true
;
}
...
...
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
浏览文件 @
e55ff1ed
...
...
@@ -845,7 +845,7 @@ protected:
OopClosure
*
scan_non_heap_roots
,
OopsInHeapRegionClosure
*
scan_rs
,
G1KlassScanClosure
*
scan_klasses
,
int
worker_i
);
u
int
worker_i
);
// Apply "blk" to all the weak roots of the system. These include
// JNI weak roots, the code cache, system dictionary, symbol table,
...
...
@@ -1144,7 +1144,7 @@ public:
void
iterate_dirty_card_closure
(
CardTableEntryClosure
*
cl
,
DirtyCardQueue
*
into_cset_dcq
,
bool
concurrent
,
int
worker_i
);
bool
concurrent
,
u
int
worker_i
);
// The shared block offset table array.
G1BlockOffsetSharedArray
*
bot_shared
()
const
{
return
_bot_shared
;
}
...
...
@@ -1384,7 +1384,7 @@ public:
// Given the id of a worker, obtain or calculate a suitable
// starting region for iterating over the current collection set.
HeapRegion
*
start_cset_region_for_worker
(
int
worker_i
);
HeapRegion
*
start_cset_region_for_worker
(
u
int
worker_i
);
// This is a convenience method that is used by the
// HeapRegionIterator classes to calculate the starting region for
...
...
src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
浏览文件 @
e55ff1ed
...
...
@@ -246,8 +246,8 @@ void G1GCPhaseTimes::print_stats(int level, const char* str, double value) {
LineBuffer
(
level
).
append_and_print_cr
(
"[%s: %.1lf ms]"
,
str
,
value
);
}
void
G1GCPhaseTimes
::
print_stats
(
int
level
,
const
char
*
str
,
double
value
,
int
workers
)
{
LineBuffer
(
level
).
append_and_print_cr
(
"[%s: %.1lf ms, GC Workers:
%d
]"
,
str
,
value
,
workers
);
void
G1GCPhaseTimes
::
print_stats
(
int
level
,
const
char
*
str
,
double
value
,
u
int
workers
)
{
LineBuffer
(
level
).
append_and_print_cr
(
"[%s: %.1lf ms, GC Workers:
"
UINT32_FORMAT
"
]"
,
str
,
value
,
workers
);
}
double
G1GCPhaseTimes
::
accounted_time_ms
()
{
...
...
src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
浏览文件 @
e55ff1ed
...
...
@@ -161,7 +161,7 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
// Helper methods for detailed logging
void
print_stats
(
int
level
,
const
char
*
str
,
double
value
);
void
print_stats
(
int
level
,
const
char
*
str
,
double
value
,
int
workers
);
void
print_stats
(
int
level
,
const
char
*
str
,
double
value
,
u
int
workers
);
public:
G1GCPhaseTimes
(
uint
max_gc_threads
);
...
...
src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
浏览文件 @
e55ff1ed
...
...
@@ -44,9 +44,9 @@ void G1HotCardCache::initialize() {
_hot_cache_idx
=
0
;
// For refining the cards in the hot cache in parallel
int
n_workers
=
(
ParallelGCThreads
>
0
?
u
int
n_workers
=
(
ParallelGCThreads
>
0
?
_g1h
->
workers
()
->
total_workers
()
:
1
);
_hot_cache_par_chunk_size
=
MAX2
(
1
,
_hot_cache_size
/
n_workers
);
_hot_cache_par_chunk_size
=
MAX2
(
1
,
_hot_cache_size
/
(
int
)
n_workers
);
_hot_cache_par_claimed_idx
=
0
;
_card_counts
.
initialize
();
...
...
@@ -89,7 +89,7 @@ jbyte* G1HotCardCache::insert(jbyte* card_ptr) {
return
res
;
}
void
G1HotCardCache
::
drain
(
int
worker_i
,
void
G1HotCardCache
::
drain
(
u
int
worker_i
,
G1RemSet
*
g1rs
,
DirtyCardQueue
*
into_cset_dcq
)
{
if
(
!
default_use_cache
())
{
...
...
@@ -122,8 +122,8 @@ void G1HotCardCache::drain(int worker_i,
// RSet updating while within an evacuation pause.
// In this case worker_i should be the id of a GC worker thread
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"Should be at a safepoint"
);
assert
(
worker_i
<
(
int
)
(
ParallelGCThreads
==
0
?
1
:
ParallelGCThreads
),
err_msg
(
"incorrect worker id: "
INT32_FORMAT
,
worker_i
));
assert
(
worker_i
<
(
ParallelGCThreads
==
0
?
1
:
ParallelGCThreads
),
err_msg
(
"incorrect worker id: "
U
INT32_FORMAT
,
worker_i
));
into_cset_dcq
->
enqueue
(
card_ptr
);
}
...
...
src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
浏览文件 @
e55ff1ed
...
...
@@ -99,7 +99,7 @@ class G1HotCardCache: public CHeapObj<mtGC> {
// Refine the cards that have delayed as a result of
// being in the cache.
void
drain
(
int
worker_i
,
G1RemSet
*
g1rs
,
DirtyCardQueue
*
into_cset_dcq
);
void
drain
(
u
int
worker_i
,
G1RemSet
*
g1rs
,
DirtyCardQueue
*
into_cset_dcq
);
// Set up for parallel processing of the cards in the hot cache
void
reset_hot_cache_claimed_index
()
{
...
...
src/share/vm/gc_implementation/g1/g1OopClosures.hpp
浏览文件 @
e55ff1ed
...
...
@@ -234,14 +234,14 @@ class G1UpdateRSOrPushRefOopClosure: public ExtendedOopClosure {
HeapRegion
*
_from
;
OopsInHeapRegionClosure
*
_push_ref_cl
;
bool
_record_refs_into_cset
;
int
_worker_i
;
u
int
_worker_i
;
public:
G1UpdateRSOrPushRefOopClosure
(
G1CollectedHeap
*
g1h
,
G1RemSet
*
rs
,
OopsInHeapRegionClosure
*
push_ref_cl
,
bool
record_refs_into_cset
,
int
worker_i
=
0
);
u
int
worker_i
=
0
);
void
set_from
(
HeapRegion
*
from
)
{
assert
(
from
!=
NULL
,
"from region must be non-NULL"
);
...
...
src/share/vm/gc_implementation/g1/g1RemSet.cpp
浏览文件 @
e55ff1ed
...
...
@@ -114,14 +114,14 @@ class ScanRSClosure : public HeapRegionClosure {
G1SATBCardTableModRefBS
*
_ct_bs
;
double
_strong_code_root_scan_time_sec
;
int
_worker_i
;
uint
_worker_i
;
int
_block_size
;
bool
_try_claimed
;
public:
ScanRSClosure
(
OopsInHeapRegionClosure
*
oc
,
CodeBlobToOopClosure
*
code_root_cl
,
int
worker_i
)
:
u
int
worker_i
)
:
_oc
(
oc
),
_code_root_cl
(
code_root_cl
),
_strong_code_root_scan_time_sec
(
0.0
),
...
...
@@ -163,7 +163,7 @@ public:
void
printCard
(
HeapRegion
*
card_region
,
size_t
card_index
,
HeapWord
*
card_start
)
{
gclog_or_tty
->
print_cr
(
"T
%d
Region ["
PTR_FORMAT
", "
PTR_FORMAT
") "
gclog_or_tty
->
print_cr
(
"T
"
UINT32_FORMAT
"
Region ["
PTR_FORMAT
", "
PTR_FORMAT
") "
"RS names card %p: "
"["
PTR_FORMAT
", "
PTR_FORMAT
")"
,
_worker_i
,
...
...
@@ -242,7 +242,7 @@ public:
void
G1RemSet
::
scanRS
(
OopsInHeapRegionClosure
*
oc
,
CodeBlobToOopClosure
*
code_root_cl
,
int
worker_i
)
{
u
int
worker_i
)
{
double
rs_time_start
=
os
::
elapsedTime
();
HeapRegion
*
startRegion
=
_g1
->
start_cset_region_for_worker
(
worker_i
);
...
...
@@ -275,13 +275,13 @@ public:
DirtyCardQueue
*
into_cset_dcq
)
:
_g1rs
(
g1h
->
g1_rem_set
()),
_into_cset_dcq
(
into_cset_dcq
)
{}
bool
do_card_ptr
(
jbyte
*
card_ptr
,
int
worker_i
)
{
bool
do_card_ptr
(
jbyte
*
card_ptr
,
u
int
worker_i
)
{
// The only time we care about recording cards that
// contain references that point into the collection set
// is during RSet updating within an evacuation pause.
// In this case worker_i should be the id of a GC worker thread.
assert
(
SafepointSynchronize
::
is_at_safepoint
(),
"not during an evacuation pause"
);
assert
(
worker_i
<
(
int
)
(
ParallelGCThreads
==
0
?
1
:
ParallelGCThreads
),
"should be a GC worker"
);
assert
(
worker_i
<
(
ParallelGCThreads
==
0
?
1
:
ParallelGCThreads
),
"should be a GC worker"
);
if
(
_g1rs
->
refine_card
(
card_ptr
,
worker_i
,
true
))
{
// 'card_ptr' contains references that point into the collection
...
...
@@ -296,7 +296,7 @@ public:
}
};
void
G1RemSet
::
updateRS
(
DirtyCardQueue
*
into_cset_dcq
,
int
worker_i
)
{
void
G1RemSet
::
updateRS
(
DirtyCardQueue
*
into_cset_dcq
,
u
int
worker_i
)
{
double
start
=
os
::
elapsedTime
();
// Apply the given closure to all remaining log entries.
RefineRecordRefsIntoCSCardTableEntryClosure
into_cset_update_rs_cl
(
_g1
,
into_cset_dcq
);
...
...
@@ -321,14 +321,14 @@ void G1RemSet::cleanupHRRS() {
void
G1RemSet
::
oops_into_collection_set_do
(
OopsInHeapRegionClosure
*
oc
,
CodeBlobToOopClosure
*
code_root_cl
,
int
worker_i
)
{
u
int
worker_i
)
{
#if CARD_REPEAT_HISTO
ct_freq_update_histo_and_reset
();
#endif
// We cache the value of 'oc' closure into the appropriate slot in the
// _cset_rs_update_cl for this worker
assert
(
worker_i
<
(
int
)
n_workers
(),
"sanity"
);
assert
(
worker_i
<
n_workers
(),
"sanity"
);
_cset_rs_update_cl
[
worker_i
]
=
oc
;
// A DirtyCardQueue that is used to hold cards containing references
...
...
@@ -400,7 +400,7 @@ public:
_g1
(
g1
),
_ct_bs
(
bs
)
{
}
bool
do_card_ptr
(
jbyte
*
card_ptr
,
int
worker_i
)
{
bool
do_card_ptr
(
jbyte
*
card_ptr
,
u
int
worker_i
)
{
// Construct the region representing the card.
HeapWord
*
start
=
_ct_bs
->
addr_for
(
card_ptr
);
// And find the region containing it.
...
...
@@ -544,7 +544,7 @@ G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
G1RemSet
*
rs
,
OopsInHeapRegionClosure
*
push_ref_cl
,
bool
record_refs_into_cset
,
int
worker_i
)
:
u
int
worker_i
)
:
_g1
(
g1h
),
_g1_rem_set
(
rs
),
_from
(
NULL
),
_record_refs_into_cset
(
record_refs_into_cset
),
_push_ref_cl
(
push_ref_cl
),
_worker_i
(
worker_i
)
{
}
...
...
@@ -553,7 +553,7 @@ G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h,
// into the collection set, if we're checking for such references;
// false otherwise.
bool
G1RemSet
::
refine_card
(
jbyte
*
card_ptr
,
int
worker_i
,
bool
G1RemSet
::
refine_card
(
jbyte
*
card_ptr
,
u
int
worker_i
,
bool
check_for_refs_into_cset
)
{
// If the card is no longer dirty, nothing to do.
...
...
src/share/vm/gc_implementation/g1/g1RemSet.hpp
浏览文件 @
e55ff1ed
...
...
@@ -97,7 +97,7 @@ public:
// In the sequential case this param will be ignored.
void
oops_into_collection_set_do
(
OopsInHeapRegionClosure
*
blk
,
CodeBlobToOopClosure
*
code_root_cl
,
int
worker_i
);
u
int
worker_i
);
// Prepare for and cleanup after an oops_into_collection_set_do
// call. Must call each of these once before and after (in sequential
...
...
@@ -109,9 +109,9 @@ public:
void
scanRS
(
OopsInHeapRegionClosure
*
oc
,
CodeBlobToOopClosure
*
code_root_cl
,
int
worker_i
);
u
int
worker_i
);
void
updateRS
(
DirtyCardQueue
*
into_cset_dcq
,
int
worker_i
);
void
updateRS
(
DirtyCardQueue
*
into_cset_dcq
,
u
int
worker_i
);
CardTableModRefBS
*
ct_bs
()
{
return
_ct_bs
;
}
size_t
cardsScanned
()
{
return
_total_cards_scanned
;
}
...
...
@@ -138,7 +138,7 @@ public:
// if the given card contains oops that have references into the
// current collection set.
virtual
bool
refine_card
(
jbyte
*
card_ptr
,
int
worker_i
,
u
int
worker_i
,
bool
check_for_refs_into_cset
);
// Print accumulated summary info from the start of the VM.
...
...
@@ -171,12 +171,12 @@ public:
class
UpdateRSOopClosure
:
public
ExtendedOopClosure
{
HeapRegion
*
_from
;
G1RemSet
*
_rs
;
int
_worker_i
;
u
int
_worker_i
;
template
<
class
T
>
void
do_oop_work
(
T
*
p
);
public:
UpdateRSOopClosure
(
G1RemSet
*
rs
,
int
worker_i
=
0
)
:
UpdateRSOopClosure
(
G1RemSet
*
rs
,
u
int
worker_i
=
0
)
:
_from
(
NULL
),
_rs
(
rs
),
_worker_i
(
worker_i
)
{}
...
...
src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
浏览文件 @
e55ff1ed
...
...
@@ -853,7 +853,7 @@ OtherRegionsTable::do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task) {
// This can be done by either mutator threads together with the
// concurrent refinement threads or GC threads.
uint
HeapRegionRemSet
::
num_par_rem_sets
()
{
return
(
uint
)
MAX2
(
DirtyCardQueueSet
::
num_par_ids
()
+
ConcurrentG1Refine
::
thread_num
(),
ParallelGCThreads
);
return
MAX2
(
DirtyCardQueueSet
::
num_par_ids
()
+
ConcurrentG1Refine
::
thread_num
(),
(
uint
)
ParallelGCThreads
);
}
HeapRegionRemSet
::
HeapRegionRemSet
(
G1BlockOffsetSharedArray
*
bosa
,
...
...
src/share/vm/gc_implementation/g1/satbQueue.cpp
浏览文件 @
e55ff1ed
...
...
@@ -290,7 +290,7 @@ void SATBMarkQueueSet::iterate_closure_all_threads() {
shared_satb_queue
()
->
apply_closure_and_empty
(
_closure
);
}
void
SATBMarkQueueSet
::
par_iterate_closure_all_threads
(
int
worker
)
{
void
SATBMarkQueueSet
::
par_iterate_closure_all_threads
(
u
int
worker
)
{
SharedHeap
*
sh
=
SharedHeap
::
heap
();
int
parity
=
sh
->
strong_roots_parity
();
...
...
@@ -315,7 +315,7 @@ void SATBMarkQueueSet::par_iterate_closure_all_threads(int worker) {
}
bool
SATBMarkQueueSet
::
apply_closure_to_completed_buffer_work
(
bool
par
,
int
worker
)
{
u
int
worker
)
{
BufferNode
*
nd
=
NULL
;
{
MutexLockerEx
x
(
_cbl_mon
,
Mutex
::
_no_safepoint_check_flag
);
...
...
src/share/vm/gc_implementation/g1/satbQueue.hpp
浏览文件 @
e55ff1ed
...
...
@@ -84,7 +84,7 @@ class SATBMarkQueueSet: public PtrQueueSet {
// Utility function to support sequential and parallel versions. If
// "par" is true, then "worker" is the par thread id; if "false", worker
// is ignored.
bool
apply_closure_to_completed_buffer_work
(
bool
par
,
int
worker
);
bool
apply_closure_to_completed_buffer_work
(
bool
par
,
u
int
worker
);
#ifdef ASSERT
void
dump_active_states
(
bool
expected_active
);
...
...
@@ -124,7 +124,7 @@ public:
// be called serially and at a safepoint.
void
iterate_closure_all_threads
();
// Parallel version of the above.
void
par_iterate_closure_all_threads
(
int
worker
);
void
par_iterate_closure_all_threads
(
u
int
worker
);
// If there exists some completed buffer, pop it, then apply the
// registered closure to all its elements, and return true. If no
...
...
@@ -133,7 +133,7 @@ public:
return
apply_closure_to_completed_buffer_work
(
false
,
0
);
}
// Parallel version of the above.
bool
par_apply_closure_to_completed_buffer
(
int
worker
)
{
bool
par_apply_closure_to_completed_buffer
(
u
int
worker
)
{
return
apply_closure_to_completed_buffer_work
(
true
,
worker
);
}
...
...
src/share/vm/runtime/thread.cpp
浏览文件 @
e55ff1ed
...
...
@@ -1420,8 +1420,8 @@ void WatcherThread::print_on(outputStream* st) const {
void
JavaThread
::
initialize
()
{
// Initialize fields
// Set the claimed par_id to
-1
(ie not claiming any par_ids)
set_claimed_par_id
(
-
1
);
// Set the claimed par_id to
UINT_MAX
(ie not claiming any par_ids)
set_claimed_par_id
(
UINT_MAX
);
set_saved_exception_pc
(
NULL
);
set_threadObj
(
NULL
);
...
...
src/share/vm/runtime/thread.hpp
浏览文件 @
e55ff1ed
...
...
@@ -1782,12 +1782,12 @@ public:
void
set_done_attaching_via_jni
()
{
_jni_attach_state
=
_attached_via_jni
;
OrderAccess
::
fence
();
}
private:
// This field is used to determine if a thread has claimed
// a par_id: it is
-1
if the thread has not claimed a par_id;
// a par_id: it is
UINT_MAX
if the thread has not claimed a par_id;
// otherwise its value is the par_id that has been claimed.
int
_claimed_par_id
;
u
int
_claimed_par_id
;
public:
int
get_claimed_par_id
()
{
return
_claimed_par_id
;
}
void
set_claimed_par_id
(
int
id
)
{
_claimed_par_id
=
id
;}
u
int
get_claimed_par_id
()
{
return
_claimed_par_id
;
}
void
set_claimed_par_id
(
u
int
id
)
{
_claimed_par_id
=
id
;}
};
// Inline implementation of JavaThread::current
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录