v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
wasm-opcodes.cc
Go to the documentation of this file.
1// Copyright 2015 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
6
7#include <array>
8
13
14namespace v8 {
15namespace internal {
16namespace wasm {
17
18std::ostream& operator<<(std::ostream& os, const FunctionSig& sig) {
19 if (sig.return_count() == 0) os << "v";
20 for (auto ret : sig.returns()) {
21 os << ret.short_name();
22 }
23 os << "_";
24 if (sig.parameter_count() == 0) os << "v";
25 for (auto param : sig.parameters()) {
26 os << param.short_name();
27 }
28 return os;
29}
30
32 for (auto type : sig->all()) {
33 if (type == kWasmS128) return false;
34 if (type.is_ref() && !type.has_index()) {
35 switch (type.generic_kind()) {
36 case GenericKind::kStringViewWtf8:
37 case GenericKind::kStringViewWtf16:
38 case GenericKind::kStringViewIter:
39 case GenericKind::kExn:
40 case GenericKind::kNoExn:
41 case GenericKind::kCont:
42 case GenericKind::kNoCont:
43 return false;
44 default:
45 break;
46 }
47 }
48 }
49 return true;
50}
51
52// Define constexpr arrays.
53constexpr uint8_t LoadType::kLoadSizeLog2[];
56constexpr uint8_t StoreType::kStoreSizeLog2[];
59
60} // namespace wasm
61} // namespace internal
62} // namespace v8
static constexpr ValueType kValueType[]
static constexpr MachineType kMemType[]
static constexpr uint8_t kLoadSizeLog2[]
static constexpr ValueType kValueType[]
static constexpr uint8_t kStoreSizeLog2[]
static constexpr MachineRepresentation kMemRep[]
bool IsJSCompatibleSignature(const CanonicalSig *sig)
std::ostream & operator<<(std::ostream &os, LiftoffVarState slot)
constexpr IndependentValueType kWasmS128
kWasmInternalFunctionIndirectPointerTag kProtectedInstanceDataOffset sig
Definition c-api.cc:87