< prev index next >

src/hotspot/share/runtime/objectMonitor.hpp

Print this page
rev 57232 : imported patch 8235931.patch.cr0

@@ -118,10 +118,16 @@
 //
 //   - The _recursions field should be of type int, or int32_t but not
 //     intptr_t. There's no reason to use a 64-bit type for this field
 //     in a 64-bit JVM.
 
+#ifndef OM_CACHE_LINE_SIZE
+// Use DEFAULT_CACHE_LINE_SIZE if not already specified for
+// the current build platform.
+#define OM_CACHE_LINE_SIZE DEFAULT_CACHE_LINE_SIZE
+#endif
+
 class ObjectMonitor {
   friend class ObjectSynchronizer;
   friend class ObjectWaiter;
   friend class VMStructs;
   JVMCI_ONLY(friend class JVMCIVMStructs;)

@@ -137,11 +143,11 @@
   // have busy multi-threaded access. _header and _object are set at
   // initial inflation and _object doesn't change until deflation so
   // _object is a good choice to share the cache line with _header.
   // _next_om shares _header's cache line for pre-monitor list historical
   // reasons. _next_om only changes if the next ObjectMonitor is deflated.
-  DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE,
+  DEFINE_PAD_MINUS_SIZE(0, OM_CACHE_LINE_SIZE,
                         sizeof(volatile markWord) + sizeof(void* volatile) +
                         sizeof(ObjectMonitor *));
   void* volatile _owner;            // pointer to owning thread OR BasicLock
   volatile jlong _previous_owner_tid;  // thread id of the previous owner of the monitor
   volatile intx _recursions;        // recursion count, 0 for first entry
< prev index next >