Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
9c7225ab
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看板
提交
9c7225ab
编写于
4月 09, 2015
作者:
M
mlarsson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8066771: Refactor VM GC operations caused by allocation failure
Reviewed-by: brutisso, jmasa
上级
45e70d71
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
36 addition
and
36 deletion
+36
-36
src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
+3
-3
src/share/vm/gc_implementation/g1/vm_operations_g1.hpp
src/share/vm/gc_implementation/g1/vm_operations_g1.hpp
+3
-6
src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp
.../vm/gc_implementation/parallelScavenge/vmPSOperations.cpp
+4
-6
src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp
.../vm/gc_implementation/parallelScavenge/vmPSOperations.hpp
+2
-8
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
+3
-3
src/share/vm/gc_implementation/shared/vmGCOperations.hpp
src/share/vm/gc_implementation/shared/vmGCOperations.hpp
+21
-10
未找到文件。
src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
浏览文件 @
9c7225ab
...
...
@@ -38,7 +38,7 @@ VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before,
size_t
word_size
)
:
VM_G1OperationWithAllocRequest
(
gc_count_before
,
word_size
,
GCCause
::
_allocation_failure
)
{
guarantee
(
word_size
>
0
,
"an allocation should always be requested
"
);
guarantee
(
word_size
!=
0
,
"An allocation should always be requested with this operation.
"
);
}
void
VM_G1CollectForAllocation
::
doit
()
{
...
...
@@ -73,7 +73,7 @@ VM_G1IncCollectionPause::VM_G1IncCollectionPause(uint gc_count_before,
}
bool
VM_G1IncCollectionPause
::
doit_prologue
()
{
bool
res
=
VM_G
C_Operation
::
doit_prologue
();
bool
res
=
VM_G
1OperationWithAllocRequest
::
doit_prologue
();
if
(
!
res
)
{
if
(
_should_initiate_conc_mark
)
{
// The prologue can fail for a couple of reasons. The first is that another GC
...
...
@@ -167,7 +167,7 @@ void VM_G1IncCollectionPause::doit() {
}
void
VM_G1IncCollectionPause
::
doit_epilogue
()
{
VM_G
C_Operation
::
doit_epilogue
();
VM_G
1OperationWithAllocRequest
::
doit_epilogue
();
// If the pause was initiated by a System.gc() and
// +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
...
...
src/share/vm/gc_implementation/g1/vm_operations_g1.hpp
浏览文件 @
9c7225ab
...
...
@@ -36,10 +36,8 @@
// - VM_G1CollectForAllocation
// - VM_G1IncCollectionPause
class
VM_G1OperationWithAllocRequest
:
public
VM_GC_Oper
ation
{
class
VM_G1OperationWithAllocRequest
:
public
VM_CollectForAlloc
ation
{
protected:
size_t
_word_size
;
HeapWord
*
_result
;
bool
_pause_succeeded
;
AllocationContext_t
_allocation_context
;
...
...
@@ -47,9 +45,8 @@ public:
VM_G1OperationWithAllocRequest
(
uint
gc_count_before
,
size_t
word_size
,
GCCause
::
Cause
gc_cause
)
:
VM_GC_Operation
(
gc_count_before
,
gc_cause
),
_word_size
(
word_size
),
_result
(
NULL
),
_pause_succeeded
(
false
)
{
}
HeapWord
*
result
()
{
return
_result
;
}
:
VM_CollectForAllocation
(
word_size
,
gc_count_before
,
gc_cause
),
_pause_succeeded
(
false
)
{}
bool
pause_succeeded
()
{
return
_pause_succeeded
;
}
void
set_allocation_context
(
AllocationContext_t
context
)
{
_allocation_context
=
context
;
}
AllocationContext_t
allocation_context
()
{
return
_allocation_context
;
}
...
...
src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp
浏览文件 @
9c7225ab
...
...
@@ -32,12 +32,10 @@
#include "utilities/dtrace.hpp"
// The following methods are used by the parallel scavenge collector
VM_ParallelGCFailedAllocation
::
VM_ParallelGCFailedAllocation
(
size_t
size
,
VM_ParallelGCFailedAllocation
::
VM_ParallelGCFailedAllocation
(
size_t
word_
size
,
uint
gc_count
)
:
VM_GC_Operation
(
gc_count
,
GCCause
::
_allocation_failure
),
_size
(
size
),
_result
(
NULL
)
{
VM_CollectForAllocation
(
word_size
,
gc_count
,
GCCause
::
_allocation_failure
)
{
assert
(
word_size
!=
0
,
"An allocation should always be requested with this operation."
);
}
void
VM_ParallelGCFailedAllocation
::
doit
()
{
...
...
@@ -47,7 +45,7 @@ void VM_ParallelGCFailedAllocation::doit() {
assert
(
heap
->
kind
()
==
CollectedHeap
::
ParallelScavengeHeap
,
"must be a ParallelScavengeHeap"
);
GCCauseSetter
gccs
(
heap
,
_gc_cause
);
_result
=
heap
->
failed_mem_allocate
(
_size
);
_result
=
heap
->
failed_mem_allocate
(
_
word_
size
);
if
(
_result
==
NULL
&&
GC_locker
::
is_active_and_needs_gc
())
{
set_gc_locked
();
...
...
src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp
浏览文件 @
9c7225ab
...
...
@@ -29,20 +29,14 @@
#include "gc_implementation/shared/vmGCOperations.hpp"
#include "gc_interface/gcCause.hpp"
class
VM_ParallelGCFailedAllocation
:
public
VM_GC_Operation
{
private:
size_t
_size
;
HeapWord
*
_result
;
class
VM_ParallelGCFailedAllocation
:
public
VM_CollectForAllocation
{
public:
VM_ParallelGCFailedAllocation
(
size_t
size
,
uint
gc_count
);
VM_ParallelGCFailedAllocation
(
size_t
word_
size
,
uint
gc_count
);
virtual
VMOp_Type
type
()
const
{
return
VMOp_ParallelGCFailedAllocation
;
}
virtual
void
doit
();
HeapWord
*
result
()
const
{
return
_result
;
}
};
class
VM_ParallelGCSystemGC
:
public
VM_GC_Operation
{
...
...
src/share/vm/gc_implementation/shared/vmGCOperations.cpp
浏览文件 @
9c7225ab
...
...
@@ -193,10 +193,10 @@ void VM_GenCollectForAllocation::doit() {
GenCollectedHeap
*
gch
=
GenCollectedHeap
::
heap
();
GCCauseSetter
gccs
(
gch
,
_gc_cause
);
_res
=
gch
->
satisfy_failed_allocation
(
_size
,
_tlab
);
assert
(
gch
->
is_in_reserved_or_null
(
_res
),
"result not in heap"
);
_res
ult
=
gch
->
satisfy_failed_allocation
(
_word
_size
,
_tlab
);
assert
(
gch
->
is_in_reserved_or_null
(
_res
ult
),
"result not in heap"
);
if
(
_res
==
NULL
&&
GC_locker
::
is_active_and_needs_gc
())
{
if
(
_res
ult
==
NULL
&&
GC_locker
::
is_active_and_needs_gc
())
{
set_gc_locked
();
}
}
...
...
src/share/vm/gc_implementation/shared/vmGCOperations.hpp
浏览文件 @
9c7225ab
...
...
@@ -38,11 +38,12 @@
// VM_Operation
// VM_GC_Operation
// VM_GC_HeapInspection
// VM_GenCollectForAllocation
// VM_GenCollectFull
// VM_GenCollectFullConcurrent
// VM_ParallelGCFailedAllocation
// VM_ParallelGCSystemGC
// VM_CollectForAllocation
// VM_GenCollectForAllocation
// VM_ParallelGCFailedAllocation
// VM_GC_Operation
// - implements methods common to all classes in the hierarchy:
// prevents multiple gc requests and manages lock on heap;
...
...
@@ -51,6 +52,7 @@
// - prints class histogram on SIGBREAK if PrintClassHistogram
// is specified; and also the attach "inspectheap" operation
//
// VM_CollectForAllocation
// VM_GenCollectForAllocation
// VM_ParallelGCFailedAllocation
// - this operation is invoked when allocation is failed;
...
...
@@ -160,25 +162,34 @@ class VM_GC_HeapInspection: public VM_GC_Operation {
bool
collect
();
};
class
VM_CollectForAllocation
:
public
VM_GC_Operation
{
protected:
size_t
_word_size
;
// Size of object to be allocated (in number of words)
HeapWord
*
_result
;
// Allocation result (NULL if allocation failed)
public:
VM_CollectForAllocation
(
size_t
word_size
,
uint
gc_count_before
,
GCCause
::
Cause
cause
)
:
VM_GC_Operation
(
gc_count_before
,
cause
),
_result
(
NULL
),
_word_size
(
word_size
)
{}
HeapWord
*
result
()
const
{
return
_result
;
}
};
class
VM_GenCollectForAllocation
:
public
VM_GC_Oper
ation
{
class
VM_GenCollectForAllocation
:
public
VM_CollectForAlloc
ation
{
private:
HeapWord
*
_res
;
size_t
_size
;
// size of object to be allocated.
bool
_tlab
;
// alloc is of a tlab.
public:
VM_GenCollectForAllocation
(
size_t
size
,
VM_GenCollectForAllocation
(
size_t
word_
size
,
bool
tlab
,
uint
gc_count_before
)
:
VM_GC_Operation
(
gc_count_before
,
GCCause
::
_allocation_failure
),
_size
(
size
),
:
VM_CollectForAllocation
(
word_size
,
gc_count_before
,
GCCause
::
_allocation_failure
),
_tlab
(
tlab
)
{
_res
=
NULL
;
assert
(
word_size
!=
0
,
"An allocation should always be requested with this operation."
)
;
}
~
VM_GenCollectForAllocation
()
{}
virtual
VMOp_Type
type
()
const
{
return
VMOp_GenCollectForAllocation
;
}
virtual
void
doit
();
HeapWord
*
result
()
const
{
return
_res
;
}
};
// VM operation to invoke a collection of the heap as a
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录