src/share/vm/runtime/synchronizer.cpp

Print this page


   1 /*
   2  * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   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 "incls/_precompiled.incl"
  26 # include "incls/_synchronizer.cpp.incl"



























  27 
  28 #if defined(__GNUC__) && !defined(IA64)
  29   // Need to inhibit inlining for older versions of GCC to avoid build-time failures
  30   #define ATTR __attribute__((noinline))
  31 #else
  32   #define ATTR
  33 #endif
  34 
  35 // The "core" versions of monitor enter and exit reside in this file.
  36 // The interpreter and compilers contain specialized transliterated
  37 // variants of the enter-exit fast-path operations.  See i486.ad fast_lock(),
  38 // for instance.  If you make changes here, make sure to modify the
  39 // interpreter, and both C1 and C2 fast-path inline locking code emission.
  40 //
  41 //
  42 // -----------------------------------------------------------------------------
  43 
  44 #ifdef DTRACE_ENABLED
  45 
  46 // Only bother with this argument setup if dtrace is available


   1 /*
   2  * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   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 "classfile/vmSymbols.hpp"
  27 #include "memory/resourceArea.hpp"
  28 #include "oops/markOop.hpp"
  29 #include "oops/oop.inline.hpp"
  30 #include "runtime/biasedLocking.hpp"
  31 #include "runtime/handles.inline.hpp"
  32 #include "runtime/interfaceSupport.hpp"
  33 #include "runtime/mutexLocker.hpp"
  34 #include "runtime/objectMonitor.hpp"
  35 #include "runtime/objectMonitor.inline.hpp"
  36 #include "runtime/osThread.hpp"
  37 #include "runtime/stubRoutines.hpp"
  38 #include "runtime/synchronizer.hpp"
  39 #include "utilities/dtrace.hpp"
  40 #include "utilities/events.hpp"
  41 #include "utilities/preserveException.hpp"
  42 #ifdef TARGET_OS_FAMILY_linux
  43 # include "os_linux.inline.hpp"
  44 # include "thread_linux.inline.hpp"
  45 #endif
  46 #ifdef TARGET_OS_FAMILY_solaris
  47 # include "os_solaris.inline.hpp"
  48 # include "thread_solaris.inline.hpp"
  49 #endif
  50 #ifdef TARGET_OS_FAMILY_windows
  51 # include "os_windows.inline.hpp"
  52 # include "thread_windows.inline.hpp"
  53 #endif
  54 
  55 #if defined(__GNUC__) && !defined(IA64)
  56   // Need to inhibit inlining for older versions of GCC to avoid build-time failures
  57   #define ATTR __attribute__((noinline))
  58 #else
  59   #define ATTR
  60 #endif
  61 
  62 // The "core" versions of monitor enter and exit reside in this file.
  63 // The interpreter and compilers contain specialized transliterated
  64 // variants of the enter-exit fast-path operations.  See i486.ad fast_lock(),
  65 // for instance.  If you make changes here, make sure to modify the
  66 // interpreter, and both C1 and C2 fast-path inline locking code emission.
  67 //
  68 //
  69 // -----------------------------------------------------------------------------
  70 
  71 #ifdef DTRACE_ENABLED
  72 
  73 // Only bother with this argument setup if dtrace is available