Mercurial > hg > graal-compiler
comparison src/share/vm/opto/locknode.hpp @ 17780:606acabe7b5c
8031320: Use Intel RTM instructions for locks
Summary: Use RTM for inflated locks and stack locks.
Reviewed-by: iveresov, twisti, roland, dcubed
author | kvn |
---|---|
date | Thu, 20 Mar 2014 17:49:27 -0700 |
parents | b9a9ed0f8eeb |
children | 62c54fcc0a35 |
comparison
equal
deleted
inserted
replaced
17778:a48e16541e6b | 17780:606acabe7b5c |
---|---|
87 }; | 87 }; |
88 | 88 |
89 //------------------------------FastLockNode----------------------------------- | 89 //------------------------------FastLockNode----------------------------------- |
90 class FastLockNode: public CmpNode { | 90 class FastLockNode: public CmpNode { |
91 private: | 91 private: |
92 BiasedLockingCounters* _counters; | 92 BiasedLockingCounters* _counters; |
93 RTMLockingCounters* _rtm_counters; // RTM lock counters for inflated locks | |
94 RTMLockingCounters* _stack_rtm_counters; // RTM lock counters for stack locks | |
93 | 95 |
94 public: | 96 public: |
95 FastLockNode(Node *ctrl, Node *oop, Node *box) : CmpNode(oop,box) { | 97 FastLockNode(Node *ctrl, Node *oop, Node *box) : CmpNode(oop,box) { |
96 init_req(0,ctrl); | 98 init_req(0,ctrl); |
97 init_class_id(Class_FastLock); | 99 init_class_id(Class_FastLock); |
98 _counters = NULL; | 100 _counters = NULL; |
101 _rtm_counters = NULL; | |
102 _stack_rtm_counters = NULL; | |
99 } | 103 } |
100 Node* obj_node() const { return in(1); } | 104 Node* obj_node() const { return in(1); } |
101 Node* box_node() const { return in(2); } | 105 Node* box_node() const { return in(2); } |
102 void set_box_node(Node* box) { set_req(2, box); } | 106 void set_box_node(Node* box) { set_req(2, box); } |
103 | 107 |
104 // FastLock and FastUnlockNode do not hash, we need one for each correspoding | 108 // FastLock and FastUnlockNode do not hash, we need one for each correspoding |
105 // LockNode/UnLockNode to avoid creating Phi's. | 109 // LockNode/UnLockNode to avoid creating Phi's. |
106 virtual uint hash() const ; // { return NO_HASH; } | 110 virtual uint hash() const ; // { return NO_HASH; } |
111 virtual uint size_of() const; | |
107 virtual uint cmp( const Node &n ) const ; // Always fail, except on self | 112 virtual uint cmp( const Node &n ) const ; // Always fail, except on self |
108 virtual int Opcode() const; | 113 virtual int Opcode() const; |
109 virtual const Type *Value( PhaseTransform *phase ) const { return TypeInt::CC; } | 114 virtual const Type *Value( PhaseTransform *phase ) const { return TypeInt::CC; } |
110 const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} | 115 const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} |
111 | 116 |
112 void create_lock_counter(JVMState* s); | 117 void create_lock_counter(JVMState* s); |
113 BiasedLockingCounters* counters() const { return _counters; } | 118 void create_rtm_lock_counter(JVMState* state); |
119 BiasedLockingCounters* counters() const { return _counters; } | |
120 RTMLockingCounters* rtm_counters() const { return _rtm_counters; } | |
121 RTMLockingCounters* stack_rtm_counters() const { return _stack_rtm_counters; } | |
114 }; | 122 }; |
115 | 123 |
116 | 124 |
117 //------------------------------FastUnlockNode--------------------------------- | 125 //------------------------------FastUnlockNode--------------------------------- |
118 class FastUnlockNode: public CmpNode { | 126 class FastUnlockNode: public CmpNode { |