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

Print this page




   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 #pragma warning(disable: 4035) // Disables warnings reporting missing return statement
  26 
  27 // Implementation of class OrderAccess.
  28 
  29 inline void OrderAccess::loadload()   { acquire(); }
  30 inline void OrderAccess::storestore() { release(); }
  31 inline void OrderAccess::loadstore()  { acquire(); }
  32 inline void OrderAccess::storeload()  { fence(); }
  33 
  34 inline void OrderAccess::acquire() {
  35 #ifndef AMD64
  36   __asm {
  37     mov eax, dword ptr [esp];
  38   }
  39 #endif // !AMD64
  40 }
  41 
  42 inline void OrderAccess::release() {
  43   // A volatile store has release semantics.
  44   volatile jint local_dummy = 0;


 191 inline void     OrderAccess::release_store_fence(volatile jfloat*  p, jfloat  v) { *p = v; fence(); }
 192 inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }
 193 
 194 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) {
 195 #ifdef AMD64
 196   *p = v; fence();
 197 #else
 198   release_store_fence((volatile jint*)p, (jint)v);
 199 #endif // AMD64
 200 }
 201 
 202 inline void     OrderAccess::release_store_ptr_fence(volatile void*     p, void*    v) {
 203 #ifdef AMD64
 204   *(void* volatile *)p = v; fence();
 205 #else
 206   release_store_fence((volatile jint*)p, (jint)v);
 207 #endif // AMD64
 208 }
 209 
 210 #pragma warning(default: 4035) // Enables warnings reporting missing return statement




   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_ORDERACCESS_WINDOWS_X86_INLINE_HPP
  26 #define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
  27 
  28 #include "runtime/orderAccess.hpp"
  29 #include "vm_version_x86.hpp"
  30 
  31 #pragma warning(disable: 4035) // Disables warnings reporting missing return statement
  32 
  33 // Implementation of class OrderAccess.
  34 
  35 inline void OrderAccess::loadload()   { acquire(); }
  36 inline void OrderAccess::storestore() { release(); }
  37 inline void OrderAccess::loadstore()  { acquire(); }
  38 inline void OrderAccess::storeload()  { fence(); }
  39 
  40 inline void OrderAccess::acquire() {
  41 #ifndef AMD64
  42   __asm {
  43     mov eax, dword ptr [esp];
  44   }
  45 #endif // !AMD64
  46 }
  47 
  48 inline void OrderAccess::release() {
  49   // A volatile store has release semantics.
  50   volatile jint local_dummy = 0;


 197 inline void     OrderAccess::release_store_fence(volatile jfloat*  p, jfloat  v) { *p = v; fence(); }
 198 inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }
 199 
 200 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) {
 201 #ifdef AMD64
 202   *p = v; fence();
 203 #else
 204   release_store_fence((volatile jint*)p, (jint)v);
 205 #endif // AMD64
 206 }
 207 
 208 inline void     OrderAccess::release_store_ptr_fence(volatile void*     p, void*    v) {
 209 #ifdef AMD64
 210   *(void* volatile *)p = v; fence();
 211 #else
 212   release_store_fence((volatile jint*)p, (jint)v);
 213 #endif // AMD64
 214 }
 215 
 216 #pragma warning(default: 4035) // Enables warnings reporting missing return statement
 217 
 218 #endif // OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP