diff options
author | Thomas Lively <tlively@google.com> | 2023-01-09 16:23:57 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 14:23:57 -0800 |
commit | 67abc2a1b9adcdf080387a29e0c92b6f5a31057a (patch) | |
tree | d8e8304e9ecdd700b56b949bb5132b26e09362f4 /scripts | |
parent | e3d9b82d9f8910063373e2952582de545659d448 (diff) | |
download | binaryen-67abc2a1b9adcdf080387a29e0c92b6f5a31057a.tar.gz binaryen-67abc2a1b9adcdf080387a29e0c92b6f5a31057a.tar.bz2 binaryen-67abc2a1b9adcdf080387a29e0c92b6f5a31057a.zip |
Replace `RefIs` with `RefIsNull` (#5401)
* Replace `RefIs` with `RefIsNull`
The other `ref.is*` instructions are deprecated and expressible in terms of
`ref.test`. Update binary and text parsing to parse those instructions as
`RefTest` expressions. Also update the printing and emitting of `RefTest`
expressions to emit the legacy instructions for now to minimize test changes and
make this a mostly non-functional change. Since `ref.is_null` is the only
`RefIs` instruction left, remove the `RefIsOp` field and rename the expression
class to `RefIsNull`.
The few test changes are due to the fact that `ref.is*` instructions are now
subject to `ref.test` validation, and in particular it is no longer valid to
perform a `ref.is_func` on a value outside of the `func` type hierarchy.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gen-s-parser.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py index 46b62711a..232429fe0 100755 --- a/scripts/gen-s-parser.py +++ b/scripts/gen-s-parser.py @@ -539,7 +539,7 @@ instructions = [ # reference types instructions ("ref.null", "makeRefNull(s)"), - ("ref.is_null", "makeRefIs(s, RefIsNull)"), + ("ref.is_null", "makeRefIsNull(s)"), ("ref.func", "makeRefFunc(s)"), ("ref.eq", "makeRefEq(s)"), # table instructions @@ -602,9 +602,9 @@ instructions = [ ("array.set", "makeArraySet(s)"), ("array.len", "makeArrayLen(s)"), ("array.copy", "makeArrayCopy(s)"), - ("ref.is_func", "makeRefIs(s, RefIsFunc)"), - ("ref.is_data", "makeRefIs(s, RefIsData)"), - ("ref.is_i31", "makeRefIs(s, RefIsI31)"), + ("ref.is_func", "makeRefTest(s, Type(HeapType::func, NonNullable))"), + ("ref.is_data", "makeRefTest(s, Type(HeapType::data, NonNullable))"), + ("ref.is_i31", "makeRefTest(s, Type(HeapType::i31, NonNullable))"), ("ref.as_non_null", "makeRefAs(s, RefAsNonNull)"), ("ref.as_func", "makeRefAs(s, RefAsFunc)"), ("ref.as_data", "makeRefAs(s, RefAsData)"), |