8266904: Use function pointer typedefs in OopOopIterateDispatch

Reviewed-by: tschatzl, iklam
This commit is contained in:
Stefan Karlsson 2021-05-14 07:55:23 +00:00
parent 301095c8be
commit 88907bb81a

@ -206,6 +206,8 @@ void Devirtualizer::do_cld(OopClosureType* closure, ClassLoaderData* cld) {
template <typename OopClosureType>
class OopOopIterateDispatch : public AllStatic {
private:
typedef void (*FunctionType)(OopClosureType*, oop, Klass*);
class Table {
private:
template <typename KlassType, typename T>
@ -242,7 +244,7 @@ private:
}
public:
void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*);
FunctionType _function[KLASS_ID_COUNT];
Table(){
set_init_function<InstanceKlass>();
@ -257,7 +259,7 @@ private:
static Table _table;
public:
static void (*function(Klass* klass))(OopClosureType*, oop, Klass*) {
static FunctionType function(Klass* klass) {
return _table._function[klass->id()];
}
};
@ -269,6 +271,8 @@ typename OopOopIterateDispatch<OopClosureType>::Table OopOopIterateDispatch<OopC
template <typename OopClosureType>
class OopOopIterateBoundedDispatch {
private:
typedef void (*FunctionType)(OopClosureType*, oop, Klass*, MemRegion);
class Table {
private:
template <typename KlassType, typename T>
@ -302,7 +306,7 @@ private:
}
public:
void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*, MemRegion);
FunctionType _function[KLASS_ID_COUNT];
Table(){
set_init_function<InstanceKlass>();
@ -317,7 +321,7 @@ private:
static Table _table;
public:
static void (*function(Klass* klass))(OopClosureType*, oop, Klass*, MemRegion) {
static FunctionType function(Klass* klass) {
return _table._function[klass->id()];
}
};
@ -329,6 +333,8 @@ typename OopOopIterateBoundedDispatch<OopClosureType>::Table OopOopIterateBounde
template <typename OopClosureType>
class OopOopIterateBackwardsDispatch {
private:
typedef void (*FunctionType)(OopClosureType*, oop, Klass*);
class Table {
private:
template <typename KlassType, typename T>
@ -362,7 +368,7 @@ private:
}
public:
void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*);
FunctionType _function[KLASS_ID_COUNT];
Table(){
set_init_function<InstanceKlass>();
@ -377,7 +383,7 @@ private:
static Table _table;
public:
static void (*function(Klass* klass))(OopClosureType*, oop, Klass*) {
static FunctionType function(Klass* klass) {
return _table._function[klass->id()];
}
};