File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff 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;)
You can’t perform that action at this time.
0 commit comments