aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmInstruction.java2
-rw-r--r--src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmMemoryFill.java4
-rw-r--r--src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructions.java6
3 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmInstruction.java b/src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmInstruction.java
index 1fc5b7aa..83ee9445 100644
--- a/src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmInstruction.java
+++ b/src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmInstruction.java
@@ -1,4 +1,4 @@
package org.shedlang.compiler.backends.wasm.structure.ast.instructions;
-public sealed interface WasmInstruction permits WasmBlock, WasmBr, WasmCall, WasmCallIndirect, WasmDrop, WasmGlobalGet, WasmGlobalSet, WasmI32Add, WasmI32Const, WasmI32Eq, WasmI32Load, WasmI32Ne, WasmI32Store, WasmI32Sub, WasmI32WrapI64, WasmI64Add, WasmI64Const, WasmI64Eq, WasmI64ExtendI32Unsigned, WasmI64Load, WasmI64Ne, WasmI64Store, WasmI64Sub, WasmIf, WasmLocalGet, WasmLocalSet, WasmLoop, WasmMemoryAddressConst, WasmMemoryGrow, WasmReturn, WasmTableElementIndexConst, WasmThrow, WasmTry, WasmUnreachable {
+public sealed interface WasmInstruction permits WasmBlock, WasmBr, WasmCall, WasmCallIndirect, WasmDrop, WasmGlobalGet, WasmGlobalSet, WasmI32Add, WasmI32Const, WasmI32Eq, WasmI32Load, WasmI32Ne, WasmI32Store, WasmI32Sub, WasmI32WrapI64, WasmI64Add, WasmI64Const, WasmI64Eq, WasmI64ExtendI32Unsigned, WasmI64Load, WasmI64Ne, WasmI64Store, WasmI64Sub, WasmIf, WasmLocalGet, WasmLocalSet, WasmLoop, WasmMemoryAddressConst, WasmMemoryFill, WasmMemoryGrow, WasmReturn, WasmTableElementIndexConst, WasmThrow, WasmTry, WasmUnreachable {
}
diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmMemoryFill.java b/src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmMemoryFill.java
new file mode 100644
index 00000000..244b6876
--- /dev/null
+++ b/src/main/java/org/shedlang/compiler/backends/wasm/structure/ast/instructions/WasmMemoryFill.java
@@ -0,0 +1,4 @@
+package org.shedlang.compiler.backends.wasm.structure.ast.instructions;
+
+public record WasmMemoryFill() implements WasmInstruction {
+}
diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructions.java b/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructions.java
index e2ef6c58..af551003 100644
--- a/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructions.java
+++ b/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructions.java
@@ -132,6 +132,12 @@ public class WasmBinaryFormatInstructions {
writer.writeByte(0x00);
}
+ case WasmMemoryFill memoryFill -> {
+ writer.writeByte(0xfc);
+ writer.writeUnsignedInt32(11);
+ writer.writeByte(0x00);
+ }
+
// == Numeric Instructions ==
case WasmI32Const i32Const -> {