8046670: Make CMS metadata aware closures applicable for other collectors

Reviewed-by: ehelin, mgerdin
This commit is contained in:
Stefan Karlsson 2014-06-24 16:20:15 +02:00
parent 4241d1c605
commit fd43773a10
11 changed files with 139 additions and 123 deletions

View file

@ -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"
@ -2114,12 +2115,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) { \
@ -2143,10 +2138,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, \