⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287012 in webkit


Ignore:
Timestamp:
Dec 13, 2021, 11:07:39 PM (5 years ago)
Author:
sbarati@apple.com
Message:

WasmB3IRGenerator should estimate static execution counts
https://bugs.webkit.org/show_bug.cgi?id=234284

Reviewed by Filip Pizlo.

This enables the register allocator to make better decisions.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • b3/B3BasicBlock.h:

(JSC::B3::BasicBlock::setFrequency):

  • b3/B3EstimateStaticExecutionCounts.cpp: Added.

(JSC::B3::estimateStaticExecutionCounts):

  • b3/B3EstimateStaticExecutionCounts.h: Added.
  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::parseAndCompile):

Location:
trunk/Source/JavaScriptCore
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r287009 r287012  
     12021-12-13  Saam Barati  <sbarati@apple.com>
     2
     3        WasmB3IRGenerator should estimate static execution counts
     4        https://bugs.webkit.org/show_bug.cgi?id=234284
     5
     6        Reviewed by Filip Pizlo.
     7
     8        This enables the register allocator to make better decisions.
     9
     10        * JavaScriptCore.xcodeproj/project.pbxproj:
     11        * Sources.txt:
     12        * b3/B3BasicBlock.h:
     13        (JSC::B3::BasicBlock::setFrequency):
     14        * b3/B3EstimateStaticExecutionCounts.cpp: Added.
     15        (JSC::B3::estimateStaticExecutionCounts):
     16        * b3/B3EstimateStaticExecutionCounts.h: Added.
     17        * wasm/WasmB3IRGenerator.cpp:
     18        (JSC::Wasm::parseAndCompile):
     19
    1202021-12-13  Brady Eidson  <beidson@apple.com>
    221
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r286994 r287012  
    907907                52CD0F682242F71C004A18A5 /* testdfg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52CD0F672242F71C004A18A5 /* testdfg.cpp */; };
    908908                52DD000826E039B90054E408 /* BaselineJITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 52DD000626E039B30054E408 /* BaselineJITCode.h */; settings = {ATTRIBUTES = (Private, ); }; };
     909                52E65A1C27682760002B4C0A /* B3EstimateStaticExecutionCounts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52E65A1A27682760002B4C0A /* B3EstimateStaticExecutionCounts.cpp */; };
     910                52E65A1E27682771002B4C0A /* B3EstimateStaticExecutionCounts.h in Headers */ = {isa = PBXBuildFile; fileRef = 52E65A1B27682760002B4C0A /* B3EstimateStaticExecutionCounts.h */; };
    909911                52EED7942492B870008F4C93 /* FunctionAllowlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 52EED7932492B868008F4C93 /* FunctionAllowlist.h */; };
    910912                52F6C35E1E71EB080081F4CC /* WebAssemblyWrapperFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F6C35C1E71EB080081F4CC /* WebAssemblyWrapperFunction.h */; };
     
    37183720                52DD000626E039B30054E408 /* BaselineJITCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaselineJITCode.h; sourceTree = "<group>"; };
    37193721                52DD000726E039B40054E408 /* BaselineJITCode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BaselineJITCode.cpp; sourceTree = "<group>"; };
     3722                52E65A1A27682760002B4C0A /* B3EstimateStaticExecutionCounts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3EstimateStaticExecutionCounts.cpp; path = b3/B3EstimateStaticExecutionCounts.cpp; sourceTree = "<group>"; };
     3723                52E65A1B27682760002B4C0A /* B3EstimateStaticExecutionCounts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3EstimateStaticExecutionCounts.h; path = b3/B3EstimateStaticExecutionCounts.h; sourceTree = "<group>"; };
    37203724                52EED7922492B868008F4C93 /* FunctionAllowlist.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionAllowlist.cpp; sourceTree = "<group>"; };
    37213725                52EED7932492B868008F4C93 /* FunctionAllowlist.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FunctionAllowlist.h; sourceTree = "<group>"; };
     
    59795983                                0F5BF16E1F23A5A10029D91D /* B3EnsureLoopPreHeaders.cpp */,
    59805984                                0F5BF16F1F23A5A10029D91D /* B3EnsureLoopPreHeaders.h */,
     5985                                52E65A1A27682760002B4C0A /* B3EstimateStaticExecutionCounts.cpp */,
     5986                                52E65A1B27682760002B4C0A /* B3EstimateStaticExecutionCounts.h */,
    59815987                                5318045D22EAAF0F004A7342 /* B3ExtractValue.cpp */,
    59825988                                5318045B22EAAC4B004A7342 /* B3ExtractValue.h */,
     
    99139919                                E322E5A31DA64439006E7709 /* DFGSnippetParams.h in Headers */,
    99149920                                86EC9DD31328DF82002B2AD7 /* DFGSpeculativeJIT.h in Headers */,
     9921                                52E65A1E27682771002B4C0A /* B3EstimateStaticExecutionCounts.h in Headers */,
    99159922                                0F682FB319BCB36400FA3BAD /* DFGSSACalculator.h in Headers */,
    99169923                                A7D89D0017A0B8CC00773AD8 /* DFGSSAConversionPhase.h in Headers */,
     
    1178411791                                5C3A77B922F2480B003827FF /* testb3_3.cpp in Sources */,
    1178511792                                5C3A77B822F24809003827FF /* testb3_4.cpp in Sources */,
     11793                                52E65A1C27682760002B4C0A /* B3EstimateStaticExecutionCounts.cpp in Sources */,
    1178611794                                5C3A77B722F24806003827FF /* testb3_5.cpp in Sources */,
    1178711795                                5C3A77B622F24803003827FF /* testb3_6.cpp in Sources */,
  • trunk/Source/JavaScriptCore/Sources.txt

    r286994 r287012  
    134134b3/B3EliminateDeadCode.cpp
    135135b3/B3EnsureLoopPreHeaders.cpp
     136b3/B3EstimateStaticExecutionCounts.cpp
    136137b3/B3ExtractValue.cpp
    137138b3/B3FenceValue.cpp
  • trunk/Source/JavaScriptCore/b3/B3BasicBlock.h

    r264152 r287012  
    145145    void updatePredecessorsAfter();
    146146
     147    void setFrequency(double frequency) { m_frequency = frequency; }
    147148    double frequency() const { return m_frequency; }
    148149
  • trunk/Source/JavaScriptCore/b3/B3Procedure.h

    r286802 r287012  
    190190
    191191    Dominators& dominators();
    192     NaturalLoops& naturalLoops();
     192    JS_EXPORT_PRIVATE NaturalLoops& naturalLoops();
    193193    BackwardsCFG& backwardsCFG();
    194194    BackwardsDominators& backwardsDominators();
  • trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp

    r286930 r287012  
    3434#include "B3CCallValue.h"
    3535#include "B3ConstPtrValue.h"
     36#include "B3EstimateStaticExecutionCounts.h"
    3637#include "B3FixSSA.h"
    3738#include "B3Generate.h"
     
    32953296        validate(procedure, "After parsing:\n");
    32963297
     3298    estimateStaticExecutionCounts(procedure);
     3299
    32973300    dataLogIf(WasmB3IRGeneratorInternal::verbose, "Pre SSA: ", procedure);
    32983301    fixSSA(procedure);
Note: See TracChangeset for help on using the changeset viewer.