[webkit-changes] [WebKit/WebKit] 7b5f7e: Create SmallHeap for JSStrings

Justin Michaud noreply at github.com
Fri May 26 09:36:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7b5f7e4443f57e7a4a1c755a49f18b50175696c1
      https://github.com/WebKit/WebKit/commit/7b5f7e4443f57e7a4a1c755a49f18b50175696c1
  Author: Justin Michaud <justin_michaud at apple.com>
  Date:   2023-05-26 (Fri, 26 May 2023)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
    M Source/JavaScriptCore/heap/Heap.cpp
    M Source/JavaScriptCore/heap/Heap.h
    M Source/JavaScriptCore/heap/IsoSubspace.cpp
    M Source/JavaScriptCore/heap/IsoSubspace.h
    M Source/JavaScriptCore/jit/AssemblyHelpers.h
    M Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
    M Source/JavaScriptCore/runtime/ClassInfo.h
    M Source/JavaScriptCore/runtime/JSString.h
    M Source/JavaScriptCore/tools/Integrity.cpp
    M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h
    M Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.h
    M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
    M Source/WTF/wtf/CompactPtr.h
    M Source/WTF/wtf/DebugHeap.h
    M Source/WTF/wtf/FastMalloc.h
    M Source/WTF/wtf/Gigacage.cpp
    M Source/WTF/wtf/Gigacage.h
    M Source/WTF/wtf/PlatformHave.h
    M Source/WTF/wtf/Threading.cpp
    M Source/WTF/wtf/text/StringImpl.cpp
    M Source/WTF/wtf/text/StringImpl.h
    M Source/WTF/wtf/text/UniquedStringImpl.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
    M Source/bmalloc/bmalloc/BPlatform.h
    M Source/bmalloc/bmalloc/Gigacage.cpp
    M Source/bmalloc/bmalloc/Gigacage.h
    M Source/bmalloc/bmalloc/GigacageConfig.h
    M Source/bmalloc/bmalloc/GigacageKind.h
    M Source/bmalloc/bmalloc/HeapKind.h
    M Source/bmalloc/bmalloc/bmalloc.cpp
    M Tools/TestWebKitAPI/Tests/WTF/AlignedRefLogger.h
    M Tools/TestWebKitAPI/Tests/WTF/CompactRefPtr.cpp
    M Tools/TestWebKitAPI/Tests/WTF/JSONValue.cpp
    M Tools/TestWebKitAPI/Tests/WTF/PackedRefPtr.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm

  Log Message:
  -----------
  Create SmallHeap for JSStrings
https://bugs.webkit.org/show_bug.cgi?id=256815
rdar://109377647

Reviewed by Yusuke Suzuki.

Create a space to allocate JSStrings from so that JSString* can fit in
32 bits (with 16-byte alignment).

This space must work even if the gigacage is disabled, or in processes like
Safari and MiniBrowser that should not allocate a full gigacage. For that reason,
we initialize this region separately.

A subsequent patch will make CompactPtr take advantage of this region,
so we lay down the foundation for that here by adding CompactPtrTypeTraits
to CompactPtr-able types.

* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::Heap):
* Source/JavaScriptCore/heap/Heap.h:
(JSC::Heap::gigacageAuxiliarySpace):
* Source/JavaScriptCore/heap/IsoSubspace.cpp:
(JSC::IsoSubspace::IsoSubspace):
* Source/JavaScriptCore/heap/IsoSubspace.h:
* Source/JavaScriptCore/jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::loadCompactPtr):
(JSC::AssemblyHelpers::branchCompactPtr):
* Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h:
* Source/JavaScriptCore/runtime/ClassInfo.h:
* Source/JavaScriptCore/runtime/JSString.h:
(JSC::JSString::destroy): Deleted.
(JSC::JSString::subspaceFor): Deleted.
(JSC::JSString::uninitializedValueInternal const): Deleted.
(JSC::JSString::valueInternal const): Deleted.
(JSC::JSString::JSString): Deleted.
(JSC::JSString::finishCreation): Deleted.
(JSC::JSString::create): Deleted.
(JSC::JSString::createHasOtherOwner): Deleted.
(JSC::JSString::toBoolean const): Deleted.
(JSC::JSString::canGetIndex): Deleted.
(JSC::JSString::offsetOfValue): Deleted.
(JSC::JSString::isRope const): Deleted.
(JSC::JSString::fiberConcurrently const): Deleted.
* Source/JavaScriptCore/tools/Integrity.cpp:
(JSC::Integrity::Analyzer::analyzeCell):
* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::emitLoadRTTFromFuncref):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emitLoadRTTFromFuncref):
* Source/JavaScriptCore/wasm/WasmTypeDefinition.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
* Source/WTF/wtf/CompactPtr.h:
(WTF::BigHeapTypeTraits::encode):
(WTF::BigHeapTypeTraits::decode):
(WTF::CompactPtr::encode):
(WTF::CompactPtr::decode):
(WTF::CompactPtr::operator!=):
(WTF::CompactPtr::storage const):
* Source/WTF/wtf/DebugHeap.h:
* Source/WTF/wtf/FastMalloc.h:
(WTF::SmallHeapMalloc::malloc):
(WTF::SmallHeapMalloc::tryMalloc):
(WTF::SmallHeapMalloc::tryRealloc):
(WTF::SmallHeapMalloc::free):
* Source/WTF/wtf/Gigacage.cpp:
(Gigacage::tryMallocSmallHeap):
* Source/WTF/wtf/Gigacage.h:
(Gigacage::name):
* Source/WTF/wtf/Threading.cpp:
(WTF::initialize):
* Source/WTF/wtf/text/StringImpl.cpp:
* Source/WTF/wtf/text/StringImpl.h:
* Source/WTF/wtf/text/UniquedStringImpl.h:
* Source/bmalloc/bmalloc/Gigacage.cpp:
(Gigacage::bmalloc::runwaySize):
(Gigacage::ensureSmallHeap):
(Gigacage::ensureGigacage):
* Source/bmalloc/bmalloc/Gigacage.h:
(Gigacage::name):
(Gigacage::maxSize):
(Gigacage::forEachKind):
(Gigacage::SmallHeapAllocatorInfo::baseAddress):
* Source/bmalloc/bmalloc/GigacageConfig.h:
* Source/bmalloc/bmalloc/GigacageKind.h:
* Source/bmalloc/bmalloc/HeapKind.h:
(bmalloc::isGigacage):
(bmalloc::gigacageKind):
(bmalloc::heapKind):
(bmalloc::isActiveHeapKindAfterEnsuringGigacage):
(bmalloc::mapToActiveHeapKindAfterEnsuringGigacage):
* Source/bmalloc/bmalloc/bmalloc.cpp:
(bmalloc::api::mallocOutOfLine):
* Tools/TestWebKitAPI/Tests/WTF/AlignedRefLogger.h:
* Tools/TestWebKitAPI/Tests/WTF/CompactRefPtr.cpp:

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




More information about the webkit-changes mailing list