[webkit-changes] [WebKit/WebKit] 5f50c2: [JSC] Further optimize wasm init time

Yusuke Suzuki noreply at github.com
Wed Feb 5 11:01:00 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5f50c2e0c206b7f0fe8ca5040af207298a09c399
      https://github.com/WebKit/WebKit/commit/5f50c2e0c206b7f0fe8ca5040af207298a09c399
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2025-02-05 (Wed, 05 Feb 2025)

  Changed paths:
    M Source/JavaScriptCore/wasm/WasmCallingConvention.h
    M Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h
    M Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.cpp
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.h

  Log Message:
  -----------
  [JSC] Further optimize wasm init time
https://bugs.webkit.org/show_bug.cgi?id=287076
rdar://144217504

Reviewed by Keith Miller.

This patch further optimizes wasm init time.

1. addCall's signature is already expanded, so we do not need to do it
   again.
2. CallInformation should hold numberOfStackValues for wasm.
3. IPIntGenerator MetadataBuffer increase policy should be 2x.
4. We introduce CallCommonData bytecode cache.
5. Use shrink(0) instead of clear() for control flow stack in IPIntGenerator.
6. Do style fix.

                                  ToT                     Patched

    hashset-wasm-load      376.2614+-1.0030     ^    318.7618+-0.6149        ^ definitely 1.1804x faster

* Source/JavaScriptCore/wasm/WasmCallingConvention.h:
(JSC::Wasm::CallInformation::CallInformation):
(JSC::Wasm::WasmCallingConvention::callInformationFor const):
(JSC::Wasm::JSCallingConvention::callInformationFor const):
(JSC::Wasm::CCallingConventionArmThumb2::callInformationFor const):
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h:
* Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp:
(JSC::Wasm::IPIntGenerator::cachedCallInformationFor):
(JSC::Wasm::IPIntGenerator::addCallCommonData):
(JSC::Wasm::IPIntGenerator::addTailCallCommonData):
(JSC::Wasm::IPIntGenerator::addCall):
(JSC::Wasm::IPIntGenerator::addCallIndirect):
(JSC::Wasm::IPIntGenerator::addCallRef):
* Source/JavaScriptCore/wasm/WasmTypeDefinition.cpp:
(JSC::Wasm::FunctionSignature::FunctionSignature):
(JSC::Wasm::StructType::StructType):
(JSC::Wasm::TypeDefinition::tryCreateFunctionSignature):
(JSC::Wasm::TypeDefinition::tryCreateStructType):
(JSC::Wasm::TypeDefinition::tryCreateArrayType):
(JSC::Wasm::TypeDefinition::tryCreateRecursionGroup):
(JSC::Wasm::TypeDefinition::tryCreateProjection):
(JSC::Wasm::TypeDefinition::tryCreateSubtype):
* Source/JavaScriptCore/wasm/WasmTypeDefinition.h:
(JSC::Wasm::ArrayType::ArrayType):
(JSC::Wasm::RecursionGroup::RecursionGroup):
(JSC::Wasm::Projection::Projection):
(JSC::Wasm::Subtype::Subtype):
(JSC::Wasm::TypeDefinition::TypeDefinition):

Canonical link: https://commits.webkit.org/289881@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