Fix dead ALWAYS_INLINE path for Blink thread-local getter [chromium/src : main]

0 views
Skip to first unread message

Zhou, Shuangshuang (Gerrit)

unread,
Jul 24, 2026, 3:42:51 AMJul 24
to Philip Rogers, Mason Freed, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Mason Freed and Philip Rogers

Zhou, Shuangshuang added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Zhou, Shuangshuang . resolved

Hi Philip&Mason, PTAL!

This came out of some VTune profiling on our Intel/Windows platforms: `blink::ThreadStateStorage::Current` shows up as an out-of-line NOINLINE call even in official builds. Tracing it back, `#if defined(BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY)` is always true (the macro is always #defined, to 0 or 1), so the ALWAYS_INLINE getter that was meant for non-component builds has been dead code.

The CL switches the guard to check the macro's value, and conservatively enables the inlined getter only on Windows official builds (initial-exec — a call-free TLS load). Other platform builds keep today's out-of-line getter.

I ran 3 spd3 tests for win11-perf and 3 spd3 tests for win11-perf-pgo. Looks like there is no regression and slight performance improvement. Feel free to correct me if my understanding is wrong.

Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Mason Freed
  • Philip Rogers
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
Gerrit-Change-Number: 8141866
Gerrit-PatchSet: 2
Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Fri, 24 Jul 2026 07:42:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Mason Freed (Gerrit)

unread,
Jul 24, 2026, 1:39:22 PMJul 24
to Zhou, Shuangshuang, Anton Bikineev, Philip Rogers, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Anton Bikineev, Philip Rogers and Zhou, Shuangshuang

Mason Freed added 1 comment

Patchset-level comments
Mason Freed . resolved

I think bikineev@ would be a better reviewer, since he [wrote the original code](https://crrev.com/c/2896895).

Open in Gerrit

Related details

Attention is currently required from:
  • Anton Bikineev
  • Philip Rogers
  • Zhou, Shuangshuang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
Gerrit-Change-Number: 8141866
Gerrit-PatchSet: 2
Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Zhou, Shuangshuang <shuangsh...@intel.com>
Gerrit-Attention: Philip Rogers <p...@chromium.org>
Gerrit-Attention: Anton Bikineev <biki...@chromium.org>
Gerrit-Comment-Date: Fri, 24 Jul 2026 17:39:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Anton Bikineev (Gerrit)

unread,
Jul 27, 2026, 7:20:35 AMJul 27
to Zhou, Shuangshuang, Mason Freed, Philip Rogers, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Philip Rogers and Zhou, Shuangshuang

Anton Bikineev added 1 comment

Commit Message
Line 13, Patchset 2 (Latest): #if defined(BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY)
Anton Bikineev . unresolved

This is a nice catch. The main question is why lifting it only on Win? Currently we have two runtime calls on Darwin - one the NOINLINE call to the getter and the other one `__tls_get_addr`.

Open in Gerrit

Related details

Attention is currently required from:
  • Philip Rogers
  • Zhou, Shuangshuang
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
    Gerrit-Change-Number: 8141866
    Gerrit-PatchSet: 2
    Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
    Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
    Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
    Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: Zhou, Shuangshuang <shuangsh...@intel.com>
    Gerrit-Attention: Philip Rogers <p...@chromium.org>
    Gerrit-Comment-Date: Mon, 27 Jul 2026 11:20:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    chromeperf@appspot.gserviceaccount.com (Gerrit)

    unread,
    Jul 27, 2026, 7:46:17 AMJul 27
    to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
    Attention needed from Philip Rogers and Zhou, Shuangshuang

    Message from chrom...@appspot.gserviceaccount.com

    📍 Job mac-m1_mini_2020-perf/speedometer3 complete.

    See results at: https://pinpoint-dot-chromeperf.appspot.com/job/1641d603290000

    Gerrit-Comment-Date: Mon, 27 Jul 2026 11:46:00 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    chromeperf@appspot.gserviceaccount.com (Gerrit)

    unread,
    Jul 27, 2026, 8:20:07 AMJul 27
    to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
    Attention needed from Philip Rogers and Zhou, Shuangshuang

    Message from chrom...@appspot.gserviceaccount.com

    📍 Job mac-m1_mini_2020-perf/speedometer3 complete.

    See results at: https://pinpoint-dot-chromeperf.appspot.com/job/15586a66290000

    Gerrit-Comment-Date: Mon, 27 Jul 2026 12:19:58 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Zhou, Shuangshuang (Gerrit)

    unread,
    Jul 27, 2026, 9:42:04 PM (13 days ago) Jul 27
    to Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
    Attention needed from Anton Bikineev and Philip Rogers

    Zhou, Shuangshuang added 1 comment

    Commit Message
    Line 13, Patchset 2 (Latest): #if defined(BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY)
    Anton Bikineev . unresolved

    This is a nice catch. The main question is why lifting it only on Win? Currently we have two runtime calls on Darwin - one the NOINLINE call to the getter and the other one `__tls_get_addr`.

    Zhou, Shuangshuang

    Thanks Anton — nice one, and yeah, on Darwin it's two calls today.

    You're right that inlining would still knock out the outer getter call there (2 → 1). The reason I kept it to Windows is really about what's left after inlining:

    • On Windows (initial-exec) the getter is wrapping a call-free TLS load, so inlining gets us all the way to zero calls — just a cheap TEB-relative load left. VTune on our RVP shows the out-of-line `ThreadStateStorage::Current` symbol simply vanishing, so it's a real drop in overhead.
    • On Darwin the getter is wrapping that second TLS-resolution call. Inlining drops the outer one (2 → 1), but then the whole sequence (that call + its setup) gets copied into every one of Current()'s many call sites, and I was a little wary the code-size growth could outweigh the single saved call and regress. Android's in the same boat (local-dynamic).

    Currently I've kept it Windows-only so we don't risk the platforms we haven't profiled yet. Happy to flip it on for all non-component builds and run the full Pinpoint set (Win / Linux / Mac / Android), then gate out whatever actually regresses. Then we just open it with:
    ```
    #if BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY
    ```

    WDYT?

    Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Anton Bikineev
    • Philip Rogers
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
    Gerrit-Change-Number: 8141866
    Gerrit-PatchSet: 2
    Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
    Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
    Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
    Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: Philip Rogers <p...@chromium.org>
    Gerrit-Attention: Anton Bikineev <biki...@chromium.org>
    Gerrit-Comment-Date: Tue, 28 Jul 2026 01:41:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Anton Bikineev <biki...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Zhou, Shuangshuang (Gerrit)

    unread,
    Jul 30, 2026, 5:02:40 AM (11 days ago) Jul 30
    to Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
    Attention needed from Anton Bikineev and Philip Rogers

    Zhou, Shuangshuang added 1 comment

    Patchset-level comments
    Zhou, Shuangshuang . resolved

    Hi Anton, any update or idea on this?
    Thanks!

    Gerrit-Comment-Date: Thu, 30 Jul 2026 09:02:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Anton Bikineev (Gerrit)

    unread,
    Aug 3, 2026, 10:41:45 AM (7 days ago) Aug 3
    to Zhou, Shuangshuang, Mason Freed, Philip Rogers, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
    Attention needed from Philip Rogers and Zhou, Shuangshuang

    Anton Bikineev voted and added 2 comments

    Votes added by Anton Bikineev

    Code-Review+1

    2 comments

    Patchset-level comments
    Anton Bikineev . resolved

    lgtm

    Commit Message
    Line 13, Patchset 2 (Latest): #if defined(BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY)
    Anton Bikineev . resolved

    This is a nice catch. The main question is why lifting it only on Win? Currently we have two runtime calls on Darwin - one the NOINLINE call to the getter and the other one `__tls_get_addr`.

    Zhou, Shuangshuang

    Thanks Anton — nice one, and yeah, on Darwin it's two calls today.

    You're right that inlining would still knock out the outer getter call there (2 → 1). The reason I kept it to Windows is really about what's left after inlining:

    • On Windows (initial-exec) the getter is wrapping a call-free TLS load, so inlining gets us all the way to zero calls — just a cheap TEB-relative load left. VTune on our RVP shows the out-of-line `ThreadStateStorage::Current` symbol simply vanishing, so it's a real drop in overhead.
    • On Darwin the getter is wrapping that second TLS-resolution call. Inlining drops the outer one (2 → 1), but then the whole sequence (that call + its setup) gets copied into every one of Current()'s many call sites, and I was a little wary the code-size growth could outweigh the single saved call and regress. Android's in the same boat (local-dynamic).

    Currently I've kept it Windows-only so we don't risk the platforms we haven't profiled yet. Happy to flip it on for all non-component builds and run the full Pinpoint set (Win / Linux / Mac / Android), then gate out whatever actually regresses. Then we just open it with:
    ```
    #if BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY
    ```

    WDYT?

    Thanks!

    Anton Bikineev

    I've tried this on M1 and it actually surprisingly regressed. I'm not sure if code-size growth is concern though given the icache size. Can you add a TODO to investigate it? Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Philip Rogers
    • Zhou, Shuangshuang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
    Gerrit-Change-Number: 8141866
    Gerrit-PatchSet: 2
    Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
    Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
    Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
    Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: Zhou, Shuangshuang <shuangsh...@intel.com>
    Gerrit-Attention: Philip Rogers <p...@chromium.org>
    Gerrit-Comment-Date: Mon, 03 Aug 2026 14:41:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Zhou, Shuangshuang <shuangsh...@intel.com>
    Comment-In-Reply-To: Anton Bikineev <biki...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Philip Rogers (Gerrit)

    unread,
    Aug 3, 2026, 6:40:23 PM (7 days ago) Aug 3
    to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
    Attention needed from Zhou, Shuangshuang

    Philip Rogers added 1 comment

    File third_party/blink/renderer/platform/heap/thread_local.h
    Line 52, Patchset 2 (Latest):// Everywhere else the access is itself a runtime call -- Apple routes every
    Philip Rogers . unresolved

    Is the "Everywhere else..." comment correct for ChromeOS and Linux? The table at the top of the file seems to say these platforms use "the fastest local-exec"? Should we instead just exclude Android and Mac, rather than only including windows?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Zhou, Shuangshuang
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
      Gerrit-Change-Number: 8141866
      Gerrit-PatchSet: 2
      Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
      Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Zhou, Shuangshuang <shuangsh...@intel.com>
      Gerrit-Comment-Date: Mon, 03 Aug 2026 22:40:14 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Aug 3, 2026, 11:43:06 PM (6 days ago) Aug 3
      to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
      Attention needed from Anton Bikineev and Zhou, Shuangshuang

      Message from chrom...@appspot.gserviceaccount.com

      📍 Job win-11-perf/speedometer-main.crossbench complete.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/146c1f98a90000

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Anton Bikineev
      • Zhou, Shuangshuang
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
      Gerrit-Change-Number: 8141866
      Gerrit-PatchSet: 3
      Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
      Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Zhou, Shuangshuang <shuangsh...@intel.com>
      Gerrit-Attention: Anton Bikineev <biki...@chromium.org>
      Gerrit-Comment-Date: Tue, 04 Aug 2026 03:42:53 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Aug 4, 2026, 1:30:16 AM (6 days ago) Aug 4
      to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
      Attention needed from Anton Bikineev and Zhou, Shuangshuang

      Message from chrom...@appspot.gserviceaccount.com

      📍 Job win-11-perf/speedometer3 complete.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/1024fb40a90000

      Gerrit-Comment-Date: Tue, 04 Aug 2026 05:30:03 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Aug 4, 2026, 3:07:19 AM (6 days ago) Aug 4
      to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
      Attention needed from Anton Bikineev and Zhou, Shuangshuang

      Message from chrom...@appspot.gserviceaccount.com

      📍 Job win-11-perf/speedometer3 complete.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/119dea32a90000

      Gerrit-Comment-Date: Tue, 04 Aug 2026 07:07:05 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Aug 4, 2026, 3:23:49 AM (6 days ago) Aug 4
      to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
      Attention needed from Anton Bikineev and Zhou, Shuangshuang

      Message from chrom...@appspot.gserviceaccount.com

      📍 Job win-11-perf/speedometer-main.crossbench complete.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/13f43588a90000

      Gerrit-Comment-Date: Tue, 04 Aug 2026 07:23:35 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Aug 4, 2026, 4:49:27 AM (6 days ago) Aug 4
      to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
      Attention needed from Anton Bikineev and Zhou, Shuangshuang

      Message from chrom...@appspot.gserviceaccount.com

      📍 Job linux-perf/speedometer-main.crossbench complete.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/1073f79ca90000

      Gerrit-Comment-Date: Tue, 04 Aug 2026 08:49:14 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Zhou, Shuangshuang (Gerrit)

      unread,
      Aug 6, 2026, 3:55:27 AM (4 days ago) Aug 6
      to Anton Bikineev, Mason Freed, Philip Rogers, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
      Attention needed from Anton Bikineev and Philip Rogers

      Zhou, Shuangshuang added 3 comments

      Patchset-level comments
      File-level comment, Patchset 4 (Latest):
      Zhou, Shuangshuang . resolved

      Hi Philip/Anton, PT-Another-L!
      Thanks!

      Commit Message
      Line 13, Patchset 2: #if defined(BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY)
      Anton Bikineev . resolved

      This is a nice catch. The main question is why lifting it only on Win? Currently we have two runtime calls on Darwin - one the NOINLINE call to the getter and the other one `__tls_get_addr`.

      Zhou, Shuangshuang

      Thanks Anton — nice one, and yeah, on Darwin it's two calls today.

      You're right that inlining would still knock out the outer getter call there (2 → 1). The reason I kept it to Windows is really about what's left after inlining:

      • On Windows (initial-exec) the getter is wrapping a call-free TLS load, so inlining gets us all the way to zero calls — just a cheap TEB-relative load left. VTune on our RVP shows the out-of-line `ThreadStateStorage::Current` symbol simply vanishing, so it's a real drop in overhead.
      • On Darwin the getter is wrapping that second TLS-resolution call. Inlining drops the outer one (2 → 1), but then the whole sequence (that call + its setup) gets copied into every one of Current()'s many call sites, and I was a little wary the code-size growth could outweigh the single saved call and regress. Android's in the same boat (local-dynamic).

      Currently I've kept it Windows-only so we don't risk the platforms we haven't profiled yet. Happy to flip it on for all non-component builds and run the full Pinpoint set (Win / Linux / Mac / Android), then gate out whatever actually regresses. Then we just open it with:
      ```
      #if BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY
      ```

      WDYT?

      Thanks!

      Anton Bikineev

      I've tried this on M1 and it actually surprisingly regressed. I'm not sure if code-size growth is concern though given the icache size. Can you add a TODO to investigate it? Thanks!

      Zhou, Shuangshuang

      Done!

      File third_party/blink/renderer/platform/heap/thread_local.h
      Line 52, Patchset 2:// Everywhere else the access is itself a runtime call -- Apple routes every
      Philip Rogers . resolved

      Is the "Everywhere else..." comment correct for ChromeOS and Linux? The table at the top of the file seems to say these platforms use "the fastest local-exec"? Should we instead just exclude Android and Mac, rather than only including windows?

      Zhou, Shuangshuang

      I think Yes, it should just exclude Android and Apple rather than only including Windows. Linux/ChromeOS resolve to local-exec in non-component builds, same call-free access as Windows' initial-exec, so there's no mechanism reason to leave them on the slow path. Now only Android and Mac is exluded.
      Thanks!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Anton Bikineev
      • Philip Rogers
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
        Gerrit-Change-Number: 8141866
        Gerrit-PatchSet: 4
        Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
        Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
        Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
        Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Mason Freed <mas...@chromium.org>
        Gerrit-Attention: Philip Rogers <p...@chromium.org>
        Gerrit-Attention: Anton Bikineev <biki...@chromium.org>
        Gerrit-Comment-Date: Thu, 06 Aug 2026 07:55:13 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Zhou, Shuangshuang <shuangsh...@intel.com>
        Comment-In-Reply-To: Philip Rogers <p...@chromium.org>
        Comment-In-Reply-To: Anton Bikineev <biki...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Philip Rogers (Gerrit)

        unread,
        Aug 6, 2026, 5:09:08 PM (4 days ago) Aug 6
        to Zhou, Shuangshuang, Anton Bikineev, Mason Freed, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
        Attention needed from Anton Bikineev and Zhou, Shuangshuang

        Philip Rogers voted and added 1 comment

        Votes added by Philip Rogers

        Code-Review+1

        1 comment

        Patchset-level comments
        Philip Rogers . resolved

        LGTM

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Anton Bikineev
        • Zhou, Shuangshuang
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
        Gerrit-Change-Number: 8141866
        Gerrit-PatchSet: 4
        Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
        Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
        Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
        Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Mason Freed <mas...@chromium.org>
        Gerrit-Attention: Zhou, Shuangshuang <shuangsh...@intel.com>
        Gerrit-Attention: Anton Bikineev <biki...@chromium.org>
        Gerrit-Comment-Date: Thu, 06 Aug 2026 21:08:53 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Anton Bikineev (Gerrit)

        unread,
        5:20 AM (4 hours ago) 5:20 AM
        to Zhou, Shuangshuang, Philip Rogers, Mason Freed, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
        Attention needed from Zhou, Shuangshuang

        Anton Bikineev voted and added 1 comment

        Votes added by Anton Bikineev

        Code-Review+1

        1 comment

        Patchset-level comments
        Anton Bikineev . resolved

        still lgtm, thanks

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Zhou, Shuangshuang
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
          Gerrit-Change-Number: 8141866
          Gerrit-PatchSet: 4
          Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
          Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
          Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
          Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
          Gerrit-CC: Kentaro Hara <har...@chromium.org>
          Gerrit-CC: Mason Freed <mas...@chromium.org>
          Gerrit-Attention: Zhou, Shuangshuang <shuangsh...@intel.com>
          Gerrit-Comment-Date: Mon, 10 Aug 2026 09:20:27 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Zhou, Shuangshuang (Gerrit)

          unread,
          6:47 AM (3 hours ago) 6:47 AM
          to Anton Bikineev, Philip Rogers, Mason Freed, Chromium LUCI CQ, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org

          Zhou, Shuangshuang voted Commit-Queue+2

          Commit-Queue+2
          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
          Gerrit-Change-Number: 8141866
          Gerrit-PatchSet: 4
          Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
          Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
          Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
          Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
          Gerrit-CC: Kentaro Hara <har...@chromium.org>
          Gerrit-CC: Mason Freed <mas...@chromium.org>
          Gerrit-Comment-Date: Mon, 10 Aug 2026 10:47:00 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          7:41 AM (2 hours ago) 7:41 AM
          to Zhou, Shuangshuang, Anton Bikineev, Philip Rogers, Mason Freed, chrom...@appspot.gserviceaccount.com, Kentaro Hara, android-bu...@system.gserviceaccount.com, kouhe...@chromium.org, oilpan-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org

          Chromium LUCI CQ submitted the change

          Change information

          Commit message:
          Fix dead ALWAYS_INLINE path for Blink thread-local getter

          BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY is always #defined -- to 1 in
          component (shared-library) builds and to 0 otherwise (see
          thread_local.h). So the getter selection

          #if defined(BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY)

          always evaluated true and unconditionally selected the NOINLINE
          out-of-line getter. The #else branch, which defines the intended
          ALWAYS_INLINE getter for non-component builds, has therefore been dead
          code on every platform and configuration since it was added -- even
          though the sibling TLS-model selection just above already switches on
          the macro's value and assumes non-component builds access the
          thread_local directly.

          Check the macro's value instead of its definedness, and enable the
          inlined getter where the platform's TLS model resolves the variable with
          a call-free static access: non-component builds on Windows
          ("initial-exec") and Linux/ChromeOS ("local-exec"). Component builds,
          Apple and Android keep the out-of-line NOINLINE getter exactly as they
          ship today -- their access is itself a runtime call (Apple routes every
          thread_local through Darwin's _tlv_get_addr thunk regardless of
          tls_model; Android and component builds use "local-dynamic", a
          __tls_get_addr call), so there is no call-free load for inlining to
          expose. Inlining on Apple would still fold away the outer getter call,
          but it measured a regression on an M1; a TODO tracks investigating that
          separately.

          Behavior observed with VTune on an official Windows 11 build (Chrome
          152.0.7962.0, PGO and ThinLTO enabled), for the getter symbol
          (out-of-line body in thread_state_storage.cc):

          blink::ThreadStateStorage::Current | Before (default) | After (fix)
          -----------------------------------+------------------+-------------
          Clockticks | 51,604,000 | not present
          Instructions Retired | 70,034,000 | not present
          CPI Rate | 0.737 | n/a

          Before the fix the out-of-line symbol is present, confirming the dead
          NOINLINE selection is what ships. After the fix the symbol is gone with
          no replacement out-of-line helper, confirming the getter is inlined into
          its callers as the #else branch always intended. The thread_local load
          itself is unchanged; only the call boundary and the NOINLINE barrier are
          removed.
          Bug: none
          Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
          Reviewed-by: Anton Bikineev <biki...@chromium.org>
          Reviewed-by: Philip Rogers <p...@chromium.org>
          Commit-Queue: Zhou, Shuangshuang <shuangsh...@intel.com>
          Cr-Commit-Position: refs/heads/main@{#1676356}
          Files:
          • M third_party/blink/renderer/platform/heap/thread_local.h
          Change size: S
          Delta: 1 file changed, 20 insertions(+), 3 deletions(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Anton Bikineev, +1 by Philip Rogers
          Open in Gerrit
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: merged
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: If9a34184286df209ec63f95fa6769e2efdf822d8
          Gerrit-Change-Number: 8141866
          Gerrit-PatchSet: 5
          Gerrit-Owner: Zhou, Shuangshuang <shuangsh...@intel.com>
          Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
          Gerrit-Reviewer: Zhou, Shuangshuang <shuangsh...@intel.com>
          open
          diffy
          satisfied_requirement
          Reply all
          Reply to author
          Forward
          0 new messages