hotspot/src/share/vm/runtime/synchronizer.cpp
changeset 28621 37cc414b6491
parent 27165 785a8d56024c
child 29070 b0a5fc9c59c8
equal deleted inserted replaced
28617:12ae756253c2 28621:37cc414b6491
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   273   }
   273   }
   274   THREAD->set_current_pending_monitor_is_from_java(false);
   274   THREAD->set_current_pending_monitor_is_from_java(false);
   275   ObjectSynchronizer::inflate(THREAD, obj())->enter(THREAD);
   275   ObjectSynchronizer::inflate(THREAD, obj())->enter(THREAD);
   276   THREAD->set_current_pending_monitor_is_from_java(true);
   276   THREAD->set_current_pending_monitor_is_from_java(true);
   277 }
   277 }
   278 
       
   279 // NOTE: must use heavy weight monitor to handle jni monitor enter
       
   280 bool ObjectSynchronizer::jni_try_enter(Handle obj, Thread* THREAD) {
       
   281   if (UseBiasedLocking) {
       
   282     BiasedLocking::revoke_and_rebias(obj, false, THREAD);
       
   283     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
       
   284   }
       
   285 
       
   286   ObjectMonitor* monitor = ObjectSynchronizer::inflate_helper(obj());
       
   287   return monitor->try_enter(THREAD);
       
   288 }
       
   289 
       
   290 
   278 
   291 // NOTE: must use heavy weight monitor to handle jni monitor exit
   279 // NOTE: must use heavy weight monitor to handle jni monitor exit
   292 void ObjectSynchronizer::jni_exit(oop obj, Thread* THREAD) {
   280 void ObjectSynchronizer::jni_exit(oop obj, Thread* THREAD) {
   293   TEVENT(jni_exit);
   281   TEVENT(jni_exit);
   294   if (UseBiasedLocking) {
   282   if (UseBiasedLocking) {