1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  * vim: set ts=8 sts=4 et sw=4 tw=99:
3  * This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 /* For documentation, see jit/AtomicOperations.h */
8 
9 #ifndef jit_none_AtomicOperations_none_h
10 #define jit_none_AtomicOperations_none_h
11 
12 #include "mozilla/Assertions.h"
13 
14 // A "none" build is never run (ref IRC discussion with h4writer) and
15 // all functions here can therefore MOZ_CRASH, even if they are
16 // referenced from other than jitted code.
17 
18 inline bool
isLockfree8()19 js::jit::AtomicOperations::isLockfree8()
20 {
21     MOZ_CRASH();
22 }
23 
24 inline void
fenceSeqCst()25 js::jit::AtomicOperations::fenceSeqCst()
26 {
27     MOZ_CRASH();
28 }
29 
30 template<typename T>
31 inline T
loadSeqCst(T * addr)32 js::jit::AtomicOperations::loadSeqCst(T* addr)
33 {
34     MOZ_CRASH();
35 }
36 
37 template<typename T>
38 inline void
storeSeqCst(T * addr,T val)39 js::jit::AtomicOperations::storeSeqCst(T* addr, T val)
40 {
41     MOZ_CRASH();
42 }
43 
44 template<typename T>
45 inline T
compareExchangeSeqCst(T * addr,T oldval,T newval)46 js::jit::AtomicOperations::compareExchangeSeqCst(T* addr, T oldval, T newval)
47 {
48     MOZ_CRASH();
49 }
50 
51 template<typename T>
52 inline T
fetchAddSeqCst(T * addr,T val)53 js::jit::AtomicOperations::fetchAddSeqCst(T* addr, T val)
54 {
55     MOZ_CRASH();
56 }
57 
58 template<typename T>
59 inline T
fetchSubSeqCst(T * addr,T val)60 js::jit::AtomicOperations::fetchSubSeqCst(T* addr, T val)
61 {
62     MOZ_CRASH();
63 }
64 
65 template<typename T>
66 inline T
fetchAndSeqCst(T * addr,T val)67 js::jit::AtomicOperations::fetchAndSeqCst(T* addr, T val)
68 {
69     MOZ_CRASH();
70 }
71 
72 template<typename T>
73 inline T
fetchOrSeqCst(T * addr,T val)74 js::jit::AtomicOperations::fetchOrSeqCst(T* addr, T val)
75 {
76     MOZ_CRASH();
77 }
78 
79 template<typename T>
80 inline T
fetchXorSeqCst(T * addr,T val)81 js::jit::AtomicOperations::fetchXorSeqCst(T* addr, T val)
82 {
83     MOZ_CRASH();
84 }
85 
86 template<typename T>
87 inline T
exchangeSeqCst(T * addr,T val)88 js::jit::AtomicOperations::exchangeSeqCst(T* addr, T val)
89 {
90     MOZ_CRASH();
91 }
92 
93 template<typename T>
94 inline T
loadSafeWhenRacy(T * addr)95 js::jit::AtomicOperations::loadSafeWhenRacy(T* addr)
96 {
97     MOZ_CRASH();
98 }
99 
100 template<typename T>
101 inline void
storeSafeWhenRacy(T * addr,T val)102 js::jit::AtomicOperations::storeSafeWhenRacy(T* addr, T val)
103 {
104     MOZ_CRASH();
105 }
106 
107 inline void
memcpySafeWhenRacy(void * dest,const void * src,size_t nbytes)108 js::jit::AtomicOperations::memcpySafeWhenRacy(void* dest, const void* src, size_t nbytes)
109 {
110     MOZ_CRASH();
111 }
112 
113 inline void
memmoveSafeWhenRacy(void * dest,const void * src,size_t nbytes)114 js::jit::AtomicOperations::memmoveSafeWhenRacy(void* dest, const void* src, size_t nbytes)
115 {
116     MOZ_CRASH();
117 }
118 
119 template<size_t nbytes>
120 inline void
acquire(void * addr)121 js::jit::RegionLock::acquire(void* addr)
122 {
123     (void)spinlock;             // Remove a lot of "unused" warnings.
124     MOZ_CRASH();
125 }
126 
127 template<size_t nbytes>
128 inline void
release(void * addr)129 js::jit::RegionLock::release(void* addr)
130 {
131     MOZ_CRASH();
132 }
133 
134 #endif // jit_none_AtomicOperations_none_h
135