Commit 70c94dfa authored by Ben Smith's avatar Ben Smith Committed by Commit Bot

[wasm] Rename memory.drop and table.drop

The new names for memory.drop and table.drop are data.drop and elem.drop
respectively. See
https://github.com/WebAssembly/bulk-memory-operations/issues/23 and
https://github.com/WebAssembly/bulk-memory-operations/pull/46.

Change-Id: I07aab8448fabe24eb9734dc7dac6f91c570cb553
Reviewed-on: https://chromium-review.googlesource.com/c/1446148
Commit-Queue: Ben Smith <binji@chromium.org>
Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59261}
parent bf18ee82
...@@ -4338,8 +4338,8 @@ Node* WasmGraphBuilder::MemoryInit(uint32_t data_segment_index, Node* dst, ...@@ -4338,8 +4338,8 @@ Node* WasmGraphBuilder::MemoryInit(uint32_t data_segment_index, Node* dst,
return BuildCCall(&sig, function, dst, src, size); return BuildCCall(&sig, function, dst, src, size);
} }
Node* WasmGraphBuilder::MemoryDrop(uint32_t data_segment_index, Node* WasmGraphBuilder::DataDrop(uint32_t data_segment_index,
wasm::WasmCodePosition position) { wasm::WasmCodePosition position) {
Node* dropped_data_segments = Node* dropped_data_segments =
CheckDataSegmentIsPassiveAndNotDropped(data_segment_index, position); CheckDataSegmentIsPassiveAndNotDropped(data_segment_index, position);
const Operator* store_op = mcgraph()->machine()->Store( const Operator* store_op = mcgraph()->machine()->Store(
...@@ -4405,8 +4405,8 @@ Node* WasmGraphBuilder::TableInit(uint32_t table_index, ...@@ -4405,8 +4405,8 @@ Node* WasmGraphBuilder::TableInit(uint32_t table_index,
return result; return result;
} }
Node* WasmGraphBuilder::TableDrop(uint32_t elem_segment_index, Node* WasmGraphBuilder::ElemDrop(uint32_t elem_segment_index,
wasm::WasmCodePosition position) { wasm::WasmCodePosition position) {
Node* dropped_elem_segments = Node* dropped_elem_segments =
CheckElemSegmentIsPassiveAndNotDropped(elem_segment_index, position); CheckElemSegmentIsPassiveAndNotDropped(elem_segment_index, position);
const Operator* store_op = mcgraph()->machine()->Store( const Operator* store_op = mcgraph()->machine()->Store(
......
...@@ -370,14 +370,13 @@ class WasmGraphBuilder { ...@@ -370,14 +370,13 @@ class WasmGraphBuilder {
Node* size, wasm::WasmCodePosition position); Node* size, wasm::WasmCodePosition position);
Node* MemoryCopy(Node* dst, Node* src, Node* size, Node* MemoryCopy(Node* dst, Node* src, Node* size,
wasm::WasmCodePosition position); wasm::WasmCodePosition position);
Node* MemoryDrop(uint32_t data_segment_index, Node* DataDrop(uint32_t data_segment_index, wasm::WasmCodePosition position);
wasm::WasmCodePosition position);
Node* MemoryFill(Node* dst, Node* fill, Node* size, Node* MemoryFill(Node* dst, Node* fill, Node* size,
wasm::WasmCodePosition position); wasm::WasmCodePosition position);
Node* TableInit(uint32_t table_index, uint32_t elem_segment_index, Node* dst, Node* TableInit(uint32_t table_index, uint32_t elem_segment_index, Node* dst,
Node* src, Node* size, wasm::WasmCodePosition position); Node* src, Node* size, wasm::WasmCodePosition position);
Node* TableDrop(uint32_t elem_segment_index, wasm::WasmCodePosition position); Node* ElemDrop(uint32_t elem_segment_index, wasm::WasmCodePosition position);
Node* TableCopy(uint32_t table_src_index, uint32_t table_dst_index, Node* dst, Node* TableCopy(uint32_t table_src_index, uint32_t table_dst_index, Node* dst,
Node* src, Node* size, wasm::WasmCodePosition position); Node* src, Node* size, wasm::WasmCodePosition position);
......
...@@ -1885,9 +1885,8 @@ class LiftoffCompiler { ...@@ -1885,9 +1885,8 @@ class LiftoffCompiler {
const Value& src, const Value& size) { const Value& src, const Value& size) {
unsupported(decoder, "memory.init"); unsupported(decoder, "memory.init");
} }
void MemoryDrop(FullDecoder* decoder, void DataDrop(FullDecoder* decoder, const DataDropImmediate<validate>& imm) {
const MemoryDropImmediate<validate>& imm) { unsupported(decoder, "data.drop");
unsupported(decoder, "memory.drop");
} }
void MemoryCopy(FullDecoder* decoder, void MemoryCopy(FullDecoder* decoder,
const MemoryCopyImmediate<validate>& imm, const Value& dst, const MemoryCopyImmediate<validate>& imm, const Value& dst,
...@@ -1903,9 +1902,8 @@ class LiftoffCompiler { ...@@ -1903,9 +1902,8 @@ class LiftoffCompiler {
Vector<Value> args) { Vector<Value> args) {
unsupported(decoder, "table.init"); unsupported(decoder, "table.init");
} }
void TableDrop(FullDecoder* decoder, void ElemDrop(FullDecoder* decoder, const ElemDropImmediate<validate>& imm) {
const TableDropImmediate<validate>& imm) { unsupported(decoder, "elem.drop");
unsupported(decoder, "table.drop");
} }
void TableCopy(FullDecoder* decoder, const TableCopyImmediate<validate>& imm, void TableCopy(FullDecoder* decoder, const TableCopyImmediate<validate>& imm,
Vector<Value> args) { Vector<Value> args) {
......
...@@ -479,11 +479,11 @@ struct MemoryInitImmediate { ...@@ -479,11 +479,11 @@ struct MemoryInitImmediate {
}; };
template <Decoder::ValidateFlag validate> template <Decoder::ValidateFlag validate>
struct MemoryDropImmediate { struct DataDropImmediate {
uint32_t index; uint32_t index;
unsigned length; unsigned length;
inline MemoryDropImmediate(Decoder* decoder, const byte* pc) { inline DataDropImmediate(Decoder* decoder, const byte* pc) {
index = decoder->read_i32v<validate>(pc + 2, &length, "data segment index"); index = decoder->read_i32v<validate>(pc + 2, &length, "data segment index");
} }
}; };
...@@ -521,11 +521,11 @@ struct TableInitImmediate { ...@@ -521,11 +521,11 @@ struct TableInitImmediate {
}; };
template <Decoder::ValidateFlag validate> template <Decoder::ValidateFlag validate>
struct TableDropImmediate { struct ElemDropImmediate {
uint32_t index; uint32_t index;
unsigned length; unsigned length;
inline TableDropImmediate(Decoder* decoder, const byte* pc) { inline ElemDropImmediate(Decoder* decoder, const byte* pc) {
index = decoder->read_i32v<validate>(pc + 2, &length, "elem segment index"); index = decoder->read_i32v<validate>(pc + 2, &length, "elem segment index");
} }
}; };
...@@ -713,13 +713,13 @@ struct ControlBase { ...@@ -713,13 +713,13 @@ struct ControlBase {
const MemoryAccessImmediate<validate>& imm, Value* result) \ const MemoryAccessImmediate<validate>& imm, Value* result) \
F(MemoryInit, const MemoryInitImmediate<validate>& imm, const Value& dst, \ F(MemoryInit, const MemoryInitImmediate<validate>& imm, const Value& dst, \
const Value& src, const Value& size) \ const Value& src, const Value& size) \
F(MemoryDrop, const MemoryDropImmediate<validate>& imm) \ F(DataDrop, const DataDropImmediate<validate>& imm) \
F(MemoryCopy, const MemoryCopyImmediate<validate>& imm, const Value& dst, \ F(MemoryCopy, const MemoryCopyImmediate<validate>& imm, const Value& dst, \
const Value& src, const Value& size) \ const Value& src, const Value& size) \
F(MemoryFill, const MemoryIndexImmediate<validate>& imm, const Value& dst, \ F(MemoryFill, const MemoryIndexImmediate<validate>& imm, const Value& dst, \
const Value& value, const Value& size) \ const Value& value, const Value& size) \
F(TableInit, const TableInitImmediate<validate>& imm, Vector<Value> args) \ F(TableInit, const TableInitImmediate<validate>& imm, Vector<Value> args) \
F(TableDrop, const TableDropImmediate<validate>& imm) \ F(ElemDrop, const ElemDropImmediate<validate>& imm) \
F(TableCopy, const TableCopyImmediate<validate>& imm, Vector<Value> args) F(TableCopy, const TableCopyImmediate<validate>& imm, Vector<Value> args)
// Generic Wasm bytecode decoder with utilities for decoding immediates, // Generic Wasm bytecode decoder with utilities for decoding immediates,
...@@ -1087,7 +1087,7 @@ class WasmDecoder : public Decoder { ...@@ -1087,7 +1087,7 @@ class WasmDecoder : public Decoder {
return true; return true;
} }
inline bool Validate(MemoryDropImmediate<validate>& imm) { inline bool Validate(DataDropImmediate<validate>& imm) {
if (!VALIDATE(module_ != nullptr && if (!VALIDATE(module_ != nullptr &&
imm.index < module_->num_declared_data_segments)) { imm.index < module_->num_declared_data_segments)) {
errorf(pc_ + 2, "invalid data segment index: %u", imm.index); errorf(pc_ + 2, "invalid data segment index: %u", imm.index);
...@@ -1122,7 +1122,7 @@ class WasmDecoder : public Decoder { ...@@ -1122,7 +1122,7 @@ class WasmDecoder : public Decoder {
return true; return true;
} }
inline bool Validate(TableDropImmediate<validate>& imm) { inline bool Validate(ElemDropImmediate<validate>& imm) {
if (!VALIDATE(module_ != nullptr && if (!VALIDATE(module_ != nullptr &&
imm.index < module_->elem_segments.size())) { imm.index < module_->elem_segments.size())) {
errorf(pc_ + 2, "invalid element segment index: %u", imm.index); errorf(pc_ + 2, "invalid element segment index: %u", imm.index);
...@@ -1239,8 +1239,8 @@ class WasmDecoder : public Decoder { ...@@ -1239,8 +1239,8 @@ class WasmDecoder : public Decoder {
MemoryInitImmediate<validate> imm(decoder, pc); MemoryInitImmediate<validate> imm(decoder, pc);
return 2 + imm.length; return 2 + imm.length;
} }
case kExprMemoryDrop: { case kExprDataDrop: {
MemoryDropImmediate<validate> imm(decoder, pc); DataDropImmediate<validate> imm(decoder, pc);
return 2 + imm.length; return 2 + imm.length;
} }
case kExprMemoryCopy: { case kExprMemoryCopy: {
...@@ -1255,8 +1255,8 @@ class WasmDecoder : public Decoder { ...@@ -1255,8 +1255,8 @@ class WasmDecoder : public Decoder {
TableInitImmediate<validate> imm(decoder, pc); TableInitImmediate<validate> imm(decoder, pc);
return 2 + imm.length; return 2 + imm.length;
} }
case kExprTableDrop: { case kExprElemDrop: {
TableDropImmediate<validate> imm(decoder, pc); ElemDropImmediate<validate> imm(decoder, pc);
return 2 + imm.length; return 2 + imm.length;
} }
case kExprTableCopy: { case kExprTableCopy: {
...@@ -2513,11 +2513,11 @@ class WasmFullDecoder : public WasmDecoder<validate> { ...@@ -2513,11 +2513,11 @@ class WasmFullDecoder : public WasmDecoder<validate> {
CALL_INTERFACE_IF_REACHABLE(MemoryInit, imm, dst, src, size); CALL_INTERFACE_IF_REACHABLE(MemoryInit, imm, dst, src, size);
break; break;
} }
case kExprMemoryDrop: { case kExprDataDrop: {
MemoryDropImmediate<validate> imm(this, this->pc_); DataDropImmediate<validate> imm(this, this->pc_);
if (!this->Validate(imm)) break; if (!this->Validate(imm)) break;
len += imm.length; len += imm.length;
CALL_INTERFACE_IF_REACHABLE(MemoryDrop, imm); CALL_INTERFACE_IF_REACHABLE(DataDrop, imm);
break; break;
} }
case kExprMemoryCopy: { case kExprMemoryCopy: {
...@@ -2548,11 +2548,11 @@ class WasmFullDecoder : public WasmDecoder<validate> { ...@@ -2548,11 +2548,11 @@ class WasmFullDecoder : public WasmDecoder<validate> {
CALL_INTERFACE_IF_REACHABLE(TableInit, imm, VectorOf(args_)); CALL_INTERFACE_IF_REACHABLE(TableInit, imm, VectorOf(args_));
break; break;
} }
case kExprTableDrop: { case kExprElemDrop: {
TableDropImmediate<validate> imm(this, this->pc_); ElemDropImmediate<validate> imm(this, this->pc_);
if (!this->Validate(imm)) break; if (!this->Validate(imm)) break;
len += imm.length; len += imm.length;
CALL_INTERFACE_IF_REACHABLE(TableDrop, imm); CALL_INTERFACE_IF_REACHABLE(ElemDrop, imm);
break; break;
} }
case kExprTableCopy: { case kExprTableCopy: {
......
...@@ -510,9 +510,8 @@ class WasmGraphBuildingInterface { ...@@ -510,9 +510,8 @@ class WasmGraphBuildingInterface {
BUILD(MemoryInit, imm.data_segment_index, dst.node, src.node, size.node, BUILD(MemoryInit, imm.data_segment_index, dst.node, src.node, size.node,
decoder->position()); decoder->position());
} }
void MemoryDrop(FullDecoder* decoder, void DataDrop(FullDecoder* decoder, const DataDropImmediate<validate>& imm) {
const MemoryDropImmediate<validate>& imm) { BUILD(DataDrop, imm.index, decoder->position());
BUILD(MemoryDrop, imm.index, decoder->position());
} }
void MemoryCopy(FullDecoder* decoder, void MemoryCopy(FullDecoder* decoder,
const MemoryCopyImmediate<validate>& imm, const Value& dst, const MemoryCopyImmediate<validate>& imm, const Value& dst,
...@@ -529,9 +528,8 @@ class WasmGraphBuildingInterface { ...@@ -529,9 +528,8 @@ class WasmGraphBuildingInterface {
BUILD(TableInit, imm.table.index, imm.elem_segment_index, args[0].node, BUILD(TableInit, imm.table.index, imm.elem_segment_index, args[0].node,
args[1].node, args[2].node, decoder->position()); args[1].node, args[2].node, decoder->position());
} }
void TableDrop(FullDecoder* decoder, void ElemDrop(FullDecoder* decoder, const ElemDropImmediate<validate>& imm) {
const TableDropImmediate<validate>& imm) { BUILD(ElemDrop, imm.index, decoder->position());
BUILD(TableDrop, imm.index, decoder->position());
} }
void TableCopy(FullDecoder* decoder, const TableCopyImmediate<validate>& imm, void TableCopy(FullDecoder* decoder, const TableCopyImmediate<validate>& imm,
Vector<Value> args) { Vector<Value> args) {
......
...@@ -198,11 +198,11 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) { ...@@ -198,11 +198,11 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
CASE_CONVERT_SAT_OP(Convert, I64, F32, "f32", "trunc") CASE_CONVERT_SAT_OP(Convert, I64, F32, "f32", "trunc")
CASE_CONVERT_SAT_OP(Convert, I64, F64, "f64", "trunc") CASE_CONVERT_SAT_OP(Convert, I64, F64, "f64", "trunc")
CASE_OP(MemoryInit, "memory.init") CASE_OP(MemoryInit, "memory.init")
CASE_OP(MemoryDrop, "memory.drop") CASE_OP(DataDrop, "data.drop")
CASE_OP(MemoryCopy, "memory.copy") CASE_OP(MemoryCopy, "memory.copy")
CASE_OP(MemoryFill, "memory.fill") CASE_OP(MemoryFill, "memory.fill")
CASE_OP(TableInit, "table.init") CASE_OP(TableInit, "table.init")
CASE_OP(TableDrop, "table.drop") CASE_OP(ElemDrop, "elem.drop")
CASE_OP(TableCopy, "table.copy") CASE_OP(TableCopy, "table.copy")
// SIMD opcodes. // SIMD opcodes.
......
...@@ -410,11 +410,11 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, bool hasBigIntFeature); ...@@ -410,11 +410,11 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, bool hasBigIntFeature);
V(I64SConvertSatF64, 0xfc06, l_d) \ V(I64SConvertSatF64, 0xfc06, l_d) \
V(I64UConvertSatF64, 0xfc07, l_d) \ V(I64UConvertSatF64, 0xfc07, l_d) \
V(MemoryInit, 0xfc08, v_iii) \ V(MemoryInit, 0xfc08, v_iii) \
V(MemoryDrop, 0xfc09, v_v) \ V(DataDrop, 0xfc09, v_v) \
V(MemoryCopy, 0xfc0a, v_iii) \ V(MemoryCopy, 0xfc0a, v_iii) \
V(MemoryFill, 0xfc0b, v_iii) \ V(MemoryFill, 0xfc0b, v_iii) \
V(TableInit, 0xfc0c, v_iii) \ V(TableInit, 0xfc0c, v_iii) \
V(TableDrop, 0xfc0d, v_v) \ V(ElemDrop, 0xfc0d, v_v) \
V(TableCopy, 0xfc0e, v_iii) V(TableCopy, 0xfc0e, v_iii)
#define FOREACH_ATOMIC_OPCODE(V) \ #define FOREACH_ATOMIC_OPCODE(V) \
......
...@@ -592,14 +592,14 @@ inline WasmOpcode LoadStoreOpcodeOf(MachineType type, bool store) { ...@@ -592,14 +592,14 @@ inline WasmOpcode LoadStoreOpcodeOf(MachineType type, bool store) {
#define WASM_MEMORY_INIT(seg, dst, src, size) \ #define WASM_MEMORY_INIT(seg, dst, src, size) \
dst, src, size, WASM_NUMERIC_OP(kExprMemoryInit), U32V_1(seg), MEMORY_ZERO dst, src, size, WASM_NUMERIC_OP(kExprMemoryInit), U32V_1(seg), MEMORY_ZERO
#define WASM_MEMORY_DROP(seg) WASM_NUMERIC_OP(kExprMemoryDrop), U32V_1(seg) #define WASM_DATA_DROP(seg) WASM_NUMERIC_OP(kExprDataDrop), U32V_1(seg)
#define WASM_MEMORY_COPY(dst, src, size) \ #define WASM_MEMORY_COPY(dst, src, size) \
dst, src, size, WASM_NUMERIC_OP(kExprMemoryCopy), MEMORY_ZERO, MEMORY_ZERO dst, src, size, WASM_NUMERIC_OP(kExprMemoryCopy), MEMORY_ZERO, MEMORY_ZERO
#define WASM_MEMORY_FILL(dst, val, size) \ #define WASM_MEMORY_FILL(dst, val, size) \
dst, val, size, WASM_NUMERIC_OP(kExprMemoryFill), MEMORY_ZERO dst, val, size, WASM_NUMERIC_OP(kExprMemoryFill), MEMORY_ZERO
#define WASM_TABLE_INIT(seg, dst, src, size) \ #define WASM_TABLE_INIT(seg, dst, src, size) \
dst, src, size, WASM_NUMERIC_OP(kExprTableInit), U32V_1(seg), TABLE_ZERO dst, src, size, WASM_NUMERIC_OP(kExprTableInit), U32V_1(seg), TABLE_ZERO
#define WASM_TABLE_DROP(seg) WASM_NUMERIC_OP(kExprTableDrop), U32V_1(seg) #define WASM_ELEM_DROP(seg) WASM_NUMERIC_OP(kExprElemDrop), U32V_1(seg)
#define WASM_TABLE_COPY(dst, src, size) \ #define WASM_TABLE_COPY(dst, src, size) \
dst, src, size, WASM_NUMERIC_OP(kExprTableCopy), TABLE_ZERO, TABLE_ZERO dst, src, size, WASM_NUMERIC_OP(kExprTableCopy), TABLE_ZERO, TABLE_ZERO
......
...@@ -143,7 +143,7 @@ function getMemoryInit(mem, segment_data) { ...@@ -143,7 +143,7 @@ function getMemoryInit(mem, segment_data) {
.exportAs('init'); .exportAs('init');
builder.addFunction('drop', kSig_v_v) builder.addFunction('drop', kSig_v_v)
.addBody([ .addBody([
kNumericPrefix, kExprMemoryDrop, kNumericPrefix, kExprDataDrop,
0, // Data segment index. 0, // Data segment index.
]) ])
.exportAs('drop'); .exportAs('drop');
...@@ -162,14 +162,14 @@ function getMemoryInit(mem, segment_data) { ...@@ -162,14 +162,14 @@ function getMemoryInit(mem, segment_data) {
assertTraps(kTrapDataSegmentDropped, () => instance.exports.drop()); assertTraps(kTrapDataSegmentDropped, () => instance.exports.drop());
})(); })();
(function TestMemoryDropOnActiveSegment() { (function TestDataDropOnActiveSegment() {
const builder = new WasmModuleBuilder(); const builder = new WasmModuleBuilder();
builder.addMemory(1); builder.addMemory(1);
builder.addPassiveDataSegment([1, 2, 3]); builder.addPassiveDataSegment([1, 2, 3]);
builder.addDataSegment(0, [4, 5, 6]); builder.addDataSegment(0, [4, 5, 6]);
builder.addFunction('drop', kSig_v_v) builder.addFunction('drop', kSig_v_v)
.addBody([ .addBody([
kNumericPrefix, kExprMemoryDrop, kNumericPrefix, kExprDataDrop,
1, // Data segment index. 1, // Data segment index.
]) ])
.exportAs('drop'); .exportAs('drop');
...@@ -320,13 +320,13 @@ function getMemoryFill(mem) { ...@@ -320,13 +320,13 @@ function getMemoryFill(mem) {
kTrapMemOutOfBounds, () => memoryFill(kPageSize + 1, v, kPageSize)); kTrapMemOutOfBounds, () => memoryFill(kPageSize + 1, v, kPageSize));
})(); })();
(function TestTableDropActive() { (function TestElemDropActive() {
const builder = new WasmModuleBuilder(); const builder = new WasmModuleBuilder();
builder.setTableBounds(5, 5); builder.setTableBounds(5, 5);
builder.addElementSegment(0, false, [0, 0, 0]); builder.addElementSegment(0, false, [0, 0, 0]);
builder.addFunction('drop', kSig_v_v) builder.addFunction('drop', kSig_v_v)
.addBody([ .addBody([
kNumericPrefix, kExprTableDrop, kNumericPrefix, kExprElemDrop,
0, // Element segment index. 0, // Element segment index.
]) ])
.exportAs('drop'); .exportAs('drop');
...@@ -335,13 +335,13 @@ function getMemoryFill(mem) { ...@@ -335,13 +335,13 @@ function getMemoryFill(mem) {
assertTraps(kTrapElemSegmentDropped, () => instance.exports.drop()); assertTraps(kTrapElemSegmentDropped, () => instance.exports.drop());
})(); })();
(function TestTableDropTwice() { (function TestElemDropTwice() {
const builder = new WasmModuleBuilder(); const builder = new WasmModuleBuilder();
builder.setTableBounds(5, 5); builder.setTableBounds(5, 5);
builder.addPassiveElementSegment([0, 0, 0]); builder.addPassiveElementSegment([0, 0, 0]);
builder.addFunction('drop', kSig_v_v) builder.addFunction('drop', kSig_v_v)
.addBody([ .addBody([
kNumericPrefix, kExprTableDrop, kNumericPrefix, kExprElemDrop,
0, // Element segment index. 0, // Element segment index.
]) ])
.exportAs('drop'); .exportAs('drop');
......
...@@ -376,11 +376,11 @@ let kAtomicPrefix = 0xfe; ...@@ -376,11 +376,11 @@ let kAtomicPrefix = 0xfe;
// Numeric opcodes. // Numeric opcodes.
let kExprMemoryInit = 0x08; let kExprMemoryInit = 0x08;
let kExprMemoryDrop = 0x09; let kExprDataDrop = 0x09;
let kExprMemoryCopy = 0x0a; let kExprMemoryCopy = 0x0a;
let kExprMemoryFill = 0x0b; let kExprMemoryFill = 0x0b;
let kExprTableInit = 0x0c; let kExprTableInit = 0x0c;
let kExprTableDrop = 0x0d; let kExprElemDrop = 0x0d;
let kExprTableCopy = 0x0e; let kExprTableCopy = 0x0e;
// Atomic opcodes. // Atomic opcodes.
......
...@@ -2769,16 +2769,16 @@ TEST_F(FunctionBodyDecoderTest, MemoryInitInvalid) { ...@@ -2769,16 +2769,16 @@ TEST_F(FunctionBodyDecoderTest, MemoryInitInvalid) {
} }
} }
TEST_F(FunctionBodyDecoderTest, MemoryDrop) { TEST_F(FunctionBodyDecoderTest, DataDrop) {
TestModuleBuilder builder; TestModuleBuilder builder;
builder.InitializeMemory(); builder.InitializeMemory();
builder.SetDataSegmentCount(1); builder.SetDataSegmentCount(1);
module = builder.module(); module = builder.module();
EXPECT_FAILURE(v_v, WASM_MEMORY_DROP(0)); EXPECT_FAILURE(v_v, WASM_DATA_DROP(0));
WASM_FEATURE_SCOPE(bulk_memory); WASM_FEATURE_SCOPE(bulk_memory);
EXPECT_VERIFIES(v_v, WASM_MEMORY_DROP(0)); EXPECT_VERIFIES(v_v, WASM_DATA_DROP(0));
EXPECT_FAILURE(v_v, WASM_MEMORY_DROP(1)); EXPECT_FAILURE(v_v, WASM_DATA_DROP(1));
} }
TEST_F(FunctionBodyDecoderTest, MemoryCopy) { TEST_F(FunctionBodyDecoderTest, MemoryCopy) {
...@@ -2833,16 +2833,16 @@ TEST_F(FunctionBodyDecoderTest, TableInitInvalid) { ...@@ -2833,16 +2833,16 @@ TEST_F(FunctionBodyDecoderTest, TableInitInvalid) {
} }
} }
TEST_F(FunctionBodyDecoderTest, TableDrop) { TEST_F(FunctionBodyDecoderTest, ElemDrop) {
TestModuleBuilder builder; TestModuleBuilder builder;
builder.InitializeTable(); builder.InitializeTable();
builder.AddPassiveElementSegment(); builder.AddPassiveElementSegment();
module = builder.module(); module = builder.module();
EXPECT_FAILURE(v_v, WASM_TABLE_DROP(0)); EXPECT_FAILURE(v_v, WASM_ELEM_DROP(0));
WASM_FEATURE_SCOPE(bulk_memory); WASM_FEATURE_SCOPE(bulk_memory);
EXPECT_VERIFIES(v_v, WASM_TABLE_DROP(0)); EXPECT_VERIFIES(v_v, WASM_ELEM_DROP(0));
EXPECT_FAILURE(v_v, WASM_TABLE_DROP(1)); EXPECT_FAILURE(v_v, WASM_ELEM_DROP(1));
} }
TEST_F(FunctionBodyDecoderTest, TableCopy) { TEST_F(FunctionBodyDecoderTest, TableCopy) {
...@@ -2862,7 +2862,7 @@ TEST_F(FunctionBodyDecoderTest, BulkTableOpsWithoutTable) { ...@@ -2862,7 +2862,7 @@ TEST_F(FunctionBodyDecoderTest, BulkTableOpsWithoutTable) {
WASM_FEATURE_SCOPE(bulk_memory); WASM_FEATURE_SCOPE(bulk_memory);
EXPECT_FAILURE(v_v, WASM_TABLE_INIT(0, WASM_ZERO, WASM_ZERO, WASM_ZERO)); EXPECT_FAILURE(v_v, WASM_TABLE_INIT(0, WASM_ZERO, WASM_ZERO, WASM_ZERO));
EXPECT_FAILURE(v_v, WASM_TABLE_DROP(0)); EXPECT_FAILURE(v_v, WASM_ELEM_DROP(0));
EXPECT_FAILURE(v_v, WASM_TABLE_COPY(WASM_ZERO, WASM_ZERO, WASM_ZERO)); EXPECT_FAILURE(v_v, WASM_TABLE_COPY(WASM_ZERO, WASM_ZERO, WASM_ZERO));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment