JDK-7121073 : secondary_super_cache memory slice has incorrect bounds in flatten_alias_type
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs23
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: x86
  • Submitted: 2011-12-13
  • Updated: 2012-03-29
  • Resolved: 2012-03-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u4Fixed 8Fixed hs23Fixed
Description
The logic for smearing the type checking slice into a single slice has incorrect bounds because of partial removal of sizeof(klassOopDesc)

    uint off2 = offset - Klass::primary_supers_offset_in_bytes();
    if( offset == Type::OffsetBot ||
        off2 < Klass::primary_super_limit()*wordSize ) {
      offset = sizeof(oopDesc) +Klass::secondary_super_cache_offset_in_bytes();
      tj = tk = TypeKlassPtr::make( TypePtr::NotNull, tk->klass(), offset );
    }
  }

off2 should also be subtracting sizeof(klassOopDesc)

Comments
EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/669f6a7d5b70
22-03-2012

EVALUATION Verified in PIT HS23b10 for JDK8: not verified: doesn't need special testing
17-01-2012

EVALUATION Verified in PIT HS23b10 for JDK7u4: not verified: doesn't need special testing
17-01-2012

EVALUATION 7121073: secondary_super_cache memory slice has incorrect bounds in flatten_alias_type Reviewed-by: kvn To ensure that memory operations for type checks are properly ordered, several fields are smeared together into the same alias slice. The existing logic is sloppy and includes a slightly larger chunk of memory than intended. Currently this is fine but changes to the shape of Klass can invalidate it. The fix is to properly test the boundaries. Additionally I changed the logic for setting the PTR to use NotNull instead of Constant to be consisten with all the following logic which uses NotNull. Tested with full CTW.
10-01-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/669f6a7d5b70
20-12-2011