17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_RUNTIME_SYNCHRONIZER_INLINE_HPP
26 #define SHARE_RUNTIME_SYNCHRONIZER_INLINE_HPP
27
28 #include "runtime/synchronizer.hpp"
29
30 #include "runtime/lightweightSynchronizer.hpp"
31 #include "runtime/safepointVerifiers.hpp"
32
33 inline ObjectMonitor* ObjectSynchronizer::read_monitor(markWord mark) {
34 return mark.monitor();
35 }
36
37 inline ObjectMonitor* ObjectSynchronizer::read_monitor(Thread* current, oop obj, markWord mark) {
38 if (!UseObjectMonitorTable) {
39 return read_monitor(mark);
40 } else {
41 return LightweightSynchronizer::get_monitor_from_table(current, obj);
42 }
43 }
44
45 inline void ObjectSynchronizer::enter(Handle obj, BasicLock* lock, JavaThread* current) {
46 assert(current == Thread::current(), "must be");
47
48 LightweightSynchronizer::enter(obj, lock, current);
49 }
50
51 inline bool ObjectSynchronizer::quick_enter(oop obj, BasicLock* lock, JavaThread* current) {
52 assert(current->thread_state() == _thread_in_Java, "invariant");
53 NoSafepointVerifier nsv;
54 if (obj == nullptr) return false; // Need to throw NPE
55
56 if (obj->klass()->is_value_based()) {
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_RUNTIME_SYNCHRONIZER_INLINE_HPP
26 #define SHARE_RUNTIME_SYNCHRONIZER_INLINE_HPP
27
28 #include "runtime/synchronizer.hpp"
29
30 #include "runtime/lightweightSynchronizer.hpp"
31 #include "runtime/safepointVerifiers.hpp"
32
33 inline ObjectMonitor* ObjectSynchronizer::read_monitor(markWord mark) {
34 return mark.monitor();
35 }
36
37 inline ObjectMonitor* ObjectSynchronizer::read_monitor(Thread* current, oop obj) {
38 return ObjectSynchronizer::read_monitor(current, obj, obj->mark());
39 }
40
41 inline ObjectMonitor* ObjectSynchronizer::read_monitor(Thread* current, oop obj, markWord mark) {
42 if (!UseObjectMonitorTable) {
43 return read_monitor(mark);
44 } else {
45 return LightweightSynchronizer::get_monitor_from_table(current, obj);
46 }
47 }
48
49 inline void ObjectSynchronizer::enter(Handle obj, BasicLock* lock, JavaThread* current) {
50 assert(current == Thread::current(), "must be");
51
52 LightweightSynchronizer::enter(obj, lock, current);
53 }
54
55 inline bool ObjectSynchronizer::quick_enter(oop obj, BasicLock* lock, JavaThread* current) {
56 assert(current->thread_state() == _thread_in_Java, "invariant");
57 NoSafepointVerifier nsv;
58 if (obj == nullptr) return false; // Need to throw NPE
59
60 if (obj->klass()->is_value_based()) {
|