Skip to content

Commit

Permalink
Finish up GC tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dy committed Feb 11, 2025
1 parent 38b38c0 commit 056acf3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ print(src, {
* [x] [simd](https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md), [relaxed simd](https://github.com/WebAssembly/relaxed-simd), [fixed-width simd](https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md)
* [x] [tail_call](https://github.com/WebAssembly/tail-call)
* [x] [ref types](https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md), [func refs](https://github.com/WebAssembly/function-references/blob/main/proposals/function-references/Overview.md)
* [ ] [gc](https://github.com/WebAssembly/gc)
* [x] [gc](https://github.com/WebAssembly/gc)
* [ ] [exceptions](https://github.com/WebAssembly/exception-handling)
* [ ] [memory64](https://github.com/WebAssembly/memory64)
* [ ] [annotations](https://github.com/WebAssembly/annotations), [code_metadata](https://github.com/WebAssembly/tool-conventions/blob/main/CodeMetadata.md)
Expand Down
8 changes: 5 additions & 3 deletions src/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,11 @@ const instr = (nodes, ctx) => {
}
// ref.test|cast (ref null? $t|heaptype)
else if (code >= 20 && code <= 23) {
if (nodes[0][1] === 'null') code++ // ref.test|cast (ref null $t) is next op
let heaptype = nodes.shift().pop()
immed.push(HEAPTYPE[heaptype] || id(heaptype, ctx.type))
// FIXME: normalizer is supposed to resolve this
let ht = reftype(nodes.shift(), ctx)
if (ht[0] !== REFTYPE.ref) immed.push(code = immed.pop()+1) // ref.test|cast (ref null $t) is next op
if (ht.length > 1) ht.shift() // pop ref
immed.push(...ht)
}
// br_on_cast[_fail] $l? (ref null? ht1) (ref null? ht2)
// FIXME: normalizer should resolve anyref|etc to (ref null any|etc)
Expand Down
6 changes: 3 additions & 3 deletions test/testsuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,18 @@ t.mute('/test/official/proposals/gc/elem.wast', async function () { await file(t
t.mute('/test/official/proposals/gc/extern.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/func.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/global.wast', async function () { await file(this.name, { spectest }) })
t.todo('/test/official/proposals/gc/i31.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/i31.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/if.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/linking.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/local_get.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/local_init.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/local_tee.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/ref_as_non_null.wast', async function () { await file(this.name, { spectest }) })
t.todo('/test/official/proposals/gc/ref_cast.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/ref_cast.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/ref_eq.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/ref_is_null.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/ref_null.wast', async function () { await file(this.name, { spectest }) })
t.todo('/test/official/proposals/gc/ref_test.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/ref_test.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/ref.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/return_call_indirect.wast', async function () { await file(this.name, { spectest }) })
t.mute('/test/official/proposals/gc/return_call_ref.wast', async function () { await file(this.name, { spectest }) })
Expand Down

0 comments on commit 056acf3

Please sign in to comment.