From f9b4ea13e693da268c9aee27dee49f9c7f798bb1 Mon Sep 17 00:00:00 2001 From: Xiaolong Peng Date: Wed, 3 Jul 2024 02:56:17 +0000 Subject: [PATCH] 8334220: Optimize Klass layout after JDK-8180450 Reviewed-by: coleenp, stuefe, dholmes --- src/hotspot/share/oops/klass.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/oops/klass.hpp b/src/hotspot/share/oops/klass.hpp index 2923235e2f3..6ec6ac889be 100644 --- a/src/hotspot/share/oops/klass.hpp +++ b/src/hotspot/share/oops/klass.hpp @@ -159,11 +159,6 @@ class Klass : public Metadata { // Provide access the corresponding instance java.lang.ClassLoader. ClassLoaderData* _class_loader_data; - // Bitmap and hash code used by hashed secondary supers. - uintx _bitmap; - uint8_t _hash_slot; - - static uint8_t compute_hash_slot(Symbol* s); int _vtable_len; // vtable length. This field may be read very often when we // have lots of itable dispatches (e.g., lambdas and streams). @@ -173,6 +168,10 @@ class Klass : public Metadata { JFR_ONLY(DEFINE_TRACE_ID_FIELD;) + // Bitmap and hash code used by hashed secondary supers. + uintx _bitmap; + uint8_t _hash_slot; + private: // This is an index into FileMapHeader::_shared_path_table[], to // associate this class with the JAR file where it's loaded from during @@ -392,6 +391,7 @@ protected: void set_next_sibling(Klass* s); private: + static uint8_t compute_hash_slot(Symbol* s); static void hash_insert(Klass* klass, GrowableArray* secondaries, uintx& bitmap); static uintx hash_secondary_supers(Array* secondaries, bool rewrite);