summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-05-15 12:07:34 -0700
committerGitHub <noreply@github.com>2024-05-15 12:07:34 -0700
commit6b43a5ef76149c92e216fddb0a1ee17f736b4b6e (patch)
tree7b2deb1e6924ba8f74e0b25c26cf2d9a63ad610a /src/wasm.h
parentef4b57c2a491a2193435dccdc9305f6a79965715 (diff)
downloadbinaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.tar.gz
binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.tar.bz2
binaryen-6b43a5ef76149c92e216fddb0a1ee17f736b4b6e.zip
[Strings] Remove operations not included in imported strings (#6589)
The stringref proposal has been superseded by the imported JS strings proposal, but the former has many more operations than the latter. To reduce complexity, remove all operations that are part of stringref but not part of imported strings.
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h44
1 files changed, 6 insertions, 38 deletions
diff --git a/src/wasm.h b/src/wasm.h
index e39d3d527..ebb5a04f6 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -573,36 +573,18 @@ enum BrOnOp {
};
enum StringNewOp {
- // Linear memory
- StringNewUTF8,
- StringNewWTF8,
- StringNewLossyUTF8,
- StringNewWTF16,
- // GC
- StringNewUTF8Array,
- StringNewWTF8Array,
StringNewLossyUTF8Array,
StringNewWTF16Array,
- // Other
StringNewFromCodePoint,
};
enum StringMeasureOp {
StringMeasureUTF8,
- StringMeasureWTF8,
StringMeasureWTF16,
- StringMeasureIsUSV,
- StringMeasureHash,
};
enum StringEncodeOp {
- StringEncodeUTF8,
- StringEncodeLossyUTF8,
- StringEncodeWTF8,
- StringEncodeWTF16,
- StringEncodeUTF8Array,
StringEncodeLossyUTF8Array,
- StringEncodeWTF8Array,
StringEncodeWTF16Array,
};
@@ -1799,21 +1781,14 @@ public:
StringNewOp op;
- // In linear memory variations this is the pointer in linear memory. In the
- // GC variations this is an Array. In from_codepoint this is the code point.
- Expression* ptr;
-
- // Used only in linear memory variations.
- Expression* length = nullptr;
+ // In the GC variations this is an Array. In from_codepoint this is the code
+ // point.
+ Expression* ref;
// Used only in GC variations.
Expression* start = nullptr;
Expression* end = nullptr;
- // The "try" variants will return null if an encoding error happens, rather
- // than trap.
- bool try_ = false;
-
void finalize();
};
@@ -1848,16 +1823,9 @@ public:
StringEncode(MixedArena& allocator) {}
StringEncodeOp op;
-
- Expression* ref;
-
- // In linear memory variations this is the pointer in linear memory. In the
- // GC variations this is an Array.
- Expression* ptr;
-
- // Used only in GC variations, where it is the index in |ptr| to start
- // encoding from.
- Expression* start = nullptr;
+ Expression* str;
+ Expression* array;
+ Expression* start;
void finalize();
};