)]}'
{
  "commit": "708c6587d1f702a2cede52dd1d83952dc4678937",
  "tree": "d5a347d97feaaa4722af9809064df9762ac00ec7",
  "parents": [
    "14af6bae5308dd9f690e74ba348786e50f069c47"
  ],
  "author": {
    "name": "Evan Brown CA",
    "email": "ezb@google.com",
    "time": "Wed Nov 11 14:51:50 2026 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Fri Nov 20 13:41:49 2026 -0800"
  },
  "message": "Copy AnyInvocable trivial storage in pointer-sized words and skip copies on dispose to avoid store-forwarding stalls\n\nTypeErasedState spans two pointer-sized words (16 bytes on 64-bit platforms, aligned to 16 bytes on 64-bit SysV/Darwin), so `*to \u003d *from` in LocalManagerTrivial() and `to-\u003eremote \u003d from-\u003eremote` in RemoteManagerTrivial() compile to a 2-word SIMD load/store (such as `vmovaps (%rsi), %xmm0` / `vmovaps %xmm0, (%rdx)` on x86-64 and `ldr q0, [x1]` / `str q0, [x2]` on AArch64). When an absl::AnyInvocable is constructed from a function pointer, single-pointer lambda, sub-word scalar capture, or two-word remote state and then moved or destroyed (LocalManagerTrivial() previously self-copied on FunctionToCall::dispose as well), the 2-word SIMD load spans narrower scalar stores—or a 2-word SIMD store precedes scalar reads in LocalInvoker/RemoteInvoker—causing store-to-load forwarding stalls.\n\nAvoid 2-word SIMD copies and unnecessary teardown copies using standard C++ without changing TypeErasedState\u0027s triviality or implicit-lifetime properties:\n- Return early on FunctionToCall::dispose in LocalManagerTrivial() and LocalManagerTrivialSingleWord() (matching RemoteManagerTrivial()) to eliminate teardown loads/stores.\n- Route empty trivially copyable local callables to EmptyManager() (starting `to-\u003estorage` lifetime per P0593 as a no-op), single-word (`\u003c\u003d sizeof(void*)`) callables to LocalManagerTrivialSingleWord() (single pointer-sized std::memmove), and multi-word callables to LocalManagerTrivial() (two sequential pointer-sized std::memmove calls).\n- Copy `remote.target` and `remote.size` field-by-field in RemoteManagerTrivial() instead of via whole-struct assignment.\n- Stage non-empty trivially copyable local callables through a zeroed word-multiple `unsigned char` buffer into `state_.storage` via pointer-sized std::memcpy calls in InitializeStorage() so narrow sub-word stores do not stall subsequent word-sized loads.\n- Guard TypeErasedState triviality with static_assert and add unit tests covering empty, sub-word, partial/full multi-word, padded, mutable, move-only, and remote trivial callables.\n\nPiperOrigin-RevId: 1019520730\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6d09c12526836f4adca4bad0d8cfa6e69a4900a0",
      "old_mode": 33188,
      "old_path": "absl/functional/any_invocable_test.h",
      "new_id": "5c0a36c788ce64d1a322227d2746af4cccf7e6d9",
      "new_mode": 33188,
      "new_path": "absl/functional/any_invocable_test.h"
    },
    {
      "type": "modify",
      "old_id": "ac21ca9adf0f66c5b6e6b4109ac9164c234dd336",
      "old_mode": 33188,
      "old_path": "absl/functional/any_invocable_test_inst4.cc",
      "new_id": "f5fbcf6046826d585ea17099c1983e202fd2bb46",
      "new_mode": 33188,
      "new_path": "absl/functional/any_invocable_test_inst4.cc"
    },
    {
      "type": "modify",
      "old_id": "1ff8bb6fa58417f11e9299b0fd1176e4ccb01f51",
      "old_mode": 33188,
      "old_path": "absl/functional/internal/any_invocable.h",
      "new_id": "6c16a88601b6bd11297c19ffa1474c19267189f9",
      "new_mode": 33188,
      "new_path": "absl/functional/internal/any_invocable.h"
    }
  ]
}
