summaryrefslogtreecommitdiff
path: root/vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go')
-rw-r--r--vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go
index 67f196b8b..7f76b1e52 100644
--- a/vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go
+++ b/vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go
@@ -777,6 +777,16 @@ const (
OpcodeAtomicI64Rmw32CmpxchgU OpcodeAtomic = 0x4e
)
+// OpcodeTailCall represents an opcode of a tail call instructions.
+//
+// These opcodes are toggled with CoreFeaturesTailCall.
+type OpcodeTailCall = byte
+
+const (
+ OpcodeTailCallReturnCall OpcodeTailCall = 0x12
+ OpcodeTailCallReturnCallIndirect OpcodeTailCall = 0x13
+)
+
const (
OpcodeUnreachableName = "unreachable"
OpcodeNopName = "nop"
@@ -1864,3 +1874,18 @@ var atomicInstructionName = map[OpcodeAtomic]string{
func AtomicInstructionName(oc OpcodeAtomic) (ret string) {
return atomicInstructionName[oc]
}
+
+const (
+ OpcodeTailCallReturnCallName = "return_call"
+ OpcodeTailCallReturnCallIndirectName = "return_call_indirect"
+)
+
+var tailCallInstructionName = map[OpcodeTailCall]string{
+ OpcodeTailCallReturnCall: OpcodeTailCallReturnCallName,
+ OpcodeTailCallReturnCallIndirect: OpcodeTailCallReturnCallIndirectName,
+}
+
+// TailCallInstructionName returns the instruction name corresponding to the tail call Opcode.
+func TailCallInstructionName(oc OpcodeTailCall) (ret string) {
+ return tailCallInstructionName[oc]
+}