Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 83540481435f16b21495a8463bc3c0bf79c670a1
      
https://github.com/WebKit/WebKit/commit/83540481435f16b21495a8463bc3c0bf79c670a1
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-07-28 (Tue, 28 Jul 2026)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
    M Source/JavaScriptCore/dfg/DFGBasicBlock.h
    M Source/JavaScriptCore/dfg/DFGCFAPhase.cpp
    M Source/JavaScriptCore/dfg/DFGGraph.cpp
    M Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

  Log Message:
  -----------
  [JSC] Allocate DFG `BasicBlock::intersectionOfPastValuesAtHead` only for OSR 
entry targets
https://bugs.webkit.org/show_bug.cgi?id=320177

Reviewed by Yusuke Suzuki.

Every DFG BasicBlock allocates intersectionOfPastValuesAtHead, an
Operands<AbstractValue> costing 32 bytes per operand, but its only
consumer is JITCompiler::noticeOSREntry, which reads it to build the
OSR entry's expected values. Only the entry block and non-inlined loop
headers are OSR entry targets, so for the vast majority of blocks the
array is written on every CFA run and never read.

Allocate it lazily in CFAPhase instead, only for OSR target blocks that
CFA has reached. noticeOSREntry now reads the field directly and asserts
it is populated and sized like variablesAtHead.

Peak RSS on Apple Silicon: a synthetic function with 1200 branches and
128 locals goes from 236.4MB to 219.4MB (-7.2%), and 8 iterations of
Octane/typescript go from 578.6MB to 564.2MB (-2.5%).

* Source/JavaScriptCore/dfg/DFGBasicBlock.cpp:
(JSC::DFG::BasicBlock::BasicBlock):
(JSC::DFG::BasicBlock::ensureLocals):
(JSC::DFG::BasicBlock::ensureTmps):
(JSC::DFG::BasicBlock::ensureIntersectionOfPastValuesAtHead):
* Source/JavaScriptCore/dfg/DFGBasicBlock.h:
* Source/JavaScriptCore/dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::run):
* Source/JavaScriptCore/dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* Source/JavaScriptCore/dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::noticeOSREntry):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to