[webkit-changes] [WebKit/WebKit] 312a44: [Wasm-GC] Add support for anyref

Asumu Takikawa noreply at github.com
Wed Mar 15 13:44:20 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 312a4496c00892aaa39421e2e42486c2a40ed1af
      https://github.com/WebKit/WebKit/commit/312a4496c00892aaa39421e2e42486c2a40ed1af
  Author: Asumu Takikawa <asumu at igalia.com>
  Date:   2023-03-15 (Wed, 15 Mar 2023)

  Changed paths:
    A JSTests/wasm/gc/any.js
    M JSTests/wasm/gc/casts.js
    M JSTests/wasm/wasm.json
    M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h
    M Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
    M Source/JavaScriptCore/wasm/WasmCallingConvention.h
    M Source/JavaScriptCore/wasm/WasmFormat.h
    M Source/JavaScriptCore/wasm/WasmFunctionParser.h
    M Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmOperationsInlines.h
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.h
    M Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.cpp
    M Source/JavaScriptCore/wasm/js/WasmToJS.cpp
    M Source/JavaScriptCore/wasm/wasm.json

  Log Message:
  -----------
  [Wasm-GC] Add support for anyref
https://bugs.webkit.org/show_bug.cgi?id=247403

Reviewed by Justin Michaud.

Adds the anyref type that is the top type of the internal reference
hierarchy.

Also adds nullref, which is the bottom type of the reference hierarchy
and has no inhabitants except null. There is also a bottom type for
externrefs and funcrefs with different type codes, which should be added
in a separate patch.

Anyref becomes more useful once the `extern.internalize` and
`extern.externalize` instructions are added, which enable hostrefs that
inhabit anyref but are not eqref.

* JSTests/wasm/gc/any.js: Added.
(testValidation):
(testNullref):
* JSTests/wasm/gc/casts.js:
* JSTests/wasm/wasm.json:
* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::emitRefTestOrCast):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emitRefTestOrCast):
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::sizeOfType):
(JSC::Wasm::BBQJIT::addConstant):
(JSC::Wasm::BBQJIT::getGlobal):
(JSC::Wasm::BBQJIT::setGlobal):
(JSC::Wasm::BBQJIT::addTopLevel):
(JSC::Wasm::BBQJIT::toB3Type):
(JSC::Wasm::BBQJIT::emitCatchImpl):
(JSC::Wasm::BBQJIT::emitCCall):
(JSC::Wasm::BBQJIT::emitStoreConst):
(JSC::Wasm::BBQJIT::emitMoveConst):
(JSC::Wasm::BBQJIT::emitStore):
(JSC::Wasm::BBQJIT::emitMoveMemory):
(JSC::Wasm::BBQJIT::emitMoveRegister):
(JSC::Wasm::BBQJIT::emitLoad):
* Source/JavaScriptCore/wasm/WasmCallingConvention.h:
(JSC::Wasm::WasmCallingConvention::numberOfStackResults const):
(JSC::Wasm::WasmCallingConvention::numberOfStackArguments const):
* Source/JavaScriptCore/wasm/WasmFormat.h:
(JSC::Wasm::isAnyref):
(JSC::Wasm::isNullref):
(JSC::Wasm::isInternalref):
(JSC::Wasm::anyrefType):
(JSC::Wasm::isSubtype):
(JSC::Wasm::isValidHeapTypeKind):
* Source/JavaScriptCore/wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp:
(JSC::Wasm::LLIntGenerator::callInformationForCaller):
(JSC::Wasm::LLIntGenerator::callInformationForCallee):
(JSC::Wasm::LLIntGenerator::addArguments):
* Source/JavaScriptCore/wasm/WasmOperationsInlines.h:
(JSC::Wasm::refCast):
* Source/JavaScriptCore/wasm/WasmTypeDefinition.h:
(JSC::Wasm::typeKindSizeInBytes):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.cpp:
(JSC::JSWebAssemblyStruct::set):
* Source/JavaScriptCore/wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* Source/JavaScriptCore/wasm/wasm.json:

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




More information about the webkit-changes mailing list