< prev index next >

src/share/vm/runtime/orderAccess.inline.hpp

Print this page
rev 11647 : 8161258: Simplify including platform files.
Summary: Include patform files with macros cpu_header() etc. Do various cleanups of macro usages. Remove _64/_32 from adlc generated files and platform .hpp files. Merge stubRoutines_x86*.hpp. Remove empty mutex_<os>* files.
Reviewed-by: dholmes, coleenp, kbarrett
   1 /*
   2  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014 SAP SE. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP
  27 #define SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP
  28 
  29 #include "runtime/atomic.inline.hpp"
  30 #include "runtime/orderAccess.hpp"

  31 
  32 // Linux
  33 #ifdef TARGET_OS_ARCH_linux_x86
  34 # include "orderAccess_linux_x86.inline.hpp"
  35 #endif
  36 #ifdef TARGET_OS_ARCH_linux_sparc
  37 # include "orderAccess_linux_sparc.inline.hpp"
  38 #endif
  39 #ifdef TARGET_OS_ARCH_linux_zero
  40 # include "orderAccess_linux_zero.inline.hpp"
  41 #endif
  42 #ifdef TARGET_OS_ARCH_linux_arm
  43 # include "orderAccess_linux_arm.inline.hpp"
  44 #endif
  45 #ifdef TARGET_OS_ARCH_linux_aarch64
  46 # include "orderAccess_linux_aarch64.inline.hpp"
  47 #endif
  48 #ifdef TARGET_OS_ARCH_linux_ppc
  49 # include "orderAccess_linux_ppc.inline.hpp"
  50 #endif
  51 
  52 // Solaris
  53 #ifdef TARGET_OS_ARCH_solaris_x86
  54 # include "orderAccess_solaris_x86.inline.hpp"
  55 #endif
  56 #ifdef TARGET_OS_ARCH_solaris_sparc
  57 # include "orderAccess_solaris_sparc.inline.hpp"
  58 #endif
  59 
  60 // Windows
  61 #ifdef TARGET_OS_ARCH_windows_x86
  62 # include "orderAccess_windows_x86.inline.hpp"
  63 #endif
  64 
  65 // AIX
  66 #ifdef TARGET_OS_ARCH_aix_ppc
  67 # include "orderAccess_aix_ppc.inline.hpp"
  68 #endif
  69 
  70 // BSD
  71 #ifdef TARGET_OS_ARCH_bsd_x86
  72 # include "orderAccess_bsd_x86.inline.hpp"
  73 #endif
  74 #ifdef TARGET_OS_ARCH_bsd_zero
  75 # include "orderAccess_bsd_zero.inline.hpp"
  76 #endif
  77 
  78 #ifdef VM_HAS_GENERALIZED_ORDER_ACCESS
  79 
  80 template<> inline void ScopedFenceGeneral<X_ACQUIRE>::postfix()       { OrderAccess::acquire(); }
  81 template<> inline void ScopedFenceGeneral<RELEASE_X>::prefix()        { OrderAccess::release(); }
  82 template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::prefix()  { OrderAccess::release(); }
  83 template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::postfix() { OrderAccess::fence();   }
  84 
  85 
  86 template <typename FieldType, ScopedFenceType FenceType>
  87 inline void OrderAccess::ordered_store(volatile FieldType* p, FieldType v) {
  88   ScopedFence<FenceType> f((void*)p);
  89   store(p, v);
  90 }
  91 
  92 template <typename FieldType, ScopedFenceType FenceType>
  93 inline FieldType OrderAccess::ordered_load(volatile FieldType* p) {
  94   ScopedFence<FenceType> f((void*)p);
  95   return load(p);
  96 }


   1 /*
   2  * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014, 2016 SAP SE. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP
  27 #define SHARE_VM_RUNTIME_ORDERACCESS_INLINE_HPP
  28 
  29 #include "runtime/atomic.inline.hpp"
  30 #include "runtime/orderAccess.hpp"
  31 #include "utilities/macros.hpp"
  32 
  33 #include OS_CPU_HEADER_INLINE(orderAccess)












































  34 
  35 #ifdef VM_HAS_GENERALIZED_ORDER_ACCESS
  36 
  37 template<> inline void ScopedFenceGeneral<X_ACQUIRE>::postfix()       { OrderAccess::acquire(); }
  38 template<> inline void ScopedFenceGeneral<RELEASE_X>::prefix()        { OrderAccess::release(); }
  39 template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::prefix()  { OrderAccess::release(); }
  40 template<> inline void ScopedFenceGeneral<RELEASE_X_FENCE>::postfix() { OrderAccess::fence();   }
  41 
  42 
  43 template <typename FieldType, ScopedFenceType FenceType>
  44 inline void OrderAccess::ordered_store(volatile FieldType* p, FieldType v) {
  45   ScopedFence<FenceType> f((void*)p);
  46   store(p, v);
  47 }
  48 
  49 template <typename FieldType, ScopedFenceType FenceType>
  50 inline FieldType OrderAccess::ordered_load(volatile FieldType* p) {
  51   ScopedFence<FenceType> f((void*)p);
  52   return load(p);
  53 }


< prev index next >