Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 133b2294fb903137aed15461980041ccfec0207c
      
https://github.com/WebKit/WebKit/commit/133b2294fb903137aed15461980041ccfec0207c
  Author: Yusuke Suzuki <[email protected]>
  Date:   2025-06-10 (Tue, 10 Jun 2025)

  Changed paths:
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/Sources.txt
    M Source/JavaScriptCore/bytecode/CodeBlock.cpp
    M Source/JavaScriptCore/dfg/DFGCommonData.h
    M Source/JavaScriptCore/dfg/DFGGraph.cpp
    M Source/JavaScriptCore/dfg/DFGGraph.h
    M Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
    M Source/JavaScriptCore/dfg/DFGOperations.cpp
    M Source/JavaScriptCore/dfg/DFGOperations.h
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
    M Source/JavaScriptCore/ftl/FTLLink.cpp
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
    A Source/JavaScriptCore/runtime/ConcatKeyAtomStringCache.cpp
    A Source/JavaScriptCore/runtime/ConcatKeyAtomStringCache.h
    A Source/JavaScriptCore/runtime/ConcatKeyAtomStringCacheInlines.h
    M Source/JavaScriptCore/runtime/CustomGetterSetter.h
    M Source/JavaScriptCore/runtime/DOMAttributeGetterSetter.h
    M Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp
    M Source/JavaScriptCore/runtime/PropertyTable.h

  Log Message:
  -----------
  [JSC] Add ConcatKeyAtomStringCache
https://bugs.webkit.org/show_bug.cgi?id=294234
rdar://152888459

Reviewed by Yijia Huang.

We can see a pattern like this,

    this["visit" + name](arg)

In the above case, we already detect `"visit" + name` is used for
AtomString so we emit MakeAtomString DFG node. Also we are having
KeyAtomStringCache for these concatenation. However we can do better for
the above pattern: since "visit" is constant, the cache should be just
keyed with `name` side. Then we no longer need to flatten the concatenated
string.
This patch adds ConcatKeyAtomStringCache. This is emitted for each
MakeAtomString site in DFG / FTL, and we manage HashMap for `name` and
resulted atom string.

* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/bytecode/CodeBlock.cpp:
(JSC::CodeBlock::stronglyVisitStrongReferences):
* Source/JavaScriptCore/dfg/DFGCommonData.h:
* Source/JavaScriptCore/dfg/DFGGraph.cpp:
(JSC::DFG::Graph::tryAddConcatKeyAtomStringCache):
* Source/JavaScriptCore/dfg/DFGGraph.h:
* Source/JavaScriptCore/dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::link):
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/dfg/DFGOperations.h:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
* Source/JavaScriptCore/ftl/FTLLink.cpp:
(JSC::FTL::link):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMakeAtomString):
* Source/JavaScriptCore/runtime/ConcatKeyAtomStringCache.cpp: Added.
(JSC::ConcatKeyAtomStringCache::visitAggregateImpl):
* Source/JavaScriptCore/runtime/ConcatKeyAtomStringCache.h: Copied from 
Source/JavaScriptCore/runtime/DOMAttributeGetterSetter.h.
(JSC::ConcatKeyAtomStringCache::ConcatKeyAtomStringCache):
* Source/JavaScriptCore/runtime/ConcatKeyAtomStringCacheInlines.h: Copied from 
Source/JavaScriptCore/runtime/DOMAttributeGetterSetter.h.
(JSC::ConcatKeyAtomStringCache::getOrInsert):
* Source/JavaScriptCore/runtime/CustomGetterSetter.h:
* Source/JavaScriptCore/runtime/DOMAttributeGetterSetter.h:
* Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp:
* Source/JavaScriptCore/runtime/PropertyTable.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to