< prev index next >

src/hotspot/share/opto/locknode.cpp

Print this page

162 #if INCLUDE_RTM_OPT
163   Compile* C = Compile::current();
164   if (C->profile_rtm() || (PrintPreciseRTMLockingStatistics && C->use_rtm())) {
165     RTMLockingNamedCounter* rlnc = (RTMLockingNamedCounter*)
166            OptoRuntime::new_named_counter(state, NamedCounter::RTMLockingCounter);
167     _rtm_counters = rlnc->counters();
168     if (UseRTMForStackLocks) {
169       rlnc = (RTMLockingNamedCounter*)
170            OptoRuntime::new_named_counter(state, NamedCounter::RTMLockingCounter);
171       _stack_rtm_counters = rlnc->counters();
172     }
173   }
174 #endif
175 }
176 
177 //=============================================================================
178 //------------------------------do_monitor_enter-------------------------------
179 void Parse::do_monitor_enter() {
180   kill_dead_locals();
181 


182   // Null check; get casted pointer.
183   Node* obj = null_check(peek());
184   // Check for locking null object
185   if (stopped()) return;
186 
187   // the monitor object is not part of debug info expression stack
188   pop();
189 
190   // Insert a FastLockNode which takes as arguments the current thread pointer,
191   // the obj pointer & the address of the stack slot pair used for the lock.
192   shared_lock(obj);
193 }
194 
195 //------------------------------do_monitor_exit--------------------------------
196 void Parse::do_monitor_exit() {
197   kill_dead_locals();
198 




199   pop();                        // Pop oop to unlock
200   // Because monitors are guaranteed paired (else we bail out), we know
201   // the matching Lock for this Unlock.  Hence we know there is no need
202   // for a null check on Unlock.
203   shared_unlock(map()->peek_monitor_box(), map()->peek_monitor_obj());
204 }

162 #if INCLUDE_RTM_OPT
163   Compile* C = Compile::current();
164   if (C->profile_rtm() || (PrintPreciseRTMLockingStatistics && C->use_rtm())) {
165     RTMLockingNamedCounter* rlnc = (RTMLockingNamedCounter*)
166            OptoRuntime::new_named_counter(state, NamedCounter::RTMLockingCounter);
167     _rtm_counters = rlnc->counters();
168     if (UseRTMForStackLocks) {
169       rlnc = (RTMLockingNamedCounter*)
170            OptoRuntime::new_named_counter(state, NamedCounter::RTMLockingCounter);
171       _stack_rtm_counters = rlnc->counters();
172     }
173   }
174 #endif
175 }
176 
177 //=============================================================================
178 //------------------------------do_monitor_enter-------------------------------
179 void Parse::do_monitor_enter() {
180   kill_dead_locals();
181 
182   C->set_has_monitors(true);
183 
184   // Null check; get casted pointer.
185   Node* obj = null_check(peek());
186   // Check for locking null object
187   if (stopped()) return;
188 
189   // the monitor object is not part of debug info expression stack
190   pop();
191 
192   // Insert a FastLockNode which takes as arguments the current thread pointer,
193   // the obj pointer & the address of the stack slot pair used for the lock.
194   shared_lock(obj);
195 }
196 
197 //------------------------------do_monitor_exit--------------------------------
198 void Parse::do_monitor_exit() {
199   kill_dead_locals();
200 
201   // need to set it for monitor exit as well.
202   // OSR compiled methods can start with lock taken
203   C->set_has_monitors(true);
204 
205   pop();                        // Pop oop to unlock
206   // Because monitors are guaranteed paired (else we bail out), we know
207   // the matching Lock for this Unlock.  Hence we know there is no need
208   // for a null check on Unlock.
209   shared_unlock(map()->peek_monitor_box(), map()->peek_monitor_obj());
210 }
< prev index next >