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>

Split Split Close
Expand all
Collapse all
          --- old/hotspot/src/share/vm/opto/graphKit.cpp
          +++ new/hotspot/src/share/vm/opto/graphKit.cpp
↓ open down ↓ 1142 lines elided ↑ open up ↑
1143 1143    }
1144 1144    return _gvn.transform( new (C) ConvL2INode(offset));
1145 1145  }
1146 1146  
1147 1147  //-------------------------load_object_klass-----------------------------------
1148 1148  Node* GraphKit::load_object_klass(Node* obj) {
1149 1149    // Special-case a fresh allocation to avoid building nodes:
1150 1150    Node* akls = AllocateNode::Ideal_klass(obj, &_gvn);
1151 1151    if (akls != NULL)  return akls;
1152 1152    Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
1153      -  return _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), k_adr, TypeInstPtr::KLASS) );
     1153 +  return _gvn.transform(LoadKlassNode::make(_gvn, NULL, immutable_memory(), k_adr, TypeInstPtr::KLASS));
1154 1154  }
1155 1155  
1156 1156  //-------------------------load_array_length-----------------------------------
1157 1157  Node* GraphKit::load_array_length(Node* array) {
1158 1158    // Special-case a fresh allocation to avoid building nodes:
1159 1159    AllocateArrayNode* alloc = AllocateArrayNode::Ideal_array_allocation(array, &_gvn);
1160 1160    Node *alen;
1161 1161    if (alloc == NULL) {
1162 1162      Node *r_adr = basic_plus_adr(array, arrayOopDesc::length_offset_in_bytes());
1163 1163      alen = _gvn.transform( new (C) LoadRangeNode(0, immutable_memory(), r_adr, TypeInt::POS));
↓ open down ↓ 1371 lines elided ↑ open up ↑
2535 2535    // if the super-klass is an interface or exceptionally deep in the Java
2536 2536    // hierarchy and we have to scan the secondary superclass list the hard way.
2537 2537    // Worst-case type is a little odd: NULL is allowed as a result (usually
2538 2538    // klass loads can never produce a NULL).
2539 2539    Node *chk_off_X = ConvI2X(chk_off);
2540 2540    Node *p2 = _gvn.transform( new (C) AddPNode(subklass,subklass,chk_off_X) );
2541 2541    // For some types like interfaces the following loadKlass is from a 1-word
2542 2542    // cache which is mutable so can't use immutable memory.  Other
2543 2543    // types load from the super-class display table which is immutable.
2544 2544    Node *kmem = might_be_cache ? memory(p2) : immutable_memory();
2545      -  Node *nkls = _gvn.transform( LoadKlassNode::make( _gvn, kmem, p2, _gvn.type(p2)->is_ptr(), TypeKlassPtr::OBJECT_OR_NULL ) );
     2545 +  Node* nkls = _gvn.transform(LoadKlassNode::make(_gvn, NULL, kmem, p2, _gvn.type(p2)->is_ptr(), TypeKlassPtr::OBJECT_OR_NULL));
2546 2546  
2547 2547    // Compile speed common case: ARE a subtype and we canNOT fail
2548 2548    if( superklass == nkls )
2549 2549      return top();             // false path is dead; no test needed.
2550 2550  
2551 2551    // See if we get an immediate positive hit.  Happens roughly 83% of the
2552 2552    // time.  Test to see if the value loaded just previously from the subklass
2553 2553    // is exactly the superklass.
2554 2554    Node *cmp1 = _gvn.transform( new (C) CmpPNode( superklass, nkls ) );
2555 2555    Node *bol1 = _gvn.transform( new (C) BoolNode( cmp1, BoolTest::eq ) );
↓ open down ↓ 1584 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX