@@ -213,6 +213,7 @@ void ConstantPool::initialize_resolved_references(ClassLoaderData* loader_data,
213
213
// Create Java array for holding resolved strings, methodHandles,
214
214
// methodTypes, invokedynamic and invokehandle appendix objects, etc.
215
215
objArrayOop stom = oopFactory::new_objArray (vmClasses::Object_klass (), map_length, CHECK);
216
+ HandleMark hm (THREAD);
216
217
Handle refs_handle (THREAD, stom); // must handleize.
217
218
set_resolved_references (loader_data->add_handle (refs_handle));
218
219
}
@@ -341,6 +342,7 @@ void ConstantPool::restore_unshareable_info(TRAPS) {
341
342
_cache->archived_references () != nullptr ) {
342
343
oop archived = _cache->archived_references ();
343
344
// Create handle for the archived resolved reference array object
345
+ HandleMark hm (THREAD);
344
346
Handle refs_handle (THREAD, archived);
345
347
set_resolved_references (loader_data->add_handle (refs_handle));
346
348
_cache->clear_archived_references ();
@@ -352,6 +354,7 @@ void ConstantPool::restore_unshareable_info(TRAPS) {
352
354
int map_length = resolved_reference_length ();
353
355
if (map_length > 0 ) {
354
356
objArrayOop stom = oopFactory::new_objArray (vmClasses::Object_klass (), map_length, CHECK);
357
+ HandleMark hm (THREAD);
355
358
Handle refs_handle (THREAD, stom); // must handleize.
356
359
set_resolved_references (loader_data->add_handle (refs_handle));
357
360
}
@@ -519,6 +522,7 @@ Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
519
522
ShouldNotReachHere ();
520
523
}
521
524
525
+ HandleMark hm (THREAD);
522
526
Handle mirror_handle;
523
527
Symbol* name = this_cp->symbol_at (name_index);
524
528
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
595
599
return nullptr ;
596
600
} else {
597
601
Thread* current = Thread::current ();
602
+ HandleMark hm (current);
598
603
Symbol* name = this_cp->symbol_at (name_index);
599
604
oop loader = this_cp->pool_holder ()->class_loader ();
600
605
oop protection_domain = this_cp->pool_holder ()->protection_domain ();
@@ -942,7 +947,6 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp,
942
947
int index, int cache_index,
943
948
bool * status_return, TRAPS) {
944
949
oop result_oop = nullptr ;
945
- Handle throw_exception;
946
950
947
951
if (cache_index == _possible_index_sentinel) {
948
952
// 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,
1110
1114
}
1111
1115
1112
1116
Klass* klass = this_cp->pool_holder ();
1117
+ HandleMark hm (THREAD);
1113
1118
Handle value = SystemDictionary::link_method_handle_constant (klass, ref_kind,
1114
1119
callee, name, signature,
1115
1120
THREAD);
@@ -1129,6 +1134,7 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp,
1129
1134
signature->as_C_string ());
1130
1135
}
1131
1136
Klass* klass = this_cp->pool_holder ();
1137
+ HandleMark hm (THREAD);
1132
1138
Handle value = SystemDictionary::find_method_handle_type (signature, klass, THREAD);
1133
1139
result_oop = value ();
1134
1140
if (HAS_PENDING_EXCEPTION) {
0 commit comments