annotate src/hotspot/os_cpu/solaris_x86/orderAccess_solaris_x86.hpp @ 54526:ee29b516a36a

revert changes
author jlaskey
date Wed, 23 Jan 2019 16:09:20 -0400
parents 83aec1d357d4
children 846bc643f4ef
rev   line source
duke@1 1 /*
coleenp@54304 2 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
trims@5547 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@5547 20 * or visit www.oracle.com if you need additional information or have any
trims@5547 21 * questions.
duke@1 22 *
duke@1 23 */
duke@1 24
coleenp@54304 25 #ifndef OS_CPU_SOLARIS_X86_ORDERACCESS_SOLARIS_X86_HPP
coleenp@54304 26 #define OS_CPU_SOLARIS_X86_ORDERACCESS_SOLARIS_X86_HPP
stefank@7397 27
coleenp@51033 28 // Included in orderAccess.hpp header file.
stefank@7397 29
dholmes@29456 30 // Compiler version last used for testing: solaris studio 12u3
dholmes@29456 31 // Please update this information when this file changes
dholmes@29456 32
duke@1 33 // Implementation of class OrderAccess.
duke@1 34
dholmes@29456 35 // A compiler barrier, forcing the C++ compiler to invalidate all memory assumptions
dholmes@29456 36 inline void compiler_barrier() {
dholmes@29456 37 __asm__ volatile ("" : : : "memory");
duke@1 38 }
duke@1 39
dholmes@29456 40 inline void OrderAccess::loadload() { compiler_barrier(); }
dholmes@29456 41 inline void OrderAccess::storestore() { compiler_barrier(); }
dholmes@29456 42 inline void OrderAccess::loadstore() { compiler_barrier(); }
dholmes@29456 43 inline void OrderAccess::storeload() { fence(); }
dholmes@29456 44
dholmes@29456 45 inline void OrderAccess::acquire() { compiler_barrier(); }
dholmes@29456 46 inline void OrderAccess::release() { compiler_barrier(); }
duke@1 47
duke@1 48 inline void OrderAccess::fence() {
dholmes@29456 49 #ifdef AMD64
coleenp@51033 50 __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory");
dholmes@29456 51 #else
coleenp@51033 52 __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory");
dholmes@29456 53 #endif
dholmes@29456 54 compiler_barrier();
duke@1 55 }
duke@1 56
coleenp@54304 57 #endif // OS_CPU_SOLARIS_X86_ORDERACCESS_SOLARIS_X86_HPP