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
25
enum
DataViewOp
: uint8_t {
26
#define V(Name) kGet##Name, kSet##Name,
27
DATAVIEW_OP_LIST
(
V
)
28
#undef V
29
kByteLength
30
};
31
32
constexpr
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;
39
DATAVIEW_OP_LIST
(
V
)
40
#undef V
41
case
DataViewOp::kByteLength
:
42
return
"get DataView.prototype.byteLength"
;
43
default
:
44
UNREACHABLE
();
45
}
46
}
47
48
#endif
// V8_BUILTINS_DATA_VIEW_OPS_H_
ToString
constexpr const char * ToString(DataViewOp op)
Definition
data-view-ops.h:32
DataViewOp
DataViewOp
Definition
data-view-ops.h:25
kByteLength
@ kByteLength
Definition
data-view-ops.h:29
V
#define V(Name)
Definition
data-view-ops.h:26
DATAVIEW_OP_LIST
#define DATAVIEW_OP_LIST(V)
Definition
data-view-ops.h:13
logging.h
UNREACHABLE
#define UNREACHABLE()
Definition
logging.h:67
src
builtins
data-view-ops.h
Generated on Sun Apr 6 2025 21:08:50 for v8 by
1.12.0