v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
atomic-memory-order.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_CODEGEN_ATOMIC_MEMORY_ORDER_H_
6#define V8_CODEGEN_ATOMIC_MEMORY_ORDER_H_
7
8#include <ostream>
9
10#include "src/base/logging.h"
11
12namespace v8 {
13namespace internal {
14
15// Atomic memory orders supported by the compiler.
16enum class AtomicMemoryOrder : uint8_t { kAcqRel, kSeqCst };
17
18inline size_t hash_value(AtomicMemoryOrder order) {
19 return static_cast<uint8_t>(order);
20}
21
22inline std::ostream& operator<<(std::ostream& os, AtomicMemoryOrder order) {
23 switch (order) {
25 return os << "kAcqRel";
27 return os << "kSeqCst";
28 }
30}
31
32} // namespace internal
33} // namespace v8
34
35#endif // V8_CODEGEN_ATOMIC_MEMORY_ORDER_H_
size_t hash_value(AtomicMemoryOrder order)
std::ostream & operator<<(std::ostream &os, AtomicMemoryOrder order)