< prev index next >

src/hotspot/share/oops/methodData.hpp

Print this page

        

@@ -557,11 +557,17 @@
     return static_cell_count();
   }
 
   // Direct accessor
   uint count() const {
-    return uint_at(count_off);
+    intptr_t raw_data = intptr_at(count_off);
+    if (raw_data > max_jint) {
+      raw_data = max_jint;
+    } else if (raw_data < min_jint) {
+      raw_data = min_jint;
+    }
+    return uint(raw_data);
   }
 
   // Code generation support
   static ByteSize count_offset() {
     return cell_offset(count_off);
< prev index next >