src/hotspot/share/opto/memnode.cpp
changeset 52441 6082c529aed8
parent 52429 b64514ff68fd
child 52873 6e7db888f04c
equal deleted inserted replaced
52440:f6583d7cff56 52441:6082c529aed8
  1695     // Different array types begin at slightly different offsets (12 vs. 16).
  1695     // Different array types begin at slightly different offsets (12 vs. 16).
  1696     // We choose T_BYTE as an example base type that is least restrictive
  1696     // We choose T_BYTE as an example base type that is least restrictive
  1697     // as to alignment, which will therefore produce the smallest
  1697     // as to alignment, which will therefore produce the smallest
  1698     // possible base offset.
  1698     // possible base offset.
  1699     const int min_base_off = arrayOopDesc::base_offset_in_bytes(T_BYTE);
  1699     const int min_base_off = arrayOopDesc::base_offset_in_bytes(T_BYTE);
  1700     const bool off_beyond_header = ((uint)off >= (uint)min_base_off);
  1700     const bool off_beyond_header = (off >= min_base_off);
  1701 
  1701 
  1702     // Try to constant-fold a stable array element.
  1702     // Try to constant-fold a stable array element.
  1703     if (FoldStableValues && !is_mismatched_access() && ary->is_stable()) {
  1703     if (FoldStableValues && !is_mismatched_access() && ary->is_stable()) {
  1704       // Make sure the reference is not into the header and the offset is constant
  1704       // Make sure the reference is not into the header and the offset is constant
  1705       ciObject* aobj = ary->const_oop();
  1705       ciObject* aobj = ary->const_oop();
  1732     if ((t->isa_int() == NULL) && (t->isa_long() == NULL)
  1732     if ((t->isa_int() == NULL) && (t->isa_long() == NULL)
  1733         && (_type->isa_vect() == NULL)
  1733         && (_type->isa_vect() == NULL)
  1734         && Opcode() != Op_LoadKlass && Opcode() != Op_LoadNKlass) {
  1734         && Opcode() != Op_LoadKlass && Opcode() != Op_LoadNKlass) {
  1735       // t might actually be lower than _type, if _type is a unique
  1735       // t might actually be lower than _type, if _type is a unique
  1736       // concrete subclass of abstract class t.
  1736       // concrete subclass of abstract class t.
  1737       if (off_beyond_header) {  // is the offset beyond the header?
  1737       if (off_beyond_header || off == Type::OffsetBot) {  // is the offset beyond the header?
  1738         const Type* jt = t->join_speculative(_type);
  1738         const Type* jt = t->join_speculative(_type);
  1739         // In any case, do not allow the join, per se, to empty out the type.
  1739         // In any case, do not allow the join, per se, to empty out the type.
  1740         if (jt->empty() && !t->empty()) {
  1740         if (jt->empty() && !t->empty()) {
  1741           // This can happen if a interface-typed array narrows to a class type.
  1741           // This can happen if a interface-typed array narrows to a class type.
  1742           jt = _type;
  1742           jt = _type;