From 3ca8c21b89c207ce5d872e9cb2d410a869522d38 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 13 Sep 2023 10:13:33 -0500 Subject: Replace I31New with RefI31 everywhere (#5930) Globally replace the source string "I31New" with "RefI31" in preparation for renaming the instruction from "i31.new" to "ref.i31", as implemented in the spec in https://github.com/WebAssembly/gc/pull/422. This would be NFC, except that it also changes the string in the external-facing C APIs. A follow-up PR will make the corresponding behavioral change. --- src/wasm-builder.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/wasm-builder.h') diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 2093b9419..b9db66983 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -856,8 +856,8 @@ public: ret->finalize(); return ret; } - I31New* makeI31New(Expression* value) { - auto* ret = wasm.allocator.alloc(); + RefI31* makeRefI31(Expression* value) { + auto* ret = wasm.allocator.alloc(); ret->value = value; ret->finalize(); return ret; @@ -1209,7 +1209,7 @@ public: return makeRefFunc(value.getFunc(), type.getHeapType()); } if (type.isRef() && type.getHeapType() == HeapType::i31) { - return makeI31New(makeConst(value.geti31())); + return makeRefI31(makeConst(value.geti31())); } if (type.isString()) { // TODO: more than ascii support @@ -1359,7 +1359,7 @@ public: return ExpressionManipulator::refNull(curr, curr->type); } if (curr->type.isRef() && curr->type.getHeapType() == HeapType::i31) { - Expression* ret = makeI31New(makeConst(0)); + Expression* ret = makeRefI31(makeConst(0)); if (curr->type.isNullable()) { // To keep the type identical, wrap it in a block that adds nullability. ret = makeBlock({ret}, curr->type); -- cgit v1.2.3