< prev index next >

hotspot/src/share/vm/opto/library_call.cpp

Print this page
rev 6883 : 8057622: java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest: SEGV inside compiled code (sparc)
Summary: In Parse::array_store_check(), add control edge FROM IfTrue branch of runtime type check of the destination array TO loading _element_klass from destination array.
Reviewed-by: kvn, roland, anoll
Contributed-by: Zoltan Majo <zoltan.majo@oracle.com>

*** 3396,3406 **** int null_path, int offset) { if (region == NULL) never_see_null = true; Node* p = basic_plus_adr(mirror, offset); const TypeKlassPtr* kls_type = TypeKlassPtr::OBJECT_OR_NULL; ! Node* kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, kls_type)); Node* null_ctl = top(); kls = null_check_oop(kls, &null_ctl, never_see_null); if (region != NULL) { // Set region->in(null_path) if the mirror is a primitive (e.g, int.class). region->init_req(null_path, null_ctl); --- 3396,3406 ---- int null_path, int offset) { if (region == NULL) never_see_null = true; Node* p = basic_plus_adr(mirror, offset); const TypeKlassPtr* kls_type = TypeKlassPtr::OBJECT_OR_NULL; ! Node* kls = _gvn.transform(LoadKlassNode::make(_gvn, NULL, immutable_memory(), p, TypeRawPtr::BOTTOM, kls_type)); Node* null_ctl = top(); kls = null_check_oop(kls, &null_ctl, never_see_null); if (region != NULL) { // Set region->in(null_path) if the mirror is a primitive (e.g, int.class). region->init_req(null_path, null_ctl);
*** 3572,3582 **** if (generate_array_guard(kls, region) != NULL) // A guard was added. If the guard is taken, it was an array. phi->add_req(makecon(TypeInstPtr::make(env()->Object_klass()->java_mirror()))); // If we fall through, it's a plain class. Get its _super. p = basic_plus_adr(kls, in_bytes(Klass::super_offset())); ! kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL)); null_ctl = top(); kls = null_check_oop(kls, &null_ctl); if (null_ctl != top()) { // If the guard is taken, Object.superClass is null (both klass and mirror). region->add_req(null_ctl); --- 3572,3582 ---- if (generate_array_guard(kls, region) != NULL) // A guard was added. If the guard is taken, it was an array. phi->add_req(makecon(TypeInstPtr::make(env()->Object_klass()->java_mirror()))); // If we fall through, it's a plain class. Get its _super. p = basic_plus_adr(kls, in_bytes(Klass::super_offset())); ! kls = _gvn.transform(LoadKlassNode::make(_gvn, NULL, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL)); null_ctl = top(); kls = null_check_oop(kls, &null_ctl); if (null_ctl != top()) { // If the guard is taken, Object.superClass is null (both klass and mirror). region->add_req(null_ctl);
*** 3654,3664 **** arg = null_check(arg); if (stopped()) break; args[which_arg] = arg; Node* p = basic_plus_adr(arg, class_klass_offset); ! Node* kls = LoadKlassNode::make(_gvn, immutable_memory(), p, adr_type, kls_type); klasses[which_arg] = _gvn.transform(kls); } // Having loaded both klasses, test each for null. bool never_see_null = !too_many_traps(Deoptimization::Reason_null_check); --- 3654,3664 ---- arg = null_check(arg); if (stopped()) break; args[which_arg] = arg; Node* p = basic_plus_adr(arg, class_klass_offset); ! Node* kls = LoadKlassNode::make(_gvn, NULL, immutable_memory(), p, adr_type, kls_type); klasses[which_arg] = _gvn.transform(kls); } // Having loaded both klasses, test each for null. bool never_see_null = !too_many_traps(Deoptimization::Reason_null_check);
*** 5170,5180 **** PreserveJVMState pjvms(this); set_control(not_subtype_ctrl); // (At this point we can assume disjoint_bases, since types differ.) int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset()); Node* p1 = basic_plus_adr(dest_klass, ek_offset); ! Node* n1 = LoadKlassNode::make(_gvn, immutable_memory(), p1, TypeRawPtr::BOTTOM); Node* dest_elem_klass = _gvn.transform(n1); Node* cv = generate_checkcast_arraycopy(adr_type, dest_elem_klass, src, src_offset, dest, dest_offset, ConvI2X(copy_length), dest_uninitialized); --- 5170,5180 ---- PreserveJVMState pjvms(this); set_control(not_subtype_ctrl); // (At this point we can assume disjoint_bases, since types differ.) int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset()); Node* p1 = basic_plus_adr(dest_klass, ek_offset); ! Node* n1 = LoadKlassNode::make(_gvn, NULL, immutable_memory(), p1, TypeRawPtr::BOTTOM); Node* dest_elem_klass = _gvn.transform(n1); Node* cv = generate_checkcast_arraycopy(adr_type, dest_elem_klass, src, src_offset, dest, dest_offset, ConvI2X(copy_length), dest_uninitialized);
< prev index next >