Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
676405f8
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看板
提交
676405f8
编写于
8月 04, 2014
作者:
J
jmasa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8031323: Optionally align objects copied to survivor spaces
Reviewed-by: brutisso, tschatzl
上级
a5eefa17
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
201 addition
and
25 deletion
+201
-25
src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
+6
-1
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+3
-3
src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
+1
-1
src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp
.../vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp
+3
-16
src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp
...implementation/parallelScavenge/psPromotionLAB.inline.hpp
+52
-0
src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
...ementation/parallelScavenge/psPromotionManager.inline.hpp
+1
-0
src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp
src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp
+4
-1
src/share/vm/gc_implementation/shared/parGCAllocBuffer.inline.hpp
...e/vm/gc_implementation/shared/parGCAllocBuffer.inline.hpp
+44
-0
src/share/vm/gc_interface/collectedHeap.hpp
src/share/vm/gc_interface/collectedHeap.hpp
+6
-0
src/share/vm/gc_interface/collectedHeap.inline.hpp
src/share/vm/gc_interface/collectedHeap.inline.hpp
+38
-0
src/share/vm/memory/defNewGeneration.cpp
src/share/vm/memory/defNewGeneration.cpp
+1
-1
src/share/vm/memory/space.cpp
src/share/vm/memory/space.cpp
+22
-0
src/share/vm/memory/space.hpp
src/share/vm/memory/space.hpp
+1
-0
src/share/vm/oops/oop.pcgc.inline.hpp
src/share/vm/oops/oop.pcgc.inline.hpp
+0
-2
src/share/vm/runtime/arguments.cpp
src/share/vm/runtime/arguments.cpp
+16
-0
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/globals.hpp
+3
-0
未找到文件。
src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
浏览文件 @
676405f8
...
...
@@ -288,7 +288,12 @@ void G1ParScanThreadState::undo_allocation(GCAllocPurpose purpose, HeapWord* obj
}
HeapWord
*
G1ParScanThreadState
::
allocate
(
GCAllocPurpose
purpose
,
size_t
word_sz
)
{
HeapWord
*
obj
=
alloc_buffer
(
purpose
)
->
allocate
(
word_sz
);
HeapWord
*
obj
=
NULL
;
if
(
purpose
==
GCAllocForSurvived
)
{
obj
=
alloc_buffer
(
GCAllocForSurvived
)
->
allocate_aligned
(
word_sz
,
SurvivorAlignmentInBytes
);
}
else
{
obj
=
alloc_buffer
(
GCAllocForTenured
)
->
allocate
(
word_sz
);
}
if
(
obj
!=
NULL
)
{
return
obj
;
}
...
...
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
浏览文件 @
676405f8
...
...
@@ -28,12 +28,12 @@
#include "gc_implementation/parNew/parOopClosures.inline.hpp"
#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
#include "gc_implementation/shared/ageTable.hpp"
#include "gc_implementation/shared/
parGCAllocBuffer
.hpp"
#include "gc_implementation/shared/
copyFailedInfo
.hpp"
#include "gc_implementation/shared/gcHeapSummary.hpp"
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/gcTraceTime.hpp"
#include "gc_implementation/shared/
copyFailedInfo
.hpp"
#include "gc_implementation/shared/
parGCAllocBuffer.inline
.hpp"
#include "gc_implementation/shared/spaceDecorator.hpp"
#include "memory/defNewGeneration.inline.hpp"
#include "memory/genCollectedHeap.hpp"
...
...
@@ -251,7 +251,7 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) {
plab
->
set_word_size
(
buf_size
);
plab
->
set_buf
(
buf_space
);
record_survivor_plab
(
buf_space
,
buf_size
);
obj
=
plab
->
allocate
(
word_sz
);
obj
=
plab
->
allocate
_aligned
(
word_sz
,
SurvivorAlignmentInBytes
);
// Note that we cannot compare buf_size < word_sz below
// because of AlignmentReserve (see ParGCAllocBuffer::allocate()).
assert
(
obj
!=
NULL
||
plab
->
words_remaining
()
<
word_sz
,
...
...
src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
浏览文件 @
676405f8
...
...
@@ -168,7 +168,7 @@ class ParScanThreadState {
HeapWord
*
alloc_in_to_space_slow
(
size_t
word_sz
);
HeapWord
*
alloc_in_to_space
(
size_t
word_sz
)
{
HeapWord
*
obj
=
to_space_alloc_buffer
()
->
allocate
(
word_sz
);
HeapWord
*
obj
=
to_space_alloc_buffer
()
->
allocate
_aligned
(
word_sz
,
SurvivorAlignmentInBytes
);
if
(
obj
!=
NULL
)
return
obj
;
else
return
alloc_in_to_space_slow
(
word_sz
);
}
...
...
src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp
浏览文件 @
676405f8
...
...
@@ -26,6 +26,7 @@
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP
#include "gc_implementation/parallelScavenge/objectStartArray.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/allocation.hpp"
//
...
...
@@ -94,23 +95,9 @@ class PSYoungPromotionLAB : public PSPromotionLAB {
PSYoungPromotionLAB
()
{
}
// Not MT safe
HeapWord
*
allocate
(
size_t
size
)
{
// Can't assert this, when young fills, we keep the LAB around, but flushed.
// assert(_state != flushed, "Sanity");
HeapWord
*
obj
=
top
();
HeapWord
*
new_top
=
obj
+
size
;
// The 'new_top>obj' check is needed to detect overflow of obj+size.
if
(
new_top
>
obj
&&
new_top
<=
end
())
{
set_top
(
new_top
);
assert
(
is_object_aligned
((
intptr_t
)
obj
)
&&
is_object_aligned
((
intptr_t
)
new_top
),
"checking alignment"
);
return
obj
;
}
inline
HeapWord
*
allocate
(
size_t
size
);
return
NULL
;
}
debug_only
(
virtual
bool
lab_is_valid
(
MemRegion
lab
));
debug_only
(
virtual
bool
lab_is_valid
(
MemRegion
lab
);)
};
class
PSOldPromotionLAB
:
public
PSPromotionLAB
{
...
...
src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp
0 → 100644
浏览文件 @
676405f8
/*
* Copyright (c) 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_INLINE_HPP
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_INLINE_HPP
#include "gc_implementation/parallelScavenge/psPromotionLAB.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
HeapWord
*
PSYoungPromotionLAB
::
allocate
(
size_t
size
)
{
// Can't assert this, when young fills, we keep the LAB around, but flushed.
// assert(_state != flushed, "Sanity");
HeapWord
*
obj
=
CollectedHeap
::
align_allocation_or_fail
(
top
(),
end
(),
SurvivorAlignmentInBytes
);
if
(
obj
==
NULL
)
{
return
NULL
;
}
HeapWord
*
new_top
=
obj
+
size
;
// The 'new_top>obj' check is needed to detect overflow of obj+size.
if
(
new_top
>
obj
&&
new_top
<=
end
())
{
set_top
(
new_top
);
assert
(
is_ptr_aligned
(
obj
,
SurvivorAlignmentInBytes
)
&&
is_object_aligned
((
intptr_t
)
new_top
),
"checking alignment"
);
return
obj
;
}
else
{
set_top
(
obj
);
return
NULL
;
}
}
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_INLINE_HPP
src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
浏览文件 @
676405f8
...
...
@@ -27,6 +27,7 @@
#include "gc_implementation/parallelScavenge/psOldGen.hpp"
#include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
#include "gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.hpp"
#include "oops/oop.psgc.inline.hpp"
...
...
src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp
浏览文件 @
676405f8
...
...
@@ -24,7 +24,7 @@
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP
#include "gc_interface/collectedHeap.hpp"
#include "memory/allocation.hpp"
#include "memory/blockOffsetTable.hpp"
#include "memory/threadLocalAllocBuffer.hpp"
...
...
@@ -84,6 +84,9 @@ public:
}
}
// Allocate the object aligned to "alignment_in_bytes".
HeapWord
*
allocate_aligned
(
size_t
word_sz
,
unsigned
short
alignment_in_bytes
);
// Undo the last allocation in the buffer, which is required to be of the
// "obj" of the given "word_sz".
void
undo_allocation
(
HeapWord
*
obj
,
size_t
word_sz
)
{
...
...
src/share/vm/gc_implementation/shared/parGCAllocBuffer.inline.hpp
0 → 100644
浏览文件 @
676405f8
/*
* Copyright (c) 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
HeapWord
*
ParGCAllocBuffer
::
allocate_aligned
(
size_t
word_sz
,
unsigned
short
alignment_in_bytes
)
{
HeapWord
*
res
=
CollectedHeap
::
align_allocation_or_fail
(
_top
,
_end
,
alignment_in_bytes
);
if
(
res
==
NULL
)
{
return
NULL
;
}
// Set _top so that allocate(), which expects _top to be correctly set,
// can be used below.
_top
=
res
;
return
allocate
(
word_sz
);
}
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP
src/share/vm/gc_interface/collectedHeap.hpp
浏览文件 @
676405f8
...
...
@@ -351,6 +351,12 @@ class CollectedHeap : public CHeapObj<mtInternal> {
fill_with_object
(
start
,
pointer_delta
(
end
,
start
),
zap
);
}
// Return the address "addr" aligned by "alignment_in_bytes" if such
// an address is below "end". Return NULL otherwise.
inline
static
HeapWord
*
align_allocation_or_fail
(
HeapWord
*
addr
,
HeapWord
*
end
,
unsigned
short
alignment_in_bytes
);
// Some heaps may offer a contiguous region for shared non-blocking
// allocation, via inlined code (by exporting the address of the top and
// end fields defining the extent of the contiguous allocation region.)
...
...
src/share/vm/gc_interface/collectedHeap.inline.hpp
浏览文件 @
676405f8
...
...
@@ -241,6 +241,44 @@ inline void CollectedHeap::oop_iterate_no_header(OopClosure* cl) {
oop_iterate
(
&
no_header_cl
);
}
inline
HeapWord
*
CollectedHeap
::
align_allocation_or_fail
(
HeapWord
*
addr
,
HeapWord
*
end
,
unsigned
short
alignment_in_bytes
)
{
if
(
alignment_in_bytes
<=
ObjectAlignmentInBytes
)
{
return
addr
;
}
assert
(
is_ptr_aligned
(
addr
,
HeapWordSize
),
err_msg
(
"Address "
PTR_FORMAT
" is not properly aligned."
,
p2i
(
addr
)));
assert
(
is_size_aligned
(
alignment_in_bytes
,
HeapWordSize
),
err_msg
(
"Alignment size %u is incorrect."
,
alignment_in_bytes
));
HeapWord
*
new_addr
=
(
HeapWord
*
)
align_pointer_up
(
addr
,
alignment_in_bytes
);
size_t
padding
=
pointer_delta
(
new_addr
,
addr
);
if
(
padding
==
0
)
{
return
addr
;
}
if
(
padding
<
CollectedHeap
::
min_fill_size
())
{
padding
+=
alignment_in_bytes
/
HeapWordSize
;
assert
(
padding
>=
CollectedHeap
::
min_fill_size
(),
err_msg
(
"alignment_in_bytes %u is expect to be larger "
"than the minimum object size"
,
alignment_in_bytes
));
new_addr
=
addr
+
padding
;
}
assert
(
new_addr
>
addr
,
err_msg
(
"Unexpected arithmetic overflow "
PTR_FORMAT
" not greater than "
PTR_FORMAT
,
p2i
(
new_addr
),
p2i
(
addr
)));
if
(
new_addr
<
end
)
{
CollectedHeap
::
fill_with_object
(
addr
,
padding
);
return
new_addr
;
}
else
{
return
NULL
;
}
}
#ifndef PRODUCT
inline
bool
...
...
src/share/vm/memory/defNewGeneration.cpp
浏览文件 @
676405f8
...
...
@@ -789,7 +789,7 @@ oop DefNewGeneration::copy_to_survivor_space(oop old) {
// Try allocating obj in to-space (unless too old)
if
(
old
->
age
()
<
tenuring_threshold
())
{
obj
=
(
oop
)
to
()
->
allocate
(
s
);
obj
=
(
oop
)
to
()
->
allocate
_aligned
(
s
);
}
// Otherwise try allocating obj tenured
...
...
src/share/vm/memory/space.cpp
浏览文件 @
676405f8
...
...
@@ -28,6 +28,7 @@
#include "gc_implementation/shared/liveRange.hpp"
#include "gc_implementation/shared/markSweep.hpp"
#include "gc_implementation/shared/spaceDecorator.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/blockOffsetTable.inline.hpp"
#include "memory/defNewGeneration.hpp"
#include "memory/genCollectedHeap.hpp"
...
...
@@ -719,6 +720,27 @@ inline HeapWord* ContiguousSpace::par_allocate_impl(size_t size,
}
while
(
true
);
}
HeapWord
*
ContiguousSpace
::
allocate_aligned
(
size_t
size
)
{
assert
(
Heap_lock
->
owned_by_self
()
||
(
SafepointSynchronize
::
is_at_safepoint
()
&&
Thread
::
current
()
->
is_VM_thread
()),
"not locked"
);
HeapWord
*
end_value
=
end
();
HeapWord
*
obj
=
CollectedHeap
::
align_allocation_or_fail
(
top
(),
end_value
,
SurvivorAlignmentInBytes
);
if
(
obj
==
NULL
)
{
return
NULL
;
}
if
(
pointer_delta
(
end_value
,
obj
)
>=
size
)
{
HeapWord
*
new_top
=
obj
+
size
;
set_top
(
new_top
);
assert
(
is_ptr_aligned
(
obj
,
SurvivorAlignmentInBytes
)
&&
is_aligned
(
new_top
),
"checking alignment"
);
return
obj
;
}
else
{
set_top
(
obj
);
return
NULL
;
}
}
// Requires locking.
HeapWord
*
ContiguousSpace
::
allocate
(
size_t
size
)
{
return
allocate_impl
(
size
,
end
());
...
...
src/share/vm/memory/space.hpp
浏览文件 @
676405f8
...
...
@@ -526,6 +526,7 @@ class ContiguousSpace: public CompactibleSpace {
// Allocation (return NULL if full)
virtual
HeapWord
*
allocate
(
size_t
word_size
);
virtual
HeapWord
*
par_allocate
(
size_t
word_size
);
HeapWord
*
allocate_aligned
(
size_t
word_size
);
// Iteration
void
oop_iterate
(
ExtendedOopClosure
*
cl
);
...
...
src/share/vm/oops/oop.pcgc.inline.hpp
浏览文件 @
676405f8
...
...
@@ -54,8 +54,6 @@ inline void oopDesc::follow_contents(ParCompactionManager* cm) {
klass
()
->
oop_follow_contents
(
cm
,
this
);
}
// Used by parallel old GC.
inline
oop
oopDesc
::
forward_to_atomic
(
oop
p
)
{
assert
(
ParNewGeneration
::
is_legal_forward_ptr
(
p
),
"illegal forwarding pointer value."
);
...
...
src/share/vm/runtime/arguments.cpp
浏览文件 @
676405f8
...
...
@@ -1398,6 +1398,22 @@ bool verify_object_alignment() {
(
int
)
ObjectAlignmentInBytes
,
os
::
vm_page_size
());
return
false
;
}
if
(
SurvivorAlignmentInBytes
==
0
)
{
SurvivorAlignmentInBytes
=
ObjectAlignmentInBytes
;
}
else
{
if
(
!
is_power_of_2
(
SurvivorAlignmentInBytes
))
{
jio_fprintf
(
defaultStream
::
error_stream
(),
"error: SurvivorAlignmentInBytes=%d must be power of 2
\n
"
,
(
int
)
SurvivorAlignmentInBytes
);
return
false
;
}
if
(
SurvivorAlignmentInBytes
<
ObjectAlignmentInBytes
)
{
jio_fprintf
(
defaultStream
::
error_stream
(),
"error: SurvivorAlignmentInBytes=%d must be greater than ObjectAlignmentInBytes=%d
\n
"
,
(
int
)
SurvivorAlignmentInBytes
,
(
int
)
ObjectAlignmentInBytes
);
return
false
;
}
}
return
true
;
}
...
...
src/share/vm/runtime/globals.hpp
浏览文件 @
676405f8
...
...
@@ -3885,6 +3885,9 @@ class CommandLineFlags {
product(bool, PrintGCCause, true, \
"Include GC cause in GC logging") \
\
experimental(intx, SurvivorAlignmentInBytes, 0, \
"Default survivor space alignment in bytes") \
\
product(bool , AllowNonVirtualCalls, false, \
"Obey the ACC_SUPER flag and allow invokenonvirtual calls") \
\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录