Coverage Report

Created: 2026-11-12 06:35

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/WasmEdge/lib/llvm/compiler/function_compiler.h
Line
Count
Source
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright The WasmEdge Authors
3
#pragma once
4
5
#include "compiler/context.h"
6
7
#include <cstdint>
8
#include <tuple>
9
#include <unordered_map>
10
#include <utility>
11
#include <vector>
12
13
namespace WasmEdge {
14
15
class FunctionCompiler {
16
  struct Control;
17
18
public:
19
  FunctionCompiler(LLVM::Compiler::CompileContext &Context,
20
                   LLVM::FunctionCallee F, Span<const ValType> Locals,
21
                   bool Interruptible, bool InstructionCounting,
22
                   bool GasMeasuring, bool IsLazyJIT, bool StackCheck) noexcept;
23
24
  LLVM::BasicBlock getTrapBB(ErrCode::Value Error) noexcept;
25
26
  Expect<void>
27
  compile(const AST::CodeSegment &Code,
28
          std::pair<std::vector<ValType>, std::vector<ValType>> Type) noexcept;
29
30
  Expect<void> compile(AST::InstrView Instrs) noexcept;
31
  Expect<void> compileAtomicOp(const AST::Instruction &Instr) noexcept;
32
  Expect<void> compileVectorOp(const AST::Instruction &Instr) noexcept;
33
  Expect<void> compileMemoryOp(const AST::Instruction &Instr) noexcept;
34
  Expect<void> compileNumericOp(const AST::Instruction &Instr) noexcept;
35
  Expect<void> compileRefOp(const AST::Instruction &Instr) noexcept;
36
  void compileSignedTrunc(LLVM::Type IntType) noexcept;
37
  void compileSignedTruncSat(LLVM::Type IntType) noexcept;
38
  void compileUnsignedTrunc(LLVM::Type IntType) noexcept;
39
  void compileUnsignedTruncSat(LLVM::Type IntType) noexcept;
40
41
  void compileAtomicCheckOffsetAlignment(LLVM::Value Offset,
42
                                         LLVM::Type IntType) noexcept;
43
44
  void compileMemoryFence() noexcept;
45
  void compileAtomicNotify(unsigned MemoryIndex,
46
                           uint64_t MemoryOffset) noexcept;
47
  void compileAtomicWait(unsigned MemoryIndex, uint64_t MemoryOffset,
48
                         LLVM::Type TargetType, uint32_t BitWidth) noexcept;
49
  void compileAtomicLoad(unsigned MemoryIndex, uint64_t MemoryOffset,
50
                         unsigned Alignment, LLVM::Type IntType,
51
                         LLVM::Type TargetType, bool Signed = false) noexcept;
52
  void compileAtomicStore(unsigned MemoryIndex, uint64_t MemoryOffset,
53
                          unsigned Alignment, LLVM::Type, LLVM::Type TargetType,
54
                          bool Signed = false) noexcept;
55
56
  void compileAtomicRMWOp(unsigned MemoryIndex, uint64_t MemoryOffset,
57
                          [[maybe_unused]] unsigned Alignment,
58
                          LLVMAtomicRMWBinOp BinOp, LLVM::Type IntType,
59
                          LLVM::Type TargetType, bool Signed = false) noexcept;
60
  void compileAtomicCompareExchange(unsigned MemoryIndex, uint64_t MemoryOffset,
61
                                    [[maybe_unused]] unsigned Alignment,
62
                                    LLVM::Type IntType, LLVM::Type TargetType,
63
                                    bool Signed = false) noexcept;
64
65
  void compileReturn() noexcept;
66
67
  void checkStackLimit() noexcept;
68
69
  void updateInstrCount() noexcept;
70
71
  void updateGas() noexcept;
72
73
  void updateGasAtTrap() noexcept;
74
75
private:
76
  void compileTryTableOp(const AST::Instruction &Instr) noexcept;
77
78
  void compileThrowOp(const uint32_t TagIndex) noexcept;
79
80
  void compileThrowRefOp() noexcept;
81
82
  void compileCallOp(const unsigned int FuncIndex) noexcept;
83
84
  void compileIndirectCallOp(const uint32_t TableIndex,
85
                             const uint32_t FuncTypeIndex) noexcept;
86
87
  void compileReturnCallOp(const unsigned int FuncIndex) noexcept;
88
89
  void compileReturnIndirectCallOp(const uint32_t TableIndex,
90
                                   const uint32_t FuncTypeIndex) noexcept;
91
92
  void compileCallRefOp(const unsigned int TypeIndex) noexcept;
93
94
  void compileReturnCallRefOp(const unsigned int TypeIndex) noexcept;
95
96
  void boundsCheckMemory64(unsigned MemoryIndex, LLVM::Value Addr,
97
                           uint64_t Offset, uint64_t AccessSize) noexcept;
98
  void compileLoadOp(unsigned MemoryIndex, uint64_t Offset, unsigned Alignment,
99
                     LLVM::Type LoadTy) noexcept;
100
  void compileLoadOp(unsigned MemoryIndex, uint64_t Offset, unsigned Alignment,
101
                     LLVM::Type LoadTy, LLVM::Type ExtendTy,
102
                     bool Signed) noexcept;
103
  void compileVectorLoadOp(unsigned MemoryIndex, uint64_t Offset,
104
                           unsigned Alignment, LLVM::Type LoadTy) noexcept;
105
  void compileVectorLoadOp(unsigned MemoryIndex, uint64_t Offset,
106
                           unsigned Alignment, LLVM::Type LoadTy,
107
                           LLVM::Type ExtendTy, bool Signed) noexcept;
108
  void compileSplatLoadOp(unsigned MemoryIndex, uint64_t Offset,
109
                          unsigned Alignment, LLVM::Type LoadTy,
110
                          LLVM::Type VectorTy) noexcept;
111
  void compileLoadLaneOp(unsigned MemoryIndex, uint64_t Offset,
112
                         unsigned Alignment, unsigned Index, LLVM::Type LoadTy,
113
                         LLVM::Type VectorTy) noexcept;
114
  void compileStoreOp(uint32_t MemoryIndex, uint64_t Offset, uint32_t Alignment,
115
                      LLVM::Type LoadTy, bool Trunc = false,
116
                      bool BitCast = false) noexcept;
117
  void compileStoreLaneOp(uint32_t MemoryIndex, uint64_t Offset,
118
                          uint32_t Alignment, uint8_t Index, LLVM::Type LoadTy,
119
                          LLVM::Type VectorTy) noexcept;
120
  void compileSplatOp(LLVM::Type VectorTy) noexcept;
121
  void compileExtractLaneOp(LLVM::Type VectorTy, unsigned Index) noexcept;
122
  void compileExtractLaneOp(LLVM::Type VectorTy, unsigned Index,
123
                            LLVM::Type ExtendTy, bool Signed) noexcept;
124
  void compileReplaceLaneOp(LLVM::Type VectorTy, unsigned Index) noexcept;
125
  void compileVectorCompareOp(LLVM::Type VectorTy,
126
                              LLVMIntPredicate Predicate) noexcept;
127
  void compileVectorCompareOp(LLVM::Type VectorTy, LLVMRealPredicate Predicate,
128
                              LLVM::Type ResultTy) noexcept;
129
  template <typename Func>
130
27.2k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
27.2k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
27.2k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
27.2k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorAbs(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorAbs(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
2.44k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
2.44k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
2.44k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
2.44k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorConvertS(WasmEdge::LLVM::Type, WasmEdge::LLVM::Type, bool)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorConvertS(WasmEdge::LLVM::Type, WasmEdge::LLVM::Type, bool)::$_0&&)
Line
Count
Source
130
635
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
635
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
635
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
635
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorConvertU(WasmEdge::LLVM::Type, WasmEdge::LLVM::Type, bool)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorConvertU(WasmEdge::LLVM::Type, WasmEdge::LLVM::Type, bool)::$_0&&)
Line
Count
Source
130
1.72k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
1.72k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
1.72k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
1.72k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorDemote()::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorDemote()::$_0&&)
Line
Count
Source
130
710
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
710
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
710
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
710
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorExtAddPairwise(WasmEdge::LLVM::Type, bool)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorExtAddPairwise(WasmEdge::LLVM::Type, bool)::$_0&&)
Line
Count
Source
130
2.65k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
2.65k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
2.65k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
2.65k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorFAbs(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorFAbs(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
557
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
557
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
557
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
557
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorFCeil(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorFCeil(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
1.66k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
1.66k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
1.66k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
1.66k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorFFloor(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorFFloor(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
2.68k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
2.68k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
2.68k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
2.68k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorFNearest(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorFNearest(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
435
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
435
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
435
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
435
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorFNeg(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorFNeg(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
781
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
781
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
781
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
781
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorFSqrt(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorFSqrt(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
233
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
233
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
233
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
233
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorFTrunc(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorFTrunc(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
1.94k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
1.94k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
1.94k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
1.94k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorNeg(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorNeg(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
130
3.09k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
3.09k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
3.09k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
3.09k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorPopcnt()::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorPopcnt()::$_0&&)
Line
Count
Source
130
126
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
126
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
126
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
126
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorPromote()::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorPromote()::$_0&&)
Line
Count
Source
130
760
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
760
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
760
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
760
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorTruncSatS32(WasmEdge::LLVM::Type, bool)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorTruncSatS32(WasmEdge::LLVM::Type, bool)::$_0&&)
Line
Count
Source
130
851
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
851
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
851
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
851
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorOp<WasmEdge::FunctionCompiler::compileVectorTruncSatU32(WasmEdge::LLVM::Type, bool)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorTruncSatU32(WasmEdge::LLVM::Type, bool)::$_0&&)
Line
Count
Source
130
5.93k
  void compileVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
131
5.93k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
132
5.93k
    Stack.back() = Builder.createBitCast(Op(V), Context.Int64x2Ty);
133
5.93k
  }
134
  void compileVectorAbs(LLVM::Type VectorTy) noexcept;
135
  void compileVectorNeg(LLVM::Type VectorTy) noexcept;
136
  void compileVectorPopcnt() noexcept;
137
  template <typename Func>
138
1.99k
  void compileVectorReduceIOp(LLVM::Type VectorTy, Func &&Op) noexcept {
139
1.99k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
140
1.99k
    Stack.back() = Builder.createZExt(Op(V), Context.Int32Ty);
141
1.99k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorReduceIOp<WasmEdge::FunctionCompiler::compileVectorAllTrue(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorAllTrue(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
138
815
  void compileVectorReduceIOp(LLVM::Type VectorTy, Func &&Op) noexcept {
139
815
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
140
815
    Stack.back() = Builder.createZExt(Op(V), Context.Int32Ty);
141
815
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorReduceIOp<WasmEdge::FunctionCompiler::compileVectorAnyTrue()::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorAnyTrue()::$_0&&)
Line
Count
Source
138
133
  void compileVectorReduceIOp(LLVM::Type VectorTy, Func &&Op) noexcept {
139
133
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
140
133
    Stack.back() = Builder.createZExt(Op(V), Context.Int32Ty);
141
133
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorReduceIOp<WasmEdge::FunctionCompiler::compileVectorBitMask(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorBitMask(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
138
1.04k
  void compileVectorReduceIOp(LLVM::Type VectorTy, Func &&Op) noexcept {
139
1.04k
    auto V = Builder.createBitCast(Stack.back(), VectorTy);
140
1.04k
    Stack.back() = Builder.createZExt(Op(V), Context.Int32Ty);
141
1.04k
  }
142
  void compileVectorAnyTrue() noexcept;
143
  void compileVectorAllTrue(LLVM::Type VectorTy) noexcept;
144
  void compileVectorBitMask(LLVM::Type VectorTy) noexcept;
145
  template <typename Func>
146
3.89k
  void compileVectorShiftOp(LLVM::Type VectorTy, Func &&Op) noexcept {
147
3.89k
    const bool Trunc = VectorTy.getElementType().getIntegerBitWidth() < 32;
148
3.89k
    const uint32_t Mask = VectorTy.getElementType().getIntegerBitWidth() - 1;
149
3.89k
    auto N = Builder.createAnd(stackPop(), LLContext.getInt32(Mask));
150
3.89k
    auto RHS = Builder.createVectorSplat(
151
3.89k
        VectorTy.getVectorSize(),
152
3.89k
        Trunc ? Builder.createTrunc(N, VectorTy.getElementType())
153
3.89k
              : Builder.createZExtOrTrunc(N, VectorTy.getElementType()));
154
3.89k
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
155
3.89k
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
156
3.89k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorShiftOp<WasmEdge::FunctionCompiler::compileVectorAShr(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorAShr(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
146
1.87k
  void compileVectorShiftOp(LLVM::Type VectorTy, Func &&Op) noexcept {
147
1.87k
    const bool Trunc = VectorTy.getElementType().getIntegerBitWidth() < 32;
148
1.87k
    const uint32_t Mask = VectorTy.getElementType().getIntegerBitWidth() - 1;
149
1.87k
    auto N = Builder.createAnd(stackPop(), LLContext.getInt32(Mask));
150
1.87k
    auto RHS = Builder.createVectorSplat(
151
1.87k
        VectorTy.getVectorSize(),
152
1.87k
        Trunc ? Builder.createTrunc(N, VectorTy.getElementType())
153
1.87k
              : Builder.createZExtOrTrunc(N, VectorTy.getElementType()));
154
1.87k
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
155
1.87k
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
156
1.87k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorShiftOp<WasmEdge::FunctionCompiler::compileVectorLShr(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorLShr(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
146
692
  void compileVectorShiftOp(LLVM::Type VectorTy, Func &&Op) noexcept {
147
692
    const bool Trunc = VectorTy.getElementType().getIntegerBitWidth() < 32;
148
692
    const uint32_t Mask = VectorTy.getElementType().getIntegerBitWidth() - 1;
149
692
    auto N = Builder.createAnd(stackPop(), LLContext.getInt32(Mask));
150
692
    auto RHS = Builder.createVectorSplat(
151
692
        VectorTy.getVectorSize(),
152
692
        Trunc ? Builder.createTrunc(N, VectorTy.getElementType())
153
692
              : Builder.createZExtOrTrunc(N, VectorTy.getElementType()));
154
692
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
155
692
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
156
692
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorShiftOp<WasmEdge::FunctionCompiler::compileVectorShl(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorShl(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
146
1.33k
  void compileVectorShiftOp(LLVM::Type VectorTy, Func &&Op) noexcept {
147
1.33k
    const bool Trunc = VectorTy.getElementType().getIntegerBitWidth() < 32;
148
1.33k
    const uint32_t Mask = VectorTy.getElementType().getIntegerBitWidth() - 1;
149
1.33k
    auto N = Builder.createAnd(stackPop(), LLContext.getInt32(Mask));
150
1.33k
    auto RHS = Builder.createVectorSplat(
151
1.33k
        VectorTy.getVectorSize(),
152
1.33k
        Trunc ? Builder.createTrunc(N, VectorTy.getElementType())
153
1.33k
              : Builder.createZExtOrTrunc(N, VectorTy.getElementType()));
154
1.33k
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
155
1.33k
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
156
1.33k
  }
157
  void compileVectorShl(LLVM::Type VectorTy) noexcept;
158
  void compileVectorLShr(LLVM::Type VectorTy) noexcept;
159
  void compileVectorAShr(LLVM::Type VectorTy) noexcept;
160
  template <typename Func>
161
7.01k
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
7.01k
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
7.01k
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
7.01k
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
7.01k
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorAdd(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorAdd(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
349
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
349
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
349
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
349
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
349
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorAddSat(WasmEdge::LLVM::Type, bool)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorAddSat(WasmEdge::LLVM::Type, bool)::$_0&&)
Line
Count
Source
161
887
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
887
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
887
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
887
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
887
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorFAdd(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorFAdd(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
171
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
171
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
171
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
171
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
171
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorFDiv(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorFDiv(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
195
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
195
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
195
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
195
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
195
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorFMax(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorFMax(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
206
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
206
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
206
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
206
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
206
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorFMin(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorFMin(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
334
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
334
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
334
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
334
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
334
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorFMul(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorFMul(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
216
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
216
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
216
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
216
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
216
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorFPMax(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorFPMax(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
309
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
309
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
309
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
309
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
309
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorFPMin(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorFPMin(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
326
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
326
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
326
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
326
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
326
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorFSub(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorFSub(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
461
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
461
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
461
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
461
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
461
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorMul(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorMul(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
426
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
426
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
426
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
426
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
426
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorQ15MulSat()::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorQ15MulSat()::$_0&&)
Line
Count
Source
161
156
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
156
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
156
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
156
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
156
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorSMax(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorSMax(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
474
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
474
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
474
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
474
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
474
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorSMin(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorSMin(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
272
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
272
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
272
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
272
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
272
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorSub(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorSub(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
655
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
655
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
655
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
655
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
655
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorSubSat(WasmEdge::LLVM::Type, bool)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorSubSat(WasmEdge::LLVM::Type, bool)::$_0&&)
Line
Count
Source
161
374
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
374
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
374
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
374
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
374
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorUAvgr(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorUAvgr(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
253
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
253
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
253
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
253
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
253
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorUMax(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorUMax(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
691
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
691
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
691
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
691
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
691
  }
vectorInstr.cpp:void WasmEdge::FunctionCompiler::compileVectorVectorOp<WasmEdge::FunctionCompiler::compileVectorVectorUMin(WasmEdge::LLVM::Type)::$_0>(WasmEdge::LLVM::Type, WasmEdge::FunctionCompiler::compileVectorVectorUMin(WasmEdge::LLVM::Type)::$_0&&)
Line
Count
Source
161
258
  void compileVectorVectorOp(LLVM::Type VectorTy, Func &&Op) noexcept {
162
258
    auto RHS = Builder.createBitCast(stackPop(), VectorTy);
163
258
    auto LHS = Builder.createBitCast(stackPop(), VectorTy);
164
258
    stackPush(Builder.createBitCast(Op(LHS, RHS), Context.Int64x2Ty));
165
258
  }
166
  void compileVectorVectorAdd(LLVM::Type VectorTy) noexcept;
167
  void compileVectorVectorAddSat(LLVM::Type VectorTy, bool Signed) noexcept;
168
  void compileVectorVectorSub(LLVM::Type VectorTy) noexcept;
169
  void compileVectorVectorSubSat(LLVM::Type VectorTy, bool Signed) noexcept;
170
  void compileVectorVectorMul(LLVM::Type VectorTy) noexcept;
171
  void compileVectorSwizzle() noexcept;
172
173
  void compileVectorVectorQ15MulSat() noexcept;
174
  void compileVectorVectorSMin(LLVM::Type VectorTy) noexcept;
175
  void compileVectorVectorUMin(LLVM::Type VectorTy) noexcept;
176
  void compileVectorVectorSMax(LLVM::Type VectorTy) noexcept;
177
  void compileVectorVectorUMax(LLVM::Type VectorTy) noexcept;
178
  void compileVectorVectorUAvgr(LLVM::Type VectorTy) noexcept;
179
  void compileVectorNarrow(LLVM::Type FromTy, bool Signed) noexcept;
180
  void compileVectorExtend(LLVM::Type FromTy, bool Signed, bool Low) noexcept;
181
  void compileVectorExtMul(LLVM::Type FromTy, bool Signed, bool Low) noexcept;
182
  void compileVectorExtAddPairwise(LLVM::Type VectorTy, bool Signed) noexcept;
183
  void compileVectorFAbs(LLVM::Type VectorTy) noexcept;
184
  void compileVectorFNeg(LLVM::Type VectorTy) noexcept;
185
  void compileVectorFSqrt(LLVM::Type VectorTy) noexcept;
186
  void compileVectorFCeil(LLVM::Type VectorTy) noexcept;
187
  void compileVectorFFloor(LLVM::Type VectorTy) noexcept;
188
  void compileVectorFTrunc(LLVM::Type VectorTy) noexcept;
189
  void compileVectorFNearest(LLVM::Type VectorTy) noexcept;
190
  void compileVectorVectorFAdd(LLVM::Type VectorTy) noexcept;
191
  void compileVectorVectorFSub(LLVM::Type VectorTy) noexcept;
192
  void compileVectorVectorFMul(LLVM::Type VectorTy) noexcept;
193
  void compileVectorVectorFDiv(LLVM::Type VectorTy) noexcept;
194
  void compileVectorVectorFMin(LLVM::Type VectorTy) noexcept;
195
  void compileVectorVectorFMax(LLVM::Type VectorTy) noexcept;
196
  LLVM::Value compileVectorQuietBit(LLVM::Value Vector) noexcept;
197
  void compileVectorVectorFPMin(LLVM::Type VectorTy) noexcept;
198
  void compileVectorVectorFPMax(LLVM::Type VectorTy) noexcept;
199
  void compileVectorTruncSatS32(LLVM::Type VectorTy, bool PadZero) noexcept;
200
  void compileVectorTruncSatU32(LLVM::Type VectorTy, bool PadZero) noexcept;
201
  void compileVectorConvertS(LLVM::Type VectorTy, LLVM::Type FPVectorTy,
202
                             bool Low) noexcept;
203
  void compileVectorConvertU(LLVM::Type VectorTy, LLVM::Type FPVectorTy,
204
                             bool Low) noexcept;
205
  void compileVectorDemote() noexcept;
206
  void compileVectorPromote() noexcept;
207
208
  void compileVectorVectorMAdd(LLVM::Type VectorTy) noexcept;
209
210
  void compileVectorVectorNMAdd(LLVM::Type VectorTy) noexcept;
211
212
  void compileVectorRelaxedIntegerDotProduct() noexcept;
213
214
  void compileVectorRelaxedIntegerDotProductAdd() noexcept;
215
216
  void
217
  enterBlock(LLVM::BasicBlock JumpBlock, LLVM::BasicBlock NextBlock,
218
             LLVM::BasicBlock ElseBlock, std::vector<LLVM::Value> Args,
219
             std::pair<std::vector<ValType>, std::vector<ValType>> Type,
220
             std::vector<std::tuple<std::vector<LLVM::Value>, LLVM::BasicBlock>>
221
                 ReturnPHI = {}) noexcept;
222
223
  Control leaveBlock() noexcept;
224
225
  void checkStop() noexcept;
226
227
  void checkPendingException() noexcept;
228
229
  void setUnreachable() noexcept;
230
231
  bool isUnreachable() const noexcept;
232
233
  void
234
  buildPHI(Span<const ValType> RetType,
235
           Span<const std::tuple<std::vector<LLVM::Value>, LLVM::BasicBlock>>
236
               Incomings) noexcept;
237
238
  void setLableJumpPHI(unsigned int Index) noexcept;
239
240
  LLVM::BasicBlock getLabel(unsigned int Index) const noexcept;
241
242
  LLVM::BasicBlock getEHDispatchTarget() noexcept;
243
244
  LLVM::Value getTmpValues(size_t Num) noexcept;
245
  void endTmpValues() noexcept;
246
247
839k
  void stackPush(LLVM::Value Value) noexcept { Stack.push_back(Value); }
248
  LLVM::Value stackPop() noexcept;
249
250
  LLVM::Value switchEndian(LLVM::Value Value);
251
252
  LLVM::Compiler::CompileContext &Context;
253
  LLVM::Context LLContext;
254
  std::vector<std::pair<LLVM::Type, LLVM::Value>> Local;
255
  std::vector<LLVM::Value> Stack;
256
  LLVM::Value LocalInstrCount = nullptr;
257
  LLVM::Value LocalGas = nullptr;
258
  // Entry-block slot reused by every call that resolves its callee at runtime.
259
  // Only entry-block allocas become static frame slots; one inside a loop body
260
  // grows the native stack on every iteration.
261
  LLVM::Value CalleeCtxSlot = nullptr;
262
  // Entry-block buffer for the temporary values passed to or from the runtime.
263
  LLVM::Value TmpValues = nullptr;
264
  size_t TmpValuesSize = 0;
265
  uint64_t TmpValuesUsed = 0;
266
  std::unordered_map<ErrCode::Value, LLVM::BasicBlock> TrapBB;
267
  bool IsUnreachable = false;
268
  bool Interruptible = false;
269
  struct Control {
270
    size_t StackSize;
271
    bool Unreachable;
272
    LLVM::BasicBlock JumpBlock;
273
    LLVM::BasicBlock NextBlock;
274
    LLVM::BasicBlock ElseBlock;
275
    LLVM::BasicBlock TryDispatchBB;
276
    std::vector<LLVM::Value> Args;
277
    std::pair<std::vector<ValType>, std::vector<ValType>> Type;
278
    std::vector<std::tuple<std::vector<LLVM::Value>, LLVM::BasicBlock>>
279
        ReturnPHI;
280
    Control(size_t S, bool U, LLVM::BasicBlock J, LLVM::BasicBlock N,
281
            LLVM::BasicBlock E, std::vector<LLVM::Value> A,
282
            std::pair<std::vector<ValType>, std::vector<ValType>> T,
283
            std::vector<std::tuple<std::vector<LLVM::Value>, LLVM::BasicBlock>>
284
                R) noexcept
285
22.7k
        : StackSize(S), Unreachable(U), JumpBlock(J), NextBlock(N),
286
22.7k
          ElseBlock(E), TryDispatchBB(), Args(std::move(A)), Type(std::move(T)),
287
22.7k
          ReturnPHI(std::move(R)) {}
288
    Control(const Control &) = default;
289
28.1k
    Control(Control &&) = default;
290
    Control &operator=(const Control &) = default;
291
1.46k
    Control &operator=(Control &&) = default;
292
  };
293
  bool IsLazyJIT;
294
  std::vector<Control> ControlStack;
295
  LLVM::FunctionCallee F;
296
  LLVM::Value ModCtx;
297
  LLVM::Value ExecCtx;
298
  LLVM::BasicBlock UnwindBB;
299
  LLVM::Builder Builder;
300
};
301
302
} // namespace WasmEdge