mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8283607: Rename KlassID to KlassKind
Reviewed-by: dholmes, tschatzl
This commit is contained in:
parent
6b59760da6
commit
636225b815
14 changed files with 62 additions and 60 deletions
|
@ -174,7 +174,7 @@ void Devirtualizer::do_cld(OopClosureType* closure, ClassLoaderData* cld) {
|
|||
// It allows for a single call to do a multi-dispatch to an optimized version
|
||||
// of oop_oop_iterate that statically know all these types:
|
||||
// - OopClosureType : static type give at call site
|
||||
// - Klass* : dynamic to static type through Klass::id() -> table index
|
||||
// - Klass* : dynamic to static type through Klass::kind() -> table index
|
||||
// - UseCompressedOops : dynamic to static value determined once
|
||||
//
|
||||
// when users call obj->oop_iterate(&cl).
|
||||
|
@ -190,7 +190,7 @@ void Devirtualizer::do_cld(OopClosureType* closure, ClassLoaderData* cld) {
|
|||
// used when calling do_oop.
|
||||
//
|
||||
// Klass* :
|
||||
// A table mapping from *Klass::ID to function is setup. This happens once
|
||||
// A table mapping from *Klass::Kind to function is setup. This happens once
|
||||
// when the program starts, when the static _table instance is initialized for
|
||||
// the OopOopIterateDispatch specialized with the OopClosureType.
|
||||
//
|
||||
|
@ -223,7 +223,7 @@ private:
|
|||
|
||||
template <typename KlassType>
|
||||
void set_init_function() {
|
||||
_function[KlassType::ID] = &init<KlassType>;
|
||||
_function[KlassType::Kind] = &init<KlassType>;
|
||||
}
|
||||
|
||||
template <typename KlassType>
|
||||
|
@ -232,20 +232,20 @@ private:
|
|||
// when functions pointers are updated.
|
||||
STATIC_ASSERT(sizeof(_function[0]) == sizeof(void*));
|
||||
if (UseCompressedOops) {
|
||||
_function[KlassType::ID] = &oop_oop_iterate<KlassType, narrowOop>;
|
||||
_function[KlassType::Kind] = &oop_oop_iterate<KlassType, narrowOop>;
|
||||
} else {
|
||||
_function[KlassType::ID] = &oop_oop_iterate<KlassType, oop>;
|
||||
_function[KlassType::Kind] = &oop_oop_iterate<KlassType, oop>;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename KlassType>
|
||||
void set_resolve_function_and_execute(OopClosureType* cl, oop obj, Klass* k) {
|
||||
set_resolve_function<KlassType>();
|
||||
_function[KlassType::ID](cl, obj, k);
|
||||
_function[KlassType::Kind](cl, obj, k);
|
||||
}
|
||||
|
||||
public:
|
||||
FunctionType _function[KLASS_ID_COUNT];
|
||||
FunctionType _function[KLASS_KIND_COUNT];
|
||||
|
||||
Table(){
|
||||
set_init_function<InstanceKlass>();
|
||||
|
@ -261,7 +261,7 @@ private:
|
|||
public:
|
||||
|
||||
static FunctionType function(Klass* klass) {
|
||||
return _table._function[klass->id()];
|
||||
return _table._function[klass->kind()];
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -288,26 +288,26 @@ private:
|
|||
|
||||
template <typename KlassType>
|
||||
void set_init_function() {
|
||||
_function[KlassType::ID] = &init<KlassType>;
|
||||
_function[KlassType::Kind] = &init<KlassType>;
|
||||
}
|
||||
|
||||
template <typename KlassType>
|
||||
void set_resolve_function() {
|
||||
if (UseCompressedOops) {
|
||||
_function[KlassType::ID] = &oop_oop_iterate_bounded<KlassType, narrowOop>;
|
||||
_function[KlassType::Kind] = &oop_oop_iterate_bounded<KlassType, narrowOop>;
|
||||
} else {
|
||||
_function[KlassType::ID] = &oop_oop_iterate_bounded<KlassType, oop>;
|
||||
_function[KlassType::Kind] = &oop_oop_iterate_bounded<KlassType, oop>;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename KlassType>
|
||||
void set_resolve_function_and_execute(OopClosureType* cl, oop obj, Klass* k, MemRegion mr) {
|
||||
set_resolve_function<KlassType>();
|
||||
_function[KlassType::ID](cl, obj, k, mr);
|
||||
_function[KlassType::Kind](cl, obj, k, mr);
|
||||
}
|
||||
|
||||
public:
|
||||
FunctionType _function[KLASS_ID_COUNT];
|
||||
FunctionType _function[KLASS_KIND_COUNT];
|
||||
|
||||
Table(){
|
||||
set_init_function<InstanceKlass>();
|
||||
|
@ -323,7 +323,7 @@ private:
|
|||
public:
|
||||
|
||||
static FunctionType function(Klass* klass) {
|
||||
return _table._function[klass->id()];
|
||||
return _table._function[klass->kind()];
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -350,26 +350,26 @@ private:
|
|||
|
||||
template <typename KlassType>
|
||||
void set_init_function() {
|
||||
_function[KlassType::ID] = &init<KlassType>;
|
||||
_function[KlassType::Kind] = &init<KlassType>;
|
||||
}
|
||||
|
||||
template <typename KlassType>
|
||||
void set_resolve_function() {
|
||||
if (UseCompressedOops) {
|
||||
_function[KlassType::ID] = &oop_oop_iterate_backwards<KlassType, narrowOop>;
|
||||
_function[KlassType::Kind] = &oop_oop_iterate_backwards<KlassType, narrowOop>;
|
||||
} else {
|
||||
_function[KlassType::ID] = &oop_oop_iterate_backwards<KlassType, oop>;
|
||||
_function[KlassType::Kind] = &oop_oop_iterate_backwards<KlassType, oop>;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename KlassType>
|
||||
void set_resolve_function_and_execute(OopClosureType* cl, oop obj, Klass* k) {
|
||||
set_resolve_function<KlassType>();
|
||||
_function[KlassType::ID](cl, obj, k);
|
||||
_function[KlassType::Kind](cl, obj, k);
|
||||
}
|
||||
|
||||
public:
|
||||
FunctionType _function[KLASS_ID_COUNT];
|
||||
FunctionType _function[KLASS_KIND_COUNT];
|
||||
|
||||
Table(){
|
||||
set_init_function<InstanceKlass>();
|
||||
|
@ -385,7 +385,7 @@ private:
|
|||
public:
|
||||
|
||||
static FunctionType function(Klass* klass) {
|
||||
return _table._function[klass->id()];
|
||||
return _table._function[klass->kind()];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue