Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
3fdcdb33
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看板
提交
3fdcdb33
编写于
6月 04, 2013
作者:
J
johnc
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
e6684fe0
fc475a94
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
98 addition
and
17 deletion
+98
-17
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+97
-16
src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp
src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp
+1
-1
未找到文件。
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
浏览文件 @
3fdcdb33
...
@@ -593,11 +593,6 @@ protected:
...
@@ -593,11 +593,6 @@ protected:
// may not be a humongous - it must fit into a single heap region.
// may not be a humongous - it must fit into a single heap region.
HeapWord
*
par_allocate_during_gc
(
GCAllocPurpose
purpose
,
size_t
word_size
);
HeapWord
*
par_allocate_during_gc
(
GCAllocPurpose
purpose
,
size_t
word_size
);
HeapWord
*
allocate_during_gc_slow
(
GCAllocPurpose
purpose
,
HeapRegion
*
alloc_region
,
bool
par
,
size_t
word_size
);
// Ensure that no further allocations can happen in "r", bearing in mind
// Ensure that no further allocations can happen in "r", bearing in mind
// that parallel threads might be attempting allocations.
// that parallel threads might be attempting allocations.
void
par_allocate_remaining_space
(
HeapRegion
*
r
);
void
par_allocate_remaining_space
(
HeapRegion
*
r
);
...
@@ -1733,6 +1728,95 @@ public:
...
@@ -1733,6 +1728,95 @@ public:
ParGCAllocBuffer
::
retire
(
end_of_gc
,
retain
);
ParGCAllocBuffer
::
retire
(
end_of_gc
,
retain
);
_retired
=
true
;
_retired
=
true
;
}
}
bool
is_retired
()
{
return
_retired
;
}
};
class
G1ParGCAllocBufferContainer
{
protected:
static
int
const
_priority_max
=
2
;
G1ParGCAllocBuffer
*
_priority_buffer
[
_priority_max
];
public:
G1ParGCAllocBufferContainer
(
size_t
gclab_word_size
)
{
for
(
int
pr
=
0
;
pr
<
_priority_max
;
++
pr
)
{
_priority_buffer
[
pr
]
=
new
G1ParGCAllocBuffer
(
gclab_word_size
);
}
}
~
G1ParGCAllocBufferContainer
()
{
for
(
int
pr
=
0
;
pr
<
_priority_max
;
++
pr
)
{
assert
(
_priority_buffer
[
pr
]
->
is_retired
(),
"alloc buffers should all retire at this point."
);
delete
_priority_buffer
[
pr
];
}
}
HeapWord
*
allocate
(
size_t
word_sz
)
{
HeapWord
*
obj
;
for
(
int
pr
=
0
;
pr
<
_priority_max
;
++
pr
)
{
obj
=
_priority_buffer
[
pr
]
->
allocate
(
word_sz
);
if
(
obj
!=
NULL
)
return
obj
;
}
return
obj
;
}
bool
contains
(
void
*
addr
)
{
for
(
int
pr
=
0
;
pr
<
_priority_max
;
++
pr
)
{
if
(
_priority_buffer
[
pr
]
->
contains
(
addr
))
return
true
;
}
return
false
;
}
void
undo_allocation
(
HeapWord
*
obj
,
size_t
word_sz
)
{
bool
finish_undo
;
for
(
int
pr
=
0
;
pr
<
_priority_max
;
++
pr
)
{
if
(
_priority_buffer
[
pr
]
->
contains
(
obj
))
{
_priority_buffer
[
pr
]
->
undo_allocation
(
obj
,
word_sz
);
finish_undo
=
true
;
}
}
if
(
!
finish_undo
)
ShouldNotReachHere
();
}
size_t
words_remaining
()
{
size_t
result
=
0
;
for
(
int
pr
=
0
;
pr
<
_priority_max
;
++
pr
)
{
result
+=
_priority_buffer
[
pr
]
->
words_remaining
();
}
return
result
;
}
size_t
words_remaining_in_retired_buffer
()
{
G1ParGCAllocBuffer
*
retired
=
_priority_buffer
[
0
];
return
retired
->
words_remaining
();
}
void
flush_stats_and_retire
(
PLABStats
*
stats
,
bool
end_of_gc
,
bool
retain
)
{
for
(
int
pr
=
0
;
pr
<
_priority_max
;
++
pr
)
{
_priority_buffer
[
pr
]
->
flush_stats_and_retire
(
stats
,
end_of_gc
,
retain
);
}
}
void
update
(
bool
end_of_gc
,
bool
retain
,
HeapWord
*
buf
,
size_t
word_sz
)
{
G1ParGCAllocBuffer
*
retired_and_set
=
_priority_buffer
[
0
];
retired_and_set
->
retire
(
end_of_gc
,
retain
);
retired_and_set
->
set_buf
(
buf
);
retired_and_set
->
set_word_size
(
word_sz
);
adjust_priority_order
();
}
private:
void
adjust_priority_order
()
{
G1ParGCAllocBuffer
*
retired_and_set
=
_priority_buffer
[
0
];
int
last
=
_priority_max
-
1
;
for
(
int
pr
=
0
;
pr
<
last
;
++
pr
)
{
_priority_buffer
[
pr
]
=
_priority_buffer
[
pr
+
1
];
}
_priority_buffer
[
last
]
=
retired_and_set
;
}
};
};
class
G1ParScanThreadState
:
public
StackObj
{
class
G1ParScanThreadState
:
public
StackObj
{
...
@@ -1743,9 +1827,9 @@ protected:
...
@@ -1743,9 +1827,9 @@ protected:
CardTableModRefBS
*
_ct_bs
;
CardTableModRefBS
*
_ct_bs
;
G1RemSet
*
_g1_rem
;
G1RemSet
*
_g1_rem
;
G1ParGCAllocBuffer
_surviving_alloc_buffer
;
G1ParGCAllocBuffer
Container
_surviving_alloc_buffer
;
G1ParGCAllocBuffer
_tenured_alloc_buffer
;
G1ParGCAllocBuffer
Container
_tenured_alloc_buffer
;
G1ParGCAllocBuffer
*
_alloc_buffers
[
GCAllocPurposeCount
];
G1ParGCAllocBuffer
Container
*
_alloc_buffers
[
GCAllocPurposeCount
];
ageTable
_age_table
;
ageTable
_age_table
;
size_t
_alloc_buffer_waste
;
size_t
_alloc_buffer_waste
;
...
@@ -1809,7 +1893,7 @@ public:
...
@@ -1809,7 +1893,7 @@ public:
RefToScanQueue
*
refs
()
{
return
_refs
;
}
RefToScanQueue
*
refs
()
{
return
_refs
;
}
ageTable
*
age_table
()
{
return
&
_age_table
;
}
ageTable
*
age_table
()
{
return
&
_age_table
;
}
G1ParGCAllocBuffer
*
alloc_buffer
(
GCAllocPurpose
purpose
)
{
G1ParGCAllocBuffer
Container
*
alloc_buffer
(
GCAllocPurpose
purpose
)
{
return
_alloc_buffers
[
purpose
];
return
_alloc_buffers
[
purpose
];
}
}
...
@@ -1839,15 +1923,13 @@ public:
...
@@ -1839,15 +1923,13 @@ public:
HeapWord
*
obj
=
NULL
;
HeapWord
*
obj
=
NULL
;
size_t
gclab_word_size
=
_g1h
->
desired_plab_sz
(
purpose
);
size_t
gclab_word_size
=
_g1h
->
desired_plab_sz
(
purpose
);
if
(
word_sz
*
100
<
gclab_word_size
*
ParallelGCBufferWastePct
)
{
if
(
word_sz
*
100
<
gclab_word_size
*
ParallelGCBufferWastePct
)
{
G1ParGCAllocBuffer
*
alloc_buf
=
alloc_buffer
(
purpose
);
G1ParGCAllocBufferContainer
*
alloc_buf
=
alloc_buffer
(
purpose
);
add_to_alloc_buffer_waste
(
alloc_buf
->
words_remaining
());
alloc_buf
->
retire
(
false
/* end_of_gc */
,
false
/* retain */
);
HeapWord
*
buf
=
_g1h
->
par_allocate_during_gc
(
purpose
,
gclab_word_size
);
HeapWord
*
buf
=
_g1h
->
par_allocate_during_gc
(
purpose
,
gclab_word_size
);
if
(
buf
==
NULL
)
return
NULL
;
// Let caller handle allocation failure.
if
(
buf
==
NULL
)
return
NULL
;
// Let caller handle allocation failure.
// Otherwise.
a
lloc_buf
->
set_word_size
(
gclab_word_size
);
a
dd_to_alloc_buffer_waste
(
alloc_buf
->
words_remaining_in_retired_buffer
()
);
alloc_buf
->
set_buf
(
buf
);
alloc_buf
->
update
(
false
/* end_of_gc */
,
false
/* retain */
,
buf
,
gclab_word_size
);
obj
=
alloc_buf
->
allocate
(
word_sz
);
obj
=
alloc_buf
->
allocate
(
word_sz
);
assert
(
obj
!=
NULL
,
"buffer was definitely big enough..."
);
assert
(
obj
!=
NULL
,
"buffer was definitely big enough..."
);
...
@@ -1959,7 +2041,6 @@ public:
...
@@ -1959,7 +2041,6 @@ public:
}
}
}
}
public:
void
trim_queue
();
void
trim_queue
();
};
};
...
...
src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp
浏览文件 @
3fdcdb33
...
@@ -158,7 +158,7 @@ public:
...
@@ -158,7 +158,7 @@ public:
// Fills in the unallocated portion of the buffer with a garbage object.
// Fills in the unallocated portion of the buffer with a garbage object.
// If "end_of_gc" is TRUE, is after the last use in the GC. IF "retain"
// If "end_of_gc" is TRUE, is after the last use in the GC. IF "retain"
// is true, attempt to re-use the unused portion in the next GC.
// is true, attempt to re-use the unused portion in the next GC.
void
retire
(
bool
end_of_gc
,
bool
retain
);
v
irtual
v
oid
retire
(
bool
end_of_gc
,
bool
retain
);
void
print
()
PRODUCT_RETURN
;
void
print
()
PRODUCT_RETURN
;
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录