Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
bfa001f7
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看板
提交
bfa001f7
编写于
6月 24, 2014
作者:
S
stefank
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8046670: Make CMS metadata aware closures applicable for other collectors
Reviewed-by: ehelin, mgerdin
上级
8333cd87
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
139 addition
and
123 deletion
+139
-123
src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp
.../gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp
+19
-57
src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp
...lementation/concurrentMarkSweep/cmsOopClosures.inline.hpp
+4
-17
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
...ion/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+13
-18
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
...ion/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+1
-1
src/share/vm/memory/iterator.cpp
src/share/vm/memory/iterator.cpp
+1
-0
src/share/vm/memory/iterator.hpp
src/share/vm/memory/iterator.hpp
+47
-2
src/share/vm/memory/iterator.inline.hpp
src/share/vm/memory/iterator.inline.hpp
+47
-0
src/share/vm/oops/instanceClassLoaderKlass.cpp
src/share/vm/oops/instanceClassLoaderKlass.cpp
+1
-6
src/share/vm/oops/instanceKlass.cpp
src/share/vm/oops/instanceKlass.cpp
+4
-10
src/share/vm/oops/instanceMirrorKlass.cpp
src/share/vm/oops/instanceMirrorKlass.cpp
+1
-6
src/share/vm/oops/objArrayKlass.cpp
src/share/vm/oops/objArrayKlass.cpp
+1
-6
未找到文件。
src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp
浏览文件 @
bfa001f7
...
...
@@ -26,6 +26,7 @@
#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
#include "memory/genOopClosures.hpp"
#include "memory/iterator.hpp"
/////////////////////////////////////////////////////////////////
// Closures used by ConcurrentMarkSweepGeneration's collector
...
...
@@ -48,52 +49,13 @@ class Par_MarkFromRootsClosure;
} \
}
// Applies the given oop closure to all oops in all klasses visited.
class
CMKlassClosure
:
public
KlassClosure
{
friend
class
CMSOopClosure
;
friend
class
CMSOopsInGenClosure
;
OopClosure
*
_oop_closure
;
// Used when _oop_closure couldn't be set in an initialization list.
void
initialize
(
OopClosure
*
oop_closure
)
{
assert
(
_oop_closure
==
NULL
,
"Should only be called once"
);
_oop_closure
=
oop_closure
;
}
public:
CMKlassClosure
(
OopClosure
*
oop_closure
=
NULL
)
:
_oop_closure
(
oop_closure
)
{
}
void
do_klass
(
Klass
*
k
);
};
// The base class for all CMS marking closures.
// It's used to proxy through the metadata to the oops defined in them.
class
CMSOopClosure
:
public
ExtendedOopClosure
{
CMKlassClosure
_klass_closure
;
public:
CMSOopClosure
()
:
ExtendedOopClosure
()
{
_klass_closure
.
initialize
(
this
);
}
CMSOopClosure
(
ReferenceProcessor
*
rp
)
:
ExtendedOopClosure
(
rp
)
{
_klass_closure
.
initialize
(
this
);
}
virtual
bool
do_metadata
()
{
return
do_metadata_nv
();
}
inline
bool
do_metadata_nv
()
{
return
true
;
}
virtual
void
do_klass
(
Klass
*
k
);
void
do_klass_nv
(
Klass
*
k
);
virtual
void
do_class_loader_data
(
ClassLoaderData
*
cld
);
};
// TODO: This duplication of the CMSOopClosure class is only needed because
// some CMS OopClosures derive from OopsInGenClosure. It would be good
// to get rid of them completely.
class
CMSOopsInGenClosure
:
public
OopsInGenClosure
{
CMKlassClosure
_klass_closure
;
// TODO: This duplication of the MetadataAwareOopClosure class is only needed
// because some CMS OopClosures derive from OopsInGenClosure. It would be
// good to get rid of them completely.
class
MetadataAwareOopsInGenClosure
:
public
OopsInGenClosure
{
KlassToOopClosure
_klass_closure
;
public:
CMS
OopsInGenClosure
()
{
MetadataAware
OopsInGenClosure
()
{
_klass_closure
.
initialize
(
this
);
}
...
...
@@ -106,7 +68,7 @@ class CMSOopsInGenClosure: public OopsInGenClosure {
virtual
void
do_class_loader_data
(
ClassLoaderData
*
cld
);
};
class
MarkRefsIntoClosure
:
public
CMS
OopsInGenClosure
{
class
MarkRefsIntoClosure
:
public
MetadataAware
OopsInGenClosure
{
private:
const
MemRegion
_span
;
CMSBitMap
*
_bitMap
;
...
...
@@ -122,7 +84,7 @@ class MarkRefsIntoClosure: public CMSOopsInGenClosure {
}
};
class
Par_MarkRefsIntoClosure
:
public
CMS
OopsInGenClosure
{
class
Par_MarkRefsIntoClosure
:
public
MetadataAware
OopsInGenClosure
{
private:
const
MemRegion
_span
;
CMSBitMap
*
_bitMap
;
...
...
@@ -140,7 +102,7 @@ class Par_MarkRefsIntoClosure: public CMSOopsInGenClosure {
// A variant of the above used in certain kinds of CMS
// marking verification.
class
MarkRefsIntoVerifyClosure
:
public
CMS
OopsInGenClosure
{
class
MarkRefsIntoVerifyClosure
:
public
MetadataAware
OopsInGenClosure
{
private:
const
MemRegion
_span
;
CMSBitMap
*
_verification_bm
;
...
...
@@ -159,7 +121,7 @@ class MarkRefsIntoVerifyClosure: public CMSOopsInGenClosure {
};
// The non-parallel version (the parallel version appears further below).
class
PushAndMarkClosure
:
public
CMS
OopClosure
{
class
PushAndMarkClosure
:
public
MetadataAware
OopClosure
{
private:
CMSCollector
*
_collector
;
MemRegion
_span
;
...
...
@@ -193,7 +155,7 @@ class PushAndMarkClosure: public CMSOopClosure {
// synchronization (for instance, via CAS). The marking stack
// used in the non-parallel case above is here replaced with
// an OopTaskQueue structure to allow efficient work stealing.
class
Par_PushAndMarkClosure
:
public
CMS
OopClosure
{
class
Par_PushAndMarkClosure
:
public
MetadataAware
OopClosure
{
private:
CMSCollector
*
_collector
;
MemRegion
_span
;
...
...
@@ -218,7 +180,7 @@ class Par_PushAndMarkClosure: public CMSOopClosure {
};
// The non-parallel version (the parallel version appears further below).
class
MarkRefsIntoAndScanClosure
:
public
CMS
OopsInGenClosure
{
class
MarkRefsIntoAndScanClosure
:
public
MetadataAware
OopsInGenClosure
{
private:
MemRegion
_span
;
CMSBitMap
*
_bit_map
;
...
...
@@ -262,7 +224,7 @@ class MarkRefsIntoAndScanClosure: public CMSOopsInGenClosure {
// stack and the bitMap are shared, so access needs to be suitably
// sycnhronized. An OopTaskQueue structure, supporting efficient
// workstealing, replaces a CMSMarkStack for storing grey objects.
class
Par_MarkRefsIntoAndScanClosure
:
public
CMS
OopsInGenClosure
{
class
Par_MarkRefsIntoAndScanClosure
:
public
MetadataAware
OopsInGenClosure
{
private:
MemRegion
_span
;
CMSBitMap
*
_bit_map
;
...
...
@@ -291,7 +253,7 @@ class Par_MarkRefsIntoAndScanClosure: public CMSOopsInGenClosure {
// This closure is used during the concurrent marking phase
// following the first checkpoint. Its use is buried in
// the closure MarkFromRootsClosure.
class
PushOrMarkClosure
:
public
CMS
OopClosure
{
class
PushOrMarkClosure
:
public
MetadataAware
OopClosure
{
private:
CMSCollector
*
_collector
;
MemRegion
_span
;
...
...
@@ -324,7 +286,7 @@ class PushOrMarkClosure: public CMSOopClosure {
// This closure is used during the concurrent marking phase
// following the first checkpoint. Its use is buried in
// the closure Par_MarkFromRootsClosure.
class
Par_PushOrMarkClosure
:
public
CMS
OopClosure
{
class
Par_PushOrMarkClosure
:
public
MetadataAware
OopClosure
{
private:
CMSCollector
*
_collector
;
MemRegion
_whole_span
;
...
...
@@ -364,7 +326,7 @@ class Par_PushOrMarkClosure: public CMSOopClosure {
// processing phase of the CMS final checkpoint step, as
// well as during the concurrent precleaning of the discovered
// reference lists.
class
CMSKeepAliveClosure
:
public
CMS
OopClosure
{
class
CMSKeepAliveClosure
:
public
MetadataAware
OopClosure
{
private:
CMSCollector
*
_collector
;
const
MemRegion
_span
;
...
...
@@ -384,7 +346,7 @@ class CMSKeepAliveClosure: public CMSOopClosure {
inline
void
do_oop_nv
(
narrowOop
*
p
)
{
CMSKeepAliveClosure
::
do_oop_work
(
p
);
}
};
class
CMSInnerParMarkAndPushClosure
:
public
CMS
OopClosure
{
class
CMSInnerParMarkAndPushClosure
:
public
MetadataAware
OopClosure
{
private:
CMSCollector
*
_collector
;
MemRegion
_span
;
...
...
@@ -405,7 +367,7 @@ class CMSInnerParMarkAndPushClosure: public CMSOopClosure {
// A parallel (MT) version of the above, used when
// reference processing is parallel; the only difference
// is in the do_oop method.
class
CMSParKeepAliveClosure
:
public
CMS
OopClosure
{
class
CMSParKeepAliveClosure
:
public
MetadataAware
OopClosure
{
private:
MemRegion
_span
;
OopTaskQueue
*
_work_queue
;
...
...
src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp
浏览文件 @
bfa001f7
...
...
@@ -44,33 +44,20 @@ inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) {
}
}
//
CMSOopClosure and CMSo
opsInGenClosure are duplicated,
//
MetadataAwareOopClosure and MetadataAwareO
opsInGenClosure are duplicated,
// until we get rid of OopsInGenClosure.
inline
void
CMSOopClosure
::
do_klass
(
Klass
*
k
)
{
do_klass_nv
(
k
);
}
inline
void
CMSOopsInGenClosure
::
do_klass
(
Klass
*
k
)
{
do_klass_nv
(
k
);
}
inline
void
CMSOopClosure
::
do_klass_nv
(
Klass
*
k
)
{
inline
void
MetadataAwareOopsInGenClosure
::
do_klass_nv
(
Klass
*
k
)
{
ClassLoaderData
*
cld
=
k
->
class_loader_data
();
do_class_loader_data
(
cld
);
}
inline
void
CMSOopsInGenClosure
::
do_klass_nv
(
Klass
*
k
)
{
ClassLoaderData
*
cld
=
k
->
class_loader_data
();
do_class_loader_data
(
cld
);
}
inline
void
CMSOopClosure
::
do_class_loader_data
(
ClassLoaderData
*
cld
)
{
assert
(
_klass_closure
.
_oop_closure
==
this
,
"Must be"
);
inline
void
MetadataAwareOopsInGenClosure
::
do_klass
(
Klass
*
k
)
{
do_klass_nv
(
k
);
}
bool
claim
=
true
;
// Must claim the class loader data before processing.
cld
->
oops_do
(
_klass_closure
.
_oop_closure
,
&
_klass_closure
,
claim
);
}
inline
void
CMSOopsInGenClosure
::
do_class_loader_data
(
ClassLoaderData
*
cld
)
{
inline
void
MetadataAwareOopsInGenClosure
::
do_class_loader_data
(
ClassLoaderData
*
cld
)
{
assert
(
_klass_closure
.
_oop_closure
==
this
,
"Must be"
);
bool
claim
=
true
;
// Must claim the class loader data before processing.
cld
->
oops_do
(
_klass_closure
.
_oop_closure
,
&
_klass_closure
,
claim
);
}
#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_INLINE_HPP
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
浏览文件 @
bfa001f7
...
...
@@ -49,7 +49,7 @@
#include "memory/genCollectedHeap.hpp"
#include "memory/genMarkSweep.hpp"
#include "memory/genOopClosures.inline.hpp"
#include "memory/iterator.hpp"
#include "memory/iterator.
inline.
hpp"
#include "memory/padded.hpp"
#include "memory/referencePolicy.hpp"
#include "memory/resourceArea.hpp"
...
...
@@ -3098,7 +3098,7 @@ void CMSCollector::verify_after_remark_work_2() {
// Mark from roots one level into CMS
MarkRefsIntoVerifyClosure
notOlder
(
_span
,
verification_mark_bm
(),
markBitMap
());
CMKlass
Closure
klass_closure
(
&
notOlder
);
KlassToOop
Closure
klass_closure
(
&
notOlder
);
gch
->
rem_set
()
->
prepare_for_younger_refs_iterate
(
false
);
// Not parallel.
gch
->
gen_process_strong_roots
(
_cmsGen
->
level
(),
...
...
@@ -3719,7 +3719,7 @@ void CMSCollector::checkpointRootsInitialWork(bool asynch) {
gch
->
set_par_threads
(
0
);
}
else
{
// The serial version.
CMKlass
Closure
klass_closure
(
&
notOlder
);
KlassToOop
Closure
klass_closure
(
&
notOlder
);
gch
->
rem_set
()
->
prepare_for_younger_refs_iterate
(
false
);
// Not parallel.
gch
->
gen_process_strong_roots
(
_cmsGen
->
level
(),
true
,
// younger gens are roots
...
...
@@ -4181,7 +4181,7 @@ void CMSConcMarkingTask::do_scan_and_mark(int i, CompactibleFreeListSpace* sp) {
pst
->
all_tasks_completed
();
}
class
Par_ConcMarkingClosure
:
public
CMS
OopClosure
{
class
Par_ConcMarkingClosure
:
public
MetadataAware
OopClosure
{
private:
CMSCollector
*
_collector
;
CMSConcMarkingTask
*
_task
;
...
...
@@ -4194,7 +4194,7 @@ class Par_ConcMarkingClosure: public CMSOopClosure {
public:
Par_ConcMarkingClosure
(
CMSCollector
*
collector
,
CMSConcMarkingTask
*
task
,
OopTaskQueue
*
work_queue
,
CMSBitMap
*
bit_map
,
CMSMarkStack
*
overflow_stack
)
:
CMS
OopClosure
(
collector
->
ref_processor
()),
MetadataAware
OopClosure
(
collector
->
ref_processor
()),
_collector
(
collector
),
_task
(
task
),
_span
(
collector
->
_span
),
...
...
@@ -4965,7 +4965,7 @@ size_t CMSCollector::preclean_card_table(ConcurrentMarkSweepGeneration* gen,
}
class
PrecleanKlassClosure
:
public
KlassClosure
{
CMKlass
Closure
_cm_klass_closure
;
KlassToOop
Closure
_cm_klass_closure
;
public:
PrecleanKlassClosure
(
OopClosure
*
oop_closure
)
:
_cm_klass_closure
(
oop_closure
)
{}
void
do_klass
(
Klass
*
k
)
{
...
...
@@ -5203,7 +5203,7 @@ void CMSParInitialMarkTask::work(uint worker_id) {
_timer
.
start
();
GenCollectedHeap
*
gch
=
GenCollectedHeap
::
heap
();
Par_MarkRefsIntoClosure
par_mri_cl
(
_collector
->
_span
,
&
(
_collector
->
_markBitMap
));
CMKlass
Closure
klass_closure
(
&
par_mri_cl
);
KlassToOop
Closure
klass_closure
(
&
par_mri_cl
);
// ---------- young gen roots --------------
{
...
...
@@ -5277,7 +5277,7 @@ class CMSParRemarkTask: public CMSParMarkTask {
};
class
RemarkKlassClosure
:
public
KlassClosure
{
CMKlass
Closure
_cm_klass_closure
;
KlassToOop
Closure
_cm_klass_closure
;
public:
RemarkKlassClosure
(
OopClosure
*
oop_closure
)
:
_cm_klass_closure
(
oop_closure
)
{}
void
do_klass
(
Klass
*
k
)
{
...
...
@@ -7716,7 +7716,7 @@ PushAndMarkVerifyClosure::PushAndMarkVerifyClosure(
CMSCollector
*
collector
,
MemRegion
span
,
CMSBitMap
*
verification_bm
,
CMSBitMap
*
cms_bm
,
CMSMarkStack
*
mark_stack
)
:
CMS
OopClosure
(
collector
->
ref_processor
()),
MetadataAware
OopClosure
(
collector
->
ref_processor
()),
_collector
(
collector
),
_span
(
span
),
_verification_bm
(
verification_bm
),
...
...
@@ -7769,7 +7769,7 @@ PushOrMarkClosure::PushOrMarkClosure(CMSCollector* collector,
MemRegion
span
,
CMSBitMap
*
bitMap
,
CMSMarkStack
*
markStack
,
HeapWord
*
finger
,
MarkFromRootsClosure
*
parent
)
:
CMS
OopClosure
(
collector
->
ref_processor
()),
MetadataAware
OopClosure
(
collector
->
ref_processor
()),
_collector
(
collector
),
_span
(
span
),
_bitMap
(
bitMap
),
...
...
@@ -7786,7 +7786,7 @@ Par_PushOrMarkClosure::Par_PushOrMarkClosure(CMSCollector* collector,
HeapWord
*
finger
,
HeapWord
**
global_finger_addr
,
Par_MarkFromRootsClosure
*
parent
)
:
CMS
OopClosure
(
collector
->
ref_processor
()),
MetadataAware
OopClosure
(
collector
->
ref_processor
()),
_collector
(
collector
),
_whole_span
(
collector
->
_span
),
_span
(
span
),
...
...
@@ -7835,11 +7835,6 @@ void Par_PushOrMarkClosure::handle_stack_overflow(HeapWord* lost) {
_overflow_stack
->
expand
();
// expand the stack if possible
}
void
CMKlassClosure
::
do_klass
(
Klass
*
k
)
{
assert
(
_oop_closure
!=
NULL
,
"Not initialized?"
);
k
->
oops_do
(
_oop_closure
);
}
void
PushOrMarkClosure
::
do_oop
(
oop
obj
)
{
// Ignore mark word because we are running concurrent with mutators.
assert
(
obj
->
is_oop_or_null
(
true
),
"expected an oop or NULL"
);
...
...
@@ -7937,7 +7932,7 @@ PushAndMarkClosure::PushAndMarkClosure(CMSCollector* collector,
CMSBitMap
*
mod_union_table
,
CMSMarkStack
*
mark_stack
,
bool
concurrent_precleaning
)
:
CMS
OopClosure
(
rp
),
MetadataAware
OopClosure
(
rp
),
_collector
(
collector
),
_span
(
span
),
_bit_map
(
bit_map
),
...
...
@@ -8010,7 +8005,7 @@ Par_PushAndMarkClosure::Par_PushAndMarkClosure(CMSCollector* collector,
ReferenceProcessor
*
rp
,
CMSBitMap
*
bit_map
,
OopTaskQueue
*
work_queue
)
:
CMS
OopClosure
(
rp
),
MetadataAware
OopClosure
(
rp
),
_collector
(
collector
),
_span
(
span
),
_bit_map
(
bit_map
),
...
...
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
浏览文件 @
bfa001f7
...
...
@@ -1446,7 +1446,7 @@ class Par_MarkFromRootsClosure: public BitMapClosure {
// The following closures are used to do certain kinds of verification of
// CMS marking.
class
PushAndMarkVerifyClosure
:
public
CMS
OopClosure
{
class
PushAndMarkVerifyClosure
:
public
MetadataAware
OopClosure
{
CMSCollector
*
_collector
;
MemRegion
_span
;
CMSBitMap
*
_verification_bm
;
...
...
src/share/vm/memory/iterator.cpp
浏览文件 @
bfa001f7
...
...
@@ -27,6 +27,7 @@
#include "oops/oop.inline.hpp"
void
KlassToOopClosure
::
do_klass
(
Klass
*
k
)
{
assert
(
_oop_closure
!=
NULL
,
"Not initialized?"
);
k
->
oops_do
(
_oop_closure
);
}
...
...
src/share/vm/memory/iterator.hpp
浏览文件 @
bfa001f7
...
...
@@ -134,9 +134,19 @@ class CLDClosure : public Closure {
};
class
KlassToOopClosure
:
public
KlassClosure
{
friend
class
MetadataAwareOopClosure
;
friend
class
MetadataAwareOopsInGenClosure
;
OopClosure
*
_oop_closure
;
public:
KlassToOopClosure
(
OopClosure
*
oop_closure
)
:
_oop_closure
(
oop_closure
)
{}
// Used when _oop_closure couldn't be set in an initialization list.
void
initialize
(
OopClosure
*
oop_closure
)
{
assert
(
_oop_closure
==
NULL
,
"Should only be called once"
);
_oop_closure
=
oop_closure
;
}
public:
KlassToOopClosure
(
OopClosure
*
oop_closure
=
NULL
)
:
_oop_closure
(
oop_closure
)
{}
virtual
void
do_klass
(
Klass
*
k
);
};
...
...
@@ -154,6 +164,29 @@ class CLDToOopClosure : public CLDClosure {
void
do_cld
(
ClassLoaderData
*
cld
);
};
// The base class for all concurrent marking closures,
// that participates in class unloading.
// It's used to proxy through the metadata to the oops defined in them.
class
MetadataAwareOopClosure
:
public
ExtendedOopClosure
{
KlassToOopClosure
_klass_closure
;
public:
MetadataAwareOopClosure
()
:
ExtendedOopClosure
()
{
_klass_closure
.
initialize
(
this
);
}
MetadataAwareOopClosure
(
ReferenceProcessor
*
rp
)
:
ExtendedOopClosure
(
rp
)
{
_klass_closure
.
initialize
(
this
);
}
virtual
bool
do_metadata
()
{
return
do_metadata_nv
();
}
inline
bool
do_metadata_nv
()
{
return
true
;
}
virtual
void
do_klass
(
Klass
*
k
);
void
do_klass_nv
(
Klass
*
k
);
virtual
void
do_class_loader_data
(
ClassLoaderData
*
cld
);
};
// ObjectClosure is used for iterating through an object space
class
ObjectClosure
:
public
Closure
{
...
...
@@ -337,4 +370,16 @@ class SymbolClosure : public StackObj {
}
};
// Helper defines for ExtendOopClosure
#define if_do_metadata_checked(closure, nv_suffix) \
/* Make sure the non-virtual and the virtual versions match. */
\
assert(closure->do_metadata##nv_suffix() == closure->do_metadata(), \
"Inconsistency in do_metadata"); \
if (closure->do_metadata##nv_suffix())
#define assert_should_ignore_metadata(closure, nv_suffix) \
assert(!closure->do_metadata##nv_suffix(), "Code to handle metadata is not implemented")
#endif // SHARE_VM_MEMORY_ITERATOR_HPP
src/share/vm/memory/iterator.inline.hpp
0 → 100644
浏览文件 @
bfa001f7
/*
* 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_MEMORY_ITERATOR_INLINE_HPP
#define SHARE_VM_MEMORY_ITERATOR_INLINE_HPP
#include "classfile/classLoaderData.hpp"
#include "memory/iterator.hpp"
#include "oops/klass.hpp"
#include "utilities/debug.hpp"
inline
void
MetadataAwareOopClosure
::
do_class_loader_data
(
ClassLoaderData
*
cld
)
{
assert
(
_klass_closure
.
_oop_closure
==
this
,
"Must be"
);
bool
claim
=
true
;
// Must claim the class loader data before processing.
cld
->
oops_do
(
_klass_closure
.
_oop_closure
,
&
_klass_closure
,
claim
);
}
inline
void
MetadataAwareOopClosure
::
do_klass_nv
(
Klass
*
k
)
{
ClassLoaderData
*
cld
=
k
->
class_loader_data
();
do_class_loader_data
(
cld
);
}
inline
void
MetadataAwareOopClosure
::
do_klass
(
Klass
*
k
)
{
do_klass_nv
(
k
);
}
#endif // SHARE_VM_MEMORY_ITERATOR_INLINE_HPP
src/share/vm/oops/instanceClassLoaderKlass.cpp
浏览文件 @
bfa001f7
...
...
@@ -28,6 +28,7 @@
#include "gc_implementation/shared/markSweep.inline.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/genOopClosures.inline.hpp"
#include "memory/iterator.inline.hpp"
#include "memory/oopFactory.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/instanceClassLoaderKlass.hpp"
...
...
@@ -44,12 +45,6 @@
#include "oops/oop.pcgc.inline.hpp"
#endif // INCLUDE_ALL_GCS
#define if_do_metadata_checked(closure, nv_suffix) \
/* Make sure the non-virtual and the virtual versions match. */
\
assert(closure->do_metadata##nv_suffix() == closure->do_metadata(), \
"Inconsistency in do_metadata"); \
if (closure->do_metadata##nv_suffix())
// Macro to define InstanceClassLoaderKlass::oop_oop_iterate for virtual/nonvirtual for
// all closures. Macros calling macros above for each oop size.
// Since ClassLoader objects have only a pointer to the loader_data, they are not
...
...
src/share/vm/oops/instanceKlass.cpp
浏览文件 @
bfa001f7
...
...
@@ -35,6 +35,7 @@
#include "jvmtifiles/jvmti.h"
#include "memory/genOopClosures.inline.hpp"
#include "memory/heapInspection.hpp"
#include "memory/iterator.inline.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/oopFactory.hpp"
#include "oops/fieldStreams.hpp"
...
...
@@ -2132,12 +2133,6 @@ void InstanceKlass::oop_follow_contents(ParCompactionManager* cm,
// closure's do_metadata() method dictates whether the given closure should be
// applied to the klass ptr in the object header.
#define if_do_metadata_checked(closure, nv_suffix) \
/* Make sure the non-virtual and the virtual versions match. */
\
assert(closure->do_metadata##nv_suffix() == closure->do_metadata(), \
"Inconsistency in do_metadata"); \
if (closure->do_metadata##nv_suffix())
#define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
\
int InstanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
...
...
@@ -2161,10 +2156,9 @@ int InstanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure)
int InstanceKlass::oop_oop_iterate_backwards##nv_suffix(oop obj, \
OopClosureType* closure) { \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik); \
/* header */
\
if_do_metadata_checked(closure, nv_suffix) { \
closure->do_klass##nv_suffix(obj->klass()); \
} \
\
assert_should_ignore_metadata(closure, nv_suffix); \
\
/* instance variables */
\
InstanceKlass_OOP_MAP_REVERSE_ITERATE( \
obj, \
...
...
src/share/vm/oops/instanceMirrorKlass.cpp
浏览文件 @
bfa001f7
...
...
@@ -28,6 +28,7 @@
#include "gc_implementation/shared/markSweep.inline.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/genOopClosures.inline.hpp"
#include "memory/iterator.inline.hpp"
#include "memory/oopFactory.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/instanceMirrorKlass.hpp"
...
...
@@ -241,12 +242,6 @@ int InstanceMirrorKlass::oop_adjust_pointers(oop obj) {
return oop_size(obj); \
#define if_do_metadata_checked(closure, nv_suffix) \
/* Make sure the non-virtual and the virtual versions match. */
\
assert(closure->do_metadata##nv_suffix() == closure->do_metadata(), \
"Inconsistency in do_metadata"); \
if (closure->do_metadata##nv_suffix())
// Macro to define InstanceMirrorKlass::oop_oop_iterate for virtual/nonvirtual for
// all closures. Macros calling macros above for each oop size.
...
...
src/share/vm/oops/objArrayKlass.cpp
浏览文件 @
bfa001f7
...
...
@@ -29,6 +29,7 @@
#include "gc_implementation/shared/markSweep.inline.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/genOopClosures.inline.hpp"
#include "memory/iterator.inline.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.inline.hpp"
...
...
@@ -476,12 +477,6 @@ void ObjArrayKlass::oop_follow_contents(ParCompactionManager* cm,
}
#endif // INCLUDE_ALL_GCS
#define if_do_metadata_checked(closure, nv_suffix) \
/* Make sure the non-virtual and the virtual versions match. */
\
assert(closure->do_metadata##nv_suffix() == closure->do_metadata(), \
"Inconsistency in do_metadata"); \
if (closure->do_metadata##nv_suffix())
#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
\
int ObjArrayKlass::oop_oop_iterate##nv_suffix(oop obj, \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录