equal
deleted
inserted
replaced
169 return true; |
169 return true; |
170 } |
170 } |
171 |
171 |
172 if (mark.has_monitor()) { |
172 if (mark.has_monitor()) { |
173 ObjectMonitor* const mon = mark.monitor(); |
173 ObjectMonitor* const mon = mark.monitor(); |
174 assert(oopDesc::equals((oop) mon->object(), obj), "invariant"); |
174 assert(mon->object() == obj, "invariant"); |
175 if (mon->owner() != self) return false; // slow-path for IMS exception |
175 if (mon->owner() != self) return false; // slow-path for IMS exception |
176 |
176 |
177 if (mon->first_waiter() != NULL) { |
177 if (mon->first_waiter() != NULL) { |
178 // We have one or more waiters. Since this is an inflated monitor |
178 // We have one or more waiters. Since this is an inflated monitor |
179 // that we own, we can transfer one or more threads from the waitset |
179 // that we own, we can transfer one or more threads from the waitset |
213 if (obj == NULL) return false; // Need to throw NPE |
213 if (obj == NULL) return false; // Need to throw NPE |
214 const markWord mark = obj->mark(); |
214 const markWord mark = obj->mark(); |
215 |
215 |
216 if (mark.has_monitor()) { |
216 if (mark.has_monitor()) { |
217 ObjectMonitor* const m = mark.monitor(); |
217 ObjectMonitor* const m = mark.monitor(); |
218 assert(oopDesc::equals((oop) m->object(), obj), "invariant"); |
218 assert(m->object() == obj, "invariant"); |
219 Thread* const owner = (Thread *) m->_owner; |
219 Thread* const owner = (Thread *) m->_owner; |
220 |
220 |
221 // Lock contention and Transactional Lock Elision (TLE) diagnostics |
221 // Lock contention and Transactional Lock Elision (TLE) diagnostics |
222 // and observability |
222 // and observability |
223 // Case: light contention possibly amenable to TLE |
223 // Case: light contention possibly amenable to TLE |
1299 // CASE: inflated |
1299 // CASE: inflated |
1300 if (mark.has_monitor()) { |
1300 if (mark.has_monitor()) { |
1301 ObjectMonitor* inf = mark.monitor(); |
1301 ObjectMonitor* inf = mark.monitor(); |
1302 markWord dmw = inf->header(); |
1302 markWord dmw = inf->header(); |
1303 assert(dmw.is_neutral(), "invariant: header=" INTPTR_FORMAT, dmw.value()); |
1303 assert(dmw.is_neutral(), "invariant: header=" INTPTR_FORMAT, dmw.value()); |
1304 assert(oopDesc::equals((oop) inf->object(), object), "invariant"); |
1304 assert(inf->object() == object, "invariant"); |
1305 assert(ObjectSynchronizer::verify_objmon_isinpool(inf), "monitor is invalid"); |
1305 assert(ObjectSynchronizer::verify_objmon_isinpool(inf), "monitor is invalid"); |
1306 return inf; |
1306 return inf; |
1307 } |
1307 } |
1308 |
1308 |
1309 // CASE: inflation in progress - inflating over a stack-lock. |
1309 // CASE: inflation in progress - inflating over a stack-lock. |