src/share/vm/opto/compile.cpp

changeset 3389
669f6a7d5b70
parent 3311
1bd45abaa507
child 3391
069ab3f976d3
     1.1 --- a/src/share/vm/opto/compile.cpp	Wed Dec 14 14:54:38 2011 -0800
     1.2 +++ b/src/share/vm/opto/compile.cpp	Mon Dec 19 14:16:23 2011 -0800
     1.3 @@ -1282,12 +1282,11 @@
     1.4    if( tk ) {
     1.5      // If we are referencing a field within a Klass, we need
     1.6      // to assume the worst case of an Object.  Both exact and
     1.7 -    // inexact types must flatten to the same alias class.
     1.8 -    // Since the flattened result for a klass is defined to be
     1.9 -    // precisely java.lang.Object, use a constant ptr.
    1.10 +    // inexact types must flatten to the same alias class so
    1.11 +    // use NotNull as the PTR.
    1.12      if ( offset == Type::OffsetBot || (offset >= 0 && (size_t)offset < sizeof(Klass)) ) {
    1.13  
    1.14 -      tj = tk = TypeKlassPtr::make(TypePtr::Constant,
    1.15 +      tj = tk = TypeKlassPtr::make(TypePtr::NotNull,
    1.16                                     TypeKlassPtr::OBJECT->klass(),
    1.17                                     offset);
    1.18      }
    1.19 @@ -1307,10 +1306,12 @@
    1.20      // these 2 disparate memories into the same alias class.  Since the
    1.21      // primary supertype array is read-only, there's no chance of confusion
    1.22      // where we bypass an array load and an array store.
    1.23 -    uint off2 = offset - Klass::primary_supers_offset_in_bytes();
    1.24 -    if( offset == Type::OffsetBot ||
    1.25 -        off2 < Klass::primary_super_limit()*wordSize ) {
    1.26 -      offset = sizeof(oopDesc) +Klass::secondary_super_cache_offset_in_bytes();
    1.27 +    int primary_supers_offset = sizeof(klassOopDesc) + Klass::primary_supers_offset_in_bytes();
    1.28 +    if (offset == Type::OffsetBot ||
    1.29 +        (offset >= primary_supers_offset &&
    1.30 +         offset < (int)(primary_supers_offset + Klass::primary_super_limit() * wordSize)) ||
    1.31 +        offset == (int)(sizeof(klassOopDesc) + Klass::secondary_super_cache_offset_in_bytes())) {
    1.32 +      offset = sizeof(klassOopDesc) + Klass::secondary_super_cache_offset_in_bytes();
    1.33        tj = tk = TypeKlassPtr::make( TypePtr::NotNull, tk->klass(), offset );
    1.34      }
    1.35    }

mercurial