< prev index next >

src/hotspot/share/runtime/thread.hpp

Print this page
*** 34,10 ***
--- 34,11 ---
  #include "oops/oopHandle.hpp"
  #include "runtime/frame.hpp"
  #include "runtime/globals.hpp"
  #include "runtime/handshake.hpp"
  #include "runtime/javaFrameAnchor.hpp"
+ #include "runtime/lockStack.hpp"
  #include "runtime/mutexLocker.hpp"
  #include "runtime/os.hpp"
  #include "runtime/park.hpp"
  #include "runtime/safepointMechanism.hpp"
  #include "runtime/stackWatermarkSet.hpp"

*** 1637,10 ***
--- 1638,23 ---
  
    // java.lang.Thread interruption support
    void interrupt();
    bool is_interrupted(bool clear_interrupted);
  
+ private:
+   LockStack _lock_stack;
+ 
+ public:
+   LockStack& lock_stack() { return _lock_stack; }
+ 
+   static ByteSize lock_stack_offset()      { return byte_offset_of(JavaThread, _lock_stack); }
+   // Those offsets are used in code generators to access the LockStack that is embedded in this
+   // JavaThread structure. Those accesses are relative to the current thread, which
+   // is typically in a dedicated register.
+   static ByteSize lock_stack_top_offset()  { return lock_stack_offset() + LockStack::top_offset(); }
+   static ByteSize lock_stack_base_offset() { return lock_stack_offset() + LockStack::base_offset(); }
+ 
    static OopStorage* thread_oop_storage();
  
    static void verify_cross_modify_fence_failure(JavaThread *thread) PRODUCT_RETURN;
  
    // Helper function to start a VM-internal daemon thread.

*** 1769,10 ***
--- 1783,13 ---
  
    // Get owning Java thread from the monitor's owner field.
    static JavaThread *owning_thread_from_monitor_owner(ThreadsList * t_list,
                                                        address owner);
  
+   static JavaThread* owning_thread_from_object(ThreadsList* t_list, oop obj);
+   static JavaThread* owning_thread_from_monitor(ThreadsList* t_list, ObjectMonitor* owner);
+ 
    // Number of threads on the active threads list
    static int number_of_threads()                 { return _number_of_threads; }
    // Number of non-daemon threads on the active threads list
    static int number_of_non_daemon_threads()      { return _number_of_non_daemon_threads; }
  
< prev index next >