Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
35ef6e02
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
35ef6e02
编写于
4月 22, 2013
作者:
S
stefank
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8012687: Remove unused is_root checks and closures
Reviewed-by: tschatzl, jmasa
上级
eda775b3
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
59 addition
and
103 deletion
+59
-103
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+2
-3
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+1
-2
src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
+3
-4
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
...are/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
+14
-15
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
...are/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
+0
-1
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
.../gc_implementation/parallelScavenge/psParallelCompact.cpp
+19
-21
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
.../gc_implementation/parallelScavenge/psParallelCompact.hpp
+2
-23
src/share/vm/gc_implementation/shared/markSweep.cpp
src/share/vm/gc_implementation/shared/markSweep.cpp
+4
-5
src/share/vm/gc_implementation/shared/markSweep.hpp
src/share/vm/gc_implementation/shared/markSweep.hpp
+1
-10
src/share/vm/gc_implementation/shared/markSweep.inline.hpp
src/share/vm/gc_implementation/shared/markSweep.inline.hpp
+1
-1
src/share/vm/memory/genCollectedHeap.cpp
src/share/vm/memory/genCollectedHeap.cpp
+2
-3
src/share/vm/memory/genCollectedHeap.hpp
src/share/vm/memory/genCollectedHeap.hpp
+1
-2
src/share/vm/memory/genMarkSweep.cpp
src/share/vm/memory/genMarkSweep.cpp
+5
-7
src/share/vm/memory/sharedHeap.cpp
src/share/vm/memory/sharedHeap.cpp
+3
-4
src/share/vm/memory/sharedHeap.hpp
src/share/vm/memory/sharedHeap.hpp
+1
-2
未找到文件。
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
浏览文件 @
35ef6e02
...
...
@@ -5079,10 +5079,9 @@ g1_process_strong_roots(bool is_scavenging,
}
void
G1CollectedHeap
::
g1_process_weak_roots
(
OopClosure
*
root_closure
,
OopClosure
*
non_root_closure
)
{
G1CollectedHeap
::
g1_process_weak_roots
(
OopClosure
*
root_closure
)
{
CodeBlobToOopClosure
roots_in_blobs
(
root_closure
,
/*do_marking=*/
false
);
SharedHeap
::
process_weak_roots
(
root_closure
,
&
roots_in_blobs
,
non_root_closure
);
SharedHeap
::
process_weak_roots
(
root_closure
,
&
roots_in_blobs
);
}
// Weak Reference Processing support
...
...
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
浏览文件 @
35ef6e02
...
...
@@ -827,8 +827,7 @@ protected:
// Apply "blk" to all the weak roots of the system. These include
// JNI weak roots, the code cache, system dictionary, symbol table,
// string table, and referents of reachable weak refs.
void
g1_process_weak_roots
(
OopClosure
*
root_closure
,
OopClosure
*
non_root_closure
);
void
g1_process_weak_roots
(
OopClosure
*
root_closure
);
// Frees a non-humongous region by initializing its contents and
// adding it to the free list that's passed as a parameter (this is
...
...
src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
浏览文件 @
35ef6e02
...
...
@@ -308,17 +308,16 @@ void G1MarkSweep::mark_sweep_phase3() {
sh
->
process_strong_roots
(
true
,
// activate StrongRootsScope
false
,
// not scavenging.
SharedHeap
::
SO_AllClasses
,
&
GenMarkSweep
::
adjust_
root_
pointer_closure
,
&
GenMarkSweep
::
adjust_pointer_closure
,
NULL
,
// do not touch code cache here
&
GenMarkSweep
::
adjust_klass_closure
);
assert
(
GenMarkSweep
::
ref_processor
()
==
g1h
->
ref_processor_stw
(),
"Sanity"
);
g1h
->
ref_processor_stw
()
->
weak_oops_do
(
&
GenMarkSweep
::
adjust_
root_
pointer_closure
);
g1h
->
ref_processor_stw
()
->
weak_oops_do
(
&
GenMarkSweep
::
adjust_pointer_closure
);
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
g1h
->
g1_process_weak_roots
(
&
GenMarkSweep
::
adjust_root_pointer_closure
,
&
GenMarkSweep
::
adjust_pointer_closure
);
g1h
->
g1_process_weak_roots
(
&
GenMarkSweep
::
adjust_pointer_closure
);
GenMarkSweep
::
adjust_marks
();
...
...
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
浏览文件 @
35ef6e02
...
...
@@ -583,28 +583,27 @@ void PSMarkSweep::mark_sweep_phase3() {
ClassLoaderDataGraph
::
clear_claimed_marks
();
// General strong roots.
Universe
::
oops_do
(
adjust_
root_
pointer_closure
());
JNIHandles
::
oops_do
(
adjust_
root_
pointer_closure
());
// Global (strong) JNI handles
CLDToOopClosure
adjust_from_cld
(
adjust_
root_
pointer_closure
());
Threads
::
oops_do
(
adjust_
root_
pointer_closure
(),
&
adjust_from_cld
,
NULL
);
ObjectSynchronizer
::
oops_do
(
adjust_
root_
pointer_closure
());
FlatProfiler
::
oops_do
(
adjust_
root_
pointer_closure
());
Management
::
oops_do
(
adjust_
root_
pointer_closure
());
JvmtiExport
::
oops_do
(
adjust_
root_
pointer_closure
());
Universe
::
oops_do
(
adjust_pointer_closure
());
JNIHandles
::
oops_do
(
adjust_pointer_closure
());
// Global (strong) JNI handles
CLDToOopClosure
adjust_from_cld
(
adjust_pointer_closure
());
Threads
::
oops_do
(
adjust_pointer_closure
(),
&
adjust_from_cld
,
NULL
);
ObjectSynchronizer
::
oops_do
(
adjust_pointer_closure
());
FlatProfiler
::
oops_do
(
adjust_pointer_closure
());
Management
::
oops_do
(
adjust_pointer_closure
());
JvmtiExport
::
oops_do
(
adjust_pointer_closure
());
// SO_AllClasses
SystemDictionary
::
oops_do
(
adjust_root_pointer_closure
());
ClassLoaderDataGraph
::
oops_do
(
adjust_root_pointer_closure
(),
adjust_klass_closure
(),
true
);
//CodeCache::scavenge_root_nmethods_oops_do(adjust_root_pointer_closure());
SystemDictionary
::
oops_do
(
adjust_pointer_closure
());
ClassLoaderDataGraph
::
oops_do
(
adjust_pointer_closure
(),
adjust_klass_closure
(),
true
);
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
// Global (weak) JNI handles
JNIHandles
::
weak_oops_do
(
&
always_true
,
adjust_
root_
pointer_closure
());
JNIHandles
::
weak_oops_do
(
&
always_true
,
adjust_pointer_closure
());
CodeCache
::
oops_do
(
adjust_pointer_closure
());
StringTable
::
oops_do
(
adjust_
root_
pointer_closure
());
ref_processor
()
->
weak_oops_do
(
adjust_
root_
pointer_closure
());
PSScavenge
::
reference_processor
()
->
weak_oops_do
(
adjust_
root_
pointer_closure
());
StringTable
::
oops_do
(
adjust_pointer_closure
());
ref_processor
()
->
weak_oops_do
(
adjust_pointer_closure
());
PSScavenge
::
reference_processor
()
->
weak_oops_do
(
adjust_pointer_closure
());
adjust_marks
();
...
...
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
浏览文件 @
35ef6e02
...
...
@@ -44,7 +44,6 @@ class PSMarkSweep : public MarkSweep {
static
KlassClosure
*
follow_klass_closure
()
{
return
&
MarkSweep
::
follow_klass_closure
;
}
static
VoidClosure
*
follow_stack_closure
()
{
return
(
VoidClosure
*
)
&
MarkSweep
::
follow_stack_closure
;
}
static
OopClosure
*
adjust_pointer_closure
()
{
return
(
OopClosure
*
)
&
MarkSweep
::
adjust_pointer_closure
;
}
static
OopClosure
*
adjust_root_pointer_closure
()
{
return
(
OopClosure
*
)
&
MarkSweep
::
adjust_root_pointer_closure
;
}
static
KlassClosure
*
adjust_klass_closure
()
{
return
&
MarkSweep
::
adjust_klass_closure
;
}
static
BoolObjectClosure
*
is_alive_closure
()
{
return
(
BoolObjectClosure
*
)
&
MarkSweep
::
is_alive
;
}
...
...
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
浏览文件 @
35ef6e02
...
...
@@ -787,12 +787,11 @@ bool PSParallelCompact::IsAliveClosure::do_object_b(oop p) { return mark_bitmap(
void
PSParallelCompact
::
KeepAliveClosure
::
do_oop
(
oop
*
p
)
{
PSParallelCompact
::
KeepAliveClosure
::
do_oop_work
(
p
);
}
void
PSParallelCompact
::
KeepAliveClosure
::
do_oop
(
narrowOop
*
p
)
{
PSParallelCompact
::
KeepAliveClosure
::
do_oop_work
(
p
);
}
PSParallelCompact
::
AdjustPointerClosure
PSParallelCompact
::
_adjust_root_pointer_closure
(
true
);
PSParallelCompact
::
AdjustPointerClosure
PSParallelCompact
::
_adjust_pointer_closure
(
false
);
PSParallelCompact
::
AdjustPointerClosure
PSParallelCompact
::
_adjust_pointer_closure
;
PSParallelCompact
::
AdjustKlassClosure
PSParallelCompact
::
_adjust_klass_closure
;
void
PSParallelCompact
::
AdjustPointerClosure
::
do_oop
(
oop
*
p
)
{
adjust_pointer
(
p
,
_is_root
);
}
void
PSParallelCompact
::
AdjustPointerClosure
::
do_oop
(
narrowOop
*
p
)
{
adjust_pointer
(
p
,
_is_root
);
}
void
PSParallelCompact
::
AdjustPointerClosure
::
do_oop
(
oop
*
p
)
{
adjust_pointer
(
p
);
}
void
PSParallelCompact
::
AdjustPointerClosure
::
do_oop
(
narrowOop
*
p
)
{
adjust_pointer
(
p
);
}
void
PSParallelCompact
::
FollowStackClosure
::
do_void
()
{
_compaction_manager
->
follow_marking_stacks
();
}
...
...
@@ -805,7 +804,7 @@ void PSParallelCompact::FollowKlassClosure::do_klass(Klass* klass) {
klass
->
oops_do
(
_mark_and_push_closure
);
}
void
PSParallelCompact
::
AdjustKlassClosure
::
do_klass
(
Klass
*
klass
)
{
klass
->
oops_do
(
&
PSParallelCompact
::
_adjust_
root_
pointer_closure
);
klass
->
oops_do
(
&
PSParallelCompact
::
_adjust_pointer_closure
);
}
void
PSParallelCompact
::
post_initialize
()
{
...
...
@@ -2398,7 +2397,7 @@ void PSParallelCompact::follow_class_loader(ParCompactionManager* cm,
void
PSParallelCompact
::
adjust_class_loader
(
ParCompactionManager
*
cm
,
ClassLoaderData
*
cld
)
{
cld
->
oops_do
(
PSParallelCompact
::
adjust_
root_
pointer_closure
(),
cld
->
oops_do
(
PSParallelCompact
::
adjust_pointer_closure
(),
PSParallelCompact
::
adjust_klass_closure
(),
true
);
}
...
...
@@ -2419,32 +2418,31 @@ void PSParallelCompact::adjust_roots() {
ClassLoaderDataGraph
::
clear_claimed_marks
();
// General strong roots.
Universe
::
oops_do
(
adjust_
root_
pointer_closure
());
JNIHandles
::
oops_do
(
adjust_
root_
pointer_closure
());
// Global (strong) JNI handles
CLDToOopClosure
adjust_from_cld
(
adjust_
root_
pointer_closure
());
Threads
::
oops_do
(
adjust_
root_
pointer_closure
(),
&
adjust_from_cld
,
NULL
);
ObjectSynchronizer
::
oops_do
(
adjust_
root_
pointer_closure
());
FlatProfiler
::
oops_do
(
adjust_
root_
pointer_closure
());
Management
::
oops_do
(
adjust_
root_
pointer_closure
());
JvmtiExport
::
oops_do
(
adjust_
root_
pointer_closure
());
Universe
::
oops_do
(
adjust_pointer_closure
());
JNIHandles
::
oops_do
(
adjust_pointer_closure
());
// Global (strong) JNI handles
CLDToOopClosure
adjust_from_cld
(
adjust_pointer_closure
());
Threads
::
oops_do
(
adjust_pointer_closure
(),
&
adjust_from_cld
,
NULL
);
ObjectSynchronizer
::
oops_do
(
adjust_pointer_closure
());
FlatProfiler
::
oops_do
(
adjust_pointer_closure
());
Management
::
oops_do
(
adjust_pointer_closure
());
JvmtiExport
::
oops_do
(
adjust_pointer_closure
());
// SO_AllClasses
SystemDictionary
::
oops_do
(
adjust_
root_
pointer_closure
());
ClassLoaderDataGraph
::
oops_do
(
adjust_
root_
pointer_closure
(),
adjust_klass_closure
(),
true
);
SystemDictionary
::
oops_do
(
adjust_pointer_closure
());
ClassLoaderDataGraph
::
oops_do
(
adjust_pointer_closure
(),
adjust_klass_closure
(),
true
);
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
// Global (weak) JNI handles
JNIHandles
::
weak_oops_do
(
&
always_true
,
adjust_
root_
pointer_closure
());
JNIHandles
::
weak_oops_do
(
&
always_true
,
adjust_pointer_closure
());
CodeCache
::
oops_do
(
adjust_pointer_closure
());
StringTable
::
oops_do
(
adjust_
root_
pointer_closure
());
ref_processor
()
->
weak_oops_do
(
adjust_
root_
pointer_closure
());
StringTable
::
oops_do
(
adjust_pointer_closure
());
ref_processor
()
->
weak_oops_do
(
adjust_pointer_closure
());
// Roots were visited so references into the young gen in roots
// may have been scanned. Process them also.
// Should the reference processor have a span that excludes
// young gen objects?
PSScavenge
::
reference_processor
()
->
weak_oops_do
(
adjust_root_pointer_closure
());
PSScavenge
::
reference_processor
()
->
weak_oops_do
(
adjust_pointer_closure
());
}
void
PSParallelCompact
::
enqueue_region_draining_tasks
(
GCTaskQueue
*
q
,
...
...
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
浏览文件 @
35ef6e02
...
...
@@ -799,16 +799,6 @@ class PSParallelCompact : AllStatic {
virtual
void
do_oop
(
narrowOop
*
p
);
};
// Current unused
class
FollowRootClosure
:
public
OopsInGenClosure
{
private:
ParCompactionManager
*
_compaction_manager
;
public:
FollowRootClosure
(
ParCompactionManager
*
cm
)
:
_compaction_manager
(
cm
)
{
}
virtual
void
do_oop
(
oop
*
p
);
virtual
void
do_oop
(
narrowOop
*
p
);
};
class
FollowStackClosure
:
public
VoidClosure
{
private:
ParCompactionManager
*
_compaction_manager
;
...
...
@@ -818,10 +808,7 @@ class PSParallelCompact : AllStatic {
};
class
AdjustPointerClosure
:
public
OopClosure
{
private:
bool
_is_root
;
public:
AdjustPointerClosure
(
bool
is_root
)
:
_is_root
(
is_root
)
{
}
virtual
void
do_oop
(
oop
*
p
);
virtual
void
do_oop
(
narrowOop
*
p
);
// do not walk from thread stacks to the code cache on this phase
...
...
@@ -838,7 +825,6 @@ class PSParallelCompact : AllStatic {
friend
class
AdjustPointerClosure
;
friend
class
AdjustKlassClosure
;
friend
class
FollowKlassClosure
;
friend
class
FollowRootClosure
;
friend
class
InstanceClassLoaderKlass
;
friend
class
RefProcTaskProxy
;
...
...
@@ -853,7 +839,6 @@ class PSParallelCompact : AllStatic {
static
IsAliveClosure
_is_alive_closure
;
static
SpaceInfo
_space_info
[
last_space_id
];
static
bool
_print_phases
;
static
AdjustPointerClosure
_adjust_root_pointer_closure
;
static
AdjustPointerClosure
_adjust_pointer_closure
;
static
AdjustKlassClosure
_adjust_klass_closure
;
...
...
@@ -889,9 +874,6 @@ class PSParallelCompact : AllStatic {
static
void
marking_phase
(
ParCompactionManager
*
cm
,
bool
maximum_heap_compaction
);
template
<
class
T
>
static
inline
void
adjust_pointer
(
T
*
p
,
bool
is_root
);
static
void
adjust_root_pointer
(
oop
*
p
)
{
adjust_pointer
(
p
,
true
);
}
template
<
class
T
>
static
inline
void
follow_root
(
ParCompactionManager
*
cm
,
T
*
p
);
...
...
@@ -1046,7 +1028,6 @@ class PSParallelCompact : AllStatic {
// Closure accessors
static
OopClosure
*
adjust_pointer_closure
()
{
return
(
OopClosure
*
)
&
_adjust_pointer_closure
;
}
static
OopClosure
*
adjust_root_pointer_closure
()
{
return
(
OopClosure
*
)
&
_adjust_root_pointer_closure
;
}
static
KlassClosure
*
adjust_klass_closure
()
{
return
(
KlassClosure
*
)
&
_adjust_klass_closure
;
}
static
BoolObjectClosure
*
is_alive_closure
()
{
return
(
BoolObjectClosure
*
)
&
_is_alive_closure
;
}
...
...
@@ -1067,6 +1048,7 @@ class PSParallelCompact : AllStatic {
// Check mark and maybe push on marking stack
template
<
class
T
>
static
inline
void
mark_and_push
(
ParCompactionManager
*
cm
,
T
*
p
);
template
<
class
T
>
static
inline
void
adjust_pointer
(
T
*
p
);
static
void
follow_klass
(
ParCompactionManager
*
cm
,
Klass
*
klass
);
static
void
adjust_klass
(
ParCompactionManager
*
cm
,
Klass
*
klass
);
...
...
@@ -1151,9 +1133,6 @@ class PSParallelCompact : AllStatic {
static
ParMarkBitMap
*
mark_bitmap
()
{
return
&
_mark_bitmap
;
}
static
ParallelCompactData
&
summary_data
()
{
return
_summary_data
;
}
static
inline
void
adjust_pointer
(
oop
*
p
)
{
adjust_pointer
(
p
,
false
);
}
static
inline
void
adjust_pointer
(
narrowOop
*
p
)
{
adjust_pointer
(
p
,
false
);
}
// Reference Processing
static
ReferenceProcessor
*
const
ref_processor
()
{
return
_ref_processor
;
}
...
...
@@ -1230,7 +1209,7 @@ inline void PSParallelCompact::mark_and_push(ParCompactionManager* cm, T* p) {
}
template
<
class
T
>
inline
void
PSParallelCompact
::
adjust_pointer
(
T
*
p
,
bool
isroot
)
{
inline
void
PSParallelCompact
::
adjust_pointer
(
T
*
p
)
{
T
heap_oop
=
oopDesc
::
load_heap_oop
(
p
);
if
(
!
oopDesc
::
is_null
(
heap_oop
))
{
oop
obj
=
oopDesc
::
decode_heap_oop_not_null
(
heap_oop
);
...
...
src/share/vm/gc_implementation/shared/markSweep.cpp
浏览文件 @
35ef6e02
...
...
@@ -81,7 +81,7 @@ void MarkSweep::follow_class_loader(ClassLoaderData* cld) {
}
void
MarkSweep
::
adjust_class_loader
(
ClassLoaderData
*
cld
)
{
cld
->
oops_do
(
&
MarkSweep
::
adjust_
root_
pointer_closure
,
&
MarkSweep
::
adjust_klass_closure
,
true
);
cld
->
oops_do
(
&
MarkSweep
::
adjust_pointer_closure
,
&
MarkSweep
::
adjust_klass_closure
,
true
);
}
...
...
@@ -121,11 +121,10 @@ void MarkSweep::preserve_mark(oop obj, markOop mark) {
}
}
MarkSweep
::
AdjustPointerClosure
MarkSweep
::
adjust_root_pointer_closure
(
true
);
MarkSweep
::
AdjustPointerClosure
MarkSweep
::
adjust_pointer_closure
(
false
);
MarkSweep
::
AdjustPointerClosure
MarkSweep
::
adjust_pointer_closure
;
void
MarkSweep
::
AdjustPointerClosure
::
do_oop
(
oop
*
p
)
{
adjust_pointer
(
p
,
_is_root
);
}
void
MarkSweep
::
AdjustPointerClosure
::
do_oop
(
narrowOop
*
p
)
{
adjust_pointer
(
p
,
_is_root
);
}
void
MarkSweep
::
AdjustPointerClosure
::
do_oop
(
oop
*
p
)
{
adjust_pointer
(
p
);
}
void
MarkSweep
::
AdjustPointerClosure
::
do_oop
(
narrowOop
*
p
)
{
adjust_pointer
(
p
);
}
void
MarkSweep
::
adjust_marks
()
{
assert
(
_preserved_oop_stack
.
size
()
==
_preserved_mark_stack
.
size
(),
...
...
src/share/vm/gc_implementation/shared/markSweep.hpp
浏览文件 @
35ef6e02
...
...
@@ -80,10 +80,7 @@ class MarkSweep : AllStatic {
};
class
AdjustPointerClosure
:
public
OopsInGenClosure
{
private:
bool
_is_root
;
public:
AdjustPointerClosure
(
bool
is_root
)
:
_is_root
(
is_root
)
{}
virtual
void
do_oop
(
oop
*
p
);
virtual
void
do_oop
(
narrowOop
*
p
);
};
...
...
@@ -146,7 +143,6 @@ class MarkSweep : AllStatic {
static
MarkAndPushClosure
mark_and_push_closure
;
static
FollowKlassClosure
follow_klass_closure
;
static
FollowStackClosure
follow_stack_closure
;
static
AdjustPointerClosure
adjust_root_pointer_closure
;
static
AdjustPointerClosure
adjust_pointer_closure
;
static
AdjustKlassClosure
adjust_klass_closure
;
...
...
@@ -179,12 +175,7 @@ class MarkSweep : AllStatic {
static
void
adjust_marks
();
// Adjust the pointers in the preserved marks table
static
void
restore_marks
();
// Restore the marks that we saved in preserve_mark
template
<
class
T
>
static
inline
void
adjust_pointer
(
T
*
p
,
bool
isroot
);
static
void
adjust_root_pointer
(
oop
*
p
)
{
adjust_pointer
(
p
,
true
);
}
static
void
adjust_pointer
(
oop
*
p
)
{
adjust_pointer
(
p
,
false
);
}
static
void
adjust_pointer
(
narrowOop
*
p
)
{
adjust_pointer
(
p
,
false
);
}
template
<
class
T
>
static
inline
void
adjust_pointer
(
T
*
p
);
};
class
PreservedMark
VALUE_OBJ_CLASS_SPEC
{
...
...
src/share/vm/gc_implementation/shared/markSweep.inline.hpp
浏览文件 @
35ef6e02
...
...
@@ -76,7 +76,7 @@ void MarkSweep::push_objarray(oop obj, size_t index) {
_objarray_stack
.
push
(
task
);
}
template
<
class
T
>
inline
void
MarkSweep
::
adjust_pointer
(
T
*
p
,
bool
isroot
)
{
template
<
class
T
>
inline
void
MarkSweep
::
adjust_pointer
(
T
*
p
)
{
T
heap_oop
=
oopDesc
::
load_heap_oop
(
p
);
if
(
!
oopDesc
::
is_null
(
heap_oop
))
{
oop
obj
=
oopDesc
::
decode_heap_oop_not_null
(
heap_oop
);
...
...
src/share/vm/memory/genCollectedHeap.cpp
浏览文件 @
35ef6e02
...
...
@@ -633,9 +633,8 @@ gen_process_strong_roots(int level,
}
void
GenCollectedHeap
::
gen_process_weak_roots
(
OopClosure
*
root_closure
,
CodeBlobClosure
*
code_roots
,
OopClosure
*
non_root_closure
)
{
SharedHeap
::
process_weak_roots
(
root_closure
,
code_roots
,
non_root_closure
);
CodeBlobClosure
*
code_roots
)
{
SharedHeap
::
process_weak_roots
(
root_closure
,
code_roots
);
// "Local" "weak" refs
for
(
int
i
=
0
;
i
<
_n_gens
;
i
++
)
{
_gens
[
i
]
->
ref_processor
()
->
weak_oops_do
(
root_closure
);
...
...
src/share/vm/memory/genCollectedHeap.hpp
浏览文件 @
35ef6e02
...
...
@@ -432,8 +432,7 @@ public:
// JNI weak roots, the code cache, system dictionary, symbol table,
// string table, and referents of reachable weak refs.
void
gen_process_weak_roots
(
OopClosure
*
root_closure
,
CodeBlobClosure
*
code_roots
,
OopClosure
*
non_root_closure
);
CodeBlobClosure
*
code_roots
);
// Set the saved marks of generations, if that makes sense.
// In particular, if any generation might iterate over the oops
...
...
src/share/vm/memory/genMarkSweep.cpp
浏览文件 @
35ef6e02
...
...
@@ -282,11 +282,10 @@ void GenMarkSweep::mark_sweep_phase3(int level) {
// Need new claim bits for the pointer adjustment tracing.
ClassLoaderDataGraph
::
clear_claimed_marks
();
// Because the
two closures below are created statically,
cannot
// Because the
closure below is created statically, we
cannot
// use OopsInGenClosure constructor which takes a generation,
// as the Universe has not been created when the static constructors
// are run.
adjust_root_pointer_closure
.
set_orig_generation
(
gch
->
get_gen
(
level
));
adjust_pointer_closure
.
set_orig_generation
(
gch
->
get_gen
(
level
));
gch
->
gen_process_strong_roots
(
level
,
...
...
@@ -294,18 +293,17 @@ void GenMarkSweep::mark_sweep_phase3(int level) {
true
,
// activate StrongRootsScope
false
,
// not scavenging
SharedHeap
::
SO_AllClasses
,
&
adjust_
root_
pointer_closure
,
&
adjust_pointer_closure
,
false
,
// do not walk code
&
adjust_
root_
pointer_closure
,
&
adjust_pointer_closure
,
&
adjust_klass_closure
);
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
CodeBlobToOopClosure
adjust_code_pointer_closure
(
&
adjust_pointer_closure
,
/*do_marking=*/
false
);
gch
->
gen_process_weak_roots
(
&
adjust_root_pointer_closure
,
&
adjust_code_pointer_closure
,
&
adjust_pointer_closure
);
gch
->
gen_process_weak_roots
(
&
adjust_pointer_closure
,
&
adjust_code_pointer_closure
);
adjust_marks
();
GenAdjustPointersClosure
blk
;
...
...
src/share/vm/memory/sharedHeap.cpp
浏览文件 @
35ef6e02
...
...
@@ -218,14 +218,13 @@ public:
static
AlwaysTrueClosure
always_true
;
void
SharedHeap
::
process_weak_roots
(
OopClosure
*
root_closure
,
CodeBlobClosure
*
code_roots
,
OopClosure
*
non_root_closure
)
{
CodeBlobClosure
*
code_roots
)
{
// Global (weak) JNI handles
JNIHandles
::
weak_oops_do
(
&
always_true
,
root_closure
);
CodeCache
::
blobs_do
(
code_roots
);
StringTable
::
oops_do
(
root_closure
);
}
}
void
SharedHeap
::
set_barrier_set
(
BarrierSet
*
bs
)
{
_barrier_set
=
bs
;
...
...
src/share/vm/memory/sharedHeap.hpp
浏览文件 @
35ef6e02
...
...
@@ -249,8 +249,7 @@ public:
// JNI weak roots, the code cache, system dictionary, symbol table,
// string table.
void
process_weak_roots
(
OopClosure
*
root_closure
,
CodeBlobClosure
*
code_roots
,
OopClosure
*
non_root_closure
);
CodeBlobClosure
*
code_roots
);
// The functions below are helper functions that a subclass of
// "SharedHeap" can use in the implementation of its virtual
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录