v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
data-view-ops.h
Go to the documentation of this file.
1// Copyright 2023 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_BUILTINS_DATA_VIEW_OPS_H_
6#define V8_BUILTINS_DATA_VIEW_OPS_H_
7
8#include <stdint.h>
9
10#include "src/base/logging.h"
11
12// DataView operations that are handled as well-known imports.
13#define DATAVIEW_OP_LIST(V) \
14 V(BigInt64) \
15 V(BigUint64) \
16 V(Float32) \
17 V(Float64) \
18 V(Int8) \
19 V(Int16) \
20 V(Int32) \
21 V(Uint8) \
22 V(Uint16) \
23 V(Uint32)
24
25enum DataViewOp : uint8_t {
26#define V(Name) kGet##Name, kSet##Name,
28#undef V
30};
31
32constexpr const char* ToString(DataViewOp op) {
33 switch (op) {
34#define V(Name) \
35 case DataViewOp::kGet##Name: \
36 return "DataView.prototype.get" #Name; \
37 case DataViewOp::kSet##Name: \
38 return "DataView.prototype.set" #Name;
40#undef V
42 return "get DataView.prototype.byteLength";
43 default:
45 }
46}
47
48#endif // V8_BUILTINS_DATA_VIEW_OPS_H_
constexpr const char * ToString(DataViewOp op)
DataViewOp
@ kByteLength
#define V(Name)
#define DATAVIEW_OP_LIST(V)
#define UNREACHABLE()
Definition logging.h:67