summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/ConstHoisting.cpp1
-rw-r--r--src/passes/Flatten.cpp10
-rw-r--r--src/passes/FuncCastEmulation.cpp2
-rw-r--r--src/passes/InstrumentLocals.cpp16
-rw-r--r--src/passes/Precompute.cpp2
-rw-r--r--src/passes/Print.cpp5
6 files changed, 10 insertions, 26 deletions
diff --git a/src/passes/ConstHoisting.cpp b/src/passes/ConstHoisting.cpp
index 3cef0773c..e3583d3bb 100644
--- a/src/passes/ConstHoisting.cpp
+++ b/src/passes/ConstHoisting.cpp
@@ -96,7 +96,6 @@ private:
case Type::v128:
case Type::funcref:
case Type::externref:
- case Type::nullref:
case Type::exnref: {
return false;
}
diff --git a/src/passes/Flatten.cpp b/src/passes/Flatten.cpp
index 54da8a86e..c7b4acbd9 100644
--- a/src/passes/Flatten.cpp
+++ b/src/passes/Flatten.cpp
@@ -211,19 +211,19 @@ struct Flatten
// the return type of the block this branch is targetting, which may
// not be the same with the innermost block's return type. For
// example,
- // (block $any (result externref)
- // (block (result nullref)
+ // (block $any (result anyref)
+ // (block (result funcref)
// (local.tee $0
// (br_if $any
- // (ref.null)
+ // (ref.null func)
// (i32.const 0)
// )
// )
// )
// )
// In this case we need two locals to store (ref.null); one with
- // externref type that's for the target block ($label0) and one more
- // with nullref type in case for flowing out. Here we create the
+ // funcref type that's for the target block ($label0) and one more
+ // with anyref type in case for flowing out. Here we create the
// second 'flowing out' local in case two block's types are
// different.
if (type != blockType) {
diff --git a/src/passes/FuncCastEmulation.cpp b/src/passes/FuncCastEmulation.cpp
index 13fb89988..160895f23 100644
--- a/src/passes/FuncCastEmulation.cpp
+++ b/src/passes/FuncCastEmulation.cpp
@@ -67,7 +67,6 @@ static Expression* toABI(Expression* value, Module* module) {
}
case Type::funcref:
case Type::externref:
- case Type::nullref:
case Type::exnref: {
WASM_UNREACHABLE("reference types cannot be converted to i64");
}
@@ -111,7 +110,6 @@ static Expression* fromABI(Expression* value, Type type, Module* module) {
}
case Type::funcref:
case Type::externref:
- case Type::nullref:
case Type::exnref: {
WASM_UNREACHABLE("reference types cannot be converted from i64");
}
diff --git a/src/passes/InstrumentLocals.cpp b/src/passes/InstrumentLocals.cpp
index f95d169e9..ee288c103 100644
--- a/src/passes/InstrumentLocals.cpp
+++ b/src/passes/InstrumentLocals.cpp
@@ -58,7 +58,6 @@ Name get_f32("get_f32");
Name get_f64("get_f64");
Name get_funcref("get_funcref");
Name get_externref("get_externref");
-Name get_nullref("get_nullref");
Name get_exnref("get_exnref");
Name get_v128("get_v128");
@@ -68,7 +67,6 @@ Name set_f32("set_f32");
Name set_f64("set_f64");
Name set_funcref("set_funcref");
Name set_externref("set_externref");
-Name set_nullref("set_nullref");
Name set_exnref("set_exnref");
Name set_v128("set_v128");
@@ -98,9 +96,6 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
case Type::externref:
import = get_externref;
break;
- case Type::nullref:
- import = get_nullref;
- break;
case Type::exnref:
import = get_exnref;
break;
@@ -147,9 +142,6 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
case Type::externref:
import = set_externref;
break;
- case Type::nullref:
- import = set_nullref;
- break;
case Type::exnref:
import = set_exnref;
break;
@@ -192,14 +184,6 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
set_externref,
{Type::i32, Type::i32, Type::externref},
Type::externref);
- addImport(curr,
- get_nullref,
- {Type::i32, Type::i32, Type::nullref},
- Type::nullref);
- addImport(curr,
- set_nullref,
- {Type::i32, Type::i32, Type::nullref},
- Type::nullref);
}
if (curr->features.hasExceptionHandling()) {
addImport(
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index 695b62ab2..0b67a25aa 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -134,7 +134,7 @@ struct Precompute
curr->finalize();
return;
}
- } else if (singleValue.type == Type::nullref &&
+ } else if (singleValue.isNull() &&
curr->value->template is<RefNull>()) {
return;
} else if (singleValue.type == Type::funcref) {
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index f35f0d626..04fcdc0b3 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -1440,7 +1440,10 @@ struct PrintExpressionContents
break;
}
}
- void visitRefNull(RefNull* curr) { printMedium(o, "ref.null"); }
+ void visitRefNull(RefNull* curr) {
+ printMedium(o, "ref.null ");
+ o << curr->type.getHeapType();
+ }
void visitRefIsNull(RefIsNull* curr) { printMedium(o, "ref.is_null"); }
void visitRefFunc(RefFunc* curr) {
printMedium(o, "ref.func ");