Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 93ebfacfd7a74429f97737a55af0814124b8ace7
      
https://github.com/WebKit/WebKit/commit/93ebfacfd7a74429f97737a55af0814124b8ace7
  Author: Vassili Bykov <[email protected]>
  Date:   2026-09-27 (Sun, 27 Sep 2026)

  Changed paths:
    A JSTests/stress/sampling-profiler-samples-processed-during-gc.js
    M Source/JavaScriptCore/parser/SourceProvider.cpp
    M Source/JavaScriptCore/parser/SourceProvider.h
    M Source/JavaScriptCore/runtime/SamplingProfiler.cpp
    M Source/WebCore/bindings/js/CachedScriptSourceProvider.h
    M Source/WebCore/bindings/js/ScriptBufferSourceProvider.h
    M Source/WebCore/loader/cache/CachedScript.cpp
    M Source/WebCore/loader/cache/CachedScript.h

  Log Message:
  -----------
  [JSC] Make line and column lookups safe off the main thread
https://bugs.webkit.org/show_bug.cgi?id=324838
rdar://188395337

Reviewed by Yusuke Suzuki.

The recent PR https://github.com/WebKit/WebKit/pull/74359 revised source 
location tracking to
only save source offsets, and to compute line and column information upon 
request. To do so, it
revisits the source to scan it for line breaks. In the general case, 
SourceProvider::source()
can only be called on the main thread because CachedScriptSourceProvider 
requires that. This is
a problem because lines and columns information may be requested off the main 
thread.

This patch adds a new API function SourceProvider::withSourceConcurrently(), 
similar to the
existing codeBlockHashConcurrently(). It provides access to the source from any 
thread, under
the appropriate lock if needed. SourceProvider::documentLineColumnForOffset() 
uses this API
while building the line table, and can now be called from any thread.

New test: JSTests/stress/sampling-profiler-samples-processed-during-gc.js

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



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

Reply via email to