src/share/vm/opto/graphKit.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/opto/graphKit.cpp
src/share/vm/opto/graphKit.cpp
Print this page
rev 7691 : 6912521: System.arraycopy works slower than the simple loop for little lengths
Summary: convert small array copies to series of loads and stores
Reviewed-by:
*** 1661,1686 ****
return basic_plus_adr(ary, offset);
}
// must be correct type for alignment purposes
Node* base = basic_plus_adr(ary, header);
! #ifdef _LP64
! // The scaled index operand to AddP must be a clean 64-bit value.
! // Java allows a 32-bit int to be incremented to a negative
! // value, which appears in a 64-bit register as a large
! // positive number. Using that large positive number as an
! // operand in pointer arithmetic has bad consequences.
! // On the other hand, 32-bit overflow is rare, and the possibility
! // can often be excluded, if we annotate the ConvI2L node with
! // a type assertion that its value is known to be a small positive
! // number. (The prior range check has ensured this.)
! // This assertion is used by ConvI2LNode::Ideal.
! int index_max = max_jint - 1; // array size is max_jint, index is one less
! if (sizetype != NULL) index_max = sizetype->_hi - 1;
! const TypeLong* lidxtype = TypeLong::make(CONST64(0), index_max, Type::WidenMax);
! idx = _gvn.transform( new ConvI2LNode(idx, lidxtype) );
! #endif
Node* scale = _gvn.transform( new LShiftXNode(idx, intcon(shift)) );
return basic_plus_adr(ary, base, scale);
}
//-------------------------load_array_element-------------------------
--- 1661,1671 ----
return basic_plus_adr(ary, offset);
}
// must be correct type for alignment purposes
Node* base = basic_plus_adr(ary, header);
! idx = Compile::conv_I2X_index(&_gvn, idx, sizetype);
Node* scale = _gvn.transform( new LShiftXNode(idx, intcon(shift)) );
return basic_plus_adr(ary, base, scale);
}
//-------------------------load_array_element-------------------------
src/share/vm/opto/graphKit.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File