Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 04de71ca40b4832b65e5c6861c399d91735c309c
      
https://github.com/WebKit/WebKit/commit/04de71ca40b4832b65e5c6861c399d91735c309c
  Author: Tim Chevalier <t...@igalia.com>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M JSTests/wasm/gc/arrays.js
    A JSTests/wasm/gc/packed-arrays.js
    M JSTests/wasm/wasm.json
    M Source/JavaScriptCore/bytecode/BytecodeList.rb
    M Source/JavaScriptCore/llint/WebAssembly.asm
    M Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmFormat.h
    M Source/JavaScriptCore/wasm/WasmFunctionParser.h
    M Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmOperations.cpp
    M Source/JavaScriptCore/wasm/WasmSectionParser.cpp
    M Source/JavaScriptCore/wasm/WasmSectionParser.h
    M Source/JavaScriptCore/wasm/WasmSlowPaths.cpp
    M Source/JavaScriptCore/wasm/WasmSlowPaths.h
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.cpp
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.h
    M Source/JavaScriptCore/wasm/generateWasm.py
    M Source/JavaScriptCore/wasm/generateWasmOpsHeader.py
    M Source/JavaScriptCore/wasm/js/JSWebAssemblyArray.cpp
    M Source/JavaScriptCore/wasm/js/JSWebAssemblyArray.h
    M Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.cpp
    M Source/JavaScriptCore/wasm/wasm.json

  Log Message:
  -----------
  [Wasm-GC] Implement packed types in arrays
https://bugs.webkit.org/show_bug.cgi?id=247576

Reviewed by Justin Michaud.

This patch implements support for packed types (i8, i16) in Wasm GC
arrays. Packed types are represented with new entries in wasm.json and
are only allowed for use in StorageTypes, which are a new kind of type
used for struct and array type definition fields.

Packed structs are not yet allowed with this patch.

* JSTests/wasm/gc/arrays.js:
(testArrayDeclaration):
* JSTests/wasm/gc/packed-arrays.js: Added.
(module):
(check):
(testArrayGetPacked):
(testArrayGetUWithNewCanonPacked):
(testArrayGetSWithNewCanonPacked):
(testTypeMismatch64):
(testTypeMismatchArrayGet):
(testPackedTypeOutOfContext):
(testSetGetTruncate):
(testArraySet):
(testArrayGetUnreachable):
* JSTests/wasm/wasm.json:
* Source/JavaScriptCore/bytecode/BytecodeList.rb:
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::addArrayNewDefault):
(JSC::Wasm::AirIRGenerator::addArrayGet):
(JSC::Wasm::AirIRGenerator::addStructGet):
(JSC::Wasm::AirIRGenerator::addStructSet):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emitStructSet):
(JSC::Wasm::B3IRGenerator::pushArrayNew):
(JSC::Wasm::B3IRGenerator::addArrayNew):
(JSC::Wasm::B3IRGenerator::addArrayNewDefault):
(JSC::Wasm::B3IRGenerator::addArrayGet):
(JSC::Wasm::B3IRGenerator::addStructGet):
* Source/JavaScriptCore/wasm/WasmFormat.h:
(JSC::Wasm::isRefType):
(JSC::Wasm::isRefWithRecursiveReference):
(JSC::Wasm::isSubtype):
(JSC::Wasm::isDefaultableType):
* Source/JavaScriptCore/wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
(JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):
* Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp:
(JSC::Wasm::LLIntGenerator::addArrayGet):
* Source/JavaScriptCore/wasm/WasmOperations.cpp:
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parsePackedType):
(JSC::Wasm::SectionParser::parseStorageType):
(JSC::Wasm::SectionParser::parseStructType):
(JSC::Wasm::SectionParser::parseArrayType):
* Source/JavaScriptCore/wasm/WasmSectionParser.h:
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::WASM_SLOW_PATH_DECL):
(JSC::LLInt::ArrayGetOperation):
* Source/JavaScriptCore/wasm/WasmSlowPaths.h:
* Source/JavaScriptCore/wasm/WasmTypeDefinition.cpp:
(JSC::Wasm::StructType::dump const):
(JSC::Wasm::StructType::StructType):
(JSC::Wasm::ArrayType::dump const):
(JSC::Wasm::StorageType::dump const):
(JSC::Wasm::computeStructTypeHash):
(JSC::Wasm::computeArrayTypeHash):
(JSC::Wasm::TypeDefinition::replacePlaceholders const):
* Source/JavaScriptCore/wasm/WasmTypeDefinition.h:
(JSC::Wasm::StorageType::is const):
(JSC::Wasm::StorageType::as const):
(JSC::Wasm::StorageType::StorageType):
(JSC::Wasm::StorageType::unpacked const):
(JSC::Wasm::StorageType::elementSize const):
(JSC::Wasm::StorageType::operator== const):
(JSC::Wasm::StorageType::operator!= const):
(JSC::Wasm::StorageType::typeCode const):
(JSC::Wasm::StorageType::index const):
(JSC::Wasm::makeString):
(JSC::Wasm::typeSizeInBytes):
* Source/JavaScriptCore/wasm/generateWasm.py:
(Wasm.__init__):
* Source/JavaScriptCore/wasm/generateWasmOpsHeader.py:
(cppMacro):
(cppMacroPacked):
(packedTypeMacroizer):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyArray.cpp:
(JSC::JSWebAssemblyArray::JSWebAssemblyArray):
(JSC::JSWebAssemblyArray::~JSWebAssemblyArray):
(JSC::JSWebAssemblyArray::visitChildrenImpl):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyArray.h:
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.cpp:
(JSC::JSWebAssemblyStruct::get const):
(JSC::JSWebAssemblyStruct::set):
* Source/JavaScriptCore/wasm/wasm.json:

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to