diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-01-28 15:37:59 +0000 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2023-01-28 22:57:25 +0330 |
commit | 53ebe607f886fa2e1261684250567cac358778ad (patch) | |
tree | 663e55e0bbdf9e17cbfbe5234f386201176f36d4 /Userland/Libraries | |
parent | a2f42512c2d6890dc2d990cf7c65dc81428e9174 (diff) | |
download | serenity-53ebe607f886fa2e1261684250567cac358778ad.zip |
LibWasm: Implement data.drop instruction
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp b/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp index a46b241f49..dba2c43e24 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp @@ -696,6 +696,13 @@ void BytecodeInterpreter::interpret(Configuration& configuration, InstructionPoi } return; } + // https://webassembly.github.io/spec/core/bikeshed/#exec-data-drop + case Instructions::data_drop.value(): { + auto data_index = instruction.arguments().get<DataIndex>(); + auto data_address = configuration.frame().module().datas()[data_index.value()]; + *configuration.store().get(data_address) = DataInstance({}); + return; + } case Instructions::table_get.value(): case Instructions::table_set.value(): goto unimplemented; @@ -1006,7 +1013,6 @@ void BytecodeInterpreter::interpret(Configuration& configuration, InstructionPoi return unary_operation<double, i64, Operators::SaturatingTruncate<i64>>(configuration); case Instructions::i64_trunc_sat_f64_u.value(): return unary_operation<double, i64, Operators::SaturatingTruncate<u64>>(configuration); - case Instructions::data_drop.value(): case Instructions::table_init.value(): case Instructions::elem_drop.value(): case Instructions::table_copy.value(): |