Commit 45cc19bb authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm][cleanup] Remove IsSubtypeNoImmediates

This function wasm created as a partial subtyping check after the
subtyping refactoring for wasm-gc, but is really not needed.

Change-Id: I5f3a38dba599f1571e26d29254eb0f8614c16a8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2241519Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68321}
parent f08cbfdc
......@@ -108,15 +108,6 @@ class ValueType {
return bit_field_ != other.bit_field_;
}
// TODO(7748): Extend this with struct and function subtyping.
// Keep up to date with funcref vs. externref subtyping.
constexpr bool IsSubtypeOfNoImmediates(ValueType other) const {
#if V8_HAS_CXX14_CONSTEXPR
DCHECK(!has_immediate() && !other.has_immediate());
#endif
return (*this == other) || (other.kind() == kEqRef &&
(kind() == kExnRef || kind() == kExternRef));
}
constexpr bool IsReferenceType() const {
return kExternRef <= kind() && kind() <= kEqRef;
......
......@@ -1720,8 +1720,8 @@ TEST_F(FunctionBodyDecoderTest, MultiReturnType) {
ExpectValidates(&sig_cd_v, {WASM_CALL_FUNCTION0(0)});
if (kValueTypes[c].IsSubtypeOfNoImmediates(kValueTypes[a]) &&
kValueTypes[d].IsSubtypeOfNoImmediates(kValueTypes[b])) {
if (IsSubtypeOf(kValueTypes[c], kValueTypes[a], module) &&
IsSubtypeOf(kValueTypes[d], kValueTypes[b], module)) {
ExpectValidates(&sig_ab_v, {WASM_CALL_FUNCTION0(0)});
} else {
ExpectFailure(&sig_ab_v, {WASM_CALL_FUNCTION0(0)});
......@@ -1937,7 +1937,7 @@ TEST_F(FunctionBodyDecoderTest, AllGetGlobalCombinations) {
TestModuleBuilder builder;
module = builder.module();
builder.AddGlobal(global_type);
Validate(global_type.IsSubtypeOfNoImmediates(local_type), &sig,
Validate(IsSubtypeOf(global_type, local_type, module), &sig,
{WASM_GET_GLOBAL(0)});
}
}
......@@ -1952,7 +1952,7 @@ TEST_F(FunctionBodyDecoderTest, AllSetGlobalCombinations) {
TestModuleBuilder builder;
module = builder.module();
builder.AddGlobal(global_type);
Validate(local_type.IsSubtypeOfNoImmediates(global_type), &sig,
Validate(IsSubtypeOf(local_type, global_type, module), &sig,
{WASM_SET_GLOBAL(0, WASM_GET_LOCAL(0))});
}
}
......@@ -2306,8 +2306,7 @@ TEST_F(FunctionBodyDecoderTest, Break_TypeCheckAll1) {
sig.GetReturn(), WASM_IF(WASM_ZERO, WASM_BRV(0, WASM_GET_LOCAL(0))),
WASM_GET_LOCAL(1))};
Validate(kValueTypes[j].IsSubtypeOfNoImmediates(kValueTypes[i]), &sig,
code);
Validate(IsSubtypeOf(kValueTypes[j], kValueTypes[i], module), &sig, code);
}
}
}
......@@ -2322,8 +2321,7 @@ TEST_F(FunctionBodyDecoderTest, Break_TypeCheckAll2) {
WASM_BRV_IF_ZERO(0, WASM_GET_LOCAL(0)),
WASM_GET_LOCAL(1))};
Validate(kValueTypes[j].IsSubtypeOfNoImmediates(kValueTypes[i]), &sig,
code);
Validate(IsSubtypeOf(kValueTypes[j], kValueTypes[i], module), &sig, code);
}
}
}
......@@ -2338,8 +2336,7 @@ TEST_F(FunctionBodyDecoderTest, Break_TypeCheckAll3) {
WASM_GET_LOCAL(1),
WASM_BRV_IF_ZERO(0, WASM_GET_LOCAL(0)))};
Validate(kValueTypes[j].IsSubtypeOfNoImmediates(kValueTypes[i]), &sig,
code);
Validate(IsSubtypeOf(kValueTypes[j], kValueTypes[i], module), &sig, code);
}
}
}
......@@ -2385,8 +2382,7 @@ TEST_F(FunctionBodyDecoderTest, BreakIf_val_type) {
types[1], WASM_BRV_IF(0, WASM_GET_LOCAL(1), WASM_GET_LOCAL(2)),
WASM_DROP, WASM_GET_LOCAL(0))};
Validate(kValueTypes[j].IsSubtypeOfNoImmediates(kValueTypes[i]), &sig,
code);
Validate(IsSubtypeOf(kValueTypes[j], kValueTypes[i], module), &sig, code);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment