Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e1edc77d22119bddcce722abe59e751a0e172260
      
https://github.com/WebKit/WebKit/commit/e1edc77d22119bddcce722abe59e751a0e172260
  Author: Sosuke Suzuki <sos...@bun.sh>
  Date:   2025-08-20 (Wed, 20 Aug 2025)

  Changed paths:
    M Source/JavaScriptCore/runtime/StackFrame.cpp
    M Source/JavaScriptCore/runtime/StackFrame.h

  Log Message:
  -----------
  [JSC] Reduce `StackFrame` size using `Variant`
https://bugs.webkit.org/show_bug.cgi?id=297529

Reviewed by Keith Miller.

StackFrame uses the same structure for both WebAssembly and JavaScript,
with fields for both types existing simultaneously. Since these fields
don't need to exist at the same time, we can reduce memory usage by
using Variant.

Before this patch: 48 bytes
After this patch: 32 bytes

Running `JSTests/stress/recursive-try-catch.js` with default options on
my local machine showed `heapUsed` of 68687762 before the patch vs
33615404 after.

* Source/JavaScriptCore/runtime/StackFrame.cpp:
(JSC::StackFrame::StackFrame):
(JSC::StackFrame::hasBytecodeIndex const):
(JSC::StackFrame::bytecodeIndex const):
(JSC::StackFrame::visitAggregate):
(JSC::StackFrame::isMarked const):
(JSC::StackFrame::sourceID const):
(JSC::StackFrame::sourceURL const):
(JSC::StackFrame::sourceURLStripped const):
(JSC::StackFrame::functionName const):
(JSC::StackFrame::computeLineAndColumn const):
* Source/JavaScriptCore/runtime/StackFrame.h:
(JSC::StackFrame::hasLineAndColumnInfo const):
(JSC::StackFrame::codeBlock const):
(JSC::StackFrame::hasBytecodeIndex const): Deleted.
(JSC::StackFrame::bytecodeIndex): Deleted.
(JSC::StackFrame::visitAggregate): Deleted.
(JSC::StackFrame::isMarked const): Deleted.

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



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

Reply via email to