src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp

Print this page
rev 4205 : Fix non-PCH build on Linux, Windows and MacOS X
   1 /*
   2  * Copyright (c) 1999, 2011, 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 #ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
  26 #define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
  27 
  28 #include "orderAccess_windows_x86.inline.hpp"
  29 #include "runtime/atomic.hpp"
  30 #include "runtime/os.hpp"
  31 #include "vm_version_x86.hpp"
  32 
  33 // The following alternative implementations are needed because
  34 // Windows 95 doesn't support (some of) the corresponding Windows NT
  35 // calls. Furthermore, these versions allow inlining in the caller.
  36 // (More precisely: The documentation for InterlockedExchange says
  37 // it is supported for Windows 95. However, when single-stepping
  38 // through the assembly code we cannot step into the routine and
  39 // when looking at the routine address we see only garbage code.
  40 // Better safe then sorry!). Was bug 7/31/98 (gri).
  41 //
  42 // Performance note: On uniprocessors, the 'lock' prefixes are not
  43 // necessary (and expensive). We should generate separate cases if
  44 // this becomes a performance problem.
  45 
  46 #pragma warning(disable: 4035) // Disables warnings reporting missing return statement
  47 
  48 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }


   1 /*
   2  * Copyright (c) 1999, 2013, 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 #ifndef OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
  26 #define OS_CPU_WINDOWS_X86_VM_ATOMIC_WINDOWS_X86_INLINE_HPP
  27 

  28 #include "runtime/atomic.hpp"
  29 #include "runtime/os.hpp"
  30 #include "vm_version_x86.hpp"
  31 
  32 // The following alternative implementations are needed because
  33 // Windows 95 doesn't support (some of) the corresponding Windows NT
  34 // calls. Furthermore, these versions allow inlining in the caller.
  35 // (More precisely: The documentation for InterlockedExchange says
  36 // it is supported for Windows 95. However, when single-stepping
  37 // through the assembly code we cannot step into the routine and
  38 // when looking at the routine address we see only garbage code.
  39 // Better safe then sorry!). Was bug 7/31/98 (gri).
  40 //
  41 // Performance note: On uniprocessors, the 'lock' prefixes are not
  42 // necessary (and expensive). We should generate separate cases if
  43 // this becomes a performance problem.
  44 
  45 #pragma warning(disable: 4035) // Disables warnings reporting missing return statement
  46 
  47 inline void Atomic::store    (jbyte    store_value, jbyte*    dest) { *dest = store_value; }