src/share/vm/opto/runtime.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/runtime.cpp Thu Mar 10 16:05:12 2016
--- new/src/share/vm/opto/runtime.cpp Thu Mar 10 16:05:12 2016
*** 218,243 ****
--- 218,238 ----
#endif
assert(check_compiled_frame(thread), "incorrect caller");
// These checks are cheap to make and support reflective allocation.
int lh = klass->layout_helper();
! if (Klass::layout_helper_needs_slow_path(lh) || !InstanceKlass::cast(klass)->is_initialized()) {
|| !InstanceKlass::cast(klass)->is_initialized()) {
! KlassHandle kh(THREAD, klass);
kh->check_valid_for_instantiation(false, THREAD);
+ Handle holder(THREAD, klass->klass_holder()); // keep the klass alive
! klass->check_valid_for_instantiation(false, THREAD);
if (!HAS_PENDING_EXCEPTION) {
! InstanceKlass::cast(kh())->initialize(THREAD);
}
if (!HAS_PENDING_EXCEPTION) {
klass = kh();
} else {
klass = NULL;
! InstanceKlass::cast(klass)->initialize(THREAD);
}
}
! if (klass != NULL) {
! if (!HAS_PENDING_EXCEPTION) {
// Scavenge and allocate an instance.
+ Handle holder(THREAD, klass->klass_holder()); // keep the klass alive
oop result = InstanceKlass::cast(klass)->allocate_instance(THREAD);
thread->set_vm_result(result);
// Pass oops back through thread local storage. Our apparent type to Java
// is that we return an oop, but we can block on exit from this routine and
*** 273,282 ****
--- 268,278 ----
result = oopFactory::new_typeArray(elem_type, len, THREAD);
} else {
// Although the oopFactory likes to work with the elem_type,
// the compiler prefers the array_type, since it must already have
// that latter value in hand for the fast path.
+ Handle holder(THREAD, array_type->klass_holder()); // keep the array klass alive
Klass* elem_type = ObjArrayKlass::cast(array_type)->element_klass();
result = oopFactory::new_objArray(elem_type, len, THREAD);
}
// Pass oops back through thread local storage. Our apparent type to Java
*** 351,360 ****
--- 347,357 ----
assert(check_compiled_frame(thread), "incorrect caller");
assert(elem_type->is_klass(), "not a class");
jint dims[2];
dims[0] = len1;
dims[1] = len2;
+ Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
oop obj = ArrayKlass::cast(elem_type)->multi_allocate(2, dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
*** 367,376 ****
--- 364,374 ----
assert(elem_type->is_klass(), "not a class");
jint dims[3];
dims[0] = len1;
dims[1] = len2;
dims[2] = len3;
+ Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
oop obj = ArrayKlass::cast(elem_type)->multi_allocate(3, dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
*** 384,393 ****
--- 382,392 ----
jint dims[4];
dims[0] = len1;
dims[1] = len2;
dims[2] = len3;
dims[3] = len4;
+ Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
oop obj = ArrayKlass::cast(elem_type)->multi_allocate(4, dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
*** 402,411 ****
--- 401,411 ----
dims[0] = len1;
dims[1] = len2;
dims[2] = len3;
dims[3] = len4;
dims[4] = len5;
+ Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
oop obj = ArrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
*** 419,428 ****
--- 419,429 ----
assert(len > 0, "Dimensions array should contain data");
jint *j_dims = typeArrayOop(dims)->int_at_addr(0);
jint *c_dims = NEW_RESOURCE_ARRAY(jint, len);
Copy::conjoint_jints_atomic(j_dims, c_dims, len);
+ Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
src/share/vm/opto/runtime.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File