8304996: Add missing HandleMarks
Reviewed-by: coleenp, shade, iklam
This commit is contained in:
parent
ac898e9051
commit
a7546b3a16
src/hotspot/share
@ -142,6 +142,7 @@ void ClassPrelinker::dumptime_resolve_constants(InstanceKlass* ik, TRAPS) {
|
||||
}
|
||||
|
||||
Klass* ClassPrelinker::find_loaded_class(JavaThread* THREAD, oop class_loader, Symbol* name) {
|
||||
HandleMark hm(THREAD);
|
||||
Handle h_loader(THREAD, class_loader);
|
||||
Klass* k = SystemDictionary::find_instance_or_array_klass(THREAD, name,
|
||||
h_loader,
|
||||
|
@ -380,7 +380,6 @@ void DynamicArchive::check_for_dynamic_dump() {
|
||||
void DynamicArchive::dump_at_exit(JavaThread* current, const char* archive_name) {
|
||||
ExceptionMark em(current);
|
||||
ResourceMark rm(current);
|
||||
HandleMark hm(current);
|
||||
|
||||
if (!DynamicDumpSharedSpaces || archive_name == nullptr) {
|
||||
return;
|
||||
|
@ -213,6 +213,7 @@ void ConstantPool::initialize_resolved_references(ClassLoaderData* loader_data,
|
||||
// Create Java array for holding resolved strings, methodHandles,
|
||||
// methodTypes, invokedynamic and invokehandle appendix objects, etc.
|
||||
objArrayOop stom = oopFactory::new_objArray(vmClasses::Object_klass(), map_length, CHECK);
|
||||
HandleMark hm(THREAD);
|
||||
Handle refs_handle (THREAD, stom); // must handleize.
|
||||
set_resolved_references(loader_data->add_handle(refs_handle));
|
||||
}
|
||||
@ -341,6 +342,7 @@ void ConstantPool::restore_unshareable_info(TRAPS) {
|
||||
_cache->archived_references() != nullptr) {
|
||||
oop archived = _cache->archived_references();
|
||||
// Create handle for the archived resolved reference array object
|
||||
HandleMark hm(THREAD);
|
||||
Handle refs_handle(THREAD, archived);
|
||||
set_resolved_references(loader_data->add_handle(refs_handle));
|
||||
_cache->clear_archived_references();
|
||||
@ -352,6 +354,7 @@ void ConstantPool::restore_unshareable_info(TRAPS) {
|
||||
int map_length = resolved_reference_length();
|
||||
if (map_length > 0) {
|
||||
objArrayOop stom = oopFactory::new_objArray(vmClasses::Object_klass(), map_length, CHECK);
|
||||
HandleMark hm(THREAD);
|
||||
Handle refs_handle(THREAD, stom); // must handleize.
|
||||
set_resolved_references(loader_data->add_handle(refs_handle));
|
||||
}
|
||||
@ -519,6 +522,7 @@ Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
HandleMark hm(THREAD);
|
||||
Handle mirror_handle;
|
||||
Symbol* name = this_cp->symbol_at(name_index);
|
||||
Handle loader (THREAD, this_cp->pool_holder()->class_loader());
|
||||
@ -595,6 +599,7 @@ Klass* ConstantPool::klass_at_if_loaded(const constantPoolHandle& this_cp, int w
|
||||
return nullptr;
|
||||
} else {
|
||||
Thread* current = Thread::current();
|
||||
HandleMark hm(current);
|
||||
Symbol* name = this_cp->symbol_at(name_index);
|
||||
oop loader = this_cp->pool_holder()->class_loader();
|
||||
oop protection_domain = this_cp->pool_holder()->protection_domain();
|
||||
@ -942,7 +947,6 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp,
|
||||
int index, int cache_index,
|
||||
bool* status_return, TRAPS) {
|
||||
oop result_oop = nullptr;
|
||||
Handle throw_exception;
|
||||
|
||||
if (cache_index == _possible_index_sentinel) {
|
||||
// It is possible that this constant is one which is cached in the objects.
|
||||
@ -1110,6 +1114,7 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp,
|
||||
}
|
||||
|
||||
Klass* klass = this_cp->pool_holder();
|
||||
HandleMark hm(THREAD);
|
||||
Handle value = SystemDictionary::link_method_handle_constant(klass, ref_kind,
|
||||
callee, name, signature,
|
||||
THREAD);
|
||||
@ -1129,6 +1134,7 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp,
|
||||
signature->as_C_string());
|
||||
}
|
||||
Klass* klass = this_cp->pool_holder();
|
||||
HandleMark hm(THREAD);
|
||||
Handle value = SystemDictionary::find_method_handle_type(signature, klass, THREAD);
|
||||
result_oop = value();
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
|
@ -572,6 +572,7 @@ void klassVtable::check_constraints(GrowableArray<InstanceKlass*>* supers, TRAPS
|
||||
// Do not check loader constraints for overpass methods because overpass
|
||||
// methods are created by the jvm to throw exceptions.
|
||||
if (!target_method->is_overpass()) {
|
||||
HandleMark hm(THREAD);
|
||||
// Override vtable entry if passes loader constraint check
|
||||
// if loader constraint checking requested
|
||||
// No need to visit his super, since he and his super
|
||||
|
Loading…
x
Reference in New Issue
Block a user