Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1b46b208061c4dbf3f8514b88d68d53bf124eb90
      
https://github.com/WebKit/WebKit/commit/1b46b208061c4dbf3f8514b88d68d53bf124eb90
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-09-04 (Fri, 04 Sep 2026)

  Changed paths:
    M Source/JavaScriptCore/wasm/WasmConstExprGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmConstExprGenerator.h
    M Source/JavaScriptCore/wasm/WasmModuleInformation.h
    M Source/JavaScriptCore/wasm/WasmOperationsInlines.h
    M Source/JavaScriptCore/wasm/WasmSectionParser.cpp
    M Source/JavaScriptCore/wasm/WasmTable.cpp
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.h
    M Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.cpp

  Log Message:
  -----------
  [JSC] Optimize Wasm globals initialization related code
https://bugs.webkit.org/show_bug.cgi?id=323465
rdar://186697890

Reviewed by Yijia Huang.

This patch optimizes Wasm globals initialization related code,

1. constant expression validator should collect maxStackHeight. So we
   can use this when evaluating constant expression.
2. Wasm array / struct are initialized with zeros. So we should set a
   new value only when it is not zero (jsNull() for example).

* Source/JavaScriptCore/wasm/WasmConstExprGenerator.cpp:
(JSC::Wasm::ConstExprInterpreter::run):
(JSC::Wasm::ConstExprInterpreter::createNewArray):
(JSC::Wasm::ConstExprInterpreter::createNewStruct):
(JSC::Wasm::ConstExprGenerator::maxStackHeight const):
(JSC::Wasm::ConstExprGenerator::didParseOpcode):
(JSC::Wasm::parseExtendedConstExpr):
(JSC::Wasm::evaluateExtendedConstExpr):
* Source/JavaScriptCore/wasm/WasmConstExprGenerator.h:
* Source/JavaScriptCore/wasm/WasmModuleInformation.h:
* Source/JavaScriptCore/wasm/WasmOperationsInlines.h:
(JSC::Wasm::structNew):
* Source/JavaScriptCore/wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseInitExpr):
* Source/JavaScriptCore/wasm/WasmTable.cpp:
(JSC::Wasm::FuncRefTable::FuncRefTable):
* Source/JavaScriptCore/wasm/WasmTypeDefinition.h:
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.cpp:
(JSC::JSWebAssemblyStruct::get const):
(JSC::JSWebAssemblyStruct::set):

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



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

Reply via email to