[Wasm] Cleanup instructions list
* Split by proposal, at least for work-in-progress ones * Add a link to the repo for WIP proposals * Move some instructions to right group
This commit is contained in:
@@ -233,12 +233,11 @@ internal annotation class WasmOp(val name: String) {
|
||||
const val REF_NULL = "REF_NULL"
|
||||
const val REF_IS_NULL = "REF_IS_NULL"
|
||||
const val REF_FUNC = "REF_FUNC"
|
||||
const val REF_AS_NOT_NULL = "REF_AS_NOT_NULL"
|
||||
const val BR_ON_NULL = "BR_ON_NULL"
|
||||
const val REF_EQ = "REF_EQ"
|
||||
const val CALL_REF = "CALL_REF"
|
||||
const val RETURN_CALL_REF = "RETURN_CALL_REF"
|
||||
const val FUNC_BIND = "FUNC_BIND"
|
||||
const val REF_AS_NOT_NULL = "REF_AS_NOT_NULL"
|
||||
const val BR_ON_NULL = "BR_ON_NULL"
|
||||
const val BR_ON_NON_NULL = "BR_ON_NON_NULL"
|
||||
const val STRUCT_NEW = "STRUCT_NEW"
|
||||
const val STRUCT_NEW_DEFAULT = "STRUCT_NEW_DEFAULT"
|
||||
const val STRUCT_GET = "STRUCT_GET"
|
||||
@@ -258,6 +257,7 @@ internal annotation class WasmOp(val name: String) {
|
||||
const val I31_NEW = "I31_NEW"
|
||||
const val I31_GET_S = "I31_GET_S"
|
||||
const val I31_GET_U = "I31_GET_U"
|
||||
const val REF_EQ = "REF_EQ"
|
||||
const val REF_TEST = "REF_TEST"
|
||||
const val REF_CAST = "REF_CAST"
|
||||
const val BR_ON_CAST_FAIL = "BR_ON_CAST_FAIL"
|
||||
|
||||
@@ -334,15 +334,20 @@ enum class WasmOp(
|
||||
REF_NULL("ref.null", 0xD0, HEAP_TYPE),
|
||||
REF_IS_NULL("ref.is_null", 0xD1),
|
||||
REF_FUNC("ref.func", 0xD2, FUNC_IDX),
|
||||
REF_AS_NOT_NULL("ref.as_non_null", 0xD3),
|
||||
BR_ON_NULL("br_on_null", 0xD4, LABEL_IDX),
|
||||
REF_EQ("ref.eq", 0xD5),
|
||||
|
||||
// ============================================================
|
||||
// Typed Function References
|
||||
// WIP: https://github.com/WebAssembly/function-references
|
||||
CALL_REF("call_ref", 0x14),
|
||||
RETURN_CALL_REF("return_call_ref", 0x15),
|
||||
FUNC_BIND("func.bind", 0x16, FUNC_IDX),
|
||||
REF_AS_NOT_NULL("ref.as_non_null", 0xD3),
|
||||
BR_ON_NULL("br_on_null", 0xD4, LABEL_IDX),
|
||||
BR_ON_NON_NULL("br_on_non_null", 0xD6, LABEL_IDX),
|
||||
|
||||
|
||||
// ============================================================
|
||||
// GC
|
||||
// WIP: https://github.com/WebAssembly/gc
|
||||
STRUCT_NEW("struct.new", 0xFB_07, STRUCT_TYPE_IDX),
|
||||
STRUCT_NEW_DEFAULT("struct.new_default", 0xFB_08, STRUCT_TYPE_IDX),
|
||||
STRUCT_GET("struct.get", 0xFB_03, listOf(STRUCT_TYPE_IDX, STRUCT_FIELD_IDX)),
|
||||
@@ -365,6 +370,7 @@ enum class WasmOp(
|
||||
I31_GET_S("i31.get_s", 0xFB_21),
|
||||
I31_GET_U("i31.get_u", 0xFB_22),
|
||||
|
||||
REF_EQ("ref.eq", 0xD5),
|
||||
REF_TEST("ref.test", 0xFB_44, STRUCT_TYPE_IDX),
|
||||
REF_CAST("ref.cast", 0xFB_45, STRUCT_TYPE_IDX),
|
||||
|
||||
@@ -384,6 +390,7 @@ enum class WasmOp(
|
||||
EXTERN_INTERNALIZE("extern.internalize", 0xfb70), // externref -> anyref
|
||||
EXTERN_EXTERNALIZE("extern.externalize", 0xfb71), // anyref -> externref
|
||||
|
||||
// ============================================================
|
||||
// Pseudo-instruction, just alias for a normal call. It's used to easily spot get_unit on the wasm level.
|
||||
GET_UNIT("call", 0x10, FUNC_IDX)
|
||||
;
|
||||
@@ -392,4 +399,4 @@ enum class WasmOp(
|
||||
}
|
||||
|
||||
val opcodesToOp: Map<Int, WasmOp> =
|
||||
enumValues<WasmOp>().associateBy { it.opcode }
|
||||
enumValues<WasmOp>().associateBy { it.opcode }
|
||||
|
||||
Reference in New Issue
Block a user