blink: Implement stack-allocated IDL unions for hot path arguments [chromium/src : main]

0 views
Skip to first unread message

chromeperf@appspot.gserviceaccount.com (Gerrit)

unread,
Jun 24, 2026, 6:17:41 AM (8 days ago) Jun 24
to Anton Bikineev, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org
Attention needed from Anton Bikineev

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

😿 Job mac-m1_mini_2020-perf/speedometer3 failed.

See results at: https://pinpoint-dot-chromeperf.appspot.com/job/126e8531c90000

Open in Gerrit

Related details

Attention is currently required from:
  • Anton Bikineev
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: Ibb9e276b1f934686dda51bf609a3cc404a5de564
Gerrit-Change-Number: 7992479
Gerrit-PatchSet: 1
Gerrit-Owner: Anton Bikineev <biki...@chromium.org>
Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Anton Bikineev <biki...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Jun 2026 10:17:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

chromeperf@appspot.gserviceaccount.com (Gerrit)

unread,
Jun 24, 2026, 6:35:59 AM (8 days ago) Jun 24
to Anton Bikineev, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org
Attention needed from Anton Bikineev

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

😿 Job mac-m1_mini_2020-perf/speedometer3 failed.

See results at: https://pinpoint-dot-chromeperf.appspot.com/job/14c89cfec90000

Gerrit-Comment-Date: Wed, 24 Jun 2026 10:35:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

chromeperf@appspot.gserviceaccount.com (Gerrit)

unread,
Jun 24, 2026, 7:13:34 AM (8 days ago) Jun 24
to Anton Bikineev, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org
Attention needed from Anton Bikineev

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

📍 Job mac-m1_mini_2020-perf/speedometer3 complete.

See results at: https://pinpoint-dot-chromeperf.appspot.com/job/117aba46c90000

Open in Gerrit

Related details

Attention is currently required from:
  • Anton Bikineev
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: Ibb9e276b1f934686dda51bf609a3cc404a5de564
Gerrit-Change-Number: 7992479
Gerrit-PatchSet: 3
Gerrit-Owner: Anton Bikineev <biki...@chromium.org>
Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Anton Bikineev <biki...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Jun 2026 11:13:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

chromeperf@appspot.gserviceaccount.com (Gerrit)

unread,
Jun 24, 2026, 7:24:24 AM (8 days ago) Jun 24
to Anton Bikineev, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org
Attention needed from Anton Bikineev

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

📍 Job mac-m1_mini_2020-perf/speedometer3 complete.

See results at: https://pinpoint-dot-chromeperf.appspot.com/job/1300ee41c90000

Gerrit-Comment-Date: Wed, 24 Jun 2026 11:24:08 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Anton Bikineev (Gerrit)

unread,
Jun 24, 2026, 7:50:18 AM (8 days ago) Jun 24
to Andrey Kosyakov, Michael Lippautz, chrom...@appspot.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org
Attention needed from Andrey Kosyakov

Anton Bikineev voted and added 1 comment

Votes added by Anton Bikineev

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Anton Bikineev . resolved

Andrey, could you please take a look if the change makes sense? In theory, I'd expect it to visibly improve S3 performance, but, unfortunately, there is no effect. The change should still reduce the GC pressure significantly.

Open in Gerrit

Related details

Attention is currently required from:
  • Andrey Kosyakov
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: Ibb9e276b1f934686dda51bf609a3cc404a5de564
Gerrit-Change-Number: 7992479
Gerrit-PatchSet: 6
Gerrit-Owner: Anton Bikineev <biki...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Jun 2026 11:49:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrey Kosyakov (Gerrit)

unread,
Jun 24, 2026, 5:55:22 PM (8 days ago) Jun 24
to Anton Bikineev, Michael Lippautz, chrom...@appspot.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org
Attention needed from Anton Bikineev

Andrey Kosyakov added 10 comments

Commit Message
Line 12, Patchset 6 (Latest):STACK_ALLOCATED() and use raw pointers (T*) instead of Member<T>:
Andrey Kosyakov . unresolved

So... If we ever need one as a dictionary member, will we have to undo it?

File third_party/blink/renderer/bindings/core/v8/is_return_type_compatible.h
Line 23, Patchset 6 (Latest):concept IsBlinkNullableType =
Andrey Kosyakov . unresolved

Move it into `namespace internal` below?

File third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h
Line 1516, Patchset 6 (Latest): return T::Create(isolate, value, exception_state);
Andrey Kosyakov . unresolved

So from what I understand the kNone enum variant is so that we have something to return here in case the conversion throws. How about we return `std::optional<>` instead?

File third_party/blink/renderer/bindings/scripts/bind_gen/interface.py
Line 18, Patchset 6 (Latest):from .union import STACK_ALLOCATED_UNIONS
Andrey Kosyakov . unresolved

Let's expose a predicate method instead? Something like `is_stack_allocated_union(idl_type)`?

Line 619, Patchset 6 (Latest): return _format("{0}.has_value() ? &*{0} : nullptr", name)
Andrey Kosyakov . unresolved

`s/{0}/{}/` for consistency?

File third_party/blink/renderer/bindings/scripts/bind_gen/union.py
Line 45, Patchset 6 (Latest):STACK_ALLOCATED_UNIONS = {
Andrey Kosyakov . unresolved

I think this rather belongs to blink_v8_bridge.py conceptually as it deals with blink-specific type names.

Line 230, Patchset 6 (Latest): entries.append("kNone")
Andrey Kosyakov . unresolved

Not sure I understand why this is needed? Thought we're handling null values via std::optional<>? This also seems to create quite a bit of hassle on the receiving side.

Line 556, Patchset 6 (Latest): func_decl = CxxFuncDeclNode(name=cg_context.class_name,
Andrey Kosyakov . unresolved

nit: you can use `func_decl = func_def.make_decl()` for brevity.

Line 990, Patchset 6 (Latest): if cg_context.class_name in STACK_ALLOCATED_UNIONS and member.type_info.is_gc_type:
Andrey Kosyakov . unresolved

I assume for stack-allocated unions, the entire Clear() function can be a no-op?

Line 1101, Patchset 6 (Latest): TextNode("STACK_ALLOCATED();\npublic:\n"))
Andrey Kosyakov . unresolved

just put it into `private_secion`? That "\npublic:\n" part doesn't look nice.

Open in Gerrit

Related details

Attention is currently required from:
  • Anton Bikineev
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: Ibb9e276b1f934686dda51bf609a3cc404a5de564
    Gerrit-Change-Number: 7992479
    Gerrit-PatchSet: 6
    Gerrit-Owner: Anton Bikineev <biki...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Anton Bikineev <biki...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Michael Lippautz <mlip...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Anton Bikineev <biki...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Jun 2026 21:55:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages