7159772: instanceKlass::all_fields_count() returns incorrect total field count
authorjiangli
Tue, 10 Apr 2012 09:31:04 -0700
changeset 12589 d31372c06aad
parent 12365 ec2b9f11794a
child 12590 ab8c85fc52ea
7159772: instanceKlass::all_fields_count() returns incorrect total field count Summary: Fix instanceKlass::all_fields_count() bug. Reviewed-by: kvn, never Contributed-by: Jiangli Zhou <jiangli.zhou@oracle.com>
hotspot/src/share/vm/oops/instanceKlass.hpp
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Sat Apr 07 09:06:55 2012 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Tue Apr 10 09:31:04 2012 -0700
@@ -337,7 +337,7 @@
   int java_fields_count() const           { return (int)_java_fields_count; }
 
   // Number of fields including any injected fields
-  int all_fields_count() const            { return _fields->length() / sizeof(FieldInfo::field_slots); }
+  int all_fields_count() const            { return _fields->length() / FieldInfo::field_slots; }
 
   typeArrayOop fields() const              { return _fields; }