Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
6d985ac4
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看板
提交
6d985ac4
编写于
1月 22, 2015
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
28ec7e4f
814045f5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
20 deletion
+40
-20
.hgtags
.hgtags
+2
-0
src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
...share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
+26
-12
src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp
...share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp
+9
-4
src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp
src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp
+3
-4
未找到文件。
.hgtags
浏览文件 @
6d985ac4
...
...
@@ -587,6 +587,8 @@ d9349fa8822336e0244da0a8448f3e6b2d62741d jdk8u40-b19
c3933f52eeb33f70ee562464edddfe9f01d944fd jdk8u40-b20
d2e9a6bec4f2eec8506eed16f7324992a85d8480 hs25.40-b24
25ec4a67433744bbe3406e5069e7fd1876ebbf2f jdk8u40-b21
0f0cb4eeab2d871274f4ffdcd6017d2fdfa89238 hs25.40-b25
0ee548a1cda08c884eccd563e2d5fdb6ee769b5a jdk8u40-b22
b95f13f05f553309cd74d6ccf8fcedb259c6716c jdk8u45-b00
41c3c456e326185053f0654be838f4b0bfb38078 jdk8u45-b01
626fd8c2eec63e2a2dff3839bfe12c0431bf00a4 jdk8u45-b02
...
...
src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
浏览文件 @
6d985ac4
...
...
@@ -45,7 +45,8 @@
#include "utilities/bitMap.inline.hpp"
G1PageBasedVirtualSpace
::
G1PageBasedVirtualSpace
()
:
_low_boundary
(
NULL
),
_high_boundary
(
NULL
),
_committed
(),
_page_size
(
0
),
_special
(
false
),
_executable
(
false
)
{
_high_boundary
(
NULL
),
_committed
(),
_page_size
(
0
),
_special
(
false
),
_dirty
(),
_executable
(
false
)
{
}
bool
G1PageBasedVirtualSpace
::
initialize_with_granularity
(
ReservedSpace
rs
,
size_t
page_size
)
{
...
...
@@ -66,6 +67,9 @@ bool G1PageBasedVirtualSpace::initialize_with_granularity(ReservedSpace rs, size
assert
(
_committed
.
size
()
==
0
,
"virtual space initialized more than once"
);
uintx
size_in_bits
=
rs
.
size
()
/
page_size
;
_committed
.
resize
(
size_in_bits
,
/* in_resource_area */
false
);
if
(
_special
)
{
_dirty
.
resize
(
size_in_bits
,
/* in_resource_area */
false
);
}
return
true
;
}
...
...
@@ -84,6 +88,7 @@ void G1PageBasedVirtualSpace::release() {
_executable
=
false
;
_page_size
=
0
;
_committed
.
resize
(
0
,
false
);
_dirty
.
resize
(
0
,
false
);
}
size_t
G1PageBasedVirtualSpace
::
committed_size
()
const
{
...
...
@@ -120,31 +125,40 @@ size_t G1PageBasedVirtualSpace::byte_size_for_pages(size_t num) {
return
num
*
_page_size
;
}
MemRegion
G1PageBasedVirtualSpace
::
commit
(
uintptr_t
start
,
size_t
size_in_pages
)
{
bool
G1PageBasedVirtualSpace
::
commit
(
uintptr_t
start
,
size_t
size_in_pages
)
{
// We need to make sure to commit all pages covered by the given area.
guarantee
(
is_area_uncommitted
(
start
,
size_in_pages
),
"Specified area is not uncommitted"
);
if
(
!
_special
)
{
bool
zero_filled
=
true
;
uintptr_t
end
=
start
+
size_in_pages
;
if
(
_special
)
{
// Check for dirty pages and update zero_filled if any found.
if
(
_dirty
.
get_next_one_offset
(
start
,
end
)
<
end
)
{
zero_filled
=
false
;
_dirty
.
clear_range
(
start
,
end
);
}
}
else
{
os
::
commit_memory_or_exit
(
page_start
(
start
),
byte_size_for_pages
(
size_in_pages
),
_executable
,
err_msg
(
"Failed to commit pages from "
SIZE_FORMAT
" of length "
SIZE_FORMAT
,
start
,
size_in_pages
));
}
_committed
.
set_range
(
start
,
start
+
size_in_pages
);
_committed
.
set_range
(
start
,
end
);
MemRegion
result
((
HeapWord
*
)
page_start
(
start
),
byte_size_for_pages
(
size_in_pages
)
/
HeapWordSize
);
return
result
;
return
zero_filled
;
}
MemRegion
G1PageBasedVirtualSpace
::
uncommit
(
uintptr_t
start
,
size_t
size_in_pages
)
{
void
G1PageBasedVirtualSpace
::
uncommit
(
uintptr_t
start
,
size_t
size_in_pages
)
{
guarantee
(
is_area_committed
(
start
,
size_in_pages
),
"checking"
);
if
(
!
_special
)
{
if
(
_special
)
{
// Mark that memory is dirty. If committed again the memory might
// need to be cleared explicitly.
_dirty
.
set_range
(
start
,
start
+
size_in_pages
);
}
else
{
os
::
uncommit_memory
(
page_start
(
start
),
byte_size_for_pages
(
size_in_pages
));
}
_committed
.
clear_range
(
start
,
start
+
size_in_pages
);
MemRegion
result
((
HeapWord
*
)
page_start
(
start
),
byte_size_for_pages
(
size_in_pages
)
/
HeapWordSize
);
return
result
;
}
bool
G1PageBasedVirtualSpace
::
contains
(
const
void
*
p
)
const
{
...
...
@@ -154,7 +168,7 @@ bool G1PageBasedVirtualSpace::contains(const void* p) const {
#ifndef PRODUCT
void
G1PageBasedVirtualSpace
::
print_on
(
outputStream
*
out
)
{
out
->
print
(
"Virtual space:"
);
if
(
special
()
)
out
->
print
(
" (pinned in memory)"
);
if
(
_special
)
out
->
print
(
" (pinned in memory)"
);
out
->
cr
();
out
->
print_cr
(
" - committed: "
SIZE_FORMAT
,
committed_size
());
out
->
print_cr
(
" - reserved: "
SIZE_FORMAT
,
reserved_size
());
...
...
src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp
浏览文件 @
6d985ac4
...
...
@@ -49,6 +49,12 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
// Bitmap used for verification of commit/uncommit operations.
BitMap
_committed
;
// Bitmap used to keep track of which pages are dirty or not for _special
// spaces. This is needed because for those spaces the underlying memory
// will only be zero filled the first time it is committed. Calls to commit
// will use this bitmap and return whether or not the memory is zero filled.
BitMap
_dirty
;
// Indicates that the entire space has been committed and pinned in memory,
// os::commit_memory() or os::uncommit_memory() have no function.
bool
_special
;
...
...
@@ -71,12 +77,11 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
public:
// Commit the given area of pages starting at start being size_in_pages large.
MemRegion
commit
(
uintptr_t
start
,
size_t
size_in_pages
);
// Returns true if the given area is zero filled upon completion.
bool
commit
(
uintptr_t
start
,
size_t
size_in_pages
);
// Uncommit the given area of pages starting at start being size_in_pages large.
MemRegion
uncommit
(
uintptr_t
start
,
size_t
size_in_pages
);
bool
special
()
const
{
return
_special
;
}
void
uncommit
(
uintptr_t
start
,
size_t
size_in_pages
);
// Initialization
G1PageBasedVirtualSpace
();
...
...
src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp
浏览文件 @
6d985ac4
...
...
@@ -67,9 +67,9 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper {
}
virtual
void
commit_regions
(
uintptr_t
start_idx
,
size_t
num_regions
)
{
_storage
.
commit
(
start_idx
*
_pages_per_region
,
num_regions
*
_pages_per_region
);
bool
zero_filled
=
_storage
.
commit
(
start_idx
*
_pages_per_region
,
num_regions
*
_pages_per_region
);
_commit_map
.
set_range
(
start_idx
,
start_idx
+
num_regions
);
fire_on_commit
(
start_idx
,
num_regions
,
true
);
fire_on_commit
(
start_idx
,
num_regions
,
zero_filled
);
}
virtual
void
uncommit_regions
(
uintptr_t
start_idx
,
size_t
num_regions
)
{
...
...
@@ -117,8 +117,7 @@ class G1RegionsSmallerThanCommitSizeMapper : public G1RegionToSpaceMapper {
uint
old_refcount
=
_refcounts
.
get_by_index
(
idx
);
bool
zero_filled
=
false
;
if
(
old_refcount
==
0
)
{
_storage
.
commit
(
idx
,
1
);
zero_filled
=
true
;
zero_filled
=
_storage
.
commit
(
idx
,
1
);
}
_refcounts
.
set_by_index
(
idx
,
old_refcount
+
1
);
_commit_map
.
set_bit
(
i
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录