changeset 4629:3a41a31ecbd7

Merge
author vladidan
date Tue, 09 Jul 2013 14:10:33 -0400
parents 7bfdc3edfe1a dd7d57bcd749
children f4d7fb7ba02e
files
diffstat 6 files changed, 43 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Jul 05 10:18:53 2013 -0400
+++ b/.hgtags	Tue Jul 09 14:10:33 2013 -0400
@@ -511,3 +511,5 @@
 41118cf72ace4f0cee56a9ff437226e98e46e9d7 hs24-b50
 645b68762a367d82c2b55f76cae431b767bee3ac jdk7u40-b31
 2417fa1acf2ba8521f480f2baef9af279ec2bf15 hs24-b51
+9658c969b7cf0de256691a80f44dcfe73d72a02f jdk7u40-b32
+15706a73a506943059a6bbf59e2ec8866a026114 hs24-b52
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Fri Jul 05 10:18:53 2013 -0400
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Tue Jul 09 14:10:33 2013 -0400
@@ -89,6 +89,7 @@
     genericSignature     = type.getAddressField("_generic_signature");
     majorVersion         = new CIntField(type.getCIntegerField("_major_version"), Oop.getHeaderSize());
     minorVersion         = new CIntField(type.getCIntegerField("_minor_version"), Oop.getHeaderSize());
+    miscFlags            = new CIntField(type.getCIntegerField("_misc_flags"), Oop.getHeaderSize());
     headerSize           = alignObjectOffset(Oop.getHeaderSize() + type.getSize());
 
     // read field offset constants
@@ -147,6 +148,16 @@
   private static AddressField  genericSignature;
   private static CIntField majorVersion;
   private static CIntField minorVersion;
+  private static CIntField miscFlags;
+
+  private static final long MISC_REWRITTEN            = 1 << 0; // methods rewritten.
+  private static final long MISC_HAS_NONSTATIC_FIELDS = 1 << 1; // for sizing with UseCompressedOops
+  private static final long MISC_SHOULD_VERIFY_CLASS  = 1 << 1; // allow caching of preverification
+  private static final long MISC_IS_ANONYMOUS         = 1 << 3; // has embedded _inner_classes field
+
+  public boolean isAnonymous() {
+    return (miscFlags.getValue(this) & MISC_IS_ANONYMOUS) != 0;
+  }
 
   // type safe enum for ClassState from instanceKlass.hpp
   public static class ClassState {
@@ -799,9 +810,22 @@
 
 
   public long getObjectSize() {
-    long bodySize =    alignObjectOffset(getVtableLen() * getHeap().getOopSize())
-                     + alignObjectOffset(getItableLen() * getHeap().getOopSize())
-                     + (getNonstaticOopMapSize()) * getHeap().getOopSize();
+    final long oopSize = getHeap().getOopSize();
+
+    long vtableSize = alignObjectOffset(getVtableLen() * oopSize);
+    long itableSize = alignObjectOffset(getItableLen() * oopSize);
+
+    long nonStaticOopMapSizeBytes = getNonstaticOopMapSize() * oopSize;
+    long alignedNonStaticOopMapSize = isInterface() || isAnonymous() ?
+                                        alignObjectOffset(nonStaticOopMapSizeBytes) :
+                                        nonStaticOopMapSizeBytes;
+
+    long interfaceImplementorSize = isInterface() ? oopSize : 0;
+    long hostKlassSize = isAnonymous() ? oopSize : 0;
+
+    long bodySize = vtableSize + itableSize + nonStaticOopMapSizeBytes +
+                    interfaceImplementorSize + hostKlassSize;
+
     return alignObjectSize(headerSize + bodySize);
   }
 
--- a/make/hotspot_version	Fri Jul 05 10:18:53 2013 -0400
+++ b/make/hotspot_version	Tue Jul 09 14:10:33 2013 -0400
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=24
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=52
+HS_BUILD_NUMBER=53
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Fri Jul 05 10:18:53 2013 -0400
+++ b/src/share/vm/gc_implementation/g1/g1CardCounts.cpp	Tue Jul 09 14:10:33 2013 -0400
@@ -152,12 +152,9 @@
     if (card_num < _committed_max_card_num) {
       count = (uint) _card_counts[card_num];
       if (count < G1ConcRSHotCardLimit) {
-        _card_counts[card_num] += 1;
+        _card_counts[card_num] =
+          (jubyte)(MIN2((uintx)(_card_counts[card_num] + 1), G1ConcRSHotCardLimit));
       }
-      assert(_card_counts[card_num] <= G1ConcRSHotCardLimit,
-             err_msg("Refinement count overflow? "
-                     "new count: "UINT32_FORMAT,
-                     (uint) _card_counts[card_num]));
     }
   }
   return count;
--- a/src/share/vm/oops/instanceKlass.hpp	Fri Jul 05 10:18:53 2013 -0400
+++ b/src/share/vm/oops/instanceKlass.hpp	Tue Jul 09 14:10:33 2013 -0400
@@ -779,13 +779,16 @@
 
   int object_size() const
   {
-    return object_size(align_object_offset(vtable_length()) +
-                       align_object_offset(itable_length()) +
-                       ((is_interface() || is_anonymous()) ?
-                         align_object_offset(nonstatic_oop_map_size()) :
-                         nonstatic_oop_map_size()) +
-                       (is_interface() ? (int)sizeof(klassOop)/HeapWordSize : 0) +
-                       (is_anonymous() ? (int)sizeof(klassOop)/HeapWordSize : 0));
+    int vtable_size = align_object_offset(vtable_length());
+    int itable_size = align_object_offset(itable_length());
+    int aligned_nonstatic_oop_map_size = is_interface() || is_anonymous() ?
+                                        align_object_offset(nonstatic_oop_map_size()) :
+                                        nonstatic_oop_map_size();
+    int interface_implementor_size = is_interface() ? (int) sizeof(klassOop) / HeapWordSize : 0;
+    int host_klass_size = is_anonymous() ? (int) sizeof(klassOop) / HeapWordSize : 0;
+
+    return object_size(vtable_size + itable_size + aligned_nonstatic_oop_map_size +
+                       interface_implementor_size + host_klass_size);
   }
   static int vtable_start_offset()    { return header_size(); }
   static int vtable_length_offset()   { return oopDesc::header_size() + offset_of(instanceKlass, _vtable_len) / HeapWordSize; }
--- a/src/share/vm/runtime/vmStructs.cpp	Fri Jul 05 10:18:53 2013 -0400
+++ b/src/share/vm/runtime/vmStructs.cpp	Tue Jul 09 14:10:33 2013 -0400
@@ -316,6 +316,7 @@
   nonstatic_field(instanceKlass,               _static_oop_field_count,                       u2)                                   \
   nonstatic_field(instanceKlass,               _nonstatic_oop_map_size,                       int)                                   \
   nonstatic_field(instanceKlass,               _is_marked_dependent,                          bool)                                  \
+  nonstatic_field(instanceKlass,               _misc_flags,                                   u2)                                    \
   nonstatic_field(instanceKlass,               _minor_version,                                u2)                                    \
   nonstatic_field(instanceKlass,               _major_version,                                u2)                                    \
   nonstatic_field(instanceKlass,               _init_state,                                   u1)                                    \