diff src/share/vm/oops/cpCache.hpp @ 13395:f19b6d14a035

8170812: Metaspace corruption caused by incorrect memory size for MethodCounters Reviewed-by: kbarrett, coleenp
author aph
date Fri, 07 Apr 2017 13:42:00 +0100
parents 65b3642849e7
children 0cdc61e61d57
line wrap: on
line diff
--- a/src/share/vm/oops/cpCache.hpp	Fri Apr 07 10:51:28 2017 +0000
+++ b/src/share/vm/oops/cpCache.hpp	Fri Apr 07 13:42:00 2017 +0100
@@ -359,7 +359,9 @@
                                                    return (TosState)((_flags >> tos_state_shift) & tos_state_mask); }
 
   // Code generation support
-  static WordSize size()                         { return in_WordSize(sizeof(ConstantPoolCacheEntry) / wordSize); }
+  static WordSize size()                         {
+    return in_WordSize(align_size_up(sizeof(ConstantPoolCacheEntry), wordSize) / wordSize);
+  }
   static ByteSize size_in_bytes()                { return in_ByteSize(sizeof(ConstantPoolCacheEntry)); }
   static ByteSize indices_offset()               { return byte_offset_of(ConstantPoolCacheEntry, _indices); }
   static ByteSize f1_offset()                    { return byte_offset_of(ConstantPoolCacheEntry, _f1); }