summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/fuzzing/fuzzing.cpp34
-rw-r--r--src/tools/fuzzing/heap-types.cpp13
-rw-r--r--src/tools/wasm-ctor-eval.cpp8
3 files changed, 3 insertions, 52 deletions
diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp
index 3378d0745..d6f8e0f12 100644
--- a/src/tools/fuzzing/fuzzing.cpp
+++ b/src/tools/fuzzing/fuzzing.cpp
@@ -29,13 +29,6 @@ namespace wasm {
namespace {
-bool canBeNullable(HeapType type) {
- // V8 does not accept nullable string views.
- return type != HeapType::stringview_wtf8 &&
- type != HeapType::stringview_wtf16 &&
- type != HeapType::stringview_iter;
-}
-
} // anonymous namespace
TranslateToFuzzReader::TranslateToFuzzReader(Module& wasm,
@@ -2654,16 +2647,6 @@ Expression* TranslateToFuzzReader::makeBasicRef(Type type) {
}
WASM_UNREACHABLE("bad switch");
}
- case HeapType::stringview_wtf16:
- // We fully support wtf16 strings.
- return builder.makeStringAs(StringAsWTF16,
- makeTrappingRefUse(HeapType::string));
- case HeapType::stringview_wtf8:
- case HeapType::stringview_iter:
- // We do not have interpreter support for wtf8 and iter, so emit something
- // that does not return, with a block that casts to the type the parent
- // expects.
- return builder.makeBlock({_makeunreachable()}, type);
case HeapType::none:
case HeapType::noext:
case HeapType::nofunc:
@@ -2719,9 +2702,6 @@ Expression* TranslateToFuzzReader::makeCompoundRef(Type type) {
if (funcContext && !funcContext->typeLocals[type].empty()) {
return makeLocalGet(type);
}
- if (!canBeNullable(heapType)) {
- return makeConst(type);
- }
return builder.makeRefAs(RefAsNonNull, builder.makeRefNull(heapType));
}
@@ -2834,11 +2814,10 @@ Expression* TranslateToFuzzReader::makeStringConcat() {
}
Expression* TranslateToFuzzReader::makeStringSlice() {
- // StringViews cannot be non-nullable.
- auto* ref = make(Type(HeapType::stringview_wtf16, NonNullable));
+ auto* ref = makeTrappingRefUse(HeapType::string);
auto* start = make(Type::i32);
auto* end = make(Type::i32);
- return builder.makeStringSliceWTF(StringSliceWTF16, ref, start, end);
+ return builder.makeStringSliceWTF(ref, start, end);
}
Expression* TranslateToFuzzReader::makeStringEq(Type type) {
@@ -2866,8 +2845,7 @@ Expression* TranslateToFuzzReader::makeStringMeasure(Type type) {
Expression* TranslateToFuzzReader::makeStringGet(Type type) {
assert(type == Type::i32);
- // StringViews cannot be non-nullable.
- auto* ref = make(Type(HeapType::stringview_wtf16, NonNullable));
+ auto* ref = makeTrappingRefUse(HeapType::string);
auto* pos = make(Type::i32);
return builder.makeStringWTF16Get(ref, pos);
}
@@ -4277,12 +4255,6 @@ HeapType TranslateToFuzzReader::getSubType(HeapType type) {
return HeapType::exn;
case HeapType::string:
return HeapType::string;
- case HeapType::stringview_wtf8:
- return HeapType::stringview_wtf8;
- case HeapType::stringview_wtf16:
- return HeapType::stringview_wtf16;
- case HeapType::stringview_iter:
- return HeapType::stringview_iter;
case HeapType::none:
case HeapType::noext:
case HeapType::nofunc:
diff --git a/src/tools/fuzzing/heap-types.cpp b/src/tools/fuzzing/heap-types.cpp
index 3d0d29153..08b4c4453 100644
--- a/src/tools/fuzzing/heap-types.cpp
+++ b/src/tools/fuzzing/heap-types.cpp
@@ -395,9 +395,6 @@ struct HeapTypeGeneratorImpl {
case HeapType::ext:
case HeapType::exn:
case HeapType::string:
- case HeapType::stringview_wtf8:
- case HeapType::stringview_wtf16:
- case HeapType::stringview_iter:
case HeapType::none:
case HeapType::noext:
case HeapType::nofunc:
@@ -460,17 +457,7 @@ struct HeapTypeGeneratorImpl {
case HeapType::string:
candidates.push_back(HeapType::any);
break;
- case HeapType::stringview_wtf8:
- case HeapType::stringview_wtf16:
- case HeapType::stringview_iter:
- break;
case HeapType::none:
- if (features.hasStrings() && rand.oneIn(10)) {
- candidates.push_back(HeapType::stringview_wtf8);
- candidates.push_back(HeapType::stringview_wtf16);
- candidates.push_back(HeapType::stringview_iter);
- break;
- }
return pickSubAny();
case HeapType::nofunc:
return pickSubFunc();
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp
index d3f798084..c025764e7 100644
--- a/src/tools/wasm-ctor-eval.cpp
+++ b/src/tools/wasm-ctor-eval.cpp
@@ -93,14 +93,6 @@ public:
// serialize them.)
throw FailToEvalException("table.set: TODO");
}
-
- Flow visitStringAs(StringAs* curr) {
- // TODO: It is not clear how we can handle string.as, since it can lead to
- // us needing string_views in globals, but string.as is not a constant
- // instruction, so we cannot generate such globals atm. Perhaps we
- // could generate them in the start function?
- throw FailToEvalException("string.as: TODO");
- }
};
// Build an artificial `env` module based on a module's imports, so that the