< prev index next >

src/hotspot/share/code/compiledMethod.inline.hpp

Print this page

        

@@ -25,10 +25,11 @@
 #ifndef SHARE_CODE_COMPILEDMETHOD_INLINE_HPP
 #define SHARE_CODE_COMPILEDMETHOD_INLINE_HPP
 
 #include "code/compiledMethod.hpp"
 #include "code/nativeInst.hpp"
+#include "runtime/atomic.hpp"
 #include "runtime/frame.hpp"
 #include "runtime/orderAccess.hpp"
 
 inline bool CompiledMethod::is_deopt_pc(address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); }
 

@@ -56,10 +57,19 @@
     return cm->get_original_pc(fr);
 
   return NULL;
 }
 
+inline oop* CompiledMethod::get_keepalive() { return _keepalive; }
+
+inline oop* CompiledMethod::set_keepalive(oop* obj) {
+  return Atomic::cmpxchg(obj, &_keepalive, (oop*) NULL);
+}
+
+inline bool CompiledMethod::clear_keepalive(oop* old) {
+  return Atomic::cmpxchg((oop*) NULL, &_keepalive, (oop*) old) == old;
+}
 
 // class ExceptionCache methods
 
 inline int ExceptionCache::count() { return OrderAccess::load_acquire(&_count); }
 

@@ -74,7 +84,6 @@
 }
 
 // increment_count is only called under lock, but there may be concurrent readers.
 inline void ExceptionCache::increment_count() { OrderAccess::release_store(&_count, _count + 1); }
 
-
 #endif // SHARE_CODE_COMPILEDMETHOD_INLINE_HPP
< prev index next >