Bug 1521780 - Rename memory.drop and table.drop. r=jseward
authorLars T Hansen <lhansen@mozilla.com>
Tue, 22 Jan 2019 17:26:35 +0100
changeset 515441 7b9d92a7c779fbbcdb481760bb946910186eef80
parent 515440 cdb9aa894138d831002974b80e7d7dbb6efcc0ba
child 515442 f632c68b2052a051634bc6780b3b0e3e5c2dd973
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjseward
bugs1521780
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1521780 - Rename memory.drop and table.drop. r=jseward Straight renaming job, no functional changes anywhere, except that the text of some error messages changed slightly.
js/src/jit-test/tests/wasm/passive-segs-boundary.js
js/src/jit-test/tests/wasm/passive-segs-nonboundary.js
js/src/wasm/WasmAST.h
js/src/wasm/WasmBaselineCompile.cpp
js/src/wasm/WasmBuiltins.cpp
js/src/wasm/WasmConstants.h
js/src/wasm/WasmFrameIter.cpp
js/src/wasm/WasmInstance.cpp
js/src/wasm/WasmInstance.h
js/src/wasm/WasmIonCompile.cpp
js/src/wasm/WasmOpIter.cpp
js/src/wasm/WasmOpIter.h
js/src/wasm/WasmTextToBinary.cpp
js/src/wasm/WasmTypes.h
js/src/wasm/WasmValidate.cpp
--- a/js/src/jit-test/tests/wasm/passive-segs-boundary.js
+++ b/js/src/jit-test/tests/wasm/passive-segs-boundary.js
@@ -98,53 +98,53 @@ function tab_test_nofail(insn1, insn2) {
     do_test(insn1, insn2, undefined, undefined,
             /*isMem=*/false, /*haveMemOrTable=*/true);
 }
 
 
 //---- memory.{drop,init} -------------------------------------------------
 
 // drop with no memory
-mem_test("memory.drop 3", "",
+mem_test("data.drop 3", "",
          WebAssembly.CompileError, /can't touch memory without memory/,
          false);
 
 // init with no memory
 mem_test("(memory.init 1 (i32.const 1234) (i32.const 1) (i32.const 1))", "",
          WebAssembly.CompileError, /can't touch memory without memory/,
          false);
 
 // drop with data seg ix out of range
-mem_test("memory.drop 4", "",
+mem_test("data.drop 4", "",
          WebAssembly.CompileError, /memory.{drop,init} index out of range/);
 
 // init with data seg ix out of range
 mem_test("(memory.init 4 (i32.const 1234) (i32.const 1) (i32.const 1))", "",
          WebAssembly.CompileError, /memory.{drop,init} index out of range/);
 
 // drop with data seg ix indicating an active segment
-mem_test("memory.drop 2", "",
+mem_test("data.drop 2", "",
          WebAssembly.RuntimeError, /use of invalid passive data segment/);
 
 // init with data seg ix indicating an active segment
 mem_test("(memory.init 2 (i32.const 1234) (i32.const 1) (i32.const 1))", "",
          WebAssembly.RuntimeError, /use of invalid passive data segment/);
 
 // init, using a data seg ix more than once is OK
 mem_test_nofail(
     "(memory.init 1 (i32.const 1234) (i32.const 1) (i32.const 1))",
     "(memory.init 1 (i32.const 4321) (i32.const 1) (i32.const 1))");
 
 // drop, then drop
-mem_test("memory.drop 1",
-         "memory.drop 1",
+mem_test("data.drop 1",
+         "data.drop 1",
          WebAssembly.RuntimeError, /use of invalid passive data segment/);
 
 // drop, then init
-mem_test("memory.drop 1",
+mem_test("data.drop 1",
          "(memory.init 1 (i32.const 1234) (i32.const 1) (i32.const 1))",
          WebAssembly.RuntimeError, /use of invalid passive data segment/);
 
 // init: seg ix is valid passive, but length to copy > len of seg
 mem_test("",
          "(memory.init 1 (i32.const 1234) (i32.const 0) (i32.const 5))",
          WebAssembly.RuntimeError, /index out of bounds/);
 
@@ -164,17 +164,17 @@ mem_test("",
          WebAssembly.RuntimeError, /index out of bounds/);
 
 // init: seg ix is valid passive, zero len, but dst offset out of bounds
 mem_test("",
          "(memory.init 1 (i32.const 0x10000) (i32.const 2) (i32.const 0))",
          WebAssembly.RuntimeError, /index out of bounds/);
 
 // drop: too many args
-mem_test("memory.drop 1 (i32.const 42)", "",
+mem_test("data.drop 1 (i32.const 42)", "",
          WebAssembly.CompileError,
          /unused values not explicitly dropped by end of block/);
 
 // init: too many args
 mem_test("(memory.init 1 (i32.const 1) (i32.const 1) (i32.const 1) (i32.const 1))",
          "",
          SyntaxError, /parsing wasm text at/);
 
@@ -196,53 +196,53 @@ mem_test("(memory.init 1 (i32.const 1) (
         mem_test(i1, "", WebAssembly.CompileError, /type mismatch/);
     }}}
 }
 
 
 //---- table.{drop,init} --------------------------------------------------
 
 // drop with no table
-tab_test("table.drop 3", "",
-         WebAssembly.CompileError, /can't table.drop without a table/,
+tab_test("elem.drop 3", "",
+         WebAssembly.CompileError, /can't elem.drop without a table/,
          false);
 
 // init with no table
 tab_test("(table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))", "",
          WebAssembly.CompileError, /table index out of range/,
          false);
 
 // drop with elem seg ix out of range
-tab_test("table.drop 4", "",
-         WebAssembly.CompileError, /element segment index out of range for table.drop/);
+tab_test("elem.drop 4", "",
+         WebAssembly.CompileError, /element segment index out of range for elem.drop/);
 
 // init with elem seg ix out of range
 tab_test("(table.init 4 (i32.const 12) (i32.const 1) (i32.const 1))", "",
          WebAssembly.CompileError, /table.init segment index out of range/);
 
 // drop with elem seg ix indicating an active segment
-tab_test("table.drop 2", "",
+tab_test("elem.drop 2", "",
          WebAssembly.RuntimeError, /use of invalid passive element segment/);
 
 // init with elem seg ix indicating an active segment
 tab_test("(table.init 2 (i32.const 12) (i32.const 1) (i32.const 1))", "",
          WebAssembly.RuntimeError, /use of invalid passive element segment/);
 
 // init, using an elem seg ix more than once is OK
 tab_test_nofail(
     "(table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))",
     "(table.init 1 (i32.const 21) (i32.const 1) (i32.const 1))");
 
 // drop, then drop
-tab_test("table.drop 1",
-         "table.drop 1",
+tab_test("elem.drop 1",
+         "elem.drop 1",
          WebAssembly.RuntimeError, /use of invalid passive element segment/);
 
 // drop, then init
-tab_test("table.drop 1",
+tab_test("elem.drop 1",
          "(table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))",
          WebAssembly.RuntimeError, /use of invalid passive element segment/);
 
 // init: seg ix is valid passive, but length to copy > len of seg
 tab_test("",
          "(table.init 1 (i32.const 12) (i32.const 0) (i32.const 5))",
          WebAssembly.RuntimeError, /index out of bounds/);
 
@@ -262,17 +262,17 @@ tab_test("",
          WebAssembly.RuntimeError, /index out of bounds/);
 
 // init: seg ix is valid passive, zero len, but dst offset out of bounds
 tab_test("",
          "(table.init 1 (i32.const 30) (i32.const 2) (i32.const 0))",
          WebAssembly.RuntimeError, /index out of bounds/);
 
 // drop: too many args
-tab_test("table.drop 1 (i32.const 42)", "",
+tab_test("elem.drop 1 (i32.const 42)", "",
          WebAssembly.CompileError,
          /unused values not explicitly dropped by end of block/);
 
 // init: too many args
 tab_test("(table.init 1 (i32.const 1) (i32.const 1) (i32.const 1) (i32.const 1))",
          "",
          SyntaxError, /parsing wasm text at/);
 
--- a/js/src/jit-test/tests/wasm/passive-segs-nonboundary.js
+++ b/js/src/jit-test/tests/wasm/passive-segs-nonboundary.js
@@ -141,19 +141,19 @@ tab_test("(table.init 1 (i32.const 7) (i
          [e,e,3,1,4, 1,e,2,7,1, 8,e,7,5,2, 3,6,e,e,e, e,e,e,e,e, e,e,e,e,e]);
 
 // Passive init that overwrites existing active-init-created entries
 tab_test("(table.init 3 (i32.const 15) (i32.const 1) (i32.const 3))",
          [e,e,3,1,4, 1,e,e,e,e, e,e,7,5,2, 9,2,7,e,e, e,e,e,e,e, e,e,e,e,e]);
 
 // Perform active and passive initialisation and then multiple copies
 tab_test("(table.init 1 (i32.const 7) (i32.const 0) (i32.const 4)) \n" +
-         "table.drop 1 \n" +
+         "elem.drop 1 \n" +
          "(table.init 3 (i32.const 15) (i32.const 1) (i32.const 3)) \n" +
-         "table.drop 3 \n" +
+         "elem.drop 3 \n" +
          "(table.copy (i32.const 20) (i32.const 15) (i32.const 5)) \n" +
          "(table.copy (i32.const 21) (i32.const 29) (i32.const 1)) \n" +
          "(table.copy (i32.const 24) (i32.const 10) (i32.const 1)) \n" +
          "(table.copy (i32.const 13) (i32.const 11) (i32.const 4)) \n" +
          "(table.copy (i32.const 19) (i32.const 20) (i32.const 5))",
          [e,e,3,1,4, 1,e,2,7,1, 8,e,7,e,7, 5,2,7,e,9, e,7,e,8,8, e,e,e,e,e]);
 
 
@@ -238,19 +238,19 @@ mem_test("(memory.init 1 (i32.const 7) (
          [e,e,3,1,4, 1,e,2,7,1, 8,e,7,5,2, 3,6,e,e,e, e,e,e,e,e, e,e,e,e,e]);
 
 // Passive init that overwrites existing active-init-created entries
 mem_test("(memory.init 3 (i32.const 15) (i32.const 1) (i32.const 3))",
          [e,e,3,1,4, 1,e,e,e,e, e,e,7,5,2, 9,2,7,e,e, e,e,e,e,e, e,e,e,e,e]);
 
 // Perform active and passive initialisation and then multiple copies
 mem_test("(memory.init 1 (i32.const 7) (i32.const 0) (i32.const 4)) \n" +
-         "memory.drop 1 \n" +
+         "data.drop 1 \n" +
          "(memory.init 3 (i32.const 15) (i32.const 1) (i32.const 3)) \n" +
-         "memory.drop 3 \n" +
+         "data.drop 3 \n" +
          "(memory.copy (i32.const 20) (i32.const 15) (i32.const 5)) \n" +
          "(memory.copy (i32.const 21) (i32.const 29) (i32.const 1)) \n" +
          "(memory.copy (i32.const 24) (i32.const 10) (i32.const 1)) \n" +
          "(memory.copy (i32.const 13) (i32.const 11) (i32.const 4)) \n" +
          "(memory.copy (i32.const 19) (i32.const 20) (i32.const 5))",
          [e,e,3,1,4, 1,e,2,7,1, 8,e,7,e,7, 5,2,7,e,9, e,7,e,8,8, e,e,e,e,e]);
 
 
--- a/js/src/wasm/WasmAST.h
+++ b/js/src/wasm/WasmAST.h
@@ -402,17 +402,17 @@ enum class AstExprKind {
   First,
   GetGlobal,
   GetLocal,
   GrowMemory,
   If,
   Load,
 #ifdef ENABLE_WASM_BULKMEM_OPS
   MemOrTableCopy,
-  MemOrTableDrop,
+  DataOrElemDrop,
   MemFill,
   MemOrTableInit,
 #endif
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
   TableGet,
   TableGrow,
   TableSet,
   TableSize,
@@ -836,26 +836,26 @@ class AstMemOrTableCopy : public AstExpr
   bool isMem() const { return isMem_; }
   AstRef& destTable() { return destTable_; }
   AstExpr& dest() const { return *dest_; }
   AstRef& srcTable() { return srcTable_; }
   AstExpr& src() const { return *src_; }
   AstExpr& len() const { return *len_; }
 };
 
-class AstMemOrTableDrop : public AstExpr {
-  bool isMem_;
+class AstDataOrElemDrop : public AstExpr {
+  bool isData_;
   uint32_t segIndex_;
 
  public:
-  static const AstExprKind Kind = AstExprKind::MemOrTableDrop;
-  explicit AstMemOrTableDrop(bool isMem, uint32_t segIndex)
-      : AstExpr(Kind, ExprType::Void), isMem_(isMem), segIndex_(segIndex) {}
+  static const AstExprKind Kind = AstExprKind::DataOrElemDrop;
+  explicit AstDataOrElemDrop(bool isData, uint32_t segIndex)
+      : AstExpr(Kind, ExprType::Void), isData_(isData), segIndex_(segIndex) {}
 
-  bool isMem() const { return isMem_; }
+  bool isData() const { return isData_; }
   uint32_t segIndex() const { return segIndex_; }
 };
 
 class AstMemFill : public AstExpr {
   AstExpr* start_;
   AstExpr* val_;
   AstExpr* len_;
 
--- a/js/src/wasm/WasmBaselineCompile.cpp
+++ b/js/src/wasm/WasmBaselineCompile.cpp
@@ -6861,17 +6861,17 @@ class BaseCompiler final : public BaseCo
   MOZ_MUST_USE bool emitAtomicStore(ValType type, Scalar::Type viewType);
   MOZ_MUST_USE bool emitWait(ValType type, uint32_t byteSize);
   MOZ_MUST_USE bool emitWake();
   MOZ_MUST_USE bool emitAtomicXchg(ValType type, Scalar::Type viewType);
   void emitAtomicXchg64(MemoryAccessDesc* access, ValType type,
                         WantResult wantResult);
 #ifdef ENABLE_WASM_BULKMEM_OPS
   MOZ_MUST_USE bool emitMemOrTableCopy(bool isMem);
-  MOZ_MUST_USE bool emitMemOrTableDrop(bool isMem);
+  MOZ_MUST_USE bool emitDataOrElemDrop(bool isData);
   MOZ_MUST_USE bool emitMemFill();
   MOZ_MUST_USE bool emitMemOrTableInit(bool isMem);
 #endif
   MOZ_MUST_USE bool emitTableGet();
   MOZ_MUST_USE bool emitTableGrow();
   MOZ_MUST_USE bool emitTableSet();
   MOZ_MUST_USE bool emitTableSize();
   MOZ_MUST_USE bool emitStructNew();
@@ -10222,34 +10222,34 @@ bool BaseCompiler::emitMemOrTableCopy(bo
   Label ok;
   masm.branchTest32(Assembler::NotSigned, ReturnReg, ReturnReg, &ok);
   trap(Trap::ThrowReported);
   masm.bind(&ok);
 
   return true;
 }
 
-bool BaseCompiler::emitMemOrTableDrop(bool isMem) {
+bool BaseCompiler::emitDataOrElemDrop(bool isData) {
   uint32_t lineOrBytecode = readCallSiteLineOrBytecode();
 
   uint32_t segIndex = 0;
-  if (!iter_.readMemOrTableDrop(isMem, &segIndex)) {
+  if (!iter_.readDataOrElemDrop(isData, &segIndex)) {
     return false;
   }
 
   if (deadCode_) {
     return true;
   }
 
   // Despite the cast to int32_t, the callee regards the value as unsigned.
   //
   // Returns -1 on trap, otherwise 0.
   pushI32(int32_t(segIndex));
   SymbolicAddress callee =
-      isMem ? SymbolicAddress::MemDrop : SymbolicAddress::TableDrop;
+      isData ? SymbolicAddress::DataDrop : SymbolicAddress::ElemDrop;
   if (!emitInstanceCall(lineOrBytecode, SigPI_, ExprType::Void, callee)) {
     return false;
   }
 
   Label ok;
   masm.branchTest32(Assembler::NotSigned, ReturnReg, ReturnReg, &ok);
   trap(Trap::ThrowReported);
   masm.bind(&ok);
@@ -11528,26 +11528,26 @@ bool BaseCompiler::emitBody() {
 #else
             CHECK_NEXT(emitConversionOOM(
                 emitTruncateF64ToI64<TRUNC_UNSIGNED | TRUNC_SATURATING>,
                 ValType::F64, ValType::I64));
 #endif
 #ifdef ENABLE_WASM_BULKMEM_OPS
           case uint16_t(MiscOp::MemCopy):
             CHECK_NEXT(emitMemOrTableCopy(/*isMem=*/true));
-          case uint16_t(MiscOp::MemDrop):
-            CHECK_NEXT(emitMemOrTableDrop(/*isMem=*/true));
+          case uint16_t(MiscOp::DataDrop):
+            CHECK_NEXT(emitDataOrElemDrop(/*isData=*/true));
           case uint16_t(MiscOp::MemFill):
             CHECK_NEXT(emitMemFill());
           case uint16_t(MiscOp::MemInit):
             CHECK_NEXT(emitMemOrTableInit(/*isMem=*/true));
           case uint16_t(MiscOp::TableCopy):
             CHECK_NEXT(emitMemOrTableCopy(/*isMem=*/false));
-          case uint16_t(MiscOp::TableDrop):
-            CHECK_NEXT(emitMemOrTableDrop(/*isMem=*/false));
+          case uint16_t(MiscOp::ElemDrop):
+            CHECK_NEXT(emitDataOrElemDrop(/*isData=*/false));
           case uint16_t(MiscOp::TableInit):
             CHECK_NEXT(emitMemOrTableInit(/*isMem=*/false));
 #endif  // ENABLE_WASM_BULKMEM_OPS
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
           case uint16_t(MiscOp::TableGet):
             CHECK_NEXT(emitTableGet());
           case uint16_t(MiscOp::TableGrow):
             CHECK_NEXT(emitTableGrow());
--- a/js/src/wasm/WasmBuiltins.cpp
+++ b/js/src/wasm/WasmBuiltins.cpp
@@ -622,31 +622,31 @@ static void* AddressOf(SymbolicAddress i
       *abiType = Args_Int_GeneralGeneralInt64Int64;
       return FuncCast(Instance::wait_i64, *abiType);
     case SymbolicAddress::Wake:
       *abiType = Args_General3;
       return FuncCast(Instance::wake, *abiType);
     case SymbolicAddress::MemCopy:
       *abiType = Args_General4;
       return FuncCast(Instance::memCopy, *abiType);
-    case SymbolicAddress::MemDrop:
+    case SymbolicAddress::DataDrop:
       *abiType = Args_General2;
-      return FuncCast(Instance::memDrop, *abiType);
+      return FuncCast(Instance::dataDrop, *abiType);
     case SymbolicAddress::MemFill:
       *abiType = Args_General4;
       return FuncCast(Instance::memFill, *abiType);
     case SymbolicAddress::MemInit:
       *abiType = Args_General5;
       return FuncCast(Instance::memInit, *abiType);
     case SymbolicAddress::TableCopy:
       *abiType = Args_General6;
       return FuncCast(Instance::tableCopy, *abiType);
-    case SymbolicAddress::TableDrop:
+    case SymbolicAddress::ElemDrop:
       *abiType = Args_General2;
-      return FuncCast(Instance::tableDrop, *abiType);
+      return FuncCast(Instance::elemDrop, *abiType);
     case SymbolicAddress::TableInit:
       *abiType = Args_General6;
       return FuncCast(Instance::tableInit, *abiType);
     case SymbolicAddress::TableGet:
       *abiType = Args_General3;
       return FuncCast(Instance::tableGet, *abiType);
     case SymbolicAddress::TableGrow:
       *abiType = Args_General4;
@@ -734,21 +734,21 @@ bool wasm::NeedsBuiltinThunk(SymbolicAdd
     case SymbolicAddress::GrowMemory:
     case SymbolicAddress::CurrentMemory:
     case SymbolicAddress::WaitI32:
     case SymbolicAddress::WaitI64:
     case SymbolicAddress::Wake:
     case SymbolicAddress::CoerceInPlace_JitEntry:
     case SymbolicAddress::ReportInt64JSCall:
     case SymbolicAddress::MemCopy:
-    case SymbolicAddress::MemDrop:
+    case SymbolicAddress::DataDrop:
     case SymbolicAddress::MemFill:
     case SymbolicAddress::MemInit:
     case SymbolicAddress::TableCopy:
-    case SymbolicAddress::TableDrop:
+    case SymbolicAddress::ElemDrop:
     case SymbolicAddress::TableGet:
     case SymbolicAddress::TableGrow:
     case SymbolicAddress::TableInit:
     case SymbolicAddress::TableSet:
     case SymbolicAddress::TableSize:
     case SymbolicAddress::PostBarrier:
     case SymbolicAddress::StructNew:
     case SymbolicAddress::StructNarrow:
--- a/js/src/wasm/WasmConstants.h
+++ b/js/src/wasm/WasmConstants.h
@@ -368,21 +368,21 @@ enum class MiscOp {
   I64TruncSSatF32 = 0x04,
   I64TruncUSatF32 = 0x05,
   I64TruncSSatF64 = 0x06,
   I64TruncUSatF64 = 0x07,
 
   // Bulk memory operations.  Note, these are unofficial, but in accordance
   // with the proposal as of June 2018.
   MemInit = 0x08,
-  MemDrop = 0x09,
+  DataDrop = 0x09,
   MemCopy = 0x0a,
   MemFill = 0x0b,
   TableInit = 0x0c,
-  TableDrop = 0x0d,
+  ElemDrop = 0x0d,
   TableCopy = 0x0e,
 
   // Generalized tables (reftypes proposal).  Note, these are unofficial.
   TableGrow = 0x0f,
   TableGet = 0x10,
   TableSet = 0x11,
   TableSize = 0x12,
 
--- a/js/src/wasm/WasmFrameIter.cpp
+++ b/js/src/wasm/WasmFrameIter.cpp
@@ -1342,26 +1342,26 @@ static const char* ThunkedNativeToDescri
     case SymbolicAddress::Wake:
       return "call to native wake (in wasm)";
     case SymbolicAddress::CoerceInPlace_JitEntry:
       return "out-of-line coercion for jit entry arguments (in wasm)";
     case SymbolicAddress::ReportInt64JSCall:
       return "jit call to int64 wasm function";
     case SymbolicAddress::MemCopy:
       return "call to native memory.copy function";
-    case SymbolicAddress::MemDrop:
-      return "call to native memory.drop function";
+    case SymbolicAddress::DataDrop:
+      return "call to native data.drop function";
     case SymbolicAddress::MemFill:
       return "call to native memory.fill function";
     case SymbolicAddress::MemInit:
       return "call to native memory.init function";
     case SymbolicAddress::TableCopy:
       return "call to native table.copy function";
-    case SymbolicAddress::TableDrop:
-      return "call to native table.drop function";
+    case SymbolicAddress::ElemDrop:
+      return "call to native elem.drop function";
     case SymbolicAddress::TableGet:
       return "call to native table.get function";
     case SymbolicAddress::TableGrow:
       return "call to native table.grow function";
     case SymbolicAddress::TableInit:
       return "call to native table.init function";
     case SymbolicAddress::TableSet:
       return "call to native table.set function";
--- a/js/src/wasm/WasmInstance.cpp
+++ b/js/src/wasm/WasmInstance.cpp
@@ -442,17 +442,17 @@ Instance::memCopy(Instance* instance, ui
 
   JSContext* cx = TlsContext.get();
   JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                             JSMSG_WASM_OUT_OF_BOUNDS);
   return -1;
 }
 
 /* static */ int32_t /* -1 to signal trap; 0 for ok */
-Instance::memDrop(Instance* instance, uint32_t segIndex) {
+Instance::dataDrop(Instance* instance, uint32_t segIndex) {
   MOZ_RELEASE_ASSERT(size_t(segIndex) < instance->passiveDataSegments_.length(),
                      "ensured by validation");
 
   if (!instance->passiveDataSegments_[segIndex]) {
     JS_ReportErrorNumberASCII(TlsContext.get(), GetErrorMessage, nullptr,
                               JSMSG_WASM_INVALID_PASSIVE_DATA_SEG);
     return -1;
   }
@@ -588,17 +588,17 @@ Instance::tableCopy(Instance* instance, 
   }
 
   JS_ReportErrorNumberASCII(TlsContext.get(), GetErrorMessage, nullptr,
                             JSMSG_WASM_OUT_OF_BOUNDS);
   return -1;
 }
 
 /* static */ int32_t /* -1 to signal trap; 0 for ok */
-Instance::tableDrop(Instance* instance, uint32_t segIndex) {
+Instance::elemDrop(Instance* instance, uint32_t segIndex) {
   MOZ_RELEASE_ASSERT(size_t(segIndex) < instance->passiveElemSegments_.length(),
                      "ensured by validation");
 
   if (!instance->passiveElemSegments_[segIndex]) {
     JS_ReportErrorNumberASCII(TlsContext.get(), GetErrorMessage, nullptr,
                               JSMSG_WASM_INVALID_PASSIVE_ELEM_SEG);
     return -1;
   }
--- a/js/src/wasm/WasmInstance.h
+++ b/js/src/wasm/WasmInstance.h
@@ -187,25 +187,25 @@ class Instance {
   static uint32_t currentMemory_i32(Instance* instance);
   static int32_t wait_i32(Instance* instance, uint32_t byteOffset,
                           int32_t value, int64_t timeout);
   static int32_t wait_i64(Instance* instance, uint32_t byteOffset,
                           int64_t value, int64_t timeout);
   static int32_t wake(Instance* instance, uint32_t byteOffset, int32_t count);
   static int32_t memCopy(Instance* instance, uint32_t destByteOffset,
                          uint32_t srcByteOffset, uint32_t len);
-  static int32_t memDrop(Instance* instance, uint32_t segIndex);
+  static int32_t dataDrop(Instance* instance, uint32_t segIndex);
   static int32_t memFill(Instance* instance, uint32_t byteOffset,
                          uint32_t value, uint32_t len);
   static int32_t memInit(Instance* instance, uint32_t dstOffset,
                          uint32_t srcOffset, uint32_t len, uint32_t segIndex);
   static int32_t tableCopy(Instance* instance, uint32_t dstOffset,
                            uint32_t srcOffset, uint32_t len,
                            uint32_t dstTableIndex, uint32_t srcTableIndex);
-  static int32_t tableDrop(Instance* instance, uint32_t segIndex);
+  static int32_t elemDrop(Instance* instance, uint32_t segIndex);
   static void* tableGet(Instance* instance, uint32_t index,
                         uint32_t tableIndex);
   static uint32_t tableGrow(Instance* instance, uint32_t delta, void* initValue,
                             uint32_t tableIndex);
   static int32_t tableSet(Instance* instance, uint32_t index, void* value,
                           uint32_t tableIndex);
   static uint32_t tableSize(Instance* instance, uint32_t tableIndex);
   static int32_t tableInit(Instance* instance, uint32_t dstOffset,
--- a/js/src/wasm/WasmIonCompile.cpp
+++ b/js/src/wasm/WasmIonCompile.cpp
@@ -2961,19 +2961,19 @@ static bool EmitMemOrTableCopy(FunctionC
 
   if (!f.checkI32NegativeMeansFailedResult(ret)) {
     return false;
   }
 
   return true;
 }
 
-static bool EmitMemOrTableDrop(FunctionCompiler& f, bool isMem) {
+static bool EmitDataOrElemDrop(FunctionCompiler& f, bool isData) {
   uint32_t segIndexVal = 0;
-  if (!f.iter().readMemOrTableDrop(isMem, &segIndexVal)) {
+  if (!f.iter().readDataOrElemDrop(isData, &segIndexVal)) {
     return false;
   }
 
   if (f.inDeadCode()) {
     return false;
   }
 
   uint32_t lineOrBytecode = f.readCallSiteLineOrBytecode();
@@ -2993,17 +2993,17 @@ static bool EmitMemOrTableDrop(FunctionC
     return false;
   }
 
   if (!f.finishCall(&args)) {
     return false;
   }
 
   SymbolicAddress callee =
-      isMem ? SymbolicAddress::MemDrop : SymbolicAddress::TableDrop;
+      isData ? SymbolicAddress::DataDrop : SymbolicAddress::ElemDrop;
   MDefinition* ret;
   if (!f.builtinInstanceMethodCall(callee, args, ValType::I32, &ret)) {
     return false;
   }
 
   if (!f.checkI32NegativeMeansFailedResult(ret)) {
     return false;
   }
@@ -3687,26 +3687,26 @@ static bool EmitBodyExprs(FunctionCompil
                                MiscOp(op.b1) == MiscOp::I64TruncUSatF32, true));
           case uint16_t(MiscOp::I64TruncSSatF64):
           case uint16_t(MiscOp::I64TruncUSatF64):
             CHECK(EmitTruncate(f, ValType::F64, ValType::I64,
                                MiscOp(op.b1) == MiscOp::I64TruncUSatF64, true));
 #ifdef ENABLE_WASM_BULKMEM_OPS
           case uint16_t(MiscOp::MemCopy):
             CHECK(EmitMemOrTableCopy(f, /*isMem=*/true));
-          case uint16_t(MiscOp::MemDrop):
-            CHECK(EmitMemOrTableDrop(f, /*isMem=*/true));
+          case uint16_t(MiscOp::DataDrop):
+            CHECK(EmitDataOrElemDrop(f, /*isData=*/true));
           case uint16_t(MiscOp::MemFill):
             CHECK(EmitMemFill(f));
           case uint16_t(MiscOp::MemInit):
             CHECK(EmitMemOrTableInit(f, /*isMem=*/true));
           case uint16_t(MiscOp::TableCopy):
             CHECK(EmitMemOrTableCopy(f, /*isMem=*/false));
-          case uint16_t(MiscOp::TableDrop):
-            CHECK(EmitMemOrTableDrop(f, /*isMem=*/false));
+          case uint16_t(MiscOp::ElemDrop):
+            CHECK(EmitDataOrElemDrop(f, /*isData=*/false));
           case uint16_t(MiscOp::TableInit):
             CHECK(EmitMemOrTableInit(f, /*isMem=*/false));
 #endif
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
           case uint16_t(MiscOp::TableGet):
             CHECK(EmitTableGet(f));
           case uint16_t(MiscOp::TableGrow):
             CHECK(EmitTableGrow(f));
--- a/js/src/wasm/WasmOpIter.cpp
+++ b/js/src/wasm/WasmOpIter.cpp
@@ -288,19 +288,19 @@ OpKind wasm::Classify(OpBytes op) {
         case MiscOp::I64TruncSSatF32:
         case MiscOp::I64TruncUSatF32:
         case MiscOp::I64TruncSSatF64:
         case MiscOp::I64TruncUSatF64:
           return OpKind::Conversion;
         case MiscOp::MemCopy:
         case MiscOp::TableCopy:
           WASM_BULK_OP(OpKind::MemOrTableCopy);
-        case MiscOp::MemDrop:
-        case MiscOp::TableDrop:
-          WASM_BULK_OP(OpKind::MemOrTableDrop);
+        case MiscOp::DataDrop:
+        case MiscOp::ElemDrop:
+          WASM_BULK_OP(OpKind::DataOrElemDrop);
         case MiscOp::MemFill:
           WASM_BULK_OP(OpKind::MemFill);
         case MiscOp::MemInit:
         case MiscOp::TableInit:
           WASM_BULK_OP(OpKind::MemOrTableInit);
         case MiscOp::TableGet:
           WASM_TABLE_OP(OpKind::TableGet);
         case MiscOp::TableGrow:
--- a/js/src/wasm/WasmOpIter.h
+++ b/js/src/wasm/WasmOpIter.h
@@ -159,17 +159,17 @@ enum class OpKind {
   OldAtomicCompareExchange,
   OldAtomicExchange,
   ExtractLane,
   ReplaceLane,
   Swizzle,
   Shuffle,
   Splat,
   MemOrTableCopy,
-  MemOrTableDrop,
+  DataOrElemDrop,
   MemFill,
   MemOrTableInit,
   TableGet,
   TableGrow,
   TableSet,
   TableSize,
   RefNull,
   StructNew,
@@ -513,17 +513,17 @@ class MOZ_STACK_CLASS OpIter : private P
                                   ValType resultType, uint32_t byteSize,
                                   Value* value);
   MOZ_MUST_USE bool readAtomicCmpXchg(LinearMemoryAddress<Value>* addr,
                                       ValType resultType, uint32_t byteSize,
                                       Value* oldValue, Value* newValue);
   MOZ_MUST_USE bool readMemOrTableCopy(bool isMem, uint32_t* dstMemOrTableIndex,
                                        Value* dst, uint32_t* srcMemOrTableIndex,
                                        Value* src, Value* len);
-  MOZ_MUST_USE bool readMemOrTableDrop(bool isMem, uint32_t* segIndex);
+  MOZ_MUST_USE bool readDataOrElemDrop(bool isData, uint32_t* segIndex);
   MOZ_MUST_USE bool readMemFill(Value* start, Value* val, Value* len);
   MOZ_MUST_USE bool readMemOrTableInit(bool isMem, uint32_t* segIndex,
                                        uint32_t* dstTableIndex, Value* dst,
                                        Value* src, Value* len);
   MOZ_MUST_USE bool readTableGet(uint32_t* tableIndex, Value* index);
   MOZ_MUST_USE bool readTableGrow(uint32_t* tableIndex, Value* delta,
                                   Value* initValue);
   MOZ_MUST_USE bool readTableSet(uint32_t* tableIndex, Value* index,
@@ -1922,41 +1922,41 @@ inline bool OpIter<Policy>::readMemOrTab
   if (!popWithType(ValType::I32, dst)) {
     return false;
   }
 
   return true;
 }
 
 template <typename Policy>
-inline bool OpIter<Policy>::readMemOrTableDrop(bool isMem, uint32_t* segIndex) {
-  MOZ_ASSERT(Classify(op_) == OpKind::MemOrTableDrop);
-
-  if (isMem) {
+inline bool OpIter<Policy>::readDataOrElemDrop(bool isData, uint32_t* segIndex) {
+  MOZ_ASSERT(Classify(op_) == OpKind::DataOrElemDrop);
+
+  if (isData) {
     if (!env_.usesMemory()) {
       return fail("can't touch memory without memory");
     }
   } else {
     if (env_.tables.length() == 0) {
-      return fail("can't table.drop without a table");
+      return fail("can't elem.drop without a table");
     }
   }
 
   if (!readVarU32(segIndex)) {
     return false;
   }
 
-  if (isMem) {
+  if (isData) {
     // We can't range-check *segIndex at this point since we don't yet
     // know how many data segments the module has.  So note the index, but
     // defer the actual check for now.
     dvs_.lock()->notifyDataSegmentIndex(*segIndex, d_.currentOffset());
   } else {
     if (*segIndex >= env_.elemSegments.length()) {
-      return fail("element segment index out of range for table.drop");
+      return fail("element segment index out of range for elem.drop");
     }
   }
 
   return true;
 }
 
 template <typename Policy>
 inline bool OpIter<Policy>::readMemFill(Value* start, Value* val, Value* len) {
@@ -2037,17 +2037,17 @@ inline bool OpIter<Policy>::readMemOrTab
     }
   }
 
   if (!readVarU32(segIndex)) {
     return false;
   }
 
   if (isMem) {
-    // Same comment as for readMemOrTableDrop.
+    // Same comment as for readDataOrElemDrop.
     dvs_.lock()->notifyDataSegmentIndex(*segIndex, d_.currentOffset());
   } else {
     // Element segments must carry functions exclusively and anyfunc is not
     // yet a subtype of anyref.
     if (env_.tables[*dstTableIndex].kind != TableKind::AnyFunction) {
       return fail("only tables of 'anyfunc' may have element segments");
     }
     if (*segIndex >= env_.elemSegments.length()) {
--- a/js/src/wasm/WasmTextToBinary.cpp
+++ b/js/src/wasm/WasmTextToBinary.cpp
@@ -100,17 +100,17 @@ class WasmToken {
     Index,
     Memory,
     NegativeZero,
     Load,
     Local,
     Loop,
 #ifdef ENABLE_WASM_BULKMEM_OPS
     MemCopy,
-    MemDrop,
+    DataDrop,
     MemFill,
     MemInit,
 #endif
     Module,
     Mutable,
     Name,
 #ifdef ENABLE_WASM_GC
     StructNew,
@@ -134,17 +134,17 @@ class WasmToken {
     Shared,
     SignedInteger,
     Start,
     Struct,
     Store,
     Table,
 #ifdef ENABLE_WASM_BULKMEM_OPS
     TableCopy,
-    TableDrop,
+    ElemDrop,
     TableInit,
 #endif
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
     TableGet,
     TableGrow,
     TableSet,
     TableSize,
 #endif
@@ -312,17 +312,17 @@ class WasmToken {
       case GetGlobal:
       case GetLocal:
       case GrowMemory:
       case If:
       case Load:
       case Loop:
 #ifdef ENABLE_WASM_BULKMEM_OPS
       case MemCopy:
-      case MemDrop:
+      case DataDrop:
       case MemFill:
       case MemInit:
 #endif
 #ifdef ENABLE_WASM_GC
       case StructNew:
       case StructGet:
       case StructSet:
       case StructNarrow:
@@ -330,17 +330,17 @@ class WasmToken {
       case Nop:
       case RefNull:
       case Return:
       case SetGlobal:
       case SetLocal:
       case Store:
 #ifdef ENABLE_WASM_BULKMEM_OPS
       case TableCopy:
-      case TableDrop:
+      case ElemDrop:
       case TableInit:
 #endif
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
       case TableGet:
       case TableGrow:
       case TableSet:
       case TableSize:
 #endif
@@ -979,25 +979,31 @@ WasmToken WasmTokenStream::next() {
       }
       if (consume(u"current_memory")) {
         return WasmToken(WasmToken::CurrentMemory, begin, cur_);
       }
       break;
 
     case 'd':
       if (consume(u"data")) {
+        if (consume(u".drop")) {
+          return WasmToken(WasmToken::DataDrop, begin, cur_);
+        }
         return WasmToken(WasmToken::Data, begin, cur_);
       }
       if (consume(u"drop")) {
         return WasmToken(WasmToken::Drop, begin, cur_);
       }
       break;
 
     case 'e':
       if (consume(u"elem")) {
+        if (consume(u".drop")) {
+          return WasmToken(WasmToken::ElemDrop, begin, cur_);
+        }
         return WasmToken(WasmToken::Elem, begin, cur_);
       }
       if (consume(u"else")) {
         return WasmToken(WasmToken::Else, begin, cur_);
       }
       if (consume(u"end")) {
         return WasmToken(WasmToken::End, begin, cur_);
       }
@@ -2094,19 +2100,16 @@ WasmToken WasmTokenStream::next() {
       break;
 
     case 'm':
       if (consume(u"memory.")) {
 #ifdef ENABLE_WASM_BULKMEM_OPS
         if (consume(u"copy")) {
           return WasmToken(WasmToken::MemCopy, begin, cur_);
         }
-        if (consume(u"drop")) {
-          return WasmToken(WasmToken::MemDrop, begin, cur_);
-        }
         if (consume(u"fill")) {
           return WasmToken(WasmToken::MemFill, begin, cur_);
         }
         if (consume(u"init")) {
           return WasmToken(WasmToken::MemInit, begin, cur_);
         }
 #endif
         if (consume(u"grow")) {
@@ -2211,19 +2214,16 @@ WasmToken WasmTokenStream::next() {
       break;
 
     case 't':
       if (consume(u"table.")) {
 #ifdef ENABLE_WASM_BULKMEM_OPS
         if (consume(u"copy")) {
           return WasmToken(WasmToken::TableCopy, begin, cur_);
         }
-        if (consume(u"drop")) {
-          return WasmToken(WasmToken::TableDrop, begin, cur_);
-        }
         if (consume(u"init")) {
           return WasmToken(WasmToken::TableInit, begin, cur_);
         }
 #endif
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
         if (consume(u"get")) {
           return WasmToken(WasmToken::TableGet, begin, cur_);
         }
@@ -3654,23 +3654,23 @@ static AstMemOrTableCopy* ParseMemOrTabl
   if (!len) {
     return nullptr;
   }
 
   return new (c.lifo) AstMemOrTableCopy(isMem, targetMemOrTable, dest,
                                         memOrTableSource, src, len);
 }
 
-static AstMemOrTableDrop* ParseMemOrTableDrop(WasmParseContext& c, bool isMem) {
+static AstDataOrElemDrop* ParseDataOrElemDrop(WasmParseContext& c, bool isData) {
   WasmToken segIndexTok;
   if (!c.ts.getIf(WasmToken::Index, &segIndexTok)) {
     return nullptr;
   }
 
-  return new (c.lifo) AstMemOrTableDrop(isMem, segIndexTok.index());
+  return new (c.lifo) AstDataOrElemDrop(isData, segIndexTok.index());
 }
 
 static AstMemFill* ParseMemFill(WasmParseContext& c, bool inParens) {
   AstExpr* start = ParseExpr(c, inParens);
   if (!start) {
     return nullptr;
   }
 
@@ -3975,26 +3975,26 @@ static AstExpr* ParseExprBody(WasmParseC
       return new (c.lifo) AstNop();
     case WasmToken::CurrentMemory:
       return new (c.lifo) AstCurrentMemory();
     case WasmToken::GrowMemory:
       return ParseGrowMemory(c, inParens);
 #ifdef ENABLE_WASM_BULKMEM_OPS
     case WasmToken::MemCopy:
       return ParseMemOrTableCopy(c, inParens, /*isMem=*/true);
-    case WasmToken::MemDrop:
-      return ParseMemOrTableDrop(c, /*isMem=*/true);
+    case WasmToken::DataDrop:
+      return ParseDataOrElemDrop(c, /*isData=*/true);
     case WasmToken::MemFill:
       return ParseMemFill(c, inParens);
     case WasmToken::MemInit:
       return ParseMemOrTableInit(c, inParens, /*isMem=*/true);
     case WasmToken::TableCopy:
       return ParseMemOrTableCopy(c, inParens, /*isMem=*/false);
-    case WasmToken::TableDrop:
-      return ParseMemOrTableDrop(c, /*isMem=*/false);
+    case WasmToken::ElemDrop:
+      return ParseDataOrElemDrop(c, /*isData=*/false);
     case WasmToken::TableInit:
       return ParseMemOrTableInit(c, inParens, /*isMem=*/false);
 #endif
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
     case WasmToken::TableGet:
       return ParseTableGet(c, inParens);
     case WasmToken::TableGrow:
       return ParseTableGrow(c, inParens);
@@ -5709,17 +5709,17 @@ static bool ResolveExpr(Resolver& r, Ast
       return ResolveAtomicStore(r, expr.as<AstAtomicStore>());
     case AstExprKind::Wait:
       return ResolveWait(r, expr.as<AstWait>());
     case AstExprKind::Wake:
       return ResolveWake(r, expr.as<AstWake>());
 #ifdef ENABLE_WASM_BULKMEM_OPS
     case AstExprKind::MemOrTableCopy:
       return ResolveMemOrTableCopy(r, expr.as<AstMemOrTableCopy>());
-    case AstExprKind::MemOrTableDrop:
+    case AstExprKind::DataOrElemDrop:
       return true;
     case AstExprKind::MemFill:
       return ResolveMemFill(r, expr.as<AstMemFill>());
     case AstExprKind::MemOrTableInit:
       return ResolveMemOrTableInit(r, expr.as<AstMemOrTableInit>());
 #endif
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
     case AstExprKind::TableGet:
@@ -6328,18 +6328,18 @@ static bool EncodeMemOrTableCopy(Encoder
     result = result &&
              e.writeVarU32(uint32_t(MemoryTableFlags::HasTableIndex)) &&
              e.writeVarU32(s.destTable().index()) &&
              e.writeVarU32(s.srcTable().index());
   }
   return result;
 }
 
-static bool EncodeMemOrTableDrop(Encoder& e, AstMemOrTableDrop& s) {
-  return e.writeOp(s.isMem() ? MiscOp::MemDrop : MiscOp::TableDrop) &&
+static bool EncodeDataOrElemDrop(Encoder& e, AstDataOrElemDrop& s) {
+  return e.writeOp(s.isData() ? MiscOp::DataDrop : MiscOp::ElemDrop) &&
          e.writeVarU32(s.segIndex());
 }
 
 static bool EncodeMemFill(Encoder& e, AstMemFill& s) {
   return EncodeExpr(e, s.start()) && EncodeExpr(e, s.val()) &&
          EncodeExpr(e, s.len()) && e.writeOp(MiscOp::MemFill) &&
          e.writeVarU32(uint32_t(MemoryTableFlags::Default));
 }
@@ -6521,18 +6521,18 @@ static bool EncodeExpr(Encoder& e, AstEx
       return EncodeAtomicStore(e, expr.as<AstAtomicStore>());
     case AstExprKind::Wait:
       return EncodeWait(e, expr.as<AstWait>());
     case AstExprKind::Wake:
       return EncodeWake(e, expr.as<AstWake>());
 #ifdef ENABLE_WASM_BULKMEM_OPS
     case AstExprKind::MemOrTableCopy:
       return EncodeMemOrTableCopy(e, expr.as<AstMemOrTableCopy>());
-    case AstExprKind::MemOrTableDrop:
-      return EncodeMemOrTableDrop(e, expr.as<AstMemOrTableDrop>());
+    case AstExprKind::DataOrElemDrop:
+      return EncodeDataOrElemDrop(e, expr.as<AstDataOrElemDrop>());
     case AstExprKind::MemFill:
       return EncodeMemFill(e, expr.as<AstMemFill>());
     case AstExprKind::MemOrTableInit:
       return EncodeMemOrTableInit(e, expr.as<AstMemOrTableInit>());
 #endif
 #ifdef ENABLE_WASM_GENERALIZED_TABLES
     case AstExprKind::TableGet:
       return EncodeTableGet(e, expr.as<AstTableGet>());
--- a/js/src/wasm/WasmTypes.h
+++ b/js/src/wasm/WasmTypes.h
@@ -1145,17 +1145,17 @@ class GlobalDesc {
     MOZ_CRASH("unexpected global kind");
   }
 };
 
 typedef Vector<GlobalDesc, 0, SystemAllocPolicy> GlobalDescVector;
 
 // When a ElemSegment is "passive" it is shared between a wasm::Module and its
 // wasm::Instances. To allow each segment to be released as soon as the last
-// Instance table.drops it and the Module is destroyed, each ElemSegment is
+// Instance elem.drops it and the Module is destroyed, each ElemSegment is
 // individually atomically ref-counted.
 
 struct ElemSegment : AtomicRefCounted<ElemSegment> {
   uint32_t tableIndex;
   Maybe<InitExpr> offsetIfActive;
   Uint32Vector elemFuncIndices;
 
   bool active() const { return !!offsetIfActive; }
@@ -2062,21 +2062,21 @@ enum class SymbolicAddress {
   Int64ToFloat32,
   Int64ToDouble,
   GrowMemory,
   CurrentMemory,
   WaitI32,
   WaitI64,
   Wake,
   MemCopy,
-  MemDrop,
+  DataDrop,
   MemFill,
   MemInit,
   TableCopy,
-  TableDrop,
+  ElemDrop,
   TableGet,
   TableGrow,
   TableInit,
   TableSet,
   TableSize,
   PostBarrier,
   StructNew,
   StructNarrow,
--- a/js/src/wasm/WasmValidate.cpp
+++ b/js/src/wasm/WasmValidate.cpp
@@ -880,19 +880,19 @@ static bool DecodeFunctionBodyExprs(cons
 #ifdef ENABLE_WASM_BULKMEM_OPS
           case uint16_t(MiscOp::MemCopy): {
             uint32_t unusedDestMemIndex;
             uint32_t unusedSrcMemIndex;
             CHECK(iter.readMemOrTableCopy(/*isMem=*/true, &unusedDestMemIndex,
                                           &nothing, &unusedSrcMemIndex,
                                           &nothing, &nothing));
           }
-          case uint16_t(MiscOp::MemDrop): {
+          case uint16_t(MiscOp::DataDrop): {
             uint32_t unusedSegIndex;
-            CHECK(iter.readMemOrTableDrop(/*isMem=*/true, &unusedSegIndex));
+            CHECK(iter.readDataOrElemDrop(/*isData=*/true, &unusedSegIndex));
           }
           case uint16_t(MiscOp::MemFill):
             CHECK(iter.readMemFill(&nothing, &nothing, &nothing));
           case uint16_t(MiscOp::MemInit): {
             uint32_t unusedSegIndex;
             uint32_t unusedTableIndex;
             CHECK(iter.readMemOrTableInit(/*isMem=*/true, &unusedSegIndex,
                                           &unusedTableIndex, &nothing, &nothing,
@@ -900,19 +900,19 @@ static bool DecodeFunctionBodyExprs(cons
           }
           case uint16_t(MiscOp::TableCopy): {
             uint32_t unusedDestTableIndex;
             uint32_t unusedSrcTableIndex;
             CHECK(iter.readMemOrTableCopy(
                 /*isMem=*/false, &unusedDestTableIndex, &nothing,
                 &unusedSrcTableIndex, &nothing, &nothing));
           }
-          case uint16_t(MiscOp::TableDrop): {
+          case uint16_t(MiscOp::ElemDrop): {
             uint32_t unusedSegIndex;
-            CHECK(iter.readMemOrTableDrop(/*isMem=*/false, &unusedSegIndex));
+            CHECK(iter.readDataOrElemDrop(/*isData=*/false, &unusedSegIndex));
           }
           case uint16_t(MiscOp::TableInit): {
             uint32_t unusedSegIndex;
             uint32_t unusedTableIndex;
             CHECK(iter.readMemOrTableInit(/*isMem=*/false, &unusedSegIndex,
                                           &unusedTableIndex, &nothing, &nothing,
                                           &nothing));
           }