hotspot/src/share/vm/runtime/objectMonitor.hpp
changeset 27608 80d91e264baf
parent 27165 785a8d56024c
child 27880 afb974a04396
--- a/hotspot/src/share/vm/runtime/objectMonitor.hpp	Thu Nov 06 13:57:26 2014 +0000
+++ b/hotspot/src/share/vm/runtime/objectMonitor.hpp	Thu Nov 06 13:05:14 2014 -0800
@@ -228,6 +228,20 @@
   static int Responsible_offset_in_bytes() { return offset_of(ObjectMonitor, _Responsible); }
   static int Spinner_offset_in_bytes()     { return offset_of(ObjectMonitor, _Spinner); }
 
+  // ObjectMonitor references can be ORed with markOopDesc::monitor_value
+  // as part of the ObjectMonitor tagging mechanism. When we combine an
+  // ObjectMonitor reference with an offset, we need to remove the tag
+  // value in order to generate the proper address.
+  //
+  // We can either adjust the ObjectMonitor reference and then add the
+  // offset or we can adjust the offset that is added to the ObjectMonitor
+  // reference. The latter avoids an AGI (Address Generation Interlock)
+  // stall so the helper macro adjusts the offset value that is returned
+  // to the ObjectMonitor reference manipulation code:
+  //
+  #define OM_OFFSET_NO_MONITOR_VALUE_TAG(f) \
+    ((ObjectMonitor::f ## _offset_in_bytes()) - markOopDesc::monitor_value)
+
   // Eventually we'll make provisions for multiple callbacks, but
   // now one will suffice.
   static int (*SpinCallbackFunction)(intptr_t, int);