summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-binary.cpp8
-rw-r--r--src/wasm/wasm-ir-builder.cpp8
-rw-r--r--src/wasm/wasm-s-parser.cpp4
-rw-r--r--src/wasm/wasm-stack.cpp4
-rw-r--r--src/wasm/wasm-validator.cpp4
-rw-r--r--src/wasm/wasm.cpp2
-rw-r--r--src/wasm/wat-parser.cpp12
7 files changed, 21 insertions, 21 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index d43640e26..969c15aaa 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -4055,7 +4055,7 @@ BinaryConsts::ASTNodes WasmBinaryReader::readExpression(Expression*& curr) {
}
case BinaryConsts::GCPrefix: {
auto opcode = getU32LEB();
- if (maybeVisitI31New(curr, opcode)) {
+ if (maybeVisitRefI31(curr, opcode)) {
break;
}
if (maybeVisitI31Get(curr, opcode)) {
@@ -6959,11 +6959,11 @@ void WasmBinaryReader::visitCallRef(CallRef* curr) {
curr->finalize();
}
-bool WasmBinaryReader::maybeVisitI31New(Expression*& out, uint32_t code) {
- if (code != BinaryConsts::I31New) {
+bool WasmBinaryReader::maybeVisitRefI31(Expression*& out, uint32_t code) {
+ if (code != BinaryConsts::RefI31) {
return false;
}
- auto* curr = allocator.alloc<I31New>();
+ auto* curr = allocator.alloc<RefI31>();
curr->value = popNonVoidExpression();
curr->finalize();
out = curr;
diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp
index 7e163fe4e..6445cc3c9 100644
--- a/src/wasm/wasm-ir-builder.cpp
+++ b/src/wasm/wasm-ir-builder.cpp
@@ -661,10 +661,10 @@ Result<> IRBuilder::makeRefEq() {
// Result<> IRBuilder::makeTupleExtract() {}
-Result<> IRBuilder::makeI31New() {
- I31New curr;
- CHECK_ERR(visitI31New(&curr));
- push(builder.makeI31New(curr.value));
+Result<> IRBuilder::makeRefI31() {
+ RefI31 curr;
+ CHECK_ERR(visitRefI31(&curr));
+ push(builder.makeRefI31(curr.value));
return Ok{};
}
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index d4dd99c2c..40bd6288d 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -2838,8 +2838,8 @@ Expression* SExpressionWasmBuilder::makeCallRef(Element& s, bool isReturn) {
target, operands, sigType.getSignature().results, isReturn);
}
-Expression* SExpressionWasmBuilder::makeI31New(Element& s) {
- auto ret = allocator.alloc<I31New>();
+Expression* SExpressionWasmBuilder::makeRefI31(Element& s) {
+ auto ret = allocator.alloc<RefI31>();
ret->value = parseExpression(s[1]);
ret->finalize();
return ret;
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 115013307..1ddf69d41 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -1989,8 +1989,8 @@ void BinaryInstWriter::visitTupleExtract(TupleExtract* curr) {
o << int8_t(BinaryConsts::LocalGet) << U32LEB(scratch);
}
-void BinaryInstWriter::visitI31New(I31New* curr) {
- o << int8_t(BinaryConsts::GCPrefix) << U32LEB(BinaryConsts::I31New);
+void BinaryInstWriter::visitRefI31(RefI31* curr) {
+ o << int8_t(BinaryConsts::GCPrefix) << U32LEB(BinaryConsts::RefI31);
}
void BinaryInstWriter::visitI31Get(I31Get* curr) {
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index d6575f7d4..0d45a4773 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -448,7 +448,7 @@ public:
void visitTupleMake(TupleMake* curr);
void visitTupleExtract(TupleExtract* curr);
void visitCallRef(CallRef* curr);
- void visitI31New(I31New* curr);
+ void visitRefI31(RefI31* curr);
void visitI31Get(I31Get* curr);
void visitRefTest(RefTest* curr);
void visitRefCast(RefCast* curr);
@@ -2502,7 +2502,7 @@ void FunctionValidator::visitCallRef(CallRef* curr) {
}
}
-void FunctionValidator::visitI31New(I31New* curr) {
+void FunctionValidator::visitRefI31(RefI31* curr) {
shouldBeTrue(
getModule()->features.hasGC(), curr, "i31.new requires gc [--enable-gc]");
shouldBeSubType(curr->value->type,
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index d7bc106e4..ca7e265f8 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -903,7 +903,7 @@ void TupleExtract::finalize() {
}
}
-void I31New::finalize() {
+void RefI31::finalize() {
if (value->type == Type::unreachable) {
type = Type::unreachable;
} else {
diff --git a/src/wasm/wat-parser.cpp b/src/wasm/wat-parser.cpp
index bdd1af0d8..6a18b2f87 100644
--- a/src/wasm/wat-parser.cpp
+++ b/src/wasm/wat-parser.cpp
@@ -760,7 +760,7 @@ struct NullInstrParserCtx {
InstrT makeRefEq(Index) { return Ok{}; }
- InstrT makeI31New(Index) { return Ok{}; }
+ InstrT makeRefI31(Index) { return Ok{}; }
InstrT makeI31Get(Index, bool) { return Ok{}; }
template<typename HeapTypeT> InstrT makeStructNew(Index, HeapTypeT) {
@@ -1762,8 +1762,8 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> {
Result<> makeRefEq(Index pos) { return withLoc(pos, irBuilder.makeRefEq()); }
- Result<> makeI31New(Index pos) {
- return withLoc(pos, irBuilder.makeI31New());
+ Result<> makeRefI31(Index pos) {
+ return withLoc(pos, irBuilder.makeRefI31());
}
Result<> makeI31Get(Index pos, bool signed_) {
@@ -1947,7 +1947,7 @@ template<typename Ctx>
Result<typename Ctx::InstrT> makeTupleExtract(Ctx&, Index);
template<typename Ctx>
Result<typename Ctx::InstrT> makeCallRef(Ctx&, Index, bool isReturn);
-template<typename Ctx> Result<typename Ctx::InstrT> makeI31New(Ctx&, Index);
+template<typename Ctx> Result<typename Ctx::InstrT> makeRefI31(Ctx&, Index);
template<typename Ctx>
Result<typename Ctx::InstrT> makeI31Get(Ctx&, Index, bool signed_);
template<typename Ctx> Result<typename Ctx::InstrT> makeRefTest(Ctx&, Index);
@@ -3042,8 +3042,8 @@ Result<typename Ctx::InstrT> makeCallRef(Ctx& ctx, Index pos, bool isReturn) {
}
template<typename Ctx>
-Result<typename Ctx::InstrT> makeI31New(Ctx& ctx, Index pos) {
- return ctx.makeI31New(pos);
+Result<typename Ctx::InstrT> makeRefI31(Ctx& ctx, Index pos) {
+ return ctx.makeRefI31(pos);
}
template<typename Ctx>