mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8244550: Unsafe::allocateInstance does redundant transitions
Reviewed-by: coleenp, mchung, dholmes
This commit is contained in:
parent
62bf2d07e7
commit
c2780c9556
16 changed files with 40 additions and 31 deletions
|
@ -157,4 +157,16 @@ ALWAYSINLINE void InstanceKlass::oop_oop_iterate_bounded(oop obj, OopClosureType
|
|||
oop_oop_iterate_oop_maps_bounded<T>(obj, closure, mr);
|
||||
}
|
||||
|
||||
inline instanceOop InstanceKlass::allocate_instance(oop java_class, TRAPS) {
|
||||
Klass* k = java_lang_Class::as_Klass(java_class);
|
||||
if (k == NULL) {
|
||||
ResourceMark rm(THREAD);
|
||||
THROW_(vmSymbols::java_lang_InstantiationException(), NULL);
|
||||
}
|
||||
InstanceKlass* ik = cast(k);
|
||||
ik->check_valid_for_instantiation(false, CHECK_NULL);
|
||||
ik->initialize(CHECK_NULL);
|
||||
return ik->allocate_instance(THREAD);
|
||||
}
|
||||
|
||||
#endif // SHARE_OOPS_INSTANCEKLASS_INLINE_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue