src/share/vm/c1/c1_Runtime1.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/c1/c1_Runtime1.cpp
src/share/vm/c1/c1_Runtime1.cpp
Print this page
*** 333,342 ****
--- 333,343 ----
JRT_ENTRY(void, Runtime1::new_instance(JavaThread* thread, Klass* klass))
NOT_PRODUCT(_new_instance_slowcase_cnt++;)
assert(klass->is_klass(), "not a class");
+ Handle holder(THREAD, klass->klass_holder()); // keep the klass alive
instanceKlassHandle h(thread, klass);
h->check_valid_for_instantiation(true, CHECK);
// make sure klass is initialized
h->initialize(CHECK);
// allocate instance and return via TLS
*** 368,377 ****
--- 369,379 ----
// Note: no handle for klass needed since they are not used
// anymore after new_objArray() and no GC can happen before.
// (This may have to change if this code changes!)
assert(array_klass->is_klass(), "not a class");
+ Handle holder(THREAD, array_klass->klass_holder()); // keep the klass alive
Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass();
objArrayOop obj = oopFactory::new_objArray(elem_klass, length, CHECK);
thread->set_vm_result(obj);
// This is pretty rare but this runtime patch is stressful to deoptimization
// if we deoptimize here so force a deopt to stress the path.
*** 384,393 ****
--- 386,396 ----
JRT_ENTRY(void, Runtime1::new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims))
NOT_PRODUCT(_new_multi_array_slowcase_cnt++;)
assert(klass->is_klass(), "not a class");
assert(rank >= 1, "rank must be nonzero");
+ Handle holder(THREAD, klass->klass_holder()); // keep the klass alive
oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK);
thread->set_vm_result(obj);
JRT_END
src/share/vm/c1/c1_Runtime1.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File