v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
wasm-opcodes.h File Reference
#include <memory>
#include "src/common/globals.h"
#include "src/common/message-template.h"
#include "src/wasm/value-type.h"
#include "src/wasm/wasm-constants.h"
Include dependency graph for wasm-opcodes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  v8::internal::wasm::WasmOpcodes
 

Namespaces

namespace  v8
 
namespace  v8::internal
 
namespace  v8::internal::wasm
 

Macros

#define FOREACH_CONTROL_OPCODE(V)
 
#define FOREACH_MISC_OPCODE(V)
 
#define FOREACH_LOAD_MEM_OPCODE(V)
 
#define FOREACH_STORE_MEM_OPCODE(V)
 
#define FOREACH_MISC_MEM_OPCODE(V)
 
#define FOREACH_SIMPLE_EXTENDED_CONST_OPCODE(V)
 
#define FOREACH_SIMPLE_NON_CONST_OPCODE(V)
 
#define FOREACH_WASMFX_OPCODE(V)
 
#define FOREACH_SIMPLE_OPCODE(V)
 
#define FOREACH_SIMPLE_PROTOTYPE_OPCODE(V)
 
#define FOREACH_ASMJS_COMPAT_OPCODE(V)
 
#define FOREACH_SIMD_MEM_OPCODE(V)
 
#define FOREACH_SIMD_MEM_1_OPERAND_OPCODE(V)
 
#define FOREACH_SIMD_CONST_OPCODE(V)
 
#define FOREACH_SIMD_MASK_OPERAND_OPCODE(V)
 
#define FOREACH_SIMD_MVP_0_OPERAND_OPCODE(V)
 
#define FOREACH_RELAXED_SIMD_OPCODE(V)
 
#define FOREACH_SIMD_1_OPERAND_1_PARAM_OPCODE(V)
 
#define FOREACH_SIMD_1_OPERAND_2_PARAM_OPCODE(V)
 
#define FOREACH_SIMD_0_OPERAND_OPCODE(V)
 
#define FOREACH_SIMD_1_OPERAND_OPCODE(V)
 
#define FOREACH_SIMD_OPCODE(V)
 
#define FOREACH_NUMERIC_OPCODE_WITH_SIG(V)
 
#define FOREACH_NUMERIC_OPCODE_VARIADIC(V)
 
#define FOREACH_NUMERIC_OPCODE(V)
 
#define FOREACH_ATOMIC_OPCODE(V)
 
#define FOREACH_ATOMIC_0_OPERAND_OPCODE(V)
 
#define FOREACH_GC_OPCODE(V)
 
#define FOREACH_OPCODE(V)
 
#define FOREACH_SIGNATURE(V)
 
#define FOREACH_SIMD_SIGNATURE(V)
 
#define FOREACH_PREFIX(V)
 
#define DECLARE_NAMED_ENUM(name, opcode, ...)
 
#define DECLARE_PREFIX(name, opcode)
 
#define DECLARE_ENUM(name)
 

Enumerations

enum  v8::internal::wasm::WasmOpcode
 
enum  v8::internal::wasm::TrapReason { v8::internal::wasm::kTrapCount }
 

Functions

std::ostream & v8::internal::wasm::operator<< (std::ostream &os, const FunctionSig &sig)
 
bool v8::internal::wasm::IsJSCompatibleSignature (const CanonicalSig *sig)
 

Macro Definition Documentation

◆ DECLARE_ENUM

#define DECLARE_ENUM ( name)
Value:
k##name,
const char * name
Definition builtins.cc:39

Definition at line 940 of file wasm-opcodes.h.

◆ DECLARE_NAMED_ENUM

#define DECLARE_NAMED_ENUM ( name,
opcode,
... )
Value:
kExpr##name = opcode,

Definition at line 931 of file wasm-opcodes.h.

◆ DECLARE_PREFIX

#define DECLARE_PREFIX ( name,
opcode )
Value:
k##name##Prefix = opcode,

Definition at line 934 of file wasm-opcodes.h.

◆ FOREACH_ASMJS_COMPAT_OPCODE

#define FOREACH_ASMJS_COMPAT_OPCODE ( V)

Definition at line 275 of file wasm-opcodes.h.

◆ FOREACH_ATOMIC_0_OPERAND_OPCODE

#define FOREACH_ATOMIC_0_OPERAND_OPCODE ( V)
Value:
/* AtomicFence does not target a particular linear memory. */ \
V(AtomicFence, 0xfe03, v_v, "atomic.fence", v_v)

Definition at line 733 of file wasm-opcodes.h.

◆ FOREACH_ATOMIC_OPCODE

#define FOREACH_ATOMIC_OPCODE ( V)

Definition at line 660 of file wasm-opcodes.h.

◆ FOREACH_CONTROL_OPCODE

#define FOREACH_CONTROL_OPCODE ( V)
Value:
V(Unreachable, 0x00, _, "unreachable") \
V(Nop, 0x01, _, "nop") \
V(Block, 0x02, _, "block") \
V(Loop, 0x03, _, "loop") \
V(If, 0x04, _, "if") \
V(Else, 0x05, _, "else") \
V(Try, 0x06, _, "try") \
V(Catch, 0x07, _, "catch") \
V(Throw, 0x08, _, "throw") \
V(Rethrow, 0x09, _, "rethrow") \
V(TryTable, 0x1f, _, "try_table") \
V(ThrowRef, 0x0a, _, "throw_ref") \
V(End, 0x0b, _, "end") \
V(Br, 0x0c, _, "br") \
V(BrIf, 0x0d, _, "br_if") \
V(BrTable, 0x0e, _, "br_table") \
V(Return, 0x0f, _, "return") \
V(Delegate, 0x18, _, "delegate") \
V(CatchAll, 0x19, _, "catch_all") \
V(BrOnNull, 0xd5, _, "br_on_null") \
V(BrOnNonNull, 0xd6, _, "br_on_non_null") \
V(NopForTestingUnsupportedInLiftoff, 0x16, _, "nop_for_testing")
#define V(Name)
#define _

Definition at line 34 of file wasm-opcodes.h.

◆ FOREACH_GC_OPCODE

#define FOREACH_GC_OPCODE ( V)

Definition at line 737 of file wasm-opcodes.h.

◆ FOREACH_LOAD_MEM_OPCODE

#define FOREACH_LOAD_MEM_OPCODE ( V)
Value:
V(I32LoadMem, 0x28, i_i, "i32.load") \
V(I64LoadMem, 0x29, l_i, "i64.load") \
V(F32LoadMem, 0x2a, f_i, "f32.load") \
V(F64LoadMem, 0x2b, d_i, "f64.load") \
V(I32LoadMem8S, 0x2c, i_i, "i32.load8_s") \
V(I32LoadMem8U, 0x2d, i_i, "i32.load8_u") \
V(I32LoadMem16S, 0x2e, i_i, "i32.load16_s") \
V(I32LoadMem16U, 0x2f, i_i, "i32.load16_u") \
V(I64LoadMem8S, 0x30, l_i, "i64.load8_s") \
V(I64LoadMem8U, 0x31, l_i, "i64.load8_u") \
V(I64LoadMem16S, 0x32, l_i, "i64.load16_s") \
V(I64LoadMem16U, 0x33, l_i, "i64.load16_u") \
V(I64LoadMem32S, 0x34, l_i, "i64.load32_s") \
V(I64LoadMem32U, 0x35, l_i, "i64.load32_u") \
V(F32LoadMemF16, 0xfc30, f_i, "f32.load_f16")

Definition at line 87 of file wasm-opcodes.h.

◆ FOREACH_MISC_MEM_OPCODE

#define FOREACH_MISC_MEM_OPCODE ( V)
Value:
V(MemorySize, 0x3f, i_v, "memory.size") \
V(MemoryGrow, 0x40, i_i, "memory.grow")

Definition at line 118 of file wasm-opcodes.h.

◆ FOREACH_MISC_OPCODE

#define FOREACH_MISC_OPCODE ( V)
Value:
V(CallFunction, 0x10, _, "call") \
V(CallIndirect, 0x11, _, "call_indirect") \
V(ReturnCall, 0x12, _, "return_call") \
V(ReturnCallIndirect, 0x13, _, "return_call_indirect") \
V(CallRef, 0x14, _, "call_ref") \
V(ReturnCallRef, 0x15, _, "return_call_ref") \
V(Drop, 0x1a, _, "drop") \
V(Select, 0x1b, _, "select") \
V(SelectWithType, 0x1c, _, "select") \
V(LocalGet, 0x20, _, "local.get") \
V(LocalSet, 0x21, _, "local.set") \
V(LocalTee, 0x22, _, "local.tee") \
V(GlobalGet, 0x23, _, "global.get") \
V(GlobalSet, 0x24, _, "global.set") \
V(TableGet, 0x25, _, "table.get") \
V(TableSet, 0x26, _, "table.set") \
V(I32Const, 0x41, _, "i32.const") \
V(I64Const, 0x42, _, "i64.const") \
V(F32Const, 0x43, _, "f32.const") \
V(F64Const, 0x44, _, "f64.const") \
V(RefNull, 0xd0, _, "ref.null") \
V(RefIsNull, 0xd1, _, "ref.is_null") \
V(RefFunc, 0xd2, _, "ref.func") \
V(RefAsNonNull, 0xd4, _, "ref.as_non_null") \
V(RefEq, 0xd3, _, "ref.eq")

Definition at line 59 of file wasm-opcodes.h.

◆ FOREACH_NUMERIC_OPCODE

#define FOREACH_NUMERIC_OPCODE ( V)
Value:
#define FOREACH_NUMERIC_OPCODE_VARIADIC(V)
#define FOREACH_NUMERIC_OPCODE_WITH_SIG(V)

Definition at line 656 of file wasm-opcodes.h.

◆ FOREACH_NUMERIC_OPCODE_VARIADIC

#define FOREACH_NUMERIC_OPCODE_VARIADIC ( V)
Value:
V(MemoryInit, 0xfc08, _, "memory.init") \
V(MemoryCopy, 0xfc0a, _, "memory.copy") \
V(MemoryFill, 0xfc0b, _, "memory.fill") \
/* TableGrow is polymorphic in the first parameter. */ \
/* It's whatever the table type is. */ \
V(TableGrow, 0xfc0f, _, "table.grow") \
/* TableFill is polymorphic in the second parameter. */ \
/* It's whatever the table type is. */ \
V(TableFill, 0xfc11, _, "table.fill")

Definition at line 645 of file wasm-opcodes.h.

◆ FOREACH_NUMERIC_OPCODE_WITH_SIG

#define FOREACH_NUMERIC_OPCODE_WITH_SIG ( V)
Value:
V(I32SConvertSatF32, 0xfc00, i_f, "i32.trunc_sat_f32_s") \
V(I32UConvertSatF32, 0xfc01, i_f, "i32.trunc_sat_f32_u") \
V(I32SConvertSatF64, 0xfc02, i_d, "i32.trunc_sat_f64_s") \
V(I32UConvertSatF64, 0xfc03, i_d, "i32.trunc_sat_f64_u") \
V(I64SConvertSatF32, 0xfc04, l_f, "i64.trunc_sat_f32_s") \
V(I64UConvertSatF32, 0xfc05, l_f, "i64.trunc_sat_f32_u") \
V(I64SConvertSatF64, 0xfc06, l_d, "i64.trunc_sat_f64_s") \
V(I64UConvertSatF64, 0xfc07, l_d, "i64.trunc_sat_f64_u") \
V(DataDrop, 0xfc09, v_v, "data.drop") \
V(TableInit, 0xfc0c, v_iii, "table.init") \
V(ElemDrop, 0xfc0d, v_v, "elem.drop") \
V(TableCopy, 0xfc0e, v_iii, "table.copy") \
V(TableSize, 0xfc10, i_v, "table.size")

Definition at line 630 of file wasm-opcodes.h.

◆ FOREACH_OPCODE

#define FOREACH_OPCODE ( V)
Value:
FOREACH_MISC_OPCODE(V) \
FOREACH_SIMPLE_OPCODE(V) \
FOREACH_SIMPLE_PROTOTYPE_OPCODE(V) \
FOREACH_STORE_MEM_OPCODE(V) \
FOREACH_LOAD_MEM_OPCODE(V) \
FOREACH_MISC_MEM_OPCODE(V) \
FOREACH_ASMJS_COMPAT_OPCODE(V) \
FOREACH_SIMD_OPCODE(V) \
FOREACH_ATOMIC_OPCODE(V) \
FOREACH_ATOMIC_0_OPERAND_OPCODE(V) \
FOREACH_NUMERIC_OPCODE(V) \
FOREACH_GC_OPCODE(V) \
FOREACH_WASMFX_OPCODE(V)
#define FOREACH_CONTROL_OPCODE(V)

Definition at line 824 of file wasm-opcodes.h.

◆ FOREACH_PREFIX

#define FOREACH_PREFIX ( V)
Value:
V(AsmJs, 0xfa) \
V(GC, 0xfb) \
V(Numeric, 0xfc) \
V(Simd, 0xfd) \
V(Atomic, 0xfe)

Definition at line 905 of file wasm-opcodes.h.

◆ FOREACH_RELAXED_SIMD_OPCODE

#define FOREACH_RELAXED_SIMD_OPCODE ( V)

Definition at line 539 of file wasm-opcodes.h.

◆ FOREACH_SIGNATURE

#define FOREACH_SIGNATURE ( V)

Definition at line 841 of file wasm-opcodes.h.

◆ FOREACH_SIMD_0_OPERAND_OPCODE

#define FOREACH_SIMD_0_OPERAND_OPCODE ( V)
Value:
FOREACH_RELAXED_SIMD_OPCODE(V)
#define FOREACH_SIMD_MVP_0_OPERAND_OPCODE(V)

Definition at line 614 of file wasm-opcodes.h.

◆ FOREACH_SIMD_1_OPERAND_1_PARAM_OPCODE

#define FOREACH_SIMD_1_OPERAND_1_PARAM_OPCODE ( V)
Value:
V(I8x16ExtractLaneS, 0xfd15, _, "i8x16.extract_lane_s") \
V(I8x16ExtractLaneU, 0xfd16, _, "i8x16.extract_lane_u") \
V(I16x8ExtractLaneS, 0xfd18, _, "i16x8.extract_lane_s") \
V(I16x8ExtractLaneU, 0xfd19, _, "i16x8.extract_lane_u") \
V(I32x4ExtractLane, 0xfd1b, _, "i32x4.extract_lane") \
V(I64x2ExtractLane, 0xfd1d, _, "i64x2.extract_lane") \
V(F32x4ExtractLane, 0xfd1f, _, "f32x4.extract_lane") \
V(F64x2ExtractLane, 0xfd21, _, "f64x2.extract_lane") \
V(F16x8ExtractLane, 0xfd121, _, "f16x8.extract_lane")

Definition at line 594 of file wasm-opcodes.h.

◆ FOREACH_SIMD_1_OPERAND_2_PARAM_OPCODE

#define FOREACH_SIMD_1_OPERAND_2_PARAM_OPCODE ( V)
Value:
V(I8x16ReplaceLane, 0xfd17, _, "i8x16.replace_lane") \
V(I16x8ReplaceLane, 0xfd1a, _, "i16x8.replace_lane") \
V(I32x4ReplaceLane, 0xfd1c, _, "i32x4.replace_lane") \
V(I64x2ReplaceLane, 0xfd1e, _, "i64x2.replace_lane") \
V(F32x4ReplaceLane, 0xfd20, _, "f32x4.replace_lane") \
V(F64x2ReplaceLane, 0xfd22, _, "f64x2.replace_lane") \
V(F16x8ReplaceLane, 0xfd122, _, "f16x8.replace_lane")

Definition at line 605 of file wasm-opcodes.h.

◆ FOREACH_SIMD_1_OPERAND_OPCODE

#define FOREACH_SIMD_1_OPERAND_OPCODE ( V)
Value:
FOREACH_SIMD_1_OPERAND_2_PARAM_OPCODE(V)
#define FOREACH_SIMD_1_OPERAND_1_PARAM_OPCODE(V)

Definition at line 618 of file wasm-opcodes.h.

◆ FOREACH_SIMD_CONST_OPCODE

#define FOREACH_SIMD_CONST_OPCODE ( V)
Value:
V(S128Const, 0xfd0c, _, "v128.const")

Definition at line 334 of file wasm-opcodes.h.

◆ FOREACH_SIMD_MASK_OPERAND_OPCODE

#define FOREACH_SIMD_MASK_OPERAND_OPCODE ( V)
Value:
V(I8x16Shuffle, 0xfd0d, s_ss, "i8x16.shuffle")

Definition at line 336 of file wasm-opcodes.h.

◆ FOREACH_SIMD_MEM_1_OPERAND_OPCODE

#define FOREACH_SIMD_MEM_1_OPERAND_OPCODE ( V)
Value:
V(S128Load8Lane, 0xfd54, s_is, "v128.load8_lane") \
V(S128Load16Lane, 0xfd55, s_is, "v128.load16_lane") \
V(S128Load32Lane, 0xfd56, s_is, "v128.load32_lane") \
V(S128Load64Lane, 0xfd57, s_is, "v128.load64_lane") \
V(S128Store8Lane, 0xfd58, v_is, "v128.store8_lane") \
V(S128Store16Lane, 0xfd59, v_is, "v128.store16_lane") \
V(S128Store32Lane, 0xfd5a, v_is, "v128.store32_lane") \
V(S128Store64Lane, 0xfd5b, v_is, "v128.store64_lane")

Definition at line 324 of file wasm-opcodes.h.

◆ FOREACH_SIMD_MEM_OPCODE

#define FOREACH_SIMD_MEM_OPCODE ( V)
Value:
V(S128LoadMem, 0xfd00, s_i, "v128.load") \
V(S128Load8x8S, 0xfd01, s_i, "v128.load8x8_s") \
V(S128Load8x8U, 0xfd02, s_i, "v128.load8x8_u") \
V(S128Load16x4S, 0xfd03, s_i, "v128.load16x4_s") \
V(S128Load16x4U, 0xfd04, s_i, "v128.load16x4_u") \
V(S128Load32x2S, 0xfd05, s_i, "v128.load32x2_s") \
V(S128Load32x2U, 0xfd06, s_i, "v128.load32x2_u") \
V(S128Load8Splat, 0xfd07, s_i, "v128.load8_splat") \
V(S128Load16Splat, 0xfd08, s_i, "v128.load16_splat") \
V(S128Load32Splat, 0xfd09, s_i, "v128.load32_splat") \
V(S128Load64Splat, 0xfd0a, s_i, "v128.load64_splat") \
V(S128StoreMem, 0xfd0b, v_is, "v128.store") \
V(S128Load32Zero, 0xfd5c, s_i, "v128.load32_zero") \
V(S128Load64Zero, 0xfd5d, s_i, "v128.load64_zero")

Definition at line 308 of file wasm-opcodes.h.

◆ FOREACH_SIMD_MVP_0_OPERAND_OPCODE

#define FOREACH_SIMD_MVP_0_OPERAND_OPCODE ( V)

Definition at line 339 of file wasm-opcodes.h.

◆ FOREACH_SIMD_OPCODE

#define FOREACH_SIMD_OPCODE ( V)
Value:
FOREACH_SIMD_1_OPERAND_OPCODE(V) \
FOREACH_SIMD_MASK_OPERAND_OPCODE(V) \
FOREACH_SIMD_MEM_OPCODE(V) \
FOREACH_SIMD_MEM_1_OPERAND_OPCODE(V) \
FOREACH_SIMD_CONST_OPCODE(V)
#define FOREACH_SIMD_0_OPERAND_OPCODE(V)

Definition at line 622 of file wasm-opcodes.h.

◆ FOREACH_SIMD_SIGNATURE

#define FOREACH_SIMD_SIGNATURE ( V)
Value:
V(s_s, kWasmS128, kWasmS128) \
V(s_f, kWasmS128, kWasmF32) \
V(s_d, kWasmS128, kWasmF64) \
V(s_ss, kWasmS128, kWasmS128, kWasmS128) \
V(s_i, kWasmS128, kWasmI32) \
V(s_l, kWasmS128, kWasmI64) \
V(s_si, kWasmS128, kWasmS128, kWasmI32) \
V(i_s, kWasmI32, kWasmS128) \
V(v_is, kWasmVoid, kWasmI32, kWasmS128) \
V(s_sss, kWasmS128, kWasmS128, kWasmS128, kWasmS128) \
V(s_is, kWasmS128, kWasmI32, kWasmS128)

Definition at line 892 of file wasm-opcodes.h.

◆ FOREACH_SIMPLE_EXTENDED_CONST_OPCODE

#define FOREACH_SIMPLE_EXTENDED_CONST_OPCODE ( V)
Value:
V(I32Add, 0x6a, i_ii, "i32.add") \
V(I32Sub, 0x6b, i_ii, "i32.sub") \
V(I32Mul, 0x6c, i_ii, "i32.mul") \
V(I64Add, 0x7c, l_ll, "i64.add") \
V(I64Sub, 0x7d, l_ll, "i64.sub") \
V(I64Mul, 0x7e, l_ll, "i64.mul")

Definition at line 126 of file wasm-opcodes.h.

◆ FOREACH_SIMPLE_NON_CONST_OPCODE

#define FOREACH_SIMPLE_NON_CONST_OPCODE ( V)

Definition at line 134 of file wasm-opcodes.h.

◆ FOREACH_SIMPLE_OPCODE

#define FOREACH_SIMPLE_OPCODE ( V)
Value:
FOREACH_SIMPLE_NON_CONST_OPCODE(V)
#define FOREACH_SIMPLE_EXTENDED_CONST_OPCODE(V)

Definition at line 266 of file wasm-opcodes.h.

◆ FOREACH_SIMPLE_PROTOTYPE_OPCODE

#define FOREACH_SIMPLE_PROTOTYPE_OPCODE ( V)

Definition at line 270 of file wasm-opcodes.h.

◆ FOREACH_STORE_MEM_OPCODE

#define FOREACH_STORE_MEM_OPCODE ( V)
Value:
V(I32StoreMem, 0x36, v_ii, "i32.store") \
V(I64StoreMem, 0x37, v_il, "i64.store") \
V(F32StoreMem, 0x38, v_if, "f32.store") \
V(F64StoreMem, 0x39, v_id, "f64.store") \
V(I32StoreMem8, 0x3a, v_ii, "i32.store8") \
V(I32StoreMem16, 0x3b, v_ii, "i32.store16") \
V(I64StoreMem8, 0x3c, v_il, "i64.store8") \
V(I64StoreMem16, 0x3d, v_il, "i64.store16") \
V(I64StoreMem32, 0x3e, v_il, "i64.store32") \
V(F32StoreMemF16, 0xfc31, v_if, "f32.store_f16")

Definition at line 105 of file wasm-opcodes.h.

◆ FOREACH_WASMFX_OPCODE

#define FOREACH_WASMFX_OPCODE ( V)
Value:
V(ContNew, 0xe0, _, "cont.new") \
V(ContBind, 0xe1, _, "cont.bind") \
V(Suspend, 0xe2, _, "suspend") \
V(Resume, 0xe3, _, "resume") \
V(ResumeThrow, 0xe4, _, "resume_throw") \
V(Switch, 0xe5, _, "switch")

Definition at line 258 of file wasm-opcodes.h.