Skip to content

Commit 4ba980b

Browse files
committed
8278020: ~13% variation in Renaissance-Scrabble
Reviewed-by: dholmes, stuefe, kvn
1 parent 04dbdd3 commit 4ba980b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/hotspot/share/oops/klass.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ class Klass : public Metadata {
117117
// Klass identifier used to implement devirtualized oop closure dispatching.
118118
const KlassID _id;
119119

120-
// vtable length
121-
int _vtable_len;
120+
// Processed access flags, for use by Class.getModifiers.
121+
jint _modifier_flags;
122122

123123
// The fields _super_check_offset, _secondary_super_cache, _secondary_supers
124124
// and _primary_supers all help make fast subtype checks. See big discussion
@@ -154,7 +154,10 @@ class Klass : public Metadata {
154154
// Provide access the corresponding instance java.lang.ClassLoader.
155155
ClassLoaderData* _class_loader_data;
156156

157-
jint _modifier_flags; // Processed access flags, for use by Class.getModifiers.
157+
int _vtable_len; // vtable length. This field may be read very often when we
158+
// have lots of itable dispatches (e.g., lambdas and streams).
159+
// Keep it away from the beginning of a Klass to avoid cacheline
160+
// contention that may happen when a nearby object is modified.
158161
AccessFlags _access_flags; // Access flags. The class/interface distinction is stored here.
159162

160163
JFR_ONLY(DEFINE_TRACE_ID_FIELD;)

0 commit comments

Comments
 (0)