From 7fd8d164030819cfe580b6177d8810b88fde00d4 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sat, 28 Mar 2020 16:27:06 +0100 Subject: [PATCH] add opcodes for function references https://github.com/WebAssembly/function-references/blob/master/proposals/function-references/Overview.md#instructions-1 --- .../binary/InstructionOpcodes.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/de/inetsoftware/jwebassembly/binary/InstructionOpcodes.java b/src/de/inetsoftware/jwebassembly/binary/InstructionOpcodes.java index bb08cd9..f86f429 100644 --- a/src/de/inetsoftware/jwebassembly/binary/InstructionOpcodes.java +++ b/src/de/inetsoftware/jwebassembly/binary/InstructionOpcodes.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 - 2019 Volker Berlin (i-net software) + * Copyright 2017 - 2020 Volker Berlin (i-net software) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,6 +85,18 @@ interface InstructionOpcodes { static final int RETURN_CALL_INDIRECT = 0x13; // tail call + /** calling a function through a ref */ + static final int CALL_REF = 0x14; + + /** tail calling a function through a ref */ + static final int RETURN_CALL_REF = 0x15; + + /** create a closure */ + static final int FUNC_BIND = 0x16; + + /** locals with block scope, in order to handle reference types without default initialisation values */ + static final int LET = 0x17; + static final int DROP = 0x1A; /** @@ -441,6 +453,12 @@ interface InstructionOpcodes { static final int REF_ISNULL = 0xD1; + /** converts a nullable reference to a non-nullable one or traps if null */ + static final int REF_AS_NON_NULL = 0xD3; + + /** converts a nullable reference to a non-nullable one or branches if null */ + static final int BR_ON_NULL = 0xD4; + static final int REF_EQ = 0xF0; // === Non-trapping float-to-int conversions ====== https://github.com/WebAssembly/design/issues/1143