Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
e8d900d1
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看板
提交
e8d900d1
编写于
6月 18, 2013
作者:
B
brutisso
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8016556: G1: Use ArrayAllocator for BitMaps
Reviewed-by: tschatzl, dholmes, coleenp, johnc
上级
7e320bca
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
8 deletion
+19
-8
src/share/vm/memory/allocation.hpp
src/share/vm/memory/allocation.hpp
+11
-3
src/share/vm/utilities/bitMap.cpp
src/share/vm/utilities/bitMap.cpp
+6
-4
src/share/vm/utilities/bitMap.hpp
src/share/vm/utilities/bitMap.hpp
+2
-1
未找到文件。
src/share/vm/memory/allocation.hpp
浏览文件 @
e8d900d1
...
@@ -713,13 +713,21 @@ public:
...
@@ -713,13 +713,21 @@ public:
// is set so that we always use malloc except for Solaris where we set the
// is set so that we always use malloc except for Solaris where we set the
// limit to get mapped memory.
// limit to get mapped memory.
template
<
class
E
,
MEMFLAGS
F
>
template
<
class
E
,
MEMFLAGS
F
>
class
ArrayAllocator
:
StackObj
{
class
ArrayAllocator
VALUE_OBJ_CLASS_SPEC
{
char
*
_addr
;
char
*
_addr
;
bool
_use_malloc
;
bool
_use_malloc
;
size_t
_size
;
size_t
_size
;
bool
_free_in_destructor
;
public:
public:
ArrayAllocator
()
:
_addr
(
NULL
),
_use_malloc
(
false
),
_size
(
0
)
{
}
ArrayAllocator
(
bool
free_in_destructor
=
true
)
:
~
ArrayAllocator
()
{
free
();
}
_addr
(
NULL
),
_use_malloc
(
false
),
_size
(
0
),
_free_in_destructor
(
free_in_destructor
)
{
}
~
ArrayAllocator
()
{
if
(
_free_in_destructor
)
{
free
();
}
}
E
*
allocate
(
size_t
length
);
E
*
allocate
(
size_t
length
);
void
free
();
void
free
();
};
};
...
...
src/share/vm/utilities/bitMap.cpp
浏览文件 @
e8d900d1
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
BitMap
::
BitMap
(
bm_word_t
*
map
,
idx_t
size_in_bits
)
:
BitMap
::
BitMap
(
bm_word_t
*
map
,
idx_t
size_in_bits
)
:
_map
(
map
),
_size
(
size_in_bits
)
_map
(
map
),
_size
(
size_in_bits
)
,
_map_allocator
(
false
)
{
{
assert
(
sizeof
(
bm_word_t
)
==
BytesPerWord
,
"Implementation assumption."
);
assert
(
sizeof
(
bm_word_t
)
==
BytesPerWord
,
"Implementation assumption."
);
assert
(
size_in_bits
>=
0
,
"just checking"
);
assert
(
size_in_bits
>=
0
,
"just checking"
);
...
@@ -49,7 +49,7 @@ BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) :
...
@@ -49,7 +49,7 @@ BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) :
BitMap
::
BitMap
(
idx_t
size_in_bits
,
bool
in_resource_area
)
:
BitMap
::
BitMap
(
idx_t
size_in_bits
,
bool
in_resource_area
)
:
_map
(
NULL
),
_size
(
0
)
_map
(
NULL
),
_size
(
0
)
,
_map_allocator
(
false
)
{
{
assert
(
sizeof
(
bm_word_t
)
==
BytesPerWord
,
"Implementation assumption."
);
assert
(
sizeof
(
bm_word_t
)
==
BytesPerWord
,
"Implementation assumption."
);
resize
(
size_in_bits
,
in_resource_area
);
resize
(
size_in_bits
,
in_resource_area
);
...
@@ -65,8 +65,10 @@ void BitMap::resize(idx_t size_in_bits, bool in_resource_area) {
...
@@ -65,8 +65,10 @@ void BitMap::resize(idx_t size_in_bits, bool in_resource_area) {
if
(
in_resource_area
)
{
if
(
in_resource_area
)
{
_map
=
NEW_RESOURCE_ARRAY
(
bm_word_t
,
new_size_in_words
);
_map
=
NEW_RESOURCE_ARRAY
(
bm_word_t
,
new_size_in_words
);
}
else
{
}
else
{
if
(
old_map
!=
NULL
)
FREE_C_HEAP_ARRAY
(
bm_word_t
,
_map
,
mtInternal
);
if
(
old_map
!=
NULL
)
{
_map
=
NEW_C_HEAP_ARRAY
(
bm_word_t
,
new_size_in_words
,
mtInternal
);
_map_allocator
.
free
();
}
_map
=
_map_allocator
.
allocate
(
new_size_in_words
);
}
}
Copy
::
disjoint_words
((
HeapWord
*
)
old_map
,
(
HeapWord
*
)
_map
,
Copy
::
disjoint_words
((
HeapWord
*
)
old_map
,
(
HeapWord
*
)
_map
,
MIN2
(
old_size_in_words
,
new_size_in_words
));
MIN2
(
old_size_in_words
,
new_size_in_words
));
...
...
src/share/vm/utilities/bitMap.hpp
浏览文件 @
e8d900d1
...
@@ -48,6 +48,7 @@ class BitMap VALUE_OBJ_CLASS_SPEC {
...
@@ -48,6 +48,7 @@ class BitMap VALUE_OBJ_CLASS_SPEC {
}
RangeSizeHint
;
}
RangeSizeHint
;
private:
private:
ArrayAllocator
<
bm_word_t
,
mtInternal
>
_map_allocator
;
bm_word_t
*
_map
;
// First word in bitmap
bm_word_t
*
_map
;
// First word in bitmap
idx_t
_size
;
// Size of bitmap (in bits)
idx_t
_size
;
// Size of bitmap (in bits)
...
@@ -113,7 +114,7 @@ class BitMap VALUE_OBJ_CLASS_SPEC {
...
@@ -113,7 +114,7 @@ class BitMap VALUE_OBJ_CLASS_SPEC {
public:
public:
// Constructs a bitmap with no map, and size 0.
// Constructs a bitmap with no map, and size 0.
BitMap
()
:
_map
(
NULL
),
_size
(
0
)
{}
BitMap
()
:
_map
(
NULL
),
_size
(
0
)
,
_map_allocator
(
false
)
{}
// Constructs a bitmap with the given map and size.
// Constructs a bitmap with the given map and size.
BitMap
(
bm_word_t
*
map
,
idx_t
size_in_bits
);
BitMap
(
bm_word_t
*
map
,
idx_t
size_in_bits
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录