< prev index next > src/hotspot/share/runtime/lockStack.hpp
Print this page
#include "oops/oopsHierarchy.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/sizes.hpp"
class JavaThread;
+ class ObjectMonitor;
class OopClosure;
class outputStream;
template<typename>
class GrowableArray;
+ class Thread;
class LockStack {
friend class LockStackTest;
friend class VMStructs;
JVMCI_ONLY(friend class JVMCIVMStructs;)
// The boundary indicies of the lock-stack.
static uint32_t start_offset();
static uint32_t end_offset();
+ // Return true if we have room to push n oops onto this lock-stack, false otherwise.
+ inline bool can_push(int n = 1) const;
+
// Returns true if the lock-stack is full. False otherwise.
inline bool is_full() const;
// Pushes an oop on this lock-stack.
inline void push(oop o);
inline oop bottom() const;
// Is the lock-stack empty.
inline bool is_empty() const;
+ // Get the oldest oop in the stack
+ inline oop top();
+
// Check if object is recursive.
// Precondition: This lock-stack must contain the oop.
inline bool is_recursive(oop o) const;
// Try recursive enter.
// Verify Lock Stack consistent with lock order
void verify_consistent_lock_order(GrowableArray<oop>& lock_order, bool leaf_frame) const NOT_DEBUG_RETURN;
};
+ class OMCache {
+ friend class VMStructs;
+ public:
+ static constexpr int CAPACITY = 8;
+
+ private:
+ struct OMCacheEntry {
+ oop _oop = nullptr;
+ ObjectMonitor* _monitor = nullptr;
+ } _entries[CAPACITY];
+ const oop _null_sentinel = nullptr;
+
+ public:
+ static ByteSize entries() { return byte_offset_of(OMCache, _entries); }
+ static constexpr ByteSize oop_to_oop_difference() { return in_ByteSize(sizeof(OMCacheEntry)); }
+ static constexpr ByteSize oop_to_monitor_difference() { return in_ByteSize(sizeof(oop)); }
+
+ explicit OMCache(JavaThread* jt);
+
+ inline ObjectMonitor* get_monitor(oop o);
+ inline void set_monitor(ObjectMonitor* monitor);
+ inline void clear();
+
+ };
+
#endif // SHARE_RUNTIME_LOCKSTACK_HPP
< prev index next >