mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8080746
: Refactor oop iteration macros to be more general
Reviewed-by: stefank, pliden
This commit is contained in:
parent
e57447bd85
commit
b04d2bca57
16 changed files with 149 additions and 252 deletions
|
@ -144,4 +144,36 @@ class ArrayKlass: public Klass {
|
|||
void oop_verify_on(oop obj, outputStream* st);
|
||||
};
|
||||
|
||||
// Array oop iteration macros for declarations.
|
||||
// Used to generate the declarations in the *ArrayKlass header files.
|
||||
|
||||
#define OOP_OOP_ITERATE_DECL_RANGE(OopClosureType, nv_suffix) \
|
||||
int oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end);
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
// Named NO_BACKWARDS because the definition used by *ArrayKlass isn't reversed, see below.
|
||||
#define OOP_OOP_ITERATE_DECL_NO_BACKWARDS(OopClosureType, nv_suffix) \
|
||||
int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure);
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
|
||||
// Array oop iteration macros for definitions.
|
||||
// Used to generate the definitions in the *ArrayKlass.inline.hpp files.
|
||||
|
||||
#define OOP_OOP_ITERATE_DEFN_RANGE(KlassType, OopClosureType, nv_suffix) \
|
||||
\
|
||||
int KlassType::oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end) { \
|
||||
return oop_oop_iterate_range<nvs_to_bool(nv_suffix)>(obj, closure, start, end); \
|
||||
}
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
#define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix) \
|
||||
int KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
|
||||
/* No reverse implementation ATM. */ \
|
||||
return oop_oop_iterate<nvs_to_bool(nv_suffix)>(obj, closure); \
|
||||
}
|
||||
#else
|
||||
#define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix)
|
||||
#endif
|
||||
|
||||
#endif // SHARE_VM_OOPS_ARRAYKLASS_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue