[webkit-changes] [WebKit/WebKit] 3a4d06: [JSC] Not use Strong<> in VM and simplify jsString

Yusuke Suzuki noreply at github.com
Mon May 15 21:03:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3a4d06abddc5454fa6a5e44567ed2033836a1a0f
      https://github.com/WebKit/WebKit/commit/3a4d06abddc5454fa6a5e44567ed2033836a1a0f
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-05-15 (Mon, 15 May 2023)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGSafeToExecute.h
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
    M Source/JavaScriptCore/heap/Heap.cpp
    M Source/JavaScriptCore/jit/AssemblyHelpers.cpp
    M Source/JavaScriptCore/runtime/JSCConfig.h
    M Source/JavaScriptCore/runtime/JSCell.h
    M Source/JavaScriptCore/runtime/JSCellInlines.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.h
    M Source/JavaScriptCore/runtime/JSObject.h
    M Source/JavaScriptCore/runtime/JSObjectInlines.h
    M Source/JavaScriptCore/runtime/JSString.cpp
    M Source/JavaScriptCore/runtime/JSString.h
    M Source/JavaScriptCore/runtime/JSTypeInfo.h
    M Source/JavaScriptCore/runtime/StructureID.h
    M Source/JavaScriptCore/runtime/TypeInfoBlob.h
    M Source/JavaScriptCore/runtime/VM.cpp
    M Source/JavaScriptCore/runtime/VM.h

  Log Message:
  -----------
  [JSC] Not use Strong<> in VM and simplify jsString
https://bugs.webkit.org/show_bug.cgi?id=256808
rdar://109373540

Reviewed by Mark Lam.

Let's avoid using Strong<> in VM since Strong<> is very costly generic abstraction.
Every access to this will cause one-level indirect load. Since we know these Strong<>
in VM are strong roots, we should just mark them explicitly and not using Strong<>
abstraction. This will wipe indirect load in some of critical functions, including
JSC::jsString.

                                                         ToT                     Patched

    vanilla-es2015-babel-webpack-todomvc-json-parse
                                                   58.6031+-0.1165     ^     57.9270+-0.0610        ^ definitely 1.0117x faster
    vanilla-es2015-todomvc-json-parse              58.6226+-0.1470     ^     57.9199+-0.0991        ^ definitely 1.0121x faster
    vanilla-todomvc-json-parse                     43.5747+-0.0433     ^     43.0709+-0.0276        ^ definitely 1.0117x faster

* Source/JavaScriptCore/dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::addCoreConstraints):
* Source/JavaScriptCore/jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitNonNullDecodeZeroExtendedStructureID):
* Source/JavaScriptCore/runtime/JSCConfig.h:
(JSC::startOfStructureHeap):
* Source/JavaScriptCore/runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):
* Source/JavaScriptCore/runtime/StructureID.h:
(JSC::StructureID::decode const):
(JSC::StructureID::tryDecode const):
(JSC::StructureID::encode):
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::getBoundFunction):
(JSC::VM::sentinelSetBucketSlow):
(JSC::VM::sentinelMapBucketSlow):
(JSC::VM::emptyPropertyNameEnumeratorSlow):
(JSC::VM::visitAggregateImpl):
* Source/JavaScriptCore/runtime/VM.h:

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




More information about the webkit-changes mailing list