src/share/vm/runtime/biasedLocking.cpp

Print this page
rev 6521 : 8044775: Improve usage of umbrella header atomic.inline.hpp.
Reviewed-by: stefank, kvn


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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 #include "precompiled.hpp"
  26 #include "oops/klass.inline.hpp"
  27 #include "oops/markOop.hpp"

  28 #include "runtime/basicLock.hpp"
  29 #include "runtime/biasedLocking.hpp"
  30 #include "runtime/task.hpp"
  31 #include "runtime/vframe.hpp"
  32 #include "runtime/vmThread.hpp"
  33 #include "runtime/vm_operations.hpp"
  34 
  35 static bool _biased_locking_enabled = false;
  36 BiasedLockingCounters BiasedLocking::_counters;
  37 
  38 static GrowableArray<Handle>*  _preserved_oop_stack  = NULL;
  39 static GrowableArray<markOop>* _preserved_mark_stack = NULL;
  40 
  41 static void enable_biased_locking(Klass* k) {
  42   k->set_prototype_header(markOopDesc::biased_locking_prototype());
  43 }
  44 
  45 class VM_EnableBiasedLocking: public VM_Operation {
  46  private:
  47   bool _is_cheap_allocated;




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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 #include "precompiled.hpp"
  26 #include "oops/klass.inline.hpp"
  27 #include "oops/markOop.hpp"
  28 #include "runtime/atomic.inline.hpp"
  29 #include "runtime/basicLock.hpp"
  30 #include "runtime/biasedLocking.hpp"
  31 #include "runtime/task.hpp"
  32 #include "runtime/vframe.hpp"
  33 #include "runtime/vmThread.hpp"
  34 #include "runtime/vm_operations.hpp"
  35 
  36 static bool _biased_locking_enabled = false;
  37 BiasedLockingCounters BiasedLocking::_counters;
  38 
  39 static GrowableArray<Handle>*  _preserved_oop_stack  = NULL;
  40 static GrowableArray<markOop>* _preserved_mark_stack = NULL;
  41 
  42 static void enable_biased_locking(Klass* k) {
  43   k->set_prototype_header(markOopDesc::biased_locking_prototype());
  44 }
  45 
  46 class VM_EnableBiasedLocking: public VM_Operation {
  47  private:
  48   bool _is_cheap_allocated;