Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
86b977d9
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看板
提交
86b977d9
编写于
3月 16, 2012
作者:
J
jcoomes
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
3aaaf904
716a49de
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
69 addition
and
61 deletion
+69
-61
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+8
-1
src/share/vm/gc_implementation/g1/survRateGroup.cpp
src/share/vm/gc_implementation/g1/survRateGroup.cpp
+27
-55
src/share/vm/memory/cardTableModRefBS.hpp
src/share/vm/memory/cardTableModRefBS.hpp
+4
-1
src/share/vm/memory/cardTableRS.cpp
src/share/vm/memory/cardTableRS.cpp
+16
-1
src/share/vm/memory/cardTableRS.hpp
src/share/vm/memory/cardTableRS.hpp
+7
-1
src/share/vm/utilities/numberSeq.cpp
src/share/vm/utilities/numberSeq.cpp
+5
-1
src/share/vm/utilities/numberSeq.hpp
src/share/vm/utilities/numberSeq.hpp
+2
-1
未找到文件。
src/os/linux/vm/os_linux.cpp
浏览文件 @
86b977d9
...
...
@@ -2547,7 +2547,14 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
}
void
os
::
free_memory
(
char
*
addr
,
size_t
bytes
,
size_t
alignment_hint
)
{
// This method works by doing an mmap over an existing mmaping and effectively discarding
// the existing pages. However it won't work for SHM-based large pages that cannot be
// uncommitted at all. We don't do anything in this case to avoid creating a segment with
// small pages on top of the SHM segment. This method always works for small pages, so we
// allow that in any case.
if
(
alignment_hint
<=
(
size_t
)
os
::
vm_page_size
()
||
!
UseSHM
)
{
commit_memory
(
addr
,
bytes
,
alignment_hint
,
false
);
}
}
void
os
::
numa_make_global
(
char
*
addr
,
size_t
bytes
)
{
...
...
src/share/vm/gc_implementation/g1/survRateGroup.cpp
浏览文件 @
86b977d9
/*
* Copyright (c) 2001, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -38,33 +38,36 @@ SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p,
_summary_surv_rates
(
NULL
),
_surv_rate
(
NULL
),
_accum_surv_rate_pred
(
NULL
),
_surv_rate_pred
(
NULL
)
{
_surv_rate_pred
(
NULL
)
,
_stats_arrays_length
(
0
)
{
reset
();
if
(
summary_surv_rates_len
>
0
)
{
size_t
length
=
summary_surv_rates_len
;
_summary_surv_rates
=
NEW_C_HEAP_ARRAY
(
NumberSeq
*
,
length
);
if
(
_summary_surv_rates
==
NULL
)
{
vm_exit_out_of_memory
(
sizeof
(
NumberSeq
*
)
*
length
,
"Not enough space for surv rate summary"
);
}
for
(
size_t
i
=
0
;
i
<
length
;
++
i
)
for
(
size_t
i
=
0
;
i
<
length
;
++
i
)
{
_summary_surv_rates
[
i
]
=
new
NumberSeq
();
}
}
start_adding_regions
();
}
void
SurvRateGroup
::
reset
()
{
void
SurvRateGroup
::
reset
()
{
_all_regions_allocated
=
0
;
_setup_seq_num
=
0
;
_stats_arrays_length
=
0
;
_accum_surv_rate
=
0.0
;
_last_pred
=
0.0
;
// the following will set up the arrays with length 1
_region_num
=
1
;
// The call to stop_adding_regions() will use "new" to refill
// the _surv_rate_pred array, so we need to make sure to call
// "delete".
for
(
size_t
i
=
0
;
i
<
_stats_arrays_length
;
++
i
)
{
delete
_surv_rate_pred
[
i
];
}
_stats_arrays_length
=
0
;
stop_adding_regions
();
guarantee
(
_stats_arrays_length
==
1
,
"invariant"
);
guarantee
(
_surv_rate_pred
[
0
]
!=
NULL
,
"invariant"
);
...
...
@@ -73,72 +76,47 @@ void SurvRateGroup::reset()
_region_num
=
0
;
}
void
SurvRateGroup
::
start_adding_regions
()
{
_setup_seq_num
=
_stats_arrays_length
;
_region_num
=
0
;
_accum_surv_rate
=
0.0
;
#if 0
gclog_or_tty->print_cr("[%s] start adding regions, seq num %d, length %d",
_name, _setup_seq_num, _region_num);
#endif // 0
}
void
SurvRateGroup
::
stop_adding_regions
()
{
#if 0
gclog_or_tty->print_cr("[%s] stop adding regions, length %d", _name, _region_num);
#endif // 0
if
(
_region_num
>
_stats_arrays_length
)
{
double
*
old_surv_rate
=
_surv_rate
;
double
*
old_accum_surv_rate_pred
=
_accum_surv_rate_pred
;
TruncatedSeq
**
old_surv_rate_pred
=
_surv_rate_pred
;
_surv_rate
=
NEW_C_HEAP_ARRAY
(
double
,
_region_num
);
if
(
_surv_rate
==
NULL
)
{
vm_exit_out_of_memory
(
sizeof
(
double
)
*
_region_num
,
"Not enough space for surv rate array."
);
}
_accum_surv_rate_pred
=
NEW_C_HEAP_ARRAY
(
double
,
_region_num
);
if
(
_accum_surv_rate_pred
==
NULL
)
{
vm_exit_out_of_memory
(
sizeof
(
double
)
*
_region_num
,
"Not enough space for accum surv rate pred array."
);
}
_surv_rate_pred
=
NEW_C_HEAP_ARRAY
(
TruncatedSeq
*
,
_region_num
);
if
(
_surv_rate
==
NULL
)
{
vm_exit_out_of_memory
(
sizeof
(
TruncatedSeq
*
)
*
_region_num
,
"Not enough space for surv rate pred array."
);
}
for
(
size_t
i
=
0
;
i
<
_stats_arrays_length
;
++
i
)
for
(
size_t
i
=
0
;
i
<
_stats_arrays_length
;
++
i
)
{
_surv_rate_pred
[
i
]
=
old_surv_rate_pred
[
i
];
#if 0
gclog_or_tty->print_cr("[%s] stop adding regions, new seqs %d to %d",
_name, _array_length, _region_num - 1);
#endif // 0
}
for
(
size_t
i
=
_stats_arrays_length
;
i
<
_region_num
;
++
i
)
{
_surv_rate_pred
[
i
]
=
new
TruncatedSeq
(
10
);
// _surv_rate_pred[i]->add(last_pred);
}
_stats_arrays_length
=
_region_num
;
if
(
old_surv_rate
!=
NULL
)
if
(
old_surv_rate
!=
NULL
)
{
FREE_C_HEAP_ARRAY
(
double
,
old_surv_rate
);
if
(
old_accum_surv_rate_pred
!=
NULL
)
}
if
(
old_accum_surv_rate_pred
!=
NULL
)
{
FREE_C_HEAP_ARRAY
(
double
,
old_accum_surv_rate_pred
);
if
(
old_surv_rate_pred
!=
NULL
)
FREE_C_HEAP_ARRAY
(
NumberSeq
*
,
old_surv_rate_pred
);
}
if
(
old_surv_rate_pred
!=
NULL
)
{
FREE_C_HEAP_ARRAY
(
TruncatedSeq
*
,
old_surv_rate_pred
);
}
}
for
(
size_t
i
=
0
;
i
<
_stats_arrays_length
;
++
i
)
for
(
size_t
i
=
0
;
i
<
_stats_arrays_length
;
++
i
)
{
_surv_rate
[
i
]
=
0.0
;
}
}
double
...
...
@@ -187,12 +165,6 @@ void
SurvRateGroup
::
all_surviving_words_recorded
(
bool
propagate
)
{
if
(
propagate
&&
_region_num
>
0
)
{
// conservative
double
surv_rate
=
_surv_rate_pred
[
_region_num
-
1
]
->
last
();
#if 0
gclog_or_tty->print_cr("propagating %1.2lf from %d to %d",
surv_rate, _curr_length, _array_length - 1);
#endif // 0
for
(
size_t
i
=
_region_num
;
i
<
_stats_arrays_length
;
++
i
)
{
guarantee
(
_surv_rate
[
i
]
<=
0.00001
,
"the slot should not have been updated"
);
...
...
src/share/vm/memory/cardTableModRefBS.hpp
浏览文件 @
86b977d9
/*
* Copyright (c) 2000, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -72,6 +72,9 @@ class CardTableModRefBS: public ModRefBarrierSet {
CT_MR_BS_last_reserved
=
16
};
// a word's worth (row) of clean card values
static
const
intptr_t
clean_card_row
=
(
intptr_t
)(
-
1
);
// dirty and precleaned are equivalent wrt younger_refs_iter.
static
bool
card_is_dirty_wrt_gen_iter
(
jbyte
cv
)
{
return
cv
==
dirty_card
||
cv
==
precleaned_card
;
...
...
src/share/vm/memory/cardTableRS.cpp
浏览文件 @
86b977d9
/*
* Copyright (c) 2001, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -173,6 +173,10 @@ ClearNoncleanCardWrapper::ClearNoncleanCardWrapper(
SharedHeap
::
heap
()
->
workers
()
->
active_workers
()),
"Mismatch"
);
}
bool
ClearNoncleanCardWrapper
::
is_word_aligned
(
jbyte
*
entry
)
{
return
(((
intptr_t
)
entry
)
&
(
BytesPerWord
-
1
))
==
0
;
}
void
ClearNoncleanCardWrapper
::
do_MemRegion
(
MemRegion
mr
)
{
assert
(
mr
.
word_size
()
>
0
,
"Error"
);
assert
(
_ct
->
is_aligned
(
mr
.
start
()),
"mr.start() should be card aligned"
);
...
...
@@ -194,6 +198,17 @@ void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) {
const
MemRegion
mrd
(
start_of_non_clean
,
end_of_non_clean
);
_dirty_card_closure
->
do_MemRegion
(
mrd
);
}
// fast forward through potential continuous whole-word range of clean cards beginning at a word-boundary
if
(
is_word_aligned
(
cur_entry
))
{
jbyte
*
cur_row
=
cur_entry
-
BytesPerWord
;
while
(
cur_row
>=
limit
&&
*
((
intptr_t
*
)
cur_row
)
==
CardTableRS
::
clean_card_row
())
{
cur_row
-=
BytesPerWord
;
}
cur_entry
=
cur_row
+
BytesPerWord
;
cur_hw
=
_ct
->
addr_for
(
cur_entry
);
}
// Reset the dirty window, while continuing to look
// for the next dirty card that will start a
// new dirty window.
...
...
src/share/vm/memory/cardTableRS.hpp
浏览文件 @
86b977d9
/*
* Copyright (c) 2001, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -45,6 +45,10 @@ class CardTableRS: public GenRemSet {
return
CardTableModRefBS
::
clean_card
;
}
static
intptr_t
clean_card_row
()
{
return
CardTableModRefBS
::
clean_card_row
;
}
static
bool
card_is_dirty_wrt_gen_iter
(
jbyte
cv
)
{
return
CardTableModRefBS
::
card_is_dirty_wrt_gen_iter
(
cv
);
...
...
@@ -176,6 +180,8 @@ private:
// Work methods called by the clear_card()
inline
bool
clear_card_serial
(
jbyte
*
entry
);
inline
bool
clear_card_parallel
(
jbyte
*
entry
);
// check alignment of pointer
bool
is_word_aligned
(
jbyte
*
entry
);
public:
ClearNoncleanCardWrapper
(
DirtyCardToOopClosure
*
dirty_card_closure
,
CardTableRS
*
ct
);
...
...
src/share/vm/utilities/numberSeq.cpp
浏览文件 @
86b977d9
/*
* Copyright (c) 2001, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -156,6 +156,10 @@ TruncatedSeq::TruncatedSeq(int length, double alpha):
_sequence
[
i
]
=
0.0
;
}
TruncatedSeq
::~
TruncatedSeq
()
{
FREE_C_HEAP_ARRAY
(
double
,
_sequence
);
}
void
TruncatedSeq
::
add
(
double
val
)
{
AbsSeq
::
add
(
val
);
...
...
src/share/vm/utilities/numberSeq.hpp
浏览文件 @
86b977d9
/*
* Copyright (c) 2001, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -118,6 +118,7 @@ public:
// accepts a value for L
TruncatedSeq
(
int
length
=
DefaultSeqLength
,
double
alpha
=
DEFAULT_ALPHA_VALUE
);
~
TruncatedSeq
();
virtual
void
add
(
double
val
);
virtual
double
maximum
()
const
;
virtual
double
last
()
const
;
// the last value added to the sequence
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录