diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc index 8956e5e887..2c8b6526da 100644 --- a/src/compiler/wasm-compiler.cc +++ b/src/compiler/wasm-compiler.cc @@ -2350,7 +2350,7 @@ Node* WasmGraphBuilder::Throw(uint32_t exception_index, break; case wasm::kI8: case wasm::kI16: - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: UNREACHABLE(); } @@ -2481,7 +2481,7 @@ Node* WasmGraphBuilder::GetExceptionValues(Node* except_obj, break; case wasm::kI8: case wasm::kI16: - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: UNREACHABLE(); } @@ -6241,7 +6241,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder { UNIMPLEMENTED(); case wasm::kI8: case wasm::kI16: - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: UNREACHABLE(); } @@ -6389,7 +6389,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder { case wasm::kI8: case wasm::kI16: case wasm::kBottom: - case wasm::kStmt: + case wasm::kVoid: UNREACHABLE(); break; } @@ -6444,7 +6444,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder { case wasm::kI8: case wasm::kI16: case wasm::kBottom: - case wasm::kStmt: + case wasm::kVoid: UNREACHABLE(); break; } @@ -6612,7 +6612,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder { case wasm::kI8: case wasm::kI16: case wasm::kBottom: - case wasm::kStmt: + case wasm::kVoid: return false; case wasm::kI32: case wasm::kF32: @@ -6661,7 +6661,7 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder { case wasm::kI8: case wasm::kI16: case wasm::kBottom: - case wasm::kStmt: + case wasm::kVoid: UNREACHABLE(); break; } diff --git a/src/compiler/wasm-compiler.h b/src/compiler/wasm-compiler.h index 0944db82a0..494ad69d7e 100644 --- a/src/compiler/wasm-compiler.h +++ b/src/compiler/wasm-compiler.h @@ -535,9 +535,9 @@ class WasmGraphBuilder { const Operator* GetSafeLoadOperator(int offset, wasm::ValueType type); const Operator* GetSafeStoreOperator(int offset, wasm::ValueType type); Node* BuildChangeEndiannessStore(Node* node, MachineRepresentation rep, - wasm::ValueType wasmtype = wasm::kWasmStmt); + wasm::ValueType wasmtype = wasm::kWasmVoid); Node* BuildChangeEndiannessLoad(Node* node, MachineType type, - wasm::ValueType wasmtype = wasm::kWasmStmt); + wasm::ValueType wasmtype = wasm::kWasmVoid); Node* MaskShiftCount32(Node* node); Node* MaskShiftCount64(Node* node); diff --git a/src/debug/debug-wasm-objects.cc b/src/debug/debug-wasm-objects.cc index 66ea30219d..070221f433 100644 --- a/src/debug/debug-wasm-objects.cc +++ b/src/debug/debug-wasm-objects.cc @@ -1035,7 +1035,7 @@ Handle WasmValueObject::New( StaticCharVector("(unimplemented)")); break; } - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: UNREACHABLE(); } diff --git a/src/debug/wasm/gdb-server/wasm-module-debug.cc b/src/debug/wasm/gdb-server/wasm-module-debug.cc index 2c08595f84..9e608e9ed0 100644 --- a/src/debug/wasm/gdb-server/wasm-module-debug.cc +++ b/src/debug/wasm/gdb-server/wasm-module-debug.cc @@ -400,7 +400,7 @@ bool WasmModuleDebug::GetWasmValue(const wasm::WasmValue& wasm_value, case wasm::kWasmS128.kind(): return StoreValue(wasm_value.to_s128(), buffer, buffer_size, size); - case wasm::kWasmStmt.kind(): + case wasm::kWasmVoid.kind(): case wasm::kWasmExternRef.kind(): case wasm::kWasmBottom.kind(): default: diff --git a/src/diagnostics/objects-printer.cc b/src/diagnostics/objects-printer.cc index 7737602f89..b20bdbf10f 100644 --- a/src/diagnostics/objects-printer.cc +++ b/src/diagnostics/objects-printer.cc @@ -1843,7 +1843,7 @@ void WasmStruct::WasmStructPrint(std::ostream& os) { // NOLINT case wasm::kRtt: case wasm::kRttWithDepth: case wasm::kBottom: - case wasm::kStmt: + case wasm::kVoid: os << "UNIMPLEMENTED"; // TODO(7748): Implement. break; } @@ -1883,7 +1883,7 @@ void WasmArray::WasmArrayPrint(std::ostream& os) { // NOLINT case wasm::kRtt: case wasm::kRttWithDepth: case wasm::kBottom: - case wasm::kStmt: + case wasm::kVoid: os << "\n Printing elements of this type is unimplemented, sorry"; // TODO(7748): Implement. break; diff --git a/src/wasm/baseline/arm/liftoff-assembler-arm.h b/src/wasm/baseline/arm/liftoff-assembler-arm.h index a42ecf777c..3df37ec899 100644 --- a/src/wasm/baseline/arm/liftoff-assembler-arm.h +++ b/src/wasm/baseline/arm/liftoff-assembler-arm.h @@ -4176,7 +4176,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, } // Load potential output value from the buffer on the stack. - if (out_argument_kind != kStmt) { + if (out_argument_kind != kVoid) { switch (out_argument_kind) { case kI32: ldr(result_reg->gp(), MemOperand(sp)); diff --git a/src/wasm/baseline/arm64/liftoff-assembler-arm64.h b/src/wasm/baseline/arm64/liftoff-assembler-arm64.h index d311266075..a18464084e 100644 --- a/src/wasm/baseline/arm64/liftoff-assembler-arm64.h +++ b/src/wasm/baseline/arm64/liftoff-assembler-arm64.h @@ -3167,7 +3167,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, } // Load potential output value from the buffer on the stack. - if (out_argument_kind != kStmt) { + if (out_argument_kind != kVoid) { Peek(liftoff::GetRegFromType(*next_result_reg, out_argument_kind), 0); } diff --git a/src/wasm/baseline/ia32/liftoff-assembler-ia32.h b/src/wasm/baseline/ia32/liftoff-assembler-ia32.h index 4bd0e1e5dd..a3cbd7f4d2 100644 --- a/src/wasm/baseline/ia32/liftoff-assembler-ia32.h +++ b/src/wasm/baseline/ia32/liftoff-assembler-ia32.h @@ -4857,7 +4857,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, } // Load potential output value from the buffer on the stack. - if (out_argument_kind != kStmt) { + if (out_argument_kind != kVoid) { liftoff::Load(this, *next_result_reg, esp, 0, out_argument_kind); } diff --git a/src/wasm/baseline/liftoff-assembler.h b/src/wasm/baseline/liftoff-assembler.h index b07f0cd1bd..3090bc8165 100644 --- a/src/wasm/baseline/liftoff-assembler.h +++ b/src/wasm/baseline/liftoff-assembler.h @@ -1395,7 +1395,7 @@ class LiftoffAssembler : public TurboAssembler { inline void DropStackSlotsAndRet(uint32_t num_stack_slots); // Execute a C call. Arguments are pushed to the stack and a pointer to this - // region is passed to the C function. If {out_argument_kind != kStmt}, + // region is passed to the C function. If {out_argument_kind != kVoid}, // this is the return value of the C function, stored in {rets[0]}. Further // outputs (specified in {sig->returns()}) are read from the buffer and stored // in the remaining {rets} registers. diff --git a/src/wasm/baseline/liftoff-compiler.cc b/src/wasm/baseline/liftoff-compiler.cc index ed7a39b497..c16611ee34 100644 --- a/src/wasm/baseline/liftoff-compiler.cc +++ b/src/wasm/baseline/liftoff-compiler.cc @@ -544,7 +544,7 @@ class LiftoffCompiler { bailout_reason = kRefTypes; break; case kBottom: - case kStmt: + case kVoid: UNREACHABLE(); } EmbeddedVector buffer; @@ -1345,7 +1345,7 @@ class LiftoffCompiler { param_bytes += element_size_bytes(param_kind); } int out_arg_bytes = - out_argument_kind == kStmt ? 0 : element_size_bytes(out_argument_kind); + out_argument_kind == kVoid ? 0 : element_size_bytes(out_argument_kind); int stack_bytes = std::max(param_bytes, out_arg_bytes); __ CallC(sig, arg_regs, result_regs, out_argument_kind, stack_bytes, ext_ref); @@ -1564,7 +1564,7 @@ class LiftoffCompiler { [=](LiftoffRegister dst, LiftoffRegister src) { if (__ emit_i32_popcnt(dst.gp(), src.gp())) return; auto sig = MakeSig::Returns(kI32).Params(kI32); - GenerateCCall(&dst, &sig, kStmt, &src, + GenerateCCall(&dst, &sig, kVoid, &src, ExternalReference::wasm_word32_popcnt()); }); case kExprI64Popcnt: @@ -1574,7 +1574,7 @@ class LiftoffCompiler { // The c function returns i32. We will zero-extend later. auto sig = MakeSig::Returns(kI32).Params(kI64); LiftoffRegister c_call_dst = kNeedI64RegPair ? dst.low() : dst; - GenerateCCall(&c_call_dst, &sig, kStmt, &src, + GenerateCCall(&c_call_dst, &sig, kVoid, &src, ExternalReference::wasm_word64_popcnt()); // Now zero-extend the result to i64. __ emit_type_conversion(kExprI64UConvertI32, dst, c_call_dst, @@ -1704,7 +1704,7 @@ class LiftoffCompiler { ValueKind sig_kinds[] = {k##kind, k##kind, k##kind}; \ const bool out_via_stack = k##kind == kI64; \ ValueKindSig sig(out_via_stack ? 0 : 1, 2, sig_kinds); \ - ValueKind out_arg_kind = out_via_stack ? kI64 : kStmt; \ + ValueKind out_arg_kind = out_via_stack ? kI64 : kVoid; \ GenerateCCall(&dst, &sig, out_arg_kind, args, ext_ref); \ }); switch (opcode) { @@ -3989,7 +3989,7 @@ class LiftoffCompiler { } case wasm::kI8: case wasm::kI16: - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: UNREACHABLE(); } @@ -4046,7 +4046,7 @@ class LiftoffCompiler { } case wasm::kI8: case wasm::kI16: - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: UNREACHABLE(); } @@ -4603,7 +4603,7 @@ class LiftoffCompiler { // We don't need the instance anymore after the call. We can use the // register for the result. LiftoffRegister result(instance); - GenerateCCall(&result, &sig, kStmt, args, ext_ref); + GenerateCCall(&result, &sig, kVoid, args, ext_ref); Label* trap_label = AddOutOfLineTrap(decoder, WasmCode::kThrowWasmTrapMemOutOfBounds); __ emit_cond_jump(kEqual, trap_label, kI32, result.gp()); @@ -4644,7 +4644,7 @@ class LiftoffCompiler { // We don't need the instance anymore after the call. We can use the // register for the result. LiftoffRegister result(instance); - GenerateCCall(&result, &sig, kStmt, args, ext_ref); + GenerateCCall(&result, &sig, kVoid, args, ext_ref); Label* trap_label = AddOutOfLineTrap(decoder, WasmCode::kThrowWasmTrapMemOutOfBounds); __ emit_cond_jump(kEqual, trap_label, kI32, result.gp()); @@ -4665,7 +4665,7 @@ class LiftoffCompiler { // We don't need the instance anymore after the call. We can use the // register for the result. LiftoffRegister result(instance); - GenerateCCall(&result, &sig, kStmt, args, ext_ref); + GenerateCCall(&result, &sig, kVoid, args, ext_ref); Label* trap_label = AddOutOfLineTrap(decoder, WasmCode::kThrowWasmTrapMemOutOfBounds); __ emit_cond_jump(kEqual, trap_label, kI32, result.gp()); @@ -6013,7 +6013,7 @@ class LiftoffCompiler { return LoadNullValue(reg.gp(), pinned); case kRtt: case kRttWithDepth: - case kStmt: + case kVoid: case kBottom: case kRef: UNREACHABLE(); diff --git a/src/wasm/baseline/mips/liftoff-assembler-mips.h b/src/wasm/baseline/mips/liftoff-assembler-mips.h index 53fc0a51b7..ca715a8a32 100644 --- a/src/wasm/baseline/mips/liftoff-assembler-mips.h +++ b/src/wasm/baseline/mips/liftoff-assembler-mips.h @@ -2948,7 +2948,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, } // Load potential output value from the buffer on the stack. - if (out_argument_kind != kStmt) { + if (out_argument_kind != kVoid) { liftoff::Load(this, *next_result_reg, sp, 0, out_argument_kind); } diff --git a/src/wasm/baseline/mips64/liftoff-assembler-mips64.h b/src/wasm/baseline/mips64/liftoff-assembler-mips64.h index fb8d8d7042..a5a9f8ce23 100644 --- a/src/wasm/baseline/mips64/liftoff-assembler-mips64.h +++ b/src/wasm/baseline/mips64/liftoff-assembler-mips64.h @@ -3116,7 +3116,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, } // Load potential output value from the buffer on the stack. - if (out_argument_kind != kStmt) { + if (out_argument_kind != kVoid) { liftoff::Load(this, *next_result_reg, MemOperand(sp, 0), out_argument_kind); } diff --git a/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h b/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h index bf127ed3c2..47f8ce2125 100644 --- a/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h +++ b/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h @@ -2523,7 +2523,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, } // Load potential output value from the buffer on the stack. - if (out_argument_kind != kStmt) { + if (out_argument_kind != kVoid) { liftoff::Load(this, *next_result_reg, MemOperand(sp, 0), out_argument_kind); } diff --git a/src/wasm/baseline/s390/liftoff-assembler-s390.h b/src/wasm/baseline/s390/liftoff-assembler-s390.h index e0b257651e..3925b4c7df 100644 --- a/src/wasm/baseline/s390/liftoff-assembler-s390.h +++ b/src/wasm/baseline/s390/liftoff-assembler-s390.h @@ -2804,7 +2804,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, } // Load potential output value from the buffer on the stack. - if (out_argument_kind != kStmt) { + if (out_argument_kind != kVoid) { switch (out_argument_kind) { case kI32: LoadS32(result_reg->gp(), MemOperand(sp)); diff --git a/src/wasm/baseline/x64/liftoff-assembler-x64.h b/src/wasm/baseline/x64/liftoff-assembler-x64.h index 35903839b1..6e5e241663 100644 --- a/src/wasm/baseline/x64/liftoff-assembler-x64.h +++ b/src/wasm/baseline/x64/liftoff-assembler-x64.h @@ -4363,7 +4363,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, } // Load potential output value from the buffer on the stack. - if (out_argument_kind != kStmt) { + if (out_argument_kind != kVoid) { liftoff::Load(this, *next_result_reg, Operand(rsp, 0), out_argument_kind); } diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc index be4f9464d0..3af5afaee3 100644 --- a/src/wasm/c-api.cc +++ b/src/wasm/c-api.cc @@ -1212,7 +1212,7 @@ namespace { class SignatureHelper : public i::AllStatic { public: // Use an invalid type as a marker separating params and results. - static constexpr i::wasm::ValueType kMarker = i::wasm::kWasmStmt; + static constexpr i::wasm::ValueType kMarker = i::wasm::kWasmVoid; static i::Handle> Serialize( i::Isolate* isolate, FuncType* type) { @@ -1427,7 +1427,7 @@ void PushArgs(const i::wasm::FunctionSig* sig, const Val args[], UNIMPLEMENTED(); case i::wasm::kI8: case i::wasm::kI16: - case i::wasm::kStmt: + case i::wasm::kVoid: case i::wasm::kBottom: UNREACHABLE(); break; @@ -1468,7 +1468,7 @@ void PopArgs(const i::wasm::FunctionSig* sig, Val results[], UNIMPLEMENTED(); case i::wasm::kI8: case i::wasm::kI16: - case i::wasm::kStmt: + case i::wasm::kVoid: case i::wasm::kBottom: UNREACHABLE(); break; @@ -1733,7 +1733,7 @@ auto Global::get() const -> Val { UNIMPLEMENTED(); case i::wasm::kI8: case i::wasm::kI16: - case i::wasm::kStmt: + case i::wasm::kVoid: case i::wasm::kBottom: UNREACHABLE(); } diff --git a/src/wasm/function-body-decoder-impl.h b/src/wasm/function-body-decoder-impl.h index 2e9d7d3f30..784b615a7d 100644 --- a/src/wasm/function-body-decoder-impl.h +++ b/src/wasm/function-body-decoder-impl.h @@ -484,7 +484,7 @@ struct ImmF64Immediate { template struct GlobalIndexImmediate { uint32_t index; - ValueType type = kWasmStmt; + ValueType type = kWasmVoid; const WasmGlobal* global = nullptr; uint32_t length; @@ -518,7 +518,7 @@ struct SelectTypeImmediate { template struct BlockTypeImmediate { uint32_t length = 1; - ValueType type = kWasmStmt; + ValueType type = kWasmVoid; uint32_t sig_index = 0; const FunctionSig* sig = nullptr; @@ -556,7 +556,7 @@ struct BlockTypeImmediate { return static_cast(sig->parameter_count()); } uint32_t out_arity() const { - if (type == kWasmStmt) return 0; + if (type == kWasmVoid) return 0; if (type != kWasmBottom) return 1; return static_cast(sig->return_count()); } @@ -566,7 +566,7 @@ struct BlockTypeImmediate { } ValueType out_type(uint32_t index) { if (type == kWasmBottom) return sig->GetReturn(index); - DCHECK_NE(kWasmStmt, type); + DCHECK_NE(kWasmVoid, type); DCHECK_EQ(0, index); return type; } @@ -914,7 +914,7 @@ struct PcForErrors { // An entry on the value stack. template struct ValueBase : public PcForErrors { - ValueType type = kWasmStmt; + ValueType type = kWasmVoid; ValueBase(const byte* pc, ValueType type) : PcForErrors(pc), type(type) {} @@ -3628,7 +3628,7 @@ class WasmFullDecoder : public WasmDecoder { ValueType GetReturnType(const FunctionSig* sig) { DCHECK_GE(1, sig->return_count()); - return sig->return_count() == 0 ? kWasmStmt : sig->GetReturn(); + return sig->return_count() == 0 ? kWasmVoid : sig->GetReturn(); } // TODO(jkummerow): Consider refactoring control stack management so @@ -4568,7 +4568,7 @@ class WasmFullDecoder : public WasmDecoder { #define CASE_ATOMIC_STORE_OP(Name, Type) \ case kExpr##Name: { \ memtype = MachineType::Type(); \ - ret_type = kWasmStmt; \ + ret_type = kWasmVoid; \ break; /* to generic mem access code below */ \ } ATOMIC_STORE_OP_LIST(CASE_ATOMIC_STORE_OP) @@ -4604,7 +4604,7 @@ class WasmFullDecoder : public WasmDecoder { // then). CHECK(!this->module_->is_memory64); ArgVector args = PeekArgs(sig); - if (ret_type == kWasmStmt) { + if (ret_type == kWasmVoid) { CALL_INTERFACE_IF_REACHABLE(AtomicOp, opcode, VectorOf(args), imm, nullptr); DropArgs(sig); @@ -4756,7 +4756,7 @@ class WasmFullDecoder : public WasmDecoder { V8_INLINE Value CreateValue(ValueType type) { return Value{this->pc_, type}; } V8_INLINE void Push(Value value) { - DCHECK_NE(kWasmStmt, value.type); + DCHECK_NE(kWasmVoid, value.type); // {EnsureStackSpace} should have been called before, either in the central // decoding loop, or individually if more than one element is pushed. DCHECK_GT(stack_capacity_end_, stack_end_); @@ -5072,7 +5072,7 @@ class WasmFullDecoder : public WasmDecoder { int BuildSimpleOperator(WasmOpcode opcode, const FunctionSig* sig) { DCHECK_GE(1, sig->return_count()); - ValueType ret = sig->return_count() == 0 ? kWasmStmt : sig->GetReturn(0); + ValueType ret = sig->return_count() == 0 ? kWasmVoid : sig->GetReturn(0); if (sig->parameter_count() == 1) { return BuildSimpleOperator(opcode, ret, sig->GetParam(0)); } else { @@ -5085,7 +5085,7 @@ class WasmFullDecoder : public WasmDecoder { int BuildSimpleOperator(WasmOpcode opcode, ValueType return_type, ValueType arg_type) { Value val = Peek(0, 0, arg_type); - if (return_type == kWasmStmt) { + if (return_type == kWasmVoid) { CALL_INTERFACE_IF_REACHABLE(UnOp, opcode, val, nullptr); Drop(val); } else { @@ -5101,7 +5101,7 @@ class WasmFullDecoder : public WasmDecoder { ValueType lhs_type, ValueType rhs_type) { Value rval = Peek(0, 1, rhs_type); Value lval = Peek(1, 0, lhs_type); - if (return_type == kWasmStmt) { + if (return_type == kWasmVoid) { CALL_INTERFACE_IF_REACHABLE(BinOp, opcode, lval, rval, nullptr); Drop(2); } else { diff --git a/src/wasm/graph-builder-interface.cc b/src/wasm/graph-builder-interface.cc index 6d034ec913..816ebb4ed4 100644 --- a/src/wasm/graph-builder-interface.cc +++ b/src/wasm/graph-builder-interface.cc @@ -1219,7 +1219,7 @@ class WasmGraphBuildingInterface { return builder_->RefNull(); case kRtt: case kRttWithDepth: - case kStmt: + case kVoid: case kBottom: case kRef: UNREACHABLE(); diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc index 8b67a2e3f8..a6a026d189 100644 --- a/src/wasm/module-decoder.cc +++ b/src/wasm/module-decoder.cc @@ -647,7 +647,7 @@ class ModuleDecoderImpl : public Decoder { // ===== Imported global ============================================= import->index = static_cast(module_->globals.size()); module_->globals.push_back( - {kWasmStmt, false, WasmInitExpr(), {0}, true, false}); + {kWasmVoid, false, WasmInitExpr(), {0}, true, false}); WasmGlobal* global = &module_->globals.back(); global->type = consume_value_type(); global->mutability = consume_mutability(); @@ -756,7 +756,7 @@ class ModuleDecoderImpl : public Decoder { TRACE("DecodeGlobal[%d] module+%d\n", i, static_cast(pc_ - start_)); // Add an uninitialized global and pass a pointer to it. module_->globals.push_back( - {kWasmStmt, false, WasmInitExpr(), {0}, false, false}); + {kWasmVoid, false, WasmInitExpr(), {0}, false, false}); WasmGlobal* global = &module_->globals.back(); global->type = consume_value_type(); global->mutability = consume_mutability(); @@ -1305,7 +1305,7 @@ class ModuleDecoderImpl : public Decoder { } WasmInitExpr DecodeInitExprForTesting() { - return consume_init_expr(nullptr, kWasmStmt, 0); + return consume_init_expr(nullptr, kWasmVoid, 0); } const std::shared_ptr& shared_module() const { return module_; } @@ -1349,11 +1349,11 @@ class ModuleDecoderImpl : public Decoder { ValueType TypeOf(const WasmInitExpr& expr) { switch (expr.kind()) { case WasmInitExpr::kNone: - return kWasmStmt; + return kWasmVoid; case WasmInitExpr::kGlobalGet: return expr.immediate().index < module_->globals.size() ? module_->globals[expr.immediate().index].type - : kWasmStmt; + : kWasmVoid; case WasmInitExpr::kI32Const: return kWasmI32; case WasmInitExpr::kI64Const: @@ -1382,7 +1382,7 @@ class ModuleDecoderImpl : public Decoder { return ValueType::Rtt(expr.immediate().heap_type, operand_type.depth() + 1); } else { - return kWasmStmt; + return kWasmVoid; } } } @@ -1841,7 +1841,7 @@ class ModuleDecoderImpl : public Decoder { } WasmInitExpr expr = std::move(stack.back()); - if (expected != kWasmStmt && !IsSubtypeOf(TypeOf(expr), expected, module)) { + if (expected != kWasmVoid && !IsSubtypeOf(TypeOf(expr), expected, module)) { errorf(pc(), "type error in init expression, expected %s, got %s", expected.name().c_str(), TypeOf(expr).name().c_str()); } diff --git a/src/wasm/module-instantiate.cc b/src/wasm/module-instantiate.cc index 9939c59743..f64a657eb8 100644 --- a/src/wasm/module-instantiate.cc +++ b/src/wasm/module-instantiate.cc @@ -923,7 +923,7 @@ void InstanceBuilder::WriteGlobalValue(const WasmGlobal& global, tagged_globals_->set(global.offset, *value->GetRef()); break; } - case kStmt: + case kVoid: case kS128: case kBottom: case kI8: diff --git a/src/wasm/value-type.h b/src/wasm/value-type.h index 26751634fb..983e2090b6 100644 --- a/src/wasm/value-type.h +++ b/src/wasm/value-type.h @@ -42,7 +42,7 @@ class Simd128; V(I16, 1, I16, Int16, 'h', "i16") #define FOREACH_VALUE_TYPE(V) \ - V(Stmt, -1, Void, None, 'v', "") \ + V(Void, -1, Void, None, 'v', "") \ FOREACH_NUMERIC_VALUE_TYPE(V) \ V(Rtt, kTaggedSizeLog2, Rtt, TaggedPointer, 't', "rtt") \ V(RttWithDepth, kTaggedSizeLog2, RttWithDepth, TaggedPointer, 'k', "rtt") \ @@ -262,7 +262,7 @@ constexpr bool is_rtt(ValueKind kind) { } constexpr bool is_defaultable(ValueKind kind) { - CONSTEXPR_DCHECK(kind != kBottom && kind != kStmt); + CONSTEXPR_DCHECK(kind != kBottom && kind != kVoid); return kind != kRef && !is_rtt(kind); } @@ -275,7 +275,7 @@ constexpr bool is_defaultable(ValueKind kind) { class ValueType { public: /******************************* Constructors *******************************/ - constexpr ValueType() : bit_field_(KindField::encode(kStmt)) {} + constexpr ValueType() : bit_field_(KindField::encode(kVoid)) {} static constexpr ValueType Primitive(ValueKind kind) { CONSTEXPR_DCHECK(kind == kBottom || kind <= kI16); return ValueType(KindField::encode(kind)); @@ -450,7 +450,7 @@ class ValueType { default: return kRefCode; } - case kStmt: + case kVoid: return kVoidCode; case kRtt: return kRttCode; @@ -555,7 +555,7 @@ constexpr ValueType kWasmF64 = ValueType::Primitive(kF64); constexpr ValueType kWasmS128 = ValueType::Primitive(kS128); constexpr ValueType kWasmI8 = ValueType::Primitive(kI8); constexpr ValueType kWasmI16 = ValueType::Primitive(kI16); -constexpr ValueType kWasmStmt = ValueType::Primitive(kStmt); +constexpr ValueType kWasmVoid = ValueType::Primitive(kVoid); constexpr ValueType kWasmBottom = ValueType::Primitive(kBottom); // Established reference-type proposal shorthands. constexpr ValueType kWasmFuncRef = ValueType::Ref(HeapType::kFunc, kNullable); diff --git a/src/wasm/wasm-debug.cc b/src/wasm/wasm-debug.cc index a3bdcbd8d6..d60a3ee601 100644 --- a/src/wasm/wasm-debug.cc +++ b/src/wasm/wasm-debug.cc @@ -642,7 +642,7 @@ class DebugInfoImpl { } case kI8: case kI16: - case kStmt: + case kVoid: case kBottom: UNREACHABLE(); } diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc index 4b432a9c08..bdb7bb57aa 100644 --- a/src/wasm/wasm-js.cc +++ b/src/wasm/wasm-js.cc @@ -1199,7 +1199,7 @@ void WebAssemblyMemory(const v8::FunctionCallbackInfo& args) { // Determines the type encoded in a value type property (e.g. type reflection). // Returns false if there was an exception, true upon success. On success the -// outgoing {type} is set accordingly, or set to {wasm::kWasmStmt} in case the +// outgoing {type} is set accordingly, or set to {wasm::kWasmVoid} in case the // type could not be properly recognized. bool GetValueType(Isolate* isolate, MaybeLocal maybe, Local context, i::wasm::ValueType* type, @@ -1228,7 +1228,7 @@ bool GetValueType(Isolate* isolate, MaybeLocal maybe, *type = i::wasm::kWasmEqRef; } else { // Unrecognized type. - *type = i::wasm::kWasmStmt; + *type = i::wasm::kWasmVoid; } return true; } @@ -1273,7 +1273,7 @@ void WebAssemblyGlobal(const v8::FunctionCallbackInfo& args) { v8::MaybeLocal maybe = descriptor->Get(context, v8_str(isolate, "value")); if (!GetValueType(isolate, maybe, context, &type, enabled_features)) return; - if (type == i::wasm::kWasmStmt) { + if (type == i::wasm::kWasmVoid) { thrower.TypeError( "Descriptor property 'value' must be a WebAssembly type"); return; @@ -1386,7 +1386,7 @@ void WebAssemblyGlobal(const v8::FunctionCallbackInfo& args) { UNIMPLEMENTED(); case i::wasm::kI8: case i::wasm::kI16: - case i::wasm::kStmt: + case i::wasm::kVoid: case i::wasm::kS128: case i::wasm::kBottom: UNREACHABLE(); @@ -1489,7 +1489,7 @@ void WebAssemblyFunction(const v8::FunctionCallbackInfo& args) { i::wasm::ValueType type; MaybeLocal maybe = parameters->Get(context, i); if (!GetValueType(isolate, maybe, context, &type, enabled_features)) return; - if (type == i::wasm::kWasmStmt) { + if (type == i::wasm::kWasmVoid) { thrower.TypeError( "Argument 0 parameter type at index #%u must be a value type", i); return; @@ -1500,7 +1500,7 @@ void WebAssemblyFunction(const v8::FunctionCallbackInfo& args) { i::wasm::ValueType type; MaybeLocal maybe = results->Get(context, i); if (!GetValueType(isolate, maybe, context, &type, enabled_features)) return; - if (type == i::wasm::kWasmStmt) { + if (type == i::wasm::kWasmVoid) { thrower.TypeError( "Argument 0 result type at index #%u must be a value type", i); return; @@ -1863,7 +1863,7 @@ void WebAssemblyGlobalGetValueCommon( case i::wasm::kI8: case i::wasm::kI16: case i::wasm::kBottom: - case i::wasm::kStmt: + case i::wasm::kVoid: UNREACHABLE(); } } @@ -1960,7 +1960,7 @@ void WebAssemblyGlobalSetValue( case i::wasm::kI8: case i::wasm::kI16: case i::wasm::kBottom: - case i::wasm::kStmt: + case i::wasm::kVoid: UNREACHABLE(); } } diff --git a/src/wasm/wasm-module-builder.cc b/src/wasm/wasm-module-builder.cc index a02b534b54..67f826f2fd 100644 --- a/src/wasm/wasm-module-builder.cc +++ b/src/wasm/wasm-module-builder.cc @@ -503,7 +503,7 @@ void WriteInitializerExpression(ZoneBuffer* buffer, const WasmInitExpr& init, break; case kI8: case kI16: - case kStmt: + case kVoid: case kS128: case kBottom: case kRef: diff --git a/src/wasm/wasm-module.h b/src/wasm/wasm-module.h index ed63db9d6d..bbfcf9623b 100644 --- a/src/wasm/wasm-module.h +++ b/src/wasm/wasm-module.h @@ -365,7 +365,7 @@ struct WasmTable { module->has_signature(heap_type.ref_index())); } - ValueType type = kWasmStmt; // table type. + ValueType type = kWasmVoid; // table type. uint32_t initial_size = 0; // initial table size. uint32_t maximum_size = 0; // maximum table size. bool has_maximum_size = false; // true if there is a maximum size. diff --git a/src/wasm/wasm-objects.cc b/src/wasm/wasm-objects.cc index 55cad21a64..b4c38827b5 100644 --- a/src/wasm/wasm-objects.cc +++ b/src/wasm/wasm-objects.cc @@ -612,7 +612,7 @@ void WasmTableObject::UpdateDispatchTables( int total_count = serialized_sig.length() - 1; std::unique_ptr reps(new wasm::ValueType[total_count]); int result_count; - static const wasm::ValueType kMarker = wasm::kWasmStmt; + static const wasm::ValueType kMarker = wasm::kWasmVoid; for (int i = 0, j = 0; i <= total_count; i++) { if (serialized_sig.get(i) == kMarker) { result_count = i; @@ -1641,7 +1641,7 @@ wasm::WasmValue WasmStruct::GetFieldValue(uint32_t index) { case wasm::kRttWithDepth: // TODO(7748): Expose RTTs to DevTools. UNIMPLEMENTED(); - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: UNREACHABLE(); } @@ -1671,7 +1671,7 @@ wasm::WasmValue WasmArray::GetElement(uint32_t index) { case wasm::kRttWithDepth: // TODO(7748): Expose RTTs to DevTools. UNIMPLEMENTED(); - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: UNREACHABLE(); } @@ -1733,7 +1733,7 @@ bool WasmCapiFunction::MatchesSignature(const wasm::FunctionSig* sig) const { return false; } } - if (serialized_sig.get(serialized_index) != wasm::kWasmStmt) return false; + if (serialized_sig.get(serialized_index) != wasm::kWasmVoid) return false; serialized_index++; for (int i = 0; i < param_count; i++, serialized_index++) { if (sig->GetParam(i) != serialized_sig.get(serialized_index)) return false; @@ -1830,7 +1830,7 @@ uint32_t WasmExceptionPackage::GetEncodedSize( break; case wasm::kRtt: case wasm::kRttWithDepth: - case wasm::kStmt: + case wasm::kVoid: case wasm::kBottom: case wasm::kI8: case wasm::kI16: diff --git a/src/wasm/wasm-opcodes-inl.h b/src/wasm/wasm-opcodes-inl.h index 59b890dd32..0c7eb1cfd5 100644 --- a/src/wasm/wasm-opcodes-inl.h +++ b/src/wasm/wasm-opcodes-inl.h @@ -575,7 +575,7 @@ enum WasmOpcodeSig : byte { #undef DECLARE_SIG_ENUM #define DECLARE_SIG(name, ...) \ constexpr ValueType kTypes_##name[] = {__VA_ARGS__}; \ - constexpr int kReturnsCount_##name = kTypes_##name[0] == kWasmStmt ? 0 : 1; \ + constexpr int kReturnsCount_##name = kTypes_##name[0] == kWasmVoid ? 0 : 1; \ constexpr FunctionSig kSig_##name( \ kReturnsCount_##name, static_cast(arraysize(kTypes_##name)) - 1, \ kTypes_##name + (1 - kReturnsCount_##name)); diff --git a/src/wasm/wasm-opcodes.h b/src/wasm/wasm-opcodes.h index fee187d5f5..b0fbec5f6b 100644 --- a/src/wasm/wasm-opcodes.h +++ b/src/wasm/wasm-opcodes.h @@ -708,7 +708,7 @@ bool V8_EXPORT_PRIVATE IsJSCompatibleSignature(const FunctionSig* sig, // All signatures. #define FOREACH_SIGNATURE(V) \ FOREACH_SIMD_SIGNATURE(V) \ - V(v_v, kWasmStmt) \ + V(v_v, kWasmVoid) \ V(i_ii, kWasmI32, kWasmI32, kWasmI32) \ V(i_i, kWasmI32, kWasmI32) \ V(i_v, kWasmI32) \ @@ -733,15 +733,15 @@ bool V8_EXPORT_PRIVATE IsJSCompatibleSignature(const FunctionSig* sig, V(d_f, kWasmF64, kWasmF32) \ V(d_i, kWasmF64, kWasmI32) \ V(d_l, kWasmF64, kWasmI64) \ - V(v_i, kWasmStmt, kWasmI32) \ - V(v_ii, kWasmStmt, kWasmI32, kWasmI32) \ - V(v_id, kWasmStmt, kWasmI32, kWasmF64) \ + V(v_i, kWasmVoid, kWasmI32) \ + V(v_ii, kWasmVoid, kWasmI32, kWasmI32) \ + V(v_id, kWasmVoid, kWasmI32, kWasmF64) \ V(d_id, kWasmF64, kWasmI32, kWasmF64) \ - V(v_if, kWasmStmt, kWasmI32, kWasmF32) \ + V(v_if, kWasmVoid, kWasmI32, kWasmF32) \ V(f_if, kWasmF32, kWasmI32, kWasmF32) \ - V(v_il, kWasmStmt, kWasmI32, kWasmI64) \ + V(v_il, kWasmVoid, kWasmI32, kWasmI64) \ V(l_il, kWasmI64, kWasmI32, kWasmI64) \ - V(v_iii, kWasmStmt, kWasmI32, kWasmI32, kWasmI32) \ + V(v_iii, kWasmVoid, kWasmI32, kWasmI32, kWasmI32) \ V(i_iii, kWasmI32, kWasmI32, kWasmI32, kWasmI32) \ V(l_ill, kWasmI64, kWasmI32, kWasmI64, kWasmI64) \ V(i_iil, kWasmI32, kWasmI32, kWasmI32, kWasmI64) \ @@ -759,7 +759,7 @@ bool V8_EXPORT_PRIVATE IsJSCompatibleSignature(const FunctionSig* sig, V(s_l, kWasmS128, kWasmI64) \ V(s_si, kWasmS128, kWasmS128, kWasmI32) \ V(i_s, kWasmI32, kWasmS128) \ - V(v_is, kWasmStmt, kWasmI32, kWasmS128) \ + V(v_is, kWasmVoid, kWasmI32, kWasmS128) \ V(s_sss, kWasmS128, kWasmS128, kWasmS128, kWasmS128) \ V(s_is, kWasmS128, kWasmI32, kWasmS128) diff --git a/src/wasm/wasm-subtyping.cc b/src/wasm/wasm-subtyping.cc index 27c6a2604e..b0e8105a60 100644 --- a/src/wasm/wasm-subtyping.cc +++ b/src/wasm/wasm-subtyping.cc @@ -281,7 +281,7 @@ V8_NOINLINE V8_EXPORT_PRIVATE bool IsSubtypeOfImpl( case kS128: case kI8: case kI16: - case kStmt: + case kVoid: case kBottom: return subtype == supertype; case kRtt: diff --git a/src/wasm/wasm-value.h b/src/wasm/wasm-value.h index f34737a501..0a1d2b69e2 100644 --- a/src/wasm/wasm-value.h +++ b/src/wasm/wasm-value.h @@ -88,7 +88,7 @@ ASSERT_TRIVIALLY_COPYABLE(Handle); // A wasm value with type information. class WasmValue { public: - WasmValue() : type_(kWasmStmt), bit_pattern_{} {} + WasmValue() : type_(kWasmVoid), bit_pattern_{} {} #define DEFINE_TYPE_SPECIFIC_METHODS(name, localtype, ctype) \ explicit WasmValue(ctype v) : type_(localtype), bit_pattern_{} { \ diff --git a/test/cctest/wasm/test-run-wasm-64.cc b/test/cctest/wasm/test-run-wasm-64.cc index 37163c0a8c..760a7cc7ea 100644 --- a/test/cctest/wasm/test-run-wasm-64.cc +++ b/test/cctest/wasm/test-run-wasm-64.cc @@ -1491,7 +1491,7 @@ static void CompileCallIndirectMany(TestExecutionTier tier, ValueType param) { TestSignatures sigs; for (byte num_params = 0; num_params < 40; num_params++) { WasmRunner r(tier); - FunctionSig* sig = sigs.many(r.zone(), kWasmStmt, param, num_params); + FunctionSig* sig = sigs.many(r.zone(), kWasmVoid, param, num_params); r.builder().AddSignature(sig); r.builder().AddSignature(sig); diff --git a/test/cctest/wasm/test-run-wasm.cc b/test/cctest/wasm/test-run-wasm.cc index b19c60e053..250820ed19 100644 --- a/test/cctest/wasm/test-run-wasm.cc +++ b/test/cctest/wasm/test-run-wasm.cc @@ -3382,7 +3382,7 @@ static void CompileCallIndirectMany(TestExecutionTier tier, ValueType param) { TestSignatures sigs; for (byte num_params = 0; num_params < 40; ++num_params) { WasmRunner r(tier); - FunctionSig* sig = sigs.many(r.zone(), kWasmStmt, param, num_params); + FunctionSig* sig = sigs.many(r.zone(), kWasmVoid, param, num_params); r.builder().AddSignature(sig); r.builder().AddSignature(sig); diff --git a/test/cctest/wasm/test-streaming-compilation.cc b/test/cctest/wasm/test-streaming-compilation.cc index 92ad205070..639bc66336 100644 --- a/test/cctest/wasm/test-streaming-compilation.cc +++ b/test/cctest/wasm/test-streaming-compilation.cc @@ -393,7 +393,7 @@ ZoneBuffer GetModuleWithInvalidSection(Zone* zone) { TestSignatures sigs; WasmModuleBuilder builder(zone); // Add an invalid global to the module. The decoder will fail there. - builder.AddGlobal(kWasmStmt, true, WasmInitExpr::GlobalGet(12)); + builder.AddGlobal(kWasmVoid, true, WasmInitExpr::GlobalGet(12)); { WasmFunctionBuilder* f = builder.AddFunction(sigs.i_iii()); uint8_t code[] = {kExprLocalGet, 0, kExprEnd}; diff --git a/test/common/wasm/test-signatures.h b/test/common/wasm/test-signatures.h index fb1a1fcddf..ba021366cb 100644 --- a/test/common/wasm/test-signatures.h +++ b/test/common/wasm/test-signatures.h @@ -121,8 +121,8 @@ class TestSignatures { FunctionSig* iii_v() { return &sig_iii_v; } FunctionSig* many(Zone* zone, ValueType ret, ValueType param, int count) { - FunctionSig::Builder builder(zone, ret == kWasmStmt ? 0 : 1, count); - if (ret != kWasmStmt) builder.AddReturn(ret); + FunctionSig::Builder builder(zone, ret == kWasmVoid ? 0 : 1, count); + if (ret != kWasmVoid) builder.AddReturn(ret); for (int i = 0; i < count; i++) { builder.AddParam(param); } diff --git a/test/common/wasm/wasm-interpreter.cc b/test/common/wasm/wasm-interpreter.cc index b525601ac2..54cbe4989d 100644 --- a/test/common/wasm/wasm-interpreter.cc +++ b/test/common/wasm/wasm-interpreter.cc @@ -1438,7 +1438,7 @@ class WasmInterpreterInternals { case kRef: // TODO(7748): Implement. case kRtt: case kRttWithDepth: - case kStmt: + case kVoid: case kBottom: case kI8: case kI16: @@ -3204,7 +3204,7 @@ class WasmInterpreterInternals { case kRttWithDepth: case kI8: case kI16: - case kStmt: + case kVoid: case kBottom: UNREACHABLE(); } @@ -3322,7 +3322,7 @@ class WasmInterpreterInternals { case kRttWithDepth: case kI8: case kI16: - case kStmt: + case kVoid: case kBottom: UNREACHABLE(); } @@ -3721,7 +3721,7 @@ class WasmInterpreterInternals { case kRttWithDepth: case kI8: case kI16: - case kStmt: + case kVoid: case kBottom: UNREACHABLE(); } @@ -4022,7 +4022,7 @@ class WasmInterpreterInternals { } void Push(WasmValue val) { - DCHECK_NE(kWasmStmt, val.type()); + DCHECK_NE(kWasmVoid, val.type()); DCHECK_NE(kWasmI8, val.type()); DCHECK_NE(kWasmI16, val.type()); DCHECK_LE(1, stack_limit_ - sp_); @@ -4036,7 +4036,7 @@ class WasmInterpreterInternals { void Push(WasmValue* vals, size_t arity) { DCHECK_LE(arity, stack_limit_ - sp_); for (WasmValue *val = vals, *end = vals + arity; val != end; ++val) { - DCHECK_NE(kWasmStmt, val->type()); + DCHECK_NE(kWasmVoid, val->type()); Push(*val); } } @@ -4113,7 +4113,7 @@ class WasmInterpreterInternals { PrintF("i32x4:%d,%d,%d,%d", s.val[0], s.val[1], s.val[2], s.val[3]); break; } - case kStmt: + case kVoid: PrintF("void"); break; case kRef: diff --git a/test/common/wasm/wasm-module-runner.cc b/test/common/wasm/wasm-module-runner.cc index ec24fd2578..770b320dfd 100644 --- a/test/common/wasm/wasm-module-runner.cc +++ b/test/common/wasm/wasm-module-runner.cc @@ -74,7 +74,7 @@ OwnedVector MakeDefaultInterpreterArguments(Isolate* isolate, case kRttWithDepth: case kI8: case kI16: - case kStmt: + case kVoid: case kBottom: UNREACHABLE(); } @@ -109,7 +109,7 @@ OwnedVector> MakeDefaultArguments(Isolate* isolate, case kRttWithDepth: case kI8: case kI16: - case kStmt: + case kVoid: case kBottom: UNREACHABLE(); } diff --git a/test/debugging/wasm/gdb-server/test_files/test_memory.js b/test/debugging/wasm/gdb-server/test_files/test_memory.js index fa0743500f..760e435bfa 100644 --- a/test/debugging/wasm/gdb-server/test_files/test_memory.js +++ b/test/debugging/wasm/gdb-server/test_files/test_memory.js @@ -19,11 +19,11 @@ var func_a_idx = builder.addFunction('wasm_B', kSig_v_i) .addBody([ kExprLoop, - kWasmStmt, // while + kWasmVoid, // while kExprLocalGet, 0, // - kExprIf, - kWasmStmt, // if != 0 + kWasmVoid, // if != 0 kExprLocalGet, 0, // - kExprI32Const, diff --git a/test/fuzzer/wasm-compile.cc b/test/fuzzer/wasm-compile.cc index 3965c34c22..663ef33a94 100644 --- a/test/fuzzer/wasm-compile.cc +++ b/test/fuzzer/wasm-compile.cc @@ -122,7 +122,7 @@ class WasmGenerator { : gen_(gen), emit_end_(emit_end) { gen->blocks_.emplace_back(br_types.begin(), br_types.end()); if (param_types.size() == 0 && result_types.size() == 0) { - gen->builder_->EmitWithU8(block_type, kWasmStmt.value_type_code()); + gen->builder_->EmitWithU8(block_type, kWasmVoid.value_type_code()); return; } if (param_types.size() == 0 && result_types.size() == 1) { @@ -135,11 +135,11 @@ class WasmGenerator { FunctionSig::Builder builder(zone, result_types.size(), param_types.size()); for (auto& type : param_types) { - DCHECK_NE(type, kWasmStmt); + DCHECK_NE(type, kWasmVoid); builder.AddParam(type); } for (auto& type : result_types) { - DCHECK_NE(type, kWasmStmt); + DCHECK_NE(type, kWasmVoid); builder.AddReturn(type); } FunctionSig* sig = builder.Build(); @@ -199,10 +199,10 @@ class WasmGenerator { template void if_(DataRange* data) { - static_assert(T == kStmt || type == kIfElse, + static_assert(T == kVoid || type == kIfElse, "if without else cannot produce a value"); if_({}, - T == kStmt ? Vector{} : VectorOf({ValueType::Primitive(T)}), + T == kVoid ? Vector{} : VectorOf({ValueType::Primitive(T)}), type, data); } @@ -217,7 +217,7 @@ class WasmGenerator { uint8_t delegate_target = data->get() % (try_blocks_.size() + 1); bool is_unwind = num_catch == 0 && !has_catch_all && !is_delegate; - Vector return_type_vec = return_type.kind() == kStmt + Vector return_type_vec = return_type.kind() == kVoid ? Vector{} : VectorOf(&return_type, 1); BlockScope block_scope(this, kExprTry, {}, return_type_vec, return_type_vec, @@ -305,7 +305,7 @@ class WasmGenerator { builder_->EmitWithI32V( kExprBrIf, static_cast(blocks_.size()) - 1 - target_block); ConsumeAndGenerate(break_types, - wanted_kind == kStmt + wanted_kind == kVoid ? Vector{} : VectorOf({ValueType::Primitive(wanted_kind)}), data); @@ -536,9 +536,9 @@ class WasmGenerator { void ConvertOrGenerate(ValueType src, ValueType dst, DataRange* data) { if (src == dst) return; - if (src == kWasmStmt && dst != kWasmStmt) { + if (src == kWasmVoid && dst != kWasmVoid) { Generate(dst, data); - } else if (dst == kWasmStmt && src != kWasmStmt) { + } else if (dst == kWasmVoid && src != kWasmVoid) { builder_->Emit(kExprDrop); } else { Convert(src, dst); @@ -579,12 +579,12 @@ class WasmGenerator { builder_->EmitByte(0); // Table index. } } - if (sig->return_count() == 0 && wanted_kind != kWasmStmt) { + if (sig->return_count() == 0 && wanted_kind != kWasmVoid) { // The call did not generate a value. Thus just generate it here. Generate(wanted_kind, data); return; } - if (wanted_kind == kWasmStmt) { + if (wanted_kind == kWasmVoid) { // The call did generate values, but we did not want one. for (size_t i = 0; i < sig->return_count(); ++i) { builder_->Emit(kExprDrop); @@ -593,16 +593,16 @@ class WasmGenerator { } auto return_types = VectorOf(sig->returns().begin(), sig->return_count()); auto wanted_types = - VectorOf(&wanted_kind, wanted_kind == kWasmStmt ? 0 : 1); + VectorOf(&wanted_kind, wanted_kind == kWasmVoid ? 0 : 1); ConsumeAndGenerate(return_types, wanted_types, data); } struct Var { uint32_t index; - ValueType type = kWasmStmt; + ValueType type = kWasmVoid; Var() = default; Var(uint32_t index, ValueType type) : index(index), type(type) {} - bool is_valid() const { return type != kWasmStmt; } + bool is_valid() const { return type != kWasmVoid; } }; Var GetRandomLocal(DataRange* data) { @@ -622,24 +622,24 @@ class WasmGenerator { // If there are no locals and no parameters, just generate any value (if a // value is needed), or do nothing. if (!local.is_valid()) { - if (wanted_kind == kStmt) return; + if (wanted_kind == kVoid) return; return Generate(data); } if (opcode != kExprLocalGet) Generate(local.type, data); builder_->EmitWithU32V(opcode, local.index); - if (wanted_kind != kStmt && local.type.kind() != wanted_kind) { + if (wanted_kind != kVoid && local.type.kind() != wanted_kind) { Convert(local.type, ValueType::Primitive(wanted_kind)); } } template void get_local(DataRange* data) { - static_assert(wanted_kind != kStmt, "illegal type"); + static_assert(wanted_kind != kVoid, "illegal type"); local_op(data, kExprLocalGet); } - void set_local(DataRange* data) { local_op(data, kExprLocalSet); } + void set_local(DataRange* data) { local_op(data, kExprLocalSet); } template void tee_local(DataRange* data) { @@ -671,12 +671,12 @@ class WasmGenerator { template void global_op(DataRange* data) { - constexpr bool is_set = wanted_kind == kStmt; + constexpr bool is_set = wanted_kind == kVoid; Var global = GetRandomGlobal(data, is_set); // If there are no globals, just generate any value (if a value is needed), // or do nothing. if (!global.is_valid()) { - if (wanted_kind == kStmt) return; + if (wanted_kind == kVoid) return; return Generate(data); } @@ -690,13 +690,13 @@ class WasmGenerator { template void get_global(DataRange* data) { - static_assert(wanted_kind != kStmt, "illegal type"); + static_assert(wanted_kind != kVoid, "illegal type"); global_op(data); } template void select_with_type(DataRange* data) { - static_assert(select_kind != kStmt, "illegal kind for select"); + static_assert(select_kind != kVoid, "illegal kind for select"); Generate(data); // num_types is always 1. uint8_t num_types = 1; @@ -704,7 +704,7 @@ class WasmGenerator { ValueType::Primitive(select_kind).value_type_code()); } - void set_global(DataRange* data) { global_op(data); } + void set_global(DataRange* data) { global_op(data); } void throw_or_rethrow(DataRange* data) { bool rethrow = data->get() % 2; @@ -822,31 +822,31 @@ class WasmGenerator { }; template <> -void WasmGenerator::block(DataRange* data) { +void WasmGenerator::block(DataRange* data) { block({}, {}, data); } template <> -void WasmGenerator::loop(DataRange* data) { +void WasmGenerator::loop(DataRange* data) { loop({}, {}, data); } template <> -void WasmGenerator::Generate(DataRange* data) { +void WasmGenerator::Generate(DataRange* data) { GeneratorRecursionScope rec_scope(this); if (recursion_limit_reached() || data->size() == 0) return; constexpr GenerateFn alternatives[] = { - &WasmGenerator::sequence, - &WasmGenerator::sequence, - &WasmGenerator::sequence, - &WasmGenerator::block, - &WasmGenerator::loop, - &WasmGenerator::if_, - &WasmGenerator::if_, + &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::block, + &WasmGenerator::loop, + &WasmGenerator::if_, + &WasmGenerator::if_, &WasmGenerator::br, - &WasmGenerator::br_if, + &WasmGenerator::br_if, &WasmGenerator::memop, &WasmGenerator::memop, @@ -872,13 +872,13 @@ void WasmGenerator::Generate(DataRange* data) { &WasmGenerator::drop, - &WasmGenerator::call, - &WasmGenerator::call_indirect, + &WasmGenerator::call, + &WasmGenerator::call_indirect, &WasmGenerator::set_local, &WasmGenerator::set_global, &WasmGenerator::throw_or_rethrow, - &WasmGenerator::try_block}; + &WasmGenerator::try_block}; GenerateOneOf(alternatives, data); } @@ -897,9 +897,9 @@ void WasmGenerator::Generate(DataRange* data) { &WasmGenerator::i32_const<3>, &WasmGenerator::i32_const<4>, - &WasmGenerator::sequence, - &WasmGenerator::sequence, - &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, &WasmGenerator::op, &WasmGenerator::op, @@ -1049,9 +1049,9 @@ void WasmGenerator::Generate(DataRange* data) { &WasmGenerator::i64_const<7>, &WasmGenerator::i64_const<8>, - &WasmGenerator::sequence, - &WasmGenerator::sequence, - &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, &WasmGenerator::op, &WasmGenerator::op, @@ -1154,9 +1154,9 @@ void WasmGenerator::Generate(DataRange* data) { } constexpr GenerateFn alternatives[] = { - &WasmGenerator::sequence, - &WasmGenerator::sequence, - &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, &WasmGenerator::op, &WasmGenerator::op, @@ -1211,9 +1211,9 @@ void WasmGenerator::Generate(DataRange* data) { } constexpr GenerateFn alternatives[] = { - &WasmGenerator::sequence, - &WasmGenerator::sequence, - &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, + &WasmGenerator::sequence, &WasmGenerator::op, &WasmGenerator::op, @@ -1512,8 +1512,8 @@ void WasmGenerator::grow_memory(DataRange* data) { void WasmGenerator::Generate(ValueType type, DataRange* data) { switch (type.kind()) { - case kStmt: - return Generate(data); + case kVoid: + return Generate(data); case kI32: return Generate(data); case kI64: @@ -1554,7 +1554,7 @@ void WasmGenerator::Generate(Vector types, DataRange* data) { } if (types.size() == 0) { - Generate(kWasmStmt, data); + Generate(kWasmVoid, data); return; } if (types.size() == 1) { diff --git a/test/inspector/debugger/wasm-get-breakable-locations-byte-offsets.js b/test/inspector/debugger/wasm-get-breakable-locations-byte-offsets.js index 931ce978c1..beb6ca9fa9 100644 --- a/test/inspector/debugger/wasm-get-breakable-locations-byte-offsets.js +++ b/test/inspector/debugger/wasm-get-breakable-locations-byte-offsets.js @@ -22,8 +22,8 @@ var func_idx = builder.addFunction('helper', kSig_v_v) builder.addFunction('main', kSig_v_i) .addBody([ kExprLocalGet, 0, - kExprIf, kWasmStmt, - kExprBlock, kWasmStmt, + kExprIf, kWasmVoid, + kExprBlock, kWasmVoid, kExprCallFunction, func_idx, kExprEnd, kExprEnd diff --git a/test/inspector/debugger/wasm-scripts.js b/test/inspector/debugger/wasm-scripts.js index 0849840abe..5c0162e4cd 100644 --- a/test/inspector/debugger/wasm-scripts.js +++ b/test/inspector/debugger/wasm-scripts.js @@ -22,7 +22,7 @@ function createModule(...customSections) { var builder = new WasmModuleBuilder(); builder.addFunction('nopFunction', kSig_v_v).addBody([kExprNop]); builder.addFunction('main', kSig_v_v) - .addBody([kExprBlock, kWasmStmt, kExprI32Const, 2, kExprDrop, kExprEnd]) + .addBody([kExprBlock, kWasmVoid, kExprI32Const, 2, kExprDrop, kExprEnd]) .exportAs('main'); for (var { name, value } of customSections) { builder.addCustomSection(name, value); diff --git a/test/inspector/debugger/wasm-set-breakpoint-breaks-on-first-breakable-location.js b/test/inspector/debugger/wasm-set-breakpoint-breaks-on-first-breakable-location.js index 8c18396318..ae59334b93 100644 --- a/test/inspector/debugger/wasm-set-breakpoint-breaks-on-first-breakable-location.js +++ b/test/inspector/debugger/wasm-set-breakpoint-breaks-on-first-breakable-location.js @@ -21,8 +21,8 @@ var func_idx = builder.addFunction('helper', kSig_v_v) builder.addFunction('main', kSig_v_i) .addBody([ kExprLocalGet, 0, - kExprIf, kWasmStmt, - kExprBlock, kWasmStmt, + kExprIf, kWasmVoid, + kExprBlock, kWasmVoid, kExprCallFunction, func_idx, kExprEnd, kExprEnd diff --git a/test/inspector/debugger/wasm-set-breakpoint.js b/test/inspector/debugger/wasm-set-breakpoint.js index 5db1e36979..1b28959f7a 100644 --- a/test/inspector/debugger/wasm-set-breakpoint.js +++ b/test/inspector/debugger/wasm-set-breakpoint.js @@ -17,9 +17,9 @@ const func_a = const func_b = builder.addFunction('wasm_B', kSig_v_i) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 kExprLocalGet, 0, // - kExprI32Const, 1, // - kExprI32Sub, // - diff --git a/test/inspector/debugger/wasm-source.js b/test/inspector/debugger/wasm-source.js index 3fd522f8d0..d13fb247cd 100644 --- a/test/inspector/debugger/wasm-source.js +++ b/test/inspector/debugger/wasm-source.js @@ -20,7 +20,7 @@ var sig_index = builder.addType(kSig_v_v); builder.addFunction('main', kSig_v_v) .addBody([ - kExprBlock, kWasmStmt, kExprI32Const, 0, kExprCallIndirect, sig_index, + kExprBlock, kWasmVoid, kExprI32Const, 0, kExprCallIndirect, sig_index, kTableZero, kExprEnd ]) .exportAs('main'); diff --git a/test/inspector/debugger/wasm-stack.js b/test/inspector/debugger/wasm-stack.js index e5a19e6fe8..961ddc84fd 100644 --- a/test/inspector/debugger/wasm-stack.js +++ b/test/inspector/debugger/wasm-stack.js @@ -19,7 +19,7 @@ var call_imported_idx = builder.addFunction('call_func', kSig_v_v) // Open a block in order to make the positions more interesting... builder.addFunction('main', kSig_v_v) .addBody( - [kExprBlock, kWasmStmt, kExprCallFunction, call_imported_idx, kExprEnd]) + [kExprBlock, kWasmVoid, kExprCallFunction, call_imported_idx, kExprEnd]) .exportAs('main'); var module_bytes = builder.toArray(); diff --git a/test/inspector/debugger/wasm-step-from-non-breakable-position.js b/test/inspector/debugger/wasm-step-from-non-breakable-position.js index 6371e80874..aa4b92b59b 100644 --- a/test/inspector/debugger/wasm-step-from-non-breakable-position.js +++ b/test/inspector/debugger/wasm-step-from-non-breakable-position.js @@ -12,7 +12,7 @@ session.setupScriptMap(); var builder = new WasmModuleBuilder(); var callee = builder.addFunction('callee', kSig_v_v) - .addBody([kExprBlock, kWasmStmt, kExprEnd]) + .addBody([kExprBlock, kWasmVoid, kExprEnd]) .index; var main = builder.addFunction('main', kSig_v_i) diff --git a/test/inspector/debugger/wasm-stepping-with-skiplist.js b/test/inspector/debugger/wasm-stepping-with-skiplist.js index e315a565e0..32301dc7bd 100644 --- a/test/inspector/debugger/wasm-stepping-with-skiplist.js +++ b/test/inspector/debugger/wasm-stepping-with-skiplist.js @@ -18,9 +18,9 @@ const func_a_idx = func_a.index; const func_b = builder.addFunction('wasm_B', kSig_v_i) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 kExprLocalGet, 0, // - kExprI32Const, 1, // - kExprI32Sub, // - diff --git a/test/inspector/debugger/wasm-stepping-with-source-map.js b/test/inspector/debugger/wasm-stepping-with-source-map.js index 3cf4d928aa..7d80628131 100644 --- a/test/inspector/debugger/wasm-stepping-with-source-map.js +++ b/test/inspector/debugger/wasm-stepping-with-source-map.js @@ -17,9 +17,9 @@ var func_a_idx = builder.addFunction('wasm_B', kSig_v_i) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 kExprLocalGet, 0, // - kExprI32Const, 1, // - kExprI32Sub, // - diff --git a/test/inspector/debugger/wasm-stepping.js b/test/inspector/debugger/wasm-stepping.js index 83ca29606d..30deadaaef 100644 --- a/test/inspector/debugger/wasm-stepping.js +++ b/test/inspector/debugger/wasm-stepping.js @@ -17,9 +17,9 @@ var func_a_idx = var func_b = builder.addFunction('wasm_B', kSig_v_i) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 kExprLocalGet, 0, // - kExprI32Const, 1, // - kExprI32Sub, // - diff --git a/test/message/fail/wasm-exception-rethrow.js b/test/message/fail/wasm-exception-rethrow.js index 0f6073e17a..c8425f7bda 100644 --- a/test/message/fail/wasm-exception-rethrow.js +++ b/test/message/fail/wasm-exception-rethrow.js @@ -10,7 +10,7 @@ let builder = new WasmModuleBuilder(); let except = builder.addException(kSig_v_i); builder.addFunction("rethrow0", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprI32Const, 23, kExprThrow, except, kExprCatch, except, diff --git a/test/mjsunit/regress/wasm/condition-change-during-branch-elimination.js b/test/mjsunit/regress/wasm/condition-change-during-branch-elimination.js index 9935b8faa3..06d3dc64d0 100644 --- a/test/mjsunit/regress/wasm/condition-change-during-branch-elimination.js +++ b/test/mjsunit/regress/wasm/condition-change-during-branch-elimination.js @@ -14,15 +14,15 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); builder.addFunction("main", kSig_v_l) .addLocals(kWasmI32, 2) .addBody([ - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprLocalGet, 0x02, kExprLocalTee, 0x01, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprElse, - kExprLoop, kWasmStmt, - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, + kExprLoop, kWasmVoid, kExprLocalGet, 0x01, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprElse, kExprLocalGet, 0x02, kExprBrIf, 0x04, diff --git a/test/mjsunit/regress/wasm/regress-1027410.js b/test/mjsunit/regress/wasm/regress-1027410.js index b353b7a94a..1d0d1470ee 100644 --- a/test/mjsunit/regress/wasm/regress-1027410.js +++ b/test/mjsunit/regress/wasm/regress-1027410.js @@ -23,7 +23,7 @@ kExprEnd, // @3 // signature: d_v // body: kExprBlock, kWasmF64, // @3 f64 - kExprBlock, kWasmStmt, // @5 + kExprBlock, kWasmVoid, // @5 kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, kExprLocalTee, 0x00, kExprLocalTee, 0x01, diff --git a/test/mjsunit/regress/wasm/regress-1034394.js b/test/mjsunit/regress/wasm/regress-1034394.js index 99519d8ffe..99d3da9329 100644 --- a/test/mjsunit/regress/wasm/regress-1034394.js +++ b/test/mjsunit/regress/wasm/regress-1034394.js @@ -10,7 +10,7 @@ const NUM_CASES = 3073; let body = []; // Add one block, so we can jump to this block or to the function end. body.push(kExprBlock); -body.push(kWasmStmt); +body.push(kWasmVoid); // Add the big BrTable. body.push(kExprLocalGet, 0); diff --git a/test/mjsunit/regress/wasm/regress-1074586.js b/test/mjsunit/regress/wasm/regress-1074586.js index eec0a46432..f3e3b59b7a 100644 --- a/test/mjsunit/regress/wasm/regress-1074586.js +++ b/test/mjsunit/regress/wasm/regress-1074586.js @@ -19,15 +19,15 @@ builder.addFunction(undefined, sig) kExprLocalGet, 0x1b, // local.get kExprLocalSet, 0x1c, // local.set kExprI32Const, 0x00, // i32.const -kExprIf, kWasmStmt, // if @11 +kExprIf, kWasmVoid, // if @11 kExprGlobalGet, 0x00, // global.get kExprLocalSet, 0x1e, // local.set - kExprBlock, kWasmStmt, // block @19 + kExprBlock, kWasmVoid, // block @19 kExprGlobalGet, 0x00, // global.get kExprLocalSet, 0x21, // local.set - kExprBlock, kWasmStmt, // block @25 - kExprBlock, kWasmStmt, // block @27 - kExprBlock, kWasmStmt, // block @29 + kExprBlock, kWasmVoid, // block @25 + kExprBlock, kWasmVoid, // block @27 + kExprBlock, kWasmVoid, // block @29 kExprGlobalGet, 0x00, // global.get kExprLocalSet, 0x0a, // local.set kExprI32Const, 0x00, // i32.const @@ -42,19 +42,19 @@ kExprIf, kWasmStmt, // if @11 kExprI32Const, 0x01, // i32.const kExprLocalSet, 0x36, // local.set kExprI32Const, 0x00, // i32.const - kExprIf, kWasmStmt, // if @56 + kExprIf, kWasmVoid, // if @56 kExprEnd, // end @59 kExprLocalGet, 0x00, // local.get kExprLocalSet, 0x10, // local.set kExprI32Const, 0x00, // i32.const kExprI32Eqz, // i32.eqz kExprLocalSet, 0x38, // local.set - kExprBlock, kWasmStmt, // block @69 + kExprBlock, kWasmVoid, // block @69 kExprI32Const, 0x7f, // i32.const kExprI32Eqz, // i32.eqz kExprLocalSet, 0x39, // local.set kExprI32Const, 0x01, // i32.const - kExprIf, kWasmStmt, // if @78 + kExprIf, kWasmVoid, // if @78 kExprGlobalGet, 0x00, // global.get kExprLocalSet, 0x11, // local.set kExprI32Const, 0x00, // i32.const diff --git a/test/mjsunit/regress/wasm/regress-1075953.js b/test/mjsunit/regress/wasm/regress-1075953.js index 413630d1b0..c0c2d0dcfc 100644 --- a/test/mjsunit/regress/wasm/regress-1075953.js +++ b/test/mjsunit/regress/wasm/regress-1075953.js @@ -25,7 +25,7 @@ builder.addFunction(undefined, sig) kExprElse, // else @45 kExprI32Const, 0x00, // i32.const kExprEnd, // end @48 - kExprIf, kWasmStmt, // if @49 + kExprIf, kWasmVoid, // if @49 kExprI32Const, 0x00, // i32.const kExprI32Const, 0x00, // i32.const kAtomicPrefix, kExprI32AtomicSub, 0x01, 0x04, // i32.atomic.sub diff --git a/test/mjsunit/regress/wasm/regress-10898.js b/test/mjsunit/regress/wasm/regress-10898.js index 61c8c72104..be366883d2 100644 --- a/test/mjsunit/regress/wasm/regress-10898.js +++ b/test/mjsunit/regress/wasm/regress-10898.js @@ -29,7 +29,7 @@ kExprLocalTee, 0x00, // local.tee kExprI32Const, 0xff, 0x00, // i32.const kAtomicPrefix, kExprAtomicNotify, 0x02, 0x03, // atomic.notify kExprI32LoadMem16S, 0x00, 0x02, // i32.load16_s -kExprIf, kWasmStmt, // if @28 +kExprIf, kWasmVoid, // if @28 kExprLocalGet, 0x00, // local.get kExprReturn, // return kExprElse, // else @33 diff --git a/test/mjsunit/regress/wasm/regress-1101304.js b/test/mjsunit/regress/wasm/regress-1101304.js index 36331d094a..aaf63724b4 100644 --- a/test/mjsunit/regress/wasm/regress-1101304.js +++ b/test/mjsunit/regress/wasm/regress-1101304.js @@ -10,9 +10,9 @@ builder.addType(makeSig( [])); builder.addFunction(undefined, 0 /* sig */).addBody([ kExprI32Const, 0, // i32.const - kExprIf, kWasmStmt, // if @3 + kExprIf, kWasmVoid, // if @3 kExprI32Const, 1, // i32.const - kExprIf, kWasmStmt, // if @7 + kExprIf, kWasmVoid, // if @7 kExprNop, // nop kExprElse, // else @10 kExprUnreachable, // unreachable diff --git a/test/mjsunit/regress/wasm/regress-1145135.js b/test/mjsunit/regress/wasm/regress-1145135.js index aacaedc93f..407f5a2f87 100644 --- a/test/mjsunit/regress/wasm/regress-1145135.js +++ b/test/mjsunit/regress/wasm/regress-1145135.js @@ -19,11 +19,11 @@ kExprI32Const, 0x10, // i32.const kExprI32Sub, // i32.sub kExprLocalTee, 0x02, // local.tee kExprGlobalSet, 0x00, // global.set -kExprBlock, kWasmStmt, // block @12 +kExprBlock, kWasmVoid, // block @12 kExprLocalGet, 0x00, // local.get kExprI32LoadMem, 0x02, 0x00, // i32.load kExprI32Eqz, // i32.eqz - kExprIf, kWasmStmt, // if @20 + kExprIf, kWasmVoid, // if @20 kExprLocalGet, 0x02, // local.get kExprI32Const, 0x00, // i32.const kExprI32StoreMem, 0x02, 0x0c, // i32.store diff --git a/test/mjsunit/regress/wasm/regress-1146861.js b/test/mjsunit/regress/wasm/regress-1146861.js index d9d80e58cc..56c0b7d194 100644 --- a/test/mjsunit/regress/wasm/regress-1146861.js +++ b/test/mjsunit/regress/wasm/regress-1146861.js @@ -35,9 +35,9 @@ kExprI32Const, 0x00, // i32.const kExprI32Const, 0x01, // i32.const kExprI32Sub, // i32.sub kExprLocalSet, 0x07, // local.set -kExprBlock, kWasmStmt, // block @45 +kExprBlock, kWasmVoid, // block @45 kExprI32Const, 0x00, // i32.const - kExprIf, kWasmStmt, // if @49 + kExprIf, kWasmVoid, // if @49 kExprLocalGet, 0x0a, // local.get kExprLocalSet, 0x08, // local.set kExprElse, // else @55 diff --git a/test/mjsunit/regress/wasm/regress-1153442.js b/test/mjsunit/regress/wasm/regress-1153442.js index 989da11a25..a86866429c 100644 --- a/test/mjsunit/regress/wasm/regress-1153442.js +++ b/test/mjsunit/regress/wasm/regress-1153442.js @@ -21,7 +21,7 @@ kExprI32Const, 0x00, // i32.const kExprLocalSet, 0x04, // local.set kExprI32Const, 0x01, // i32.const kExprLocalSet, 0x05, // local.set -kExprBlock, kWasmStmt, // block @11 +kExprBlock, kWasmVoid, // block @11 kExprBr, 0x00, // br depth=0 kExprEnd, // end @15 kExprGlobalGet, 0x01, // global.get @@ -35,7 +35,7 @@ kExprLocalSet, 0x01, // local.set kExprI32Const, 0x00, // i32.const kExprI32Eqz, // i32.eqz kExprLocalSet, 0x07, // local.set -kExprBlock, kWasmStmt, // block @36 +kExprBlock, kWasmVoid, // block @36 kExprBr, 0x00, // br depth=0 kExprEnd, // end @40 kExprGlobalGet, 0x01, // global.get diff --git a/test/mjsunit/regress/wasm/regress-1161654.js b/test/mjsunit/regress/wasm/regress-1161654.js index 93f2c3b556..f942798927 100644 --- a/test/mjsunit/regress/wasm/regress-1161654.js +++ b/test/mjsunit/regress/wasm/regress-1161654.js @@ -34,7 +34,7 @@ kExprLocalGet, 0x01, // local.get kExprLocalGet, 0x01, // local.get kExprGlobalGet, 0x00, // global.get kExprDrop, // drop -kExprLoop, kWasmStmt, // loop @8 +kExprLoop, kWasmVoid, // loop @8 kExprLoop, 0x00, // loop @10 kExprI32Const, 0x01, // i32.const kExprMemoryGrow, 0x00, // memory.grow diff --git a/test/mjsunit/regress/wasm/regress-1179182.js b/test/mjsunit/regress/wasm/regress-1179182.js index 907cf563c9..0bcdd7bd44 100644 --- a/test/mjsunit/regress/wasm/regress-1179182.js +++ b/test/mjsunit/regress/wasm/regress-1179182.js @@ -13,7 +13,7 @@ builder.addFunction(undefined, kSig_i_v) .addBody([ kExprI64Const, 0x0, // i64.const kExprI32Const, 0x0, // i32.const -kExprIf, kWasmStmt, // if +kExprIf, kWasmVoid, // if kExprI32Const, 0x0, // i32.const kExprI32LoadMem, 0x01, 0x23, // i32.load kExprBrTable, 0x01, 0x00, 0x00, // br_table diff --git a/test/mjsunit/regress/wasm/regress-1188825.js b/test/mjsunit/regress/wasm/regress-1188825.js index 3fdab7e2c1..9a4cb1ecbd 100644 --- a/test/mjsunit/regress/wasm/regress-1188825.js +++ b/test/mjsunit/regress/wasm/regress-1188825.js @@ -13,7 +13,7 @@ let exception = builder.addException(kSig_v_v); builder.addFunction("foo", kSig_v_v) .addBody([ kExprTry, - kWasmStmt, + kWasmVoid, kExprCallFunction, imports, kExprCatch, exception, kExprEnd] diff --git a/test/mjsunit/regress/wasm/regress-1188975.js b/test/mjsunit/regress/wasm/regress-1188975.js index 0fdc055b7d..3d716cd2ca 100644 --- a/test/mjsunit/regress/wasm/regress-1188975.js +++ b/test/mjsunit/regress/wasm/regress-1188975.js @@ -12,7 +12,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); builder.addFunction("f", kSig_v_v) .addBody([ kExprUnreachable, - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprElse, kExprCatchAll, kExprEnd, diff --git a/test/mjsunit/regress/wasm/regress-5800.js b/test/mjsunit/regress/wasm/regress-5800.js index 77c436119c..75605e3612 100644 --- a/test/mjsunit/regress/wasm/regress-5800.js +++ b/test/mjsunit/regress/wasm/regress-5800.js @@ -9,7 +9,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); builder.addFunction("main", kSig_i_v) .addBody([ - kExprBlock, kWasmStmt, + kExprBlock, kWasmVoid, kExprI64Const, 0, // 0x80 ... 0x10 is the LEB encoding of 0x100000000. This is chosen so // that the 64-bit constant has a non-zero top half. In this bug, the @@ -34,7 +34,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); builder.addFunction("main", kSig_i_v) .addBody([ - kExprBlock, kWasmStmt, + kExprBlock, kWasmVoid, kExprI64Const, 0, // 0x80 ... 0x10 is the LEB encoding of 0x100000000. This is chosen so // that the 64-bit constant has a non-zero top half. In this bug, the diff --git a/test/mjsunit/regress/wasm/regress-7353.js b/test/mjsunit/regress/wasm/regress-7353.js index 671da730fb..9bda7fcc70 100644 --- a/test/mjsunit/regress/wasm/regress-7353.js +++ b/test/mjsunit/regress/wasm/regress-7353.js @@ -16,7 +16,7 @@ builder.addFunction('main', kSig_i_i).addBody([ ...wasmI32Const(0x41), kExprLocalSet, 0, // Enter loop, such that values are spilled to the stack. - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprEnd, // Reload value. This must be loaded as 32 bit value. kExprLocalGet, 0, diff --git a/test/mjsunit/regress/wasm/regress-7366.js b/test/mjsunit/regress/wasm/regress-7366.js index b5e4e2e2b6..92579bc37b 100644 --- a/test/mjsunit/regress/wasm/regress-7366.js +++ b/test/mjsunit/regress/wasm/regress-7366.js @@ -18,7 +18,7 @@ builder.addFunction(undefined, kSig_i_iii) kExprLocalSet, 1, // set_local 1 ...wasmI32Const(16), // i32.const 0x1 kExprLocalSet, 2, // set_local 2 - kExprLoop, kWasmStmt, // loop + kExprLoop, kWasmVoid, // loop kExprEnd, // end kExprLocalGet, 0, // get_local 0 kExprLocalGet, 1, // get_local 1 diff --git a/test/mjsunit/regress/wasm/regress-782280.js b/test/mjsunit/regress/wasm/regress-782280.js index 008ab16159..776ca522c2 100644 --- a/test/mjsunit/regress/wasm/regress-782280.js +++ b/test/mjsunit/regress/wasm/regress-782280.js @@ -21,7 +21,7 @@ builder.addFunction('test', kSig_i_iii) kExprI32Const, 0, // 0, 0 kExprI32Const, 1, // 0, 0, 1 kExprI32Add, // 0, 0 + 1 -> 1 - kExprBlock, kWasmStmt, // 0, 1 + kExprBlock, kWasmVoid, // 0, 1 kExprBr, 0, // 0, 1 kExprEnd, // 0, 1 kExprI32Add, // 0 + 1 -> 1 diff --git a/test/mjsunit/regress/wasm/regress-791810.js b/test/mjsunit/regress/wasm/regress-791810.js index 3daeff9e15..74f11ca81e 100644 --- a/test/mjsunit/regress/wasm/regress-791810.js +++ b/test/mjsunit/regress/wasm/regress-791810.js @@ -8,10 +8,10 @@ const builder = new WasmModuleBuilder(); builder.addFunction('test', kSig_i_i) .addBody([ kExprLocalGet, 0x00, // get_local 0 - kExprBlock, kWasmStmt, // block + kExprBlock, kWasmVoid, // block kExprBr, 0x00, // br depth=0 kExprEnd, // end - kExprBlock, kWasmStmt, // block + kExprBlock, kWasmVoid, // block kExprBr, 0x00, // br depth=0 kExprEnd, // end kExprBr, 0x00, // br depth=0 diff --git a/test/mjsunit/regress/wasm/regress-793551.js b/test/mjsunit/regress/wasm/regress-793551.js index ac2b34019e..db93c83fde 100644 --- a/test/mjsunit/regress/wasm/regress-793551.js +++ b/test/mjsunit/regress/wasm/regress-793551.js @@ -10,7 +10,7 @@ builder.addFunction('test', kSig_i_i) // body: kExprLocalGet, 0, // get_local 0 kExprLocalGet, 0, // get_local 0 - kExprLoop, kWasmStmt, // loop + kExprLoop, kWasmVoid, // loop kExprBr, 0, // br depth=0 kExprEnd, // end kExprUnreachable, // unreachable diff --git a/test/mjsunit/regress/wasm/regress-842501.js b/test/mjsunit/regress/wasm/regress-842501.js index d54507cc59..8445b48906 100644 --- a/test/mjsunit/regress/wasm/regress-842501.js +++ b/test/mjsunit/regress/wasm/regress-842501.js @@ -23,7 +23,7 @@ load('test/mjsunit/wasm/wasm-module-builder.js'); kExprF32Eq, kExprI32LoadMem, 0x01, 0xef, 0xec, 0x95, 0x93, 0x07, kExprI32Add, - kExprIf, kWasmStmt, // @30 + kExprIf, kWasmVoid, // @30 kExprEnd, // @32 kExprI32Const, 0xc9, 0x93, 0xdf, 0xcc, 0x7c, kExprEnd, // @39 diff --git a/test/mjsunit/regress/wasm/regress-8533.js b/test/mjsunit/regress/wasm/regress-8533.js index a39d7e8836..db027a226d 100644 --- a/test/mjsunit/regress/wasm/regress-8533.js +++ b/test/mjsunit/regress/wasm/regress-8533.js @@ -21,7 +21,7 @@ const sync_address = 12; // Calling the imported function sets the thread-in-wasm flag of the // main thread. kExprCallFunction, import_id, // -- - kExprLoop, kWasmStmt, // -- + kExprLoop, kWasmVoid, // -- kExprI32Const, sync_address, // -- kExprI32LoadMem, 0, 0, // -- kExprI32Eqz, diff --git a/test/mjsunit/regress/wasm/regress-854050.js b/test/mjsunit/regress/wasm/regress-854050.js index bf170c5d63..040c0e36c8 100644 --- a/test/mjsunit/regress/wasm/regress-854050.js +++ b/test/mjsunit/regress/wasm/regress-854050.js @@ -10,7 +10,7 @@ builder.addFunction(undefined, makeSig([kWasmI32, kWasmF32], [])) .addBody([ kExprLocalGet, 0, // get_local kExprI32Const, 0, // i32.const 0 - kExprIf, kWasmStmt, // if + kExprIf, kWasmVoid, // if kExprUnreachable, // unreachable kExprEnd, // end if kExprLocalGet, 4, // get_local @@ -21,7 +21,7 @@ builder.addFunction(undefined, makeSig([kWasmI32, kWasmF32], [])) kExprLocalTee, 2, // tee_local kExprLocalTee, 8, // tee_local kExprDrop, // drop - kExprLoop, kWasmStmt, // loop + kExprLoop, kWasmVoid, // loop kExprEnd, // end loop ]); builder.instantiate(); diff --git a/test/mjsunit/regress/wasm/regress-905815.js b/test/mjsunit/regress/wasm/regress-905815.js index 21f32180bd..00f7825a24 100644 --- a/test/mjsunit/regress/wasm/regress-905815.js +++ b/test/mjsunit/regress/wasm/regress-905815.js @@ -15,7 +15,7 @@ load('test/mjsunit/wasm/wasm-module-builder.js'); builder.addFunction(undefined, 1 /* sig */) .addLocals(kWasmI32, 65) .addBodyWithEnd([ - kExprLoop, kWasmStmt, // @3 + kExprLoop, kWasmVoid, // @3 kSimdPrefix, kExprF32x4Min, kExprI64UConvertI32, diff --git a/test/mjsunit/regress/wasm/regress-913804.js b/test/mjsunit/regress/wasm/regress-913804.js index e9d4026308..630929a0bd 100644 --- a/test/mjsunit/regress/wasm/regress-913804.js +++ b/test/mjsunit/regress/wasm/regress-913804.js @@ -6,9 +6,9 @@ load('test/mjsunit/wasm/wasm-module-builder.js'); const builder = new WasmModuleBuilder(); builder.addFunction('main', kSig_v_v).addBody([ - kExprLoop, kWasmStmt, // loop + kExprLoop, kWasmVoid, // loop /**/ kExprBr, 0x01, // br depth=1 - /**/ kExprBlock, kWasmStmt, // block + /**/ kExprBlock, kWasmVoid, // block /**/ /**/ kExprBr, 0x02, // br depth=2 /**/ /**/ kExprEnd, // end [block] /**/ kExprEnd // end [loop] diff --git a/test/mjsunit/regress/wasm/regress-917412.js b/test/mjsunit/regress/wasm/regress-917412.js index 4b9528ccf6..74fb87133c 100644 --- a/test/mjsunit/regress/wasm/regress-917412.js +++ b/test/mjsunit/regress/wasm/regress-917412.js @@ -16,7 +16,7 @@ kExprElse, kExprEnd, kExprLocalTee, 0, kExprLocalGet, 0, -kExprLoop, kWasmStmt, +kExprLoop, kWasmVoid, kExprI64Const, 0x80, 0x80, 0x80, 0x70, kExprLocalSet, 0x01, kExprI32Const, 0x00, diff --git a/test/mjsunit/regress/wasm/regress-917588b.js b/test/mjsunit/regress/wasm/regress-917588b.js index 1e5c1a4488..1fab062b85 100644 --- a/test/mjsunit/regress/wasm/regress-917588b.js +++ b/test/mjsunit/regress/wasm/regress-917588b.js @@ -16,8 +16,8 @@ builder.addFunction(undefined, sig1) // signature: f_lilfl kExprBlock, kWasmF32, // @1 f32 kExprI32Const, 0x00, - kExprIf, kWasmStmt, // @5 - kExprLoop, kWasmStmt, // @7 + kExprIf, kWasmVoid, // @5 + kExprLoop, kWasmVoid, // @7 kExprBlock, kWasmI32, // @9 i32 kExprF32Const, 0x00, 0x00, 0x80, 0xc1, kExprF32Const, 0x00, 0x00, 0x80, 0x45, diff --git a/test/mjsunit/regress/wasm/regress-919533.js b/test/mjsunit/regress/wasm/regress-919533.js index 1cc4b675c2..ab13941b20 100644 --- a/test/mjsunit/regress/wasm/regress-919533.js +++ b/test/mjsunit/regress/wasm/regress-919533.js @@ -12,7 +12,7 @@ builder.addFunction(undefined, kSig_i_i) kExprLocalGet, 0, // Stack now contains two copies of the first param register. // Start a loop to create a merge point (values still in registers). - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, // The call spills all values. kExprCallFunction, 0, // Break to the loop. Now the spilled values need to be loaded back *into diff --git a/test/mjsunit/regress/wasm/regress-922933.js b/test/mjsunit/regress/wasm/regress-922933.js index aabe001392..7df7fb47d2 100644 --- a/test/mjsunit/regress/wasm/regress-922933.js +++ b/test/mjsunit/regress/wasm/regress-922933.js @@ -9,21 +9,21 @@ const sig = builder.addType(makeSig([kWasmI64], [kWasmI64])); builder.addFunction(undefined, sig) .addLocals(kWasmI32, 14).addLocals(kWasmI64, 17).addLocals(kWasmF32, 14) .addBody([ - kExprBlock, kWasmStmt, + kExprBlock, kWasmVoid, kExprBr, 0x00, kExprEnd, - kExprBlock, kWasmStmt, + kExprBlock, kWasmVoid, kExprI32Const, 0x00, kExprLocalSet, 0x09, kExprI32Const, 0x00, - kExprIf, kWasmStmt, - kExprBlock, kWasmStmt, + kExprIf, kWasmVoid, + kExprBlock, kWasmVoid, kExprI32Const, 0x00, kExprLocalSet, 0x0a, kExprBr, 0x00, kExprEnd, - kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, + kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, kExprLocalGet, 0x00, kExprLocalSet, 0x12, kExprBr, 0x00, diff --git a/test/mjsunit/regress/wasm/regress-924843.js b/test/mjsunit/regress/wasm/regress-924843.js index c77845af76..c4c8b30987 100644 --- a/test/mjsunit/regress/wasm/regress-924843.js +++ b/test/mjsunit/regress/wasm/regress-924843.js @@ -9,8 +9,8 @@ const sig = builder.addType(makeSig([kWasmI32, kWasmI32, kWasmI32], [kWasmI32])) builder.addFunction(undefined, sig) .addBody([ kExprLocalGet, 2, - kExprIf, kWasmStmt, - kExprBlock, kWasmStmt + kExprIf, kWasmVoid, + kExprBlock, kWasmVoid ]); builder.addExport('main', 0); assertThrows(() => builder.instantiate(), WebAssembly.CompileError); diff --git a/test/mjsunit/regress/wasm/regress-968078.js b/test/mjsunit/regress/wasm/regress-968078.js index 07081087fa..fce3727cd3 100644 --- a/test/mjsunit/regress/wasm/regress-968078.js +++ b/test/mjsunit/regress/wasm/regress-968078.js @@ -27,12 +27,12 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); builder.addMemory(12, 12, false); builder.addFunction("foo", kSig_v_iii) .addBody([].concat([ - kExprBlock, kWasmStmt, + kExprBlock, kWasmVoid, kExprLocalGet, 0x2, kExprI32Const, 0x01, kExprI32And, // Generate a test branch (which has 32k limited reach). - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprLocalGet, 0x0, kExprI32Const, 0x01, kExprI32And, diff --git a/test/mjsunit/regress/wasm/regress-9759.js b/test/mjsunit/regress/wasm/regress-9759.js index 05bb26f7ff..ca0604eebf 100644 --- a/test/mjsunit/regress/wasm/regress-9759.js +++ b/test/mjsunit/regress/wasm/regress-9759.js @@ -15,7 +15,7 @@ const NUM_CASES = 0xfffd; let cases = new Array(NUM_CASES).fill(0); builder.addFunction('main', kSig_v_i) .addBody([].concat([ - kExprBlock, kWasmStmt, + kExprBlock, kWasmVoid, kExprLocalGet, 0, kExprBrTable], wasmSignedLeb(NUM_CASES), cases, [0, diff --git a/test/mjsunit/regress/wasm/regress-9832.js b/test/mjsunit/regress/wasm/regress-9832.js index 05b63b0984..891139f50d 100644 --- a/test/mjsunit/regress/wasm/regress-9832.js +++ b/test/mjsunit/regress/wasm/regress-9832.js @@ -16,7 +16,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); ]).exportFunc(); builder.addFunction("main", kSig_i_i) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprLocalGet, 0, kExprCallFunction, f.index, kExprCallFunction, f.index, diff --git a/test/mjsunit/wasm/atomics-stress.js b/test/mjsunit/wasm/atomics-stress.js index 19a9a0ccfb..e006ecdf0f 100644 --- a/test/mjsunit/wasm/atomics-stress.js +++ b/test/mjsunit/wasm/atomics-stress.js @@ -264,7 +264,7 @@ function generateFunctionBodyForSequence(sequence) { kExprLocalGet, 2, kExprI32Const, 1, kAtomicPrefix, kExprI32AtomicSub, 2, 0, // Spin until zero. - kExprLoop, kWasmStmt, kExprLocalGet, 2, kAtomicPrefix, + kExprLoop, kWasmVoid, kExprLocalGet, 2, kAtomicPrefix, kExprI32AtomicLoad, 2, 0, kExprI32Const, 0, kExprI32GtU, kExprBrIf, 0, kExprEnd); } diff --git a/test/mjsunit/wasm/atomics.js b/test/mjsunit/wasm/atomics.js index 6d37ba5548..3df938af7f 100644 --- a/test/mjsunit/wasm/atomics.js +++ b/test/mjsunit/wasm/atomics.js @@ -399,7 +399,7 @@ function TestStore(func, buffer, value, size) { builder.addImportedMemory("m", "imported_mem", 16, 128, "shared"); builder.addFunction("main", kSig_i_v) .addBody([ - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprI32Const, 16, kExprI32Const, 20, kAtomicPrefix, @@ -442,7 +442,7 @@ function CmpExchgLoop(opcode, alignment) { builder.addFunction("main", makeSig([kWasmI32], [])) .addLocals(kWasmI64, 2) .addBody([ - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprLocalGet, 0, kExprLocalGet, 1, kExprLocalGet, 2, diff --git a/test/mjsunit/wasm/atomics64-stress.js b/test/mjsunit/wasm/atomics64-stress.js index 99e9016f1a..472bba81c0 100644 --- a/test/mjsunit/wasm/atomics64-stress.js +++ b/test/mjsunit/wasm/atomics64-stress.js @@ -302,7 +302,7 @@ function generateFunctionBodyForSequence(sequence) { kExprLocalGet, 2, kExprI32Const, 1, kAtomicPrefix, kExprI32AtomicSub, 2, 0, // Spin until zero. - kExprLoop, kWasmStmt, kExprLocalGet, 2, kAtomicPrefix, + kExprLoop, kWasmVoid, kExprLocalGet, 2, kAtomicPrefix, kExprI32AtomicLoad, 2, 0, kExprI32Const, 0, kExprI32GtU, kExprBrIf, 0, kExprEnd); } diff --git a/test/mjsunit/wasm/compare-exchange-stress.js b/test/mjsunit/wasm/compare-exchange-stress.js index 97ed71b9e1..7d979b65ec 100644 --- a/test/mjsunit/wasm/compare-exchange-stress.js +++ b/test/mjsunit/wasm/compare-exchange-stress.js @@ -43,20 +43,20 @@ function makeWorkerCodeForOpcode(compareExchangeOpcode, size, functionName, kExprI32Mul, kExprLocalSet, kArgSeqenceLength, // Outer block so we have something to jump for return. - ...[kExprBlock, kWasmStmt, + ...[kExprBlock, kWasmVoid, // Set counter to 0. kExprI32Const, 0, kExprLocalSet, kLocalCurrentOffset, // Outer loop until maxcount. - ...[kExprLoop, kWasmStmt, + ...[kExprLoop, kWasmVoid, // Find the next value to wait for. - ...[kExprLoop, kWasmStmt, + ...[kExprLoop, kWasmVoid, // Check end of sequence. kExprLocalGet, kLocalCurrentOffset, kExprLocalGet, kArgSeqenceLength, kExprI32Eq, kExprBrIf, 2, // return - ...[kExprBlock, kWasmStmt, + ...[kExprBlock, kWasmVoid, // Load next value. kExprLocalGet, kArgSequencePtr, kExprLocalGet, kLocalCurrentOffset, @@ -95,7 +95,7 @@ function makeWorkerCodeForOpcode(compareExchangeOpcode, size, functionName, loadMemOpcode, 0, 0, kExprLocalSet, kLocalNextValue, // Hammer on memory until value found. - ...[kExprLoop, kWasmStmt, + ...[kExprLoop, kWasmVoid, // Load address. kExprLocalGet, kArgMemoryCell, // Load expected value. diff --git a/test/mjsunit/wasm/compare-exchange64-stress.js b/test/mjsunit/wasm/compare-exchange64-stress.js index be219f3a07..ae266d1139 100644 --- a/test/mjsunit/wasm/compare-exchange64-stress.js +++ b/test/mjsunit/wasm/compare-exchange64-stress.js @@ -46,20 +46,20 @@ function makeWorkerCodeForOpcode(compareExchangeOpcode, size, functionName, kExprI32Mul, kExprLocalSet, kArgSeqenceLength, // Outer block so we have something to jump for return. - ...[kExprBlock, kWasmStmt, + ...[kExprBlock, kWasmVoid, // Set counter to 0. kExprI32Const, 0, kExprLocalSet, kLocalCurrentOffset, // Outer loop until maxcount. - ...[kExprLoop, kWasmStmt, + ...[kExprLoop, kWasmVoid, // Find the next value to wait for. - ...[kExprLoop, kWasmStmt, + ...[kExprLoop, kWasmVoid, // Check end of sequence. kExprLocalGet, kLocalCurrentOffset, kExprLocalGet, kArgSeqenceLength, kExprI32Eq, kExprBrIf, 2, // return - ...[kExprBlock, kWasmStmt, + ...[kExprBlock, kWasmVoid, // Load next value. kExprLocalGet, kArgSequencePtr, kExprLocalGet, kLocalCurrentOffset, @@ -100,7 +100,7 @@ function makeWorkerCodeForOpcode(compareExchangeOpcode, size, functionName, loadMemOpcode, 0, 0, kExprLocalSet, kLocalNextValue, // Hammer on memory until value found. - ...[kExprLoop, kWasmStmt, + ...[kExprLoop, kWasmVoid, // Load address. kExprLocalGet, kArgMemoryCell, // Load expected value. diff --git a/test/mjsunit/wasm/compiled-module-serialization.js b/test/mjsunit/wasm/compiled-module-serialization.js index 63568fe657..d527a72ca6 100644 --- a/test/mjsunit/wasm/compiled-module-serialization.js +++ b/test/mjsunit/wasm/compiled-module-serialization.js @@ -359,13 +359,13 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); print(arguments.callee.name); const builder = new WasmModuleBuilder(); builder.addFunction('main', kSig_i_i) - .addBody([kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, + .addBody([kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, kExprLocalGet, 0, kExprBrTable, 6, 0, 1, 2, 3, 4, 5, 6, kExprEnd, diff --git a/test/mjsunit/wasm/exceptions-rethrow.js b/test/mjsunit/wasm/exceptions-rethrow.js index ec689791ca..e7dc9e4f0b 100644 --- a/test/mjsunit/wasm/exceptions-rethrow.js +++ b/test/mjsunit/wasm/exceptions-rethrow.js @@ -14,7 +14,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); let except = builder.addException(kSig_v_v); builder.addFunction("rethrow0", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprThrow, except, kExprCatch, except, kExprRethrow, 0, @@ -27,7 +27,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprCatch, except, kExprLocalGet, 0, kExprI32Eqz, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprRethrow, 1, kExprEnd, kExprI32Const, 23, @@ -47,7 +47,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); let except = builder.addException(kSig_v_v); builder.addFunction("rethrow0", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprThrow, except, kExprCatchAll, kExprRethrow, 0, @@ -60,7 +60,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprCatchAll, kExprLocalGet, 0, kExprI32Eqz, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprRethrow, 1, kExprEnd, kExprI32Const, 23, @@ -91,13 +91,13 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprLocalGet, 0, kExprI32Const, 0, kExprI32Eq, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprRethrow, 1, kExprEnd, kExprLocalGet, 0, kExprI32Const, 1, kExprI32Eq, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprRethrow, 2, kExprEnd, kExprI32Const, 23, @@ -125,7 +125,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprTry, kWasmI32, kExprLocalGet, 0, kExprI32Eqz, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprRethrow, 2, kExprEnd, kExprI32Const, 42, diff --git a/test/mjsunit/wasm/exceptions-shared.js b/test/mjsunit/wasm/exceptions-shared.js index 8b3defb9af..d2d595dc73 100644 --- a/test/mjsunit/wasm/exceptions-shared.js +++ b/test/mjsunit/wasm/exceptions-shared.js @@ -30,7 +30,7 @@ function NewExportedException() { ]).exportFunc(); builder.addFunction("catch", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, fun, kExprCatch, except, kExprEnd, @@ -62,7 +62,7 @@ function NewExportedException() { ]).exportFunc(); builder.addFunction("catch", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, fun, kExprCatch, except, kExprEnd, @@ -97,7 +97,7 @@ function NewExportedException() { ]).exportFunc(); builder.addFunction("catch", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, fun, kExprCatch, except1, kExprEnd, @@ -136,7 +136,7 @@ function NewExportedException() { let except = builder2.addImportedException("m", "ex", kSig_v_v); builder2.addFunction("catch", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, fun, kExprCatch, except, kExprEnd, diff --git a/test/mjsunit/wasm/exceptions.js b/test/mjsunit/wasm/exceptions.js index 7115c54a1f..88e92fa3bb 100644 --- a/test/mjsunit/wasm/exceptions.js +++ b/test/mjsunit/wasm/exceptions.js @@ -17,7 +17,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprLocalGet, 0, kExprI32Const, 0, kExprI32Ne, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except, kExprEnd, kExprI32Const, 1 @@ -36,7 +36,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); let except = builder.addException(kSig_v_v); builder.addFunction("catch_empty_try", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCatch, except, kExprEnd, ]).exportFunc(); @@ -55,7 +55,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprTry, kWasmI32, kExprLocalGet, 0, kExprI32Eqz, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except, kExprEnd, kExprI32Const, 42, @@ -74,14 +74,14 @@ load("test/mjsunit/wasm/exceptions-utils.js"); let builder = new WasmModuleBuilder(); builder.addFunction('unreachable_in_try', kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprUnreachable, kExprCatchAll, kExprEnd ]).exportFunc(); builder.addFunction('unreachable_in_try_unwind', kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprUnreachable, kExprUnwind, kExprEnd @@ -229,13 +229,13 @@ load("test/mjsunit/wasm/exceptions-utils.js"); builder.addFunction('test', kSig_v_v) .addBody([ // Calling "throw" directly should produce the expected exception. - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, throw_fn.index, kExprCatch, except, kExprEnd, // Calling through JS produces a wrapped exceptions which does not match // the catch. - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, imp, kExprCatch, except, kExprEnd @@ -277,13 +277,13 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprTry, kWasmI32, kExprLocalGet, 0, kExprI32Eqz, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except1, kExprElse, kExprLocalGet, 0, kExprI32Const, 1, kExprI32Eq, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except2, kExprElse, kExprThrow, except3, @@ -317,13 +317,13 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprTry, kWasmI32, kExprLocalGet, 0, kExprI32Eqz, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except1, kExprElse, kExprLocalGet, 0, kExprI32Const, 1, kExprI32Eq, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except2, kExprElse, kExprThrow, except3, @@ -609,7 +609,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprLocalGet, 0, kExprI32Const, 0, kExprI32Ne, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprLocalGet, 0, kExprThrow, except, kExprUnreachable, @@ -672,7 +672,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprLocalGet, 0, kExprI32Const, 1, kExprI32Eq, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprI32Const, 1, kExprThrow, except, kExprUnreachable, @@ -688,7 +688,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprLocalGet, 0, kExprI32Const, 2, kExprI32Eq, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprLocalGet, 1, kExprI32Const, 8, kExprI32Ior, @@ -707,7 +707,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprLocalGet, 0, kExprI32Const, 3, kExprI32Eq, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprLocalGet, 1, kExprI32Const, /*64=*/ 192, 0, kExprI32Ior, @@ -766,7 +766,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); builder.addFunction("string_from_js", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, kJSThrowString, kExprCatch, except, kExprUnreachable, @@ -776,7 +776,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); builder.addFunction("fp_from_js", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, kJSThrowFP, kExprCatch, except, kExprUnreachable, @@ -786,7 +786,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); builder.addFunction("large_from_js", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, kJSThrowLarge, kExprCatch, except, kExprUnreachable, @@ -796,7 +796,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); builder.addFunction("undefined_from_js", kSig_v_v) .addBody([ - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprCallFunction, kJSThrowUndefined, kExprCatch, except, kExprUnreachable, @@ -866,7 +866,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); let throw_if = builder.addFunction('throw', kSig_v_i) .addBody([ kExprLocalGet, 0, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except, kExprEnd]).exportFunc(); builder.addFunction('test', kSig_i_i) @@ -924,9 +924,9 @@ load("test/mjsunit/wasm/exceptions-utils.js"); // 2 -> throw except2 let throw_fn = builder.addFunction('throw', kSig_v_i) .addBody([ - kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, - kExprBlock, kWasmStmt, + kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, + kExprBlock, kWasmVoid, kExprLocalGet, 0, kExprBrTable, 2, 0, 1, 2, kExprEnd, @@ -993,7 +993,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); builder.addFunction('test', kSig_i_v) .addBody([ kExprTry, kWasmI32, - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, kExprThrow, except1, kExprDelegate, 0, kExprI32Const, 1, @@ -1013,8 +1013,8 @@ load("test/mjsunit/wasm/exceptions-utils.js"); let except = builder.addException(kSig_v_v); builder.addFunction('test', kSig_v_v) .addBody([ - kExprTry, kWasmStmt, - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, + kExprTry, kWasmVoid, kExprThrow, except, kExprDelegate, 1, kExprCatchAll, @@ -1022,8 +1022,8 @@ load("test/mjsunit/wasm/exceptions-utils.js"); ]).exportFunc(); builder.addFunction('test_unwind', kSig_v_v) .addBody([ - kExprTry, kWasmStmt, - kExprTry, kWasmStmt, + kExprTry, kWasmVoid, + kExprTry, kWasmVoid, kExprThrow, except, kExprDelegate, 1, kExprUnwind, diff --git a/test/mjsunit/wasm/globals.js b/test/mjsunit/wasm/globals.js index ba7bef301c..8a9bb2517e 100644 --- a/test/mjsunit/wasm/globals.js +++ b/test/mjsunit/wasm/globals.js @@ -183,7 +183,7 @@ TestGlobalIndexSpace(kWasmF64, 12345.678); builder.addFunction("set", kSig_v_ii) .addBody([ kExprLocalGet, 0, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprLocalGet, 1, kExprGlobalSet, g.index, kExprElse, diff --git a/test/mjsunit/wasm/grow-memory-in-branch.js b/test/mjsunit/wasm/grow-memory-in-branch.js index 8babc66b75..9c9e881fab 100644 --- a/test/mjsunit/wasm/grow-memory-in-branch.js +++ b/test/mjsunit/wasm/grow-memory-in-branch.js @@ -33,7 +33,7 @@ function generateBuilder() { builder.addFunction('main', kSig_i_i) .addBody([ kExprLocalGet, 0, // get condition parameter - kExprIf, kWasmStmt, // if it's 1 then enter if + kExprIf, kWasmVoid, // if it's 1 then enter if kExprI32Const, deltaPages, // put deltaPages on stack kExprMemoryGrow, kMemoryZero, // grow memory kExprDrop, // drop the result of grow @@ -60,7 +60,7 @@ function generateBuilder() { builder.addFunction('main', kSig_i_i) .addBody([ kExprLocalGet, 0, // get condition parameter - kExprIf, kWasmStmt, // if it's 1 then enter if + kExprIf, kWasmVoid, // if it's 1 then enter if kExprI32Const, deltaPages, // put deltaPages on stack kExprMemoryGrow, kMemoryZero, // grow memory kExprDrop, // drop the result of grow @@ -95,7 +95,7 @@ function generateBuilder() { builder.addFunction('main', kSig_i_i) .addBody([ kExprLocalGet, 0, // get condition parameter - kExprIf, kWasmStmt, // if it's 1 then enter if + kExprIf, kWasmVoid, // if it's 1 then enter if kExprI32Const, index, // put index on stack kExprI32Const, newValue, // put the value on stack kExprI32StoreMem, 0, 0, // store @@ -128,7 +128,7 @@ function generateBuilder() { builder.addFunction('main', kSig_i_i) .addBody([ kExprLocalGet, 0, // get condition parameter - kExprIf, kWasmStmt, // if it's 1 then enter if + kExprIf, kWasmVoid, // if it's 1 then enter if kExprI32Const, deltaPagesIf, // put deltaPagesIf on stack kExprMemoryGrow, kMemoryZero, // grow memory kExprDrop, // drop the result of grow @@ -160,7 +160,7 @@ function generateBuilder() { builder.addFunction('main', kSig_i_ii) .addBody([ kExprLocalGet, 0, // get condition parameter - kExprIf, kWasmStmt, // if it's 1 then enter if + kExprIf, kWasmVoid, // if it's 1 then enter if kExprI32Const, deltaPages, // put deltaPages on stack kExprMemoryGrow, kMemoryZero, // grow memory kExprDrop, // drop the result of grow @@ -192,7 +192,7 @@ function generateBuilder() { builder.addFunction('main', kSig_i_ii) .addBody([ kExprLocalGet, 0, // get condition parameter - kExprIf, kWasmStmt, // if it's 1 then enter if + kExprIf, kWasmVoid, // if it's 1 then enter if kExprI32Const, deltaPages, // put deltaPages on stack kExprMemoryGrow, kMemoryZero, // grow memory kExprDrop, // drop the result of grow @@ -227,7 +227,7 @@ function generateBuilder() { builder.addFunction('main', kSig_i_ii) .addBody([ kExprLocalGet, 0, // get condition parameter - kExprIf, kWasmStmt, // if it's 1 then enter if + kExprIf, kWasmVoid, // if it's 1 then enter if kExprLocalGet, 1, // get index parameter kExprI32Const, value, // put the value on stack kExprI32StoreMem, 0, 0, // store @@ -264,7 +264,7 @@ function generateBuilder() { builder.addFunction('main', kSig_i_ii) .addBody([ kExprLocalGet, 0, // get condition parameter - kExprIf, kWasmStmt, // if it's 1 then enter if + kExprIf, kWasmVoid, // if it's 1 then enter if kExprI32Const, deltaPagesIf, // put deltaPagesIf on stack kExprMemoryGrow, kMemoryZero, // grow memory kExprDrop, // drop the result of grow diff --git a/test/mjsunit/wasm/grow-memory-in-call.js b/test/mjsunit/wasm/grow-memory-in-call.js index 660ec08e90..29ece1cba2 100644 --- a/test/mjsunit/wasm/grow-memory-in-call.js +++ b/test/mjsunit/wasm/grow-memory-in-call.js @@ -124,9 +124,9 @@ print('=== grow_memory in direct calls ==='); builder.addFunction('main', kSig_i_ii) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 // Grow memory. kExprLocalGet, 1, // get number of new pages kExprCallFunction, kGrowFunction, // call the grow function @@ -174,9 +174,9 @@ print('=== grow_memory in direct calls ==='); builder.addFunction('main', kSig_i_iii) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 // Grow memory. kExprLocalGet, 1, // get number of new pages kExprCallFunction, kGrowFunction, // call the grow function @@ -338,9 +338,9 @@ print('\n=== grow_memory in indirect calls ==='); builder.addFunction('main', kSig_i_iii) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 1, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 // Grow memory. kExprLocalGet, 2, // get number of new pages kExprLocalGet, 0, // get index of the function @@ -393,9 +393,9 @@ print('\n=== grow_memory in indirect calls ==='); 'main', makeSig([kWasmI32, kWasmI32, kWasmI32, kWasmI32], [kWasmI32])) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 1, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 // Grow memory. kExprLocalGet, 2, // get number of new pages kExprLocalGet, 0, // get index of the function diff --git a/test/mjsunit/wasm/grow-memory-in-loop.js b/test/mjsunit/wasm/grow-memory-in-loop.js index 143b555b17..eb99902c14 100644 --- a/test/mjsunit/wasm/grow-memory-in-loop.js +++ b/test/mjsunit/wasm/grow-memory-in-loop.js @@ -30,9 +30,9 @@ function generateBuilder() { builder.addFunction('main', kSig_i_i) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 // Grow memory. kExprI32Const, deltaPages, // - kExprMemoryGrow, kMemoryZero, // grow memory @@ -82,9 +82,9 @@ function generateBuilder() { kExprI32Const, deltaPagesOut, // - kExprMemoryGrow, kMemoryZero, // grow memory kExprDrop, // drop the result of grow - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 // Grow memory. kExprI32Const, deltaPagesIn, // - kExprMemoryGrow, kMemoryZero, // grow memory @@ -131,9 +131,9 @@ function generateBuilder() { builder.addFunction('main', kSig_i_ii) .addBody([ // clang-format off - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 // Grow memory. kExprI32Const, deltaPages, // - kExprMemoryGrow, kMemoryZero, // grow memory @@ -202,9 +202,9 @@ function generateBuilder() { kExprI32Add, // increase value on stack kExprI32StoreMem, 0, 0, // store new value // Start loop. - kExprLoop, kWasmStmt, // while + kExprLoop, kWasmVoid, // while kExprLocalGet, 0, // - - kExprIf, kWasmStmt, // if != 0 + kExprIf, kWasmVoid, // if != 0 // Grow memory. kExprI32Const, deltaPagesIn, // - kExprMemoryGrow, kMemoryZero, // grow memory diff --git a/test/mjsunit/wasm/loop-rotation.js b/test/mjsunit/wasm/loop-rotation.js index 7805f5ccf5..538bdb0bd0 100644 --- a/test/mjsunit/wasm/loop-rotation.js +++ b/test/mjsunit/wasm/loop-rotation.js @@ -11,7 +11,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); var builder = new WasmModuleBuilder(); builder.addFunction("main", kSig_v_i) .addBody([ - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprLocalGet, 0, kExprI32Const, 1, kExprI32Sub, @@ -32,7 +32,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); var builder = new WasmModuleBuilder(); builder.addFunction("main", kSig_v_i) .addBody([ - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprLocalGet, 0, kExprI32Const, 1, kExprI32Sub, @@ -55,7 +55,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); builder.addMemory(1, undefined, false); builder.addFunction("main", kSig_v_i) .addBody([ - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprLocalGet, 0, kExprI32Const, 1, kExprI32Sub, diff --git a/test/mjsunit/wasm/loop-unrolling.js b/test/mjsunit/wasm/loop-unrolling.js index db774f8b2f..43852dec26 100644 --- a/test/mjsunit/wasm/loop-unrolling.js +++ b/test/mjsunit/wasm/loop-unrolling.js @@ -17,10 +17,10 @@ load("test/mjsunit/wasm/exceptions-utils.js"); builder.addFunction("main", kSig_i_i) .addBody([ ...wasmI32Const(1), - kExprLet, kWasmStmt, 1, 1, kWasmI32, - kExprLoop, kWasmStmt, + kExprLet, kWasmVoid, 1, 1, kWasmI32, + kExprLoop, kWasmVoid, ...wasmI32Const(10), - kExprLet, kWasmStmt, 1, 1, kWasmI32, + kExprLet, kWasmVoid, 1, 1, kWasmI32, kExprLocalGet, 0, kExprLocalGet, 1, kExprI32Sub, @@ -47,9 +47,9 @@ load("test/mjsunit/wasm/exceptions-utils.js"); builder.addFunction("main", kSig_i_i) .addBody([ - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprLocalGet, 0, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprLocalGet, 0, kExprReturnCall, callee.index, kExprElse, @@ -86,16 +86,16 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprLocalGet, 0, kExprI32Const, 0, kExprI32Eq, - kExprIf, kWasmStmt, - kExprLoop, kWasmStmt, + kExprIf, kWasmVoid, + kExprLoop, kWasmVoid, kExprRethrow, 2, kExprEnd, kExprEnd, kExprLocalGet, 0, kExprI32Const, 1, kExprI32Eq, - kExprIf, kWasmStmt, - kExprLoop, kWasmStmt, + kExprIf, kWasmVoid, + kExprLoop, kWasmVoid, kExprRethrow, 3, kExprEnd, kExprEnd, @@ -119,11 +119,11 @@ load("test/mjsunit/wasm/exceptions-utils.js"); let except1 = builder.addException(kSig_v_v); builder.addFunction("throw", kSig_i_i) .addBody([ - kExprLoop, kWasmStmt, + kExprLoop, kWasmVoid, kExprLocalGet, 0, kExprI32Const, 10, kExprI32GtS, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except1, kExprElse, kExprLocalGet, 0, @@ -152,7 +152,7 @@ load("test/mjsunit/wasm/exceptions-utils.js"); kExprLocalGet, 0, kExprI32Const, 10, kExprI32GtS, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprThrow, except1, kExprElse, kExprLocalGet, 0, diff --git a/test/mjsunit/wasm/module-memory.js b/test/mjsunit/wasm/module-memory.js index d5a4e7119f..5d5e81c6d3 100644 --- a/test/mjsunit/wasm/module-memory.js +++ b/test/mjsunit/wasm/module-memory.js @@ -17,12 +17,12 @@ function genModule(memory) { .addBody([ // main body: while(i) { if(mem[i]) return -1; i -= 4; } return 0; // TODO(titzer): this manual bytecode has a copy of test-run-wasm.cc - /**/ kExprLoop, kWasmStmt, // -- + /**/ kExprLoop, kWasmVoid, // -- /* */ kExprLocalGet, 0, // -- - /* */ kExprIf, kWasmStmt, // -- + /* */ kExprIf, kWasmVoid, // -- /* */ kExprLocalGet, 0, // -- /* */ kExprI32LoadMem, 0, 0, // -- - /* */ kExprIf, kWasmStmt, // -- + /* */ kExprIf, kWasmVoid, // -- /* */ kExprI32Const, 127, // -- /* */ kExprReturn, // -- /* */ kExprEnd, // -- diff --git a/test/mjsunit/wasm/multiple-code-spaces.js b/test/mjsunit/wasm/multiple-code-spaces.js index 9e786bed23..342b3c682d 100644 --- a/test/mjsunit/wasm/multiple-code-spaces.js +++ b/test/mjsunit/wasm/multiple-code-spaces.js @@ -32,7 +32,7 @@ while (true) { // Each function f with argument {i} then calls f with argument // {i + 1} and returns whatever that function returns. const body_template = [ - kExprLocalGet, 0, kExprI32Eqz, kExprIf, kWasmStmt, // if (i == 0) + kExprLocalGet, 0, kExprI32Eqz, kExprIf, kWasmVoid, // if (i == 0) kExprLocalGet, 0 // get i ]; for (let i = 0; i < 1000; ++i) body_template.push(kExprI32LoadMem, 0, 0); diff --git a/test/mjsunit/wasm/streaming-error-position.js b/test/mjsunit/wasm/streaming-error-position.js index 24ed958687..6984f22ea2 100644 --- a/test/mjsunit/wasm/streaming-error-position.js +++ b/test/mjsunit/wasm/streaming-error-position.js @@ -390,7 +390,7 @@ function testErrorPosition(bytes, pos, message) { 1, // number of types kWasmFunctionTypeForm, // type 1, // number of parameter - kWasmStmt, // invalid type + kWasmVoid, // invalid type 0 // number of returns ]); diff --git a/test/mjsunit/wasm/trap-location.js b/test/mjsunit/wasm/trap-location.js index a34162ab8c..719af7e7b7 100644 --- a/test/mjsunit/wasm/trap-location.js +++ b/test/mjsunit/wasm/trap-location.js @@ -57,7 +57,7 @@ builder.addFunction("main", kSig_i_i) kExprLocalGet, 0, kExprI32Const, 2, kExprI32LtU, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, // offset 9 kExprI32Const, 0x7e /* -2 */, kExprLocalGet, 0, @@ -70,7 +70,7 @@ builder.addFunction("main", kSig_i_i) kExprLocalGet, 0, kExprI32Const, 2, kExprI32Eq, - kExprIf, kWasmStmt, + kExprIf, kWasmVoid, kExprUnreachable, kExprEnd, // offset 30 diff --git a/test/mjsunit/wasm/unreachable-validation.js b/test/mjsunit/wasm/unreachable-validation.js index 70768ff7d4..a9165639ab 100644 --- a/test/mjsunit/wasm/unreachable-validation.js +++ b/test/mjsunit/wasm/unreachable-validation.js @@ -45,13 +45,13 @@ let brt1 = [kExprBrTable, 0, 1]; let brt01 = [kExprBrTable, 1, 0, 1]; let f32 = [kExprF32Const, 0, 0, 0, 0]; let zero = [kExprI32Const, 0]; -let if_else_empty = [kExprIf, kWasmStmt, kExprElse, kExprEnd]; -let if_unr = [kExprIf, kWasmStmt, kExprUnreachable, kExprEnd]; -let if_else_unr = [kExprIf, kWasmStmt, kExprUnreachable, kExprElse, kExprUnreachable, kExprEnd]; -let block_unr = [kExprBlock, kWasmStmt, kExprUnreachable, kExprEnd]; -let loop_unr = [kExprLoop, kWasmStmt, kExprUnreachable, kExprEnd]; -let block_block_unr = [kExprBlock, kWasmStmt, kExprBlock, kWasmStmt, kExprUnreachable, kExprEnd, kExprEnd]; -let block = [kExprBlock, kWasmStmt] +let if_else_empty = [kExprIf, kWasmVoid, kExprElse, kExprEnd]; +let if_unr = [kExprIf, kWasmVoid, kExprUnreachable, kExprEnd]; +let if_else_unr = [kExprIf, kWasmVoid, kExprUnreachable, kExprElse, kExprUnreachable, kExprEnd]; +let block_unr = [kExprBlock, kWasmVoid, kExprUnreachable, kExprEnd]; +let loop_unr = [kExprLoop, kWasmVoid, kExprUnreachable, kExprEnd]; +let block_block_unr = [kExprBlock, kWasmVoid, kExprBlock, kWasmVoid, kExprUnreachable, kExprEnd, kExprEnd]; +let block = [kExprBlock, kWasmVoid] let iblock = [kExprBlock, kWasmI32] let fblock = [kExprBlock, kWasmF32] let end = kExprEnd; diff --git a/test/mjsunit/wasm/wasm-module-builder.js b/test/mjsunit/wasm/wasm-module-builder.js index 5df348fc17..d3ae3a9b4a 100644 --- a/test/mjsunit/wasm/wasm-module-builder.js +++ b/test/mjsunit/wasm/wasm-module-builder.js @@ -98,7 +98,7 @@ let kDeclFunctionLocals = 0x04; let kDeclFunctionExport = 0x08; // Value types and related -let kWasmStmt = 0x40; +let kWasmVoid = 0x40; let kWasmI32 = 0x7f; let kWasmI64 = 0x7e; let kWasmF32 = 0x7d; @@ -1189,7 +1189,7 @@ class WasmModuleBuilder { addTable( type, initial_size, max_size = undefined, init_func_index = undefined) { if (type == kWasmI32 || type == kWasmI64 || type == kWasmF32 || - type == kWasmF64 || type == kWasmS128 || type == kWasmStmt) { + type == kWasmF64 || type == kWasmS128 || type == kWasmVoid) { throw new Error('Tables must be of a reference type'); } let table = new WasmTableBuilder( diff --git a/test/unittests/wasm/function-body-decoder-unittest.cc b/test/unittests/wasm/function-body-decoder-unittest.cc index f193848c5e..f37d2f42e6 100644 --- a/test/unittests/wasm/function-body-decoder-unittest.cc +++ b/test/unittests/wasm/function-body-decoder-unittest.cc @@ -1306,7 +1306,7 @@ TEST_F(FunctionBodyDecoderTest, TypeConversions) { TestUnop(kExprF32ConvertF64, kWasmF32, kWasmF64); } -TEST_F(FunctionBodyDecoderTest, MacrosStmt) { +TEST_F(FunctionBodyDecoderTest, MacrosVoid) { builder.InitializeMemory(); ExpectValidates(sigs.v_i(), {WASM_LOCAL_SET(0, WASM_I32V_3(87348))}); ExpectValidates( @@ -1746,7 +1746,7 @@ TEST_F(FunctionBodyDecoderTest, IndirectReturnCallsWithMismatchedSigs3) { WASM_FEATURE_SCOPE(return_call); const FunctionSig* sig = sigs.i_i(); - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); byte sig0 = builder.AddSignature(sigs.i_f()); @@ -1789,7 +1789,7 @@ TEST_F(FunctionBodyDecoderTest, IndirectReturnCallsWithoutTableCrash) { TEST_F(FunctionBodyDecoderTest, IncompleteIndirectReturnCall) { const FunctionSig* sig = sigs.i_i(); - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); static byte code[] = {kExprReturnCallIndirect}; ExpectFailure(sig, ArrayVector(code), kOmitEnd); @@ -1869,7 +1869,7 @@ TEST_F(FunctionBodyDecoderTest, IndirectCallsOutOfBounds) { TEST_F(FunctionBodyDecoderTest, IndirectCallsWithMismatchedSigs1) { const FunctionSig* sig = sigs.i_i(); - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); byte sig0 = builder.AddSignature(sigs.i_f()); @@ -1931,7 +1931,7 @@ TEST_F(FunctionBodyDecoderTest, IndirectCallsWithoutTableCrash) { TEST_F(FunctionBodyDecoderTest, IncompleteIndirectCall) { const FunctionSig* sig = sigs.i_i(); - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); static byte code[] = {kExprCallIndirect}; ExpectFailure(sig, ArrayVector(code), kOmitEnd); @@ -1940,7 +1940,7 @@ TEST_F(FunctionBodyDecoderTest, IncompleteIndirectCall) { TEST_F(FunctionBodyDecoderTest, IncompleteStore) { const FunctionSig* sig = sigs.i_i(); builder.InitializeMemory(); - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); static byte code[] = {kExprI32StoreMem}; ExpectFailure(sig, ArrayVector(code), kOmitEnd); @@ -1950,7 +1950,7 @@ TEST_F(FunctionBodyDecoderTest, IncompleteI8x16Shuffle) { WASM_FEATURE_SCOPE(simd); const FunctionSig* sig = sigs.i_i(); builder.InitializeMemory(); - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); static byte code[] = {kSimdPrefix, static_cast(kExprI8x16Shuffle & 0xff)}; @@ -3320,7 +3320,7 @@ TEST_F(FunctionBodyDecoderTest, DeclarativeElemDrop) { } TEST_F(FunctionBodyDecoderTest, RefFuncDeclared) { - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); byte function_index = builder.AddFunction(sigs.v_i()); ExpectFailure(sigs.a_v(), {WASM_REF_FUNC(function_index)}); @@ -3329,7 +3329,7 @@ TEST_F(FunctionBodyDecoderTest, RefFuncDeclared) { } TEST_F(FunctionBodyDecoderTest, RefFuncUndeclared) { - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); byte function_index = builder.AddFunction(sigs.v_i(), false); WASM_FEATURE_SCOPE(reftypes); @@ -3350,7 +3350,7 @@ TEST_F(FunctionBodyDecoderTest, ElemSegmentIndexUnsigned) { } TEST_F(FunctionBodyDecoderTest, TableCopy) { - builder.InitializeTable(wasm::kWasmStmt); + builder.InitializeTable(wasm::kWasmVoid); ExpectValidates(sigs.v_v(), {WASM_TABLE_COPY(0, 0, WASM_ZERO, WASM_ZERO, WASM_ZERO)});