diff options
Diffstat (limited to 'src/wasm')
-rw-r--r-- | src/wasm/literal.cpp | 22 | ||||
-rw-r--r-- | src/wasm/wasm-binary.cpp | 4 | ||||
-rw-r--r-- | src/wasm/wasm-s-parser.cpp | 4 | ||||
-rw-r--r-- | src/wasm/wasm-stack.cpp | 6 | ||||
-rw-r--r-- | src/wasm/wasm-type.cpp | 18 | ||||
-rw-r--r-- | src/wasm/wasm-validator.cpp | 4 |
6 files changed, 29 insertions, 29 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp index 5aebf30a3..29d047723 100644 --- a/src/wasm/literal.cpp +++ b/src/wasm/literal.cpp @@ -59,7 +59,7 @@ Literal& Literal::operator=(const Literal& other) { case Type::none: case Type::nullref: break; - case Type::anyref: + case Type::externref: case Type::unreachable: WASM_UNREACHABLE("unexpected type"); } @@ -191,7 +191,7 @@ void Literal::getBits(uint8_t (&buf)[16]) const { case Type::funcref: case Type::nullref: break; - case Type::anyref: + case Type::externref: case Type::exnref: case Type::none: case Type::unreachable: @@ -346,7 +346,7 @@ std::ostream& operator<<(std::ostream& o, Literal literal) { case Type::exnref: o << "exnref(" << literal.getExceptionPackage() << ")"; break; - case Type::anyref: + case Type::externref: case Type::unreachable: WASM_UNREACHABLE("invalid type"); } @@ -569,7 +569,7 @@ Literal Literal::eqz() const { return eq(Literal(double(0))); case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -591,7 +591,7 @@ Literal Literal::neg() const { return Literal(int64_t(i64 ^ 0x8000000000000000ULL)).castToF64(); case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -613,7 +613,7 @@ Literal Literal::abs() const { return Literal(int64_t(i64 & 0x7fffffffffffffffULL)).castToF64(); case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -718,7 +718,7 @@ Literal Literal::add(const Literal& other) const { return Literal(getf64() + other.getf64()); case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -740,7 +740,7 @@ Literal Literal::sub(const Literal& other) const { return Literal(getf64() - other.getf64()); case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -833,7 +833,7 @@ Literal Literal::mul(const Literal& other) const { return Literal(getf64() * other.getf64()); case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -1071,7 +1071,7 @@ Literal Literal::eq(const Literal& other) const { return Literal(getf64() == other.getf64()); case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -1093,7 +1093,7 @@ Literal Literal::ne(const Literal& other) const { return Literal(getf64() != other.getf64()); case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index a766e9b63..8a7f0d744 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -1132,8 +1132,8 @@ Type WasmBinaryBuilder::getType() { return Type::v128; case BinaryConsts::EncodedType::funcref: return Type::funcref; - case BinaryConsts::EncodedType::anyref: - return Type::anyref; + case BinaryConsts::EncodedType::externref: + return Type::externref; case BinaryConsts::EncodedType::nullref: return Type::nullref; case BinaryConsts::EncodedType::exnref: diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 7ca8dd131..429cac273 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -866,8 +866,8 @@ Type SExpressionWasmBuilder::stringToType(const char* str, if (strncmp(str, "funcref", 7) == 0 && (prefix || str[7] == 0)) { return Type::funcref; } - if (strncmp(str, "anyref", 6) == 0 && (prefix || str[6] == 0)) { - return Type::anyref; + if (strncmp(str, "externref", 9) == 0 && (prefix || str[9] == 0)) { + return Type::externref; } if (strncmp(str, "nullref", 7) == 0 && (prefix || str[7] == 0)) { return Type::nullref; diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp index 9ebf39fb8..c6c450cfb 100644 --- a/src/wasm/wasm-stack.cpp +++ b/src/wasm/wasm-stack.cpp @@ -188,7 +188,7 @@ void BinaryInstWriter::visitLoad(Load* curr) { // a load return; case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -290,7 +290,7 @@ void BinaryInstWriter::visitStore(Store* curr) { << U32LEB(BinaryConsts::V128Store); break; case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -687,7 +687,7 @@ void BinaryInstWriter::visitConst(Const* curr) { break; } case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index 8467e2176..b49f0338f 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -64,7 +64,7 @@ std::array<std::vector<Type>, Type::_last_value_type + 1> basicTypes = { {Type::f64}, {Type::v128}, {Type::funcref}, - {Type::anyref}, + {Type::externref}, {Type::nullref}, {Type::exnref}}}; @@ -81,7 +81,7 @@ std::unordered_map<std::vector<Type>, uintptr_t> indices = { {{Type::f64}, Type::f64}, {{Type::v128}, Type::v128}, {{Type::funcref}, Type::funcref}, - {{Type::anyref}, Type::anyref}, + {{Type::externref}, Type::externref}, {{Type::nullref}, Type::nullref}, {{Type::exnref}, Type::exnref}, }; @@ -156,7 +156,7 @@ unsigned Type::getByteSize() const { case Type::v128: return 16; case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -191,7 +191,7 @@ Type Type::reinterpret() const { return i64; case Type::v128: case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -207,7 +207,7 @@ FeatureSet Type::getFeatures() const { case Type::v128: return FeatureSet::SIMD; case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: return FeatureSet::ReferenceTypes; case Type::exnref: @@ -249,7 +249,7 @@ bool Type::isSubType(Type left, Type right) { return true; } if (left.isRef() && right.isRef() && - (right == Type::anyref || left == Type::nullref)) { + (right == Type::externref || left == Type::nullref)) { return true; } if (left.isMulti() && right.isMulti()) { @@ -303,7 +303,7 @@ Type Type::getLeastUpperBound(Type a, Type b) { if (b == Type::nullref) { return a; } - return Type::anyref; + return Type::externref; } namespace { @@ -379,8 +379,8 @@ std::ostream& operator<<(std::ostream& os, Type type) { case Type::funcref: os << "funcref"; break; - case Type::anyref: - os << "anyref"; + case Type::externref: + os << "externref"; break; case Type::nullref: os << "nullref"; diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 97e45d471..2c2aac1c8 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1260,7 +1260,7 @@ void FunctionValidator::validateMemBytes(uint8_t bytes, case Type::unreachable: break; case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: @@ -2068,7 +2068,7 @@ void FunctionValidator::validateAlignment( case Type::unreachable: break; case Type::funcref: - case Type::anyref: + case Type::externref: case Type::nullref: case Type::exnref: case Type::none: |