mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8266904: Use function pointer typedefs in OopOopIterateDispatch
Reviewed-by: tschatzl, iklam
This commit is contained in:
parent
301095c8be
commit
88907bb81a
1 changed files with 12 additions and 6 deletions
|
@ -206,6 +206,8 @@ void Devirtualizer::do_cld(OopClosureType* closure, ClassLoaderData* cld) {
|
||||||
template <typename OopClosureType>
|
template <typename OopClosureType>
|
||||||
class OopOopIterateDispatch : public AllStatic {
|
class OopOopIterateDispatch : public AllStatic {
|
||||||
private:
|
private:
|
||||||
|
typedef void (*FunctionType)(OopClosureType*, oop, Klass*);
|
||||||
|
|
||||||
class Table {
|
class Table {
|
||||||
private:
|
private:
|
||||||
template <typename KlassType, typename T>
|
template <typename KlassType, typename T>
|
||||||
|
@ -242,7 +244,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*);
|
FunctionType _function[KLASS_ID_COUNT];
|
||||||
|
|
||||||
Table(){
|
Table(){
|
||||||
set_init_function<InstanceKlass>();
|
set_init_function<InstanceKlass>();
|
||||||
|
@ -257,7 +259,7 @@ private:
|
||||||
static Table _table;
|
static Table _table;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static void (*function(Klass* klass))(OopClosureType*, oop, Klass*) {
|
static FunctionType function(Klass* klass) {
|
||||||
return _table._function[klass->id()];
|
return _table._function[klass->id()];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -269,6 +271,8 @@ typename OopOopIterateDispatch<OopClosureType>::Table OopOopIterateDispatch<OopC
|
||||||
template <typename OopClosureType>
|
template <typename OopClosureType>
|
||||||
class OopOopIterateBoundedDispatch {
|
class OopOopIterateBoundedDispatch {
|
||||||
private:
|
private:
|
||||||
|
typedef void (*FunctionType)(OopClosureType*, oop, Klass*, MemRegion);
|
||||||
|
|
||||||
class Table {
|
class Table {
|
||||||
private:
|
private:
|
||||||
template <typename KlassType, typename T>
|
template <typename KlassType, typename T>
|
||||||
|
@ -302,7 +306,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*, MemRegion);
|
FunctionType _function[KLASS_ID_COUNT];
|
||||||
|
|
||||||
Table(){
|
Table(){
|
||||||
set_init_function<InstanceKlass>();
|
set_init_function<InstanceKlass>();
|
||||||
|
@ -317,7 +321,7 @@ private:
|
||||||
static Table _table;
|
static Table _table;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static void (*function(Klass* klass))(OopClosureType*, oop, Klass*, MemRegion) {
|
static FunctionType function(Klass* klass) {
|
||||||
return _table._function[klass->id()];
|
return _table._function[klass->id()];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -329,6 +333,8 @@ typename OopOopIterateBoundedDispatch<OopClosureType>::Table OopOopIterateBounde
|
||||||
template <typename OopClosureType>
|
template <typename OopClosureType>
|
||||||
class OopOopIterateBackwardsDispatch {
|
class OopOopIterateBackwardsDispatch {
|
||||||
private:
|
private:
|
||||||
|
typedef void (*FunctionType)(OopClosureType*, oop, Klass*);
|
||||||
|
|
||||||
class Table {
|
class Table {
|
||||||
private:
|
private:
|
||||||
template <typename KlassType, typename T>
|
template <typename KlassType, typename T>
|
||||||
|
@ -362,7 +368,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*);
|
FunctionType _function[KLASS_ID_COUNT];
|
||||||
|
|
||||||
Table(){
|
Table(){
|
||||||
set_init_function<InstanceKlass>();
|
set_init_function<InstanceKlass>();
|
||||||
|
@ -377,7 +383,7 @@ private:
|
||||||
static Table _table;
|
static Table _table;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static void (*function(Klass* klass))(OopClosureType*, oop, Klass*) {
|
static FunctionType function(Klass* klass) {
|
||||||
return _table._function[klass->id()];
|
return _table._function[klass->id()];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue