[webkit-changes] [WebKit/WebKit] aea780: [WASM] Fix the assertion in ExternRefTable and ren...

Yijia Huang noreply at github.com
Wed Sep 11 00:55:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: aea780d518debdbdf8ec34a939ea425a82f2addb
      https://github.com/WebKit/WebKit/commit/aea780d518debdbdf8ec34a939ea425a82f2addb
  Author: Yijia Huang <yijia_huang at apple.com>
  Date:   2024-09-11 (Wed, 11 Sep 2024)

  Changed paths:
    A JSTests/stress/table-with-noexternref-wasm-type.js
    M Source/JavaScriptCore/wasm/WasmTable.cpp
    M Source/JavaScriptCore/wasm/WasmTable.h

  Log Message:
  -----------
  [WASM] Fix the assertion in ExternRefTable and rename it to ExternOrAnyRefTable
https://bugs.webkit.org/show_bug.cgi?id=279390
rdar://135214204

Reviewed by David Degazio.

With the introduction of WasmGC, ExternRefTable should also accept
`nullexternref` type (aka null). This patch fixes that by adding
additional subtype check against to `externref` [2] since it's not a
subtype of `anyref` [1]. As a wasm table can contain any reference types [3],
this patch also rename the ExternRefTable to ExternOrAnyRefTable.

[1] https://webassembly.github.io/gc/core/syntax/types.html#heap-types
[2] https://webassembly.github.io/gc/core/valid/matching.html#heap-types
[3] https://webassembly.github.io/gc/core/valid/types.html#table-types

* JSTests/stress/table-with-noexternref-wasm-type.js: Added.
(catch):
* Source/JavaScriptCore/wasm/WasmTable.cpp:
(JSC::Wasm::Table::visitDerived):
(JSC::Wasm::Table::tryCreate):
(JSC::Wasm::Table::grow):
(JSC::Wasm::Table::visitAggregateImpl):
(JSC::Wasm::ExternOrAnyRefTable::ExternOrAnyRefTable):
(JSC::Wasm::ExternOrAnyRefTable::clear):
(JSC::Wasm::ExternOrAnyRefTable::set):
(JSC::Wasm::ExternRefTable::ExternRefTable): Deleted.
(JSC::Wasm::ExternRefTable::clear): Deleted.
(JSC::Wasm::ExternRefTable::set): Deleted.
* Source/JavaScriptCore/wasm/WasmTable.h:

Canonical link: https://commits.webkit.org/283472@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list