[turbolev] Clone KNA before emitting CallKnowJSFunction node [v8/v8 : main]

0 views
Skip to first unread message

Darius Mercadier (Gerrit)

unread,
Sep 4, 2025, 9:35:50 AM (3 days ago) Sep 4
to Victor Gomes, V8 LUCI CQ, AyeAye, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Victor Gomes

Darius Mercadier voted and added 1 comment

Votes added by Darius Mercadier

Auto-Submit+1
Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Darius Mercadier . resolved

PTAL! :)

Open in Gerrit

Related details

Attention is currently required from:
  • Victor Gomes
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I8a8fb8aabad8b9549a9441bf53b44f12fe4e445b
Gerrit-Change-Number: 6915240
Gerrit-PatchSet: 2
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Victor Gomes <victo...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Sep 2025 13:35:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Victor Gomes (Gerrit)

unread,
Sep 4, 2025, 9:42:01 AM (3 days ago) Sep 4
to Darius Mercadier, V8 LUCI CQ, AyeAye, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Darius Mercadier

Victor Gomes voted and added 1 comment

Votes added by Victor Gomes

Code-Review+1
Commit-Queue+2

1 comment

Patchset-level comments
Victor Gomes . resolved

Nice!

Open in Gerrit

Related details

Attention is currently required from:
  • Darius Mercadier
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I8a8fb8aabad8b9549a9441bf53b44f12fe4e445b
Gerrit-Change-Number: 6915240
Gerrit-PatchSet: 2
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Sep 2025 13:41:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

V8 LUCI CQ (Gerrit)

unread,
Sep 4, 2025, 9:54:37 AM (3 days ago) Sep 4
to Darius Mercadier, Victor Gomes, AyeAye, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org

V8 LUCI CQ submitted the change

Change information

Commit message:
[turbolev] Clone KNA before emitting CallKnowJSFunction node

... since emitting the CallKnowJSFunction node will clear the unstable
maps from the KNA.

This is especially useful for constructors: the construct stub is
inlined eagerly during graph building, but the constructor itself can
be inlined non-greedily later, but if it has multiple derived classes,
its stores will be megamorphic, and it will thus require the KNA to
make them simple stores rather than calls to the megamorphic store IC.

For instance:

class B {
constructor() {
this.a0 = 42;
this.a1 = 42;
this.a2 = 42;
this.a3 = 42;
this.a4 = 42;
this.a5 = 42;
}
}

class D1 extends B {}
class D2 extends B {}
class D3 extends B {}
class D4 extends B {}
class D5 extends B {}

%PrepareFunctionForOptimization(B);
new B();
new D1();
new D2();
new D3();
new D4();
new D5();

function foo() {
return new B();
}

%PrepareFunctionForOptimization(foo);
print(foo());
%OptimizeFunctionOnNextCall(foo);
print(foo());

Prior to this CL, `foo` would end up calling the megamorphic store IC,
while after this CL, it simply does a few raw stores.

This CL improves FLightPlanner AverageScore with --turbolev-future
by 26%.
Bug: 431933185
Change-Id: I8a8fb8aabad8b9549a9441bf53b44f12fe4e445b
Commit-Queue: Darius Mercadier <dmerc...@chromium.org>
Auto-Submit: Darius Mercadier <dmerc...@chromium.org>
Reviewed-by: Victor Gomes <victo...@chromium.org>
Commit-Queue: Victor Gomes <victo...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#102248}
Files:
  • M src/maglev/maglev-graph-builder.cc
Change size: S
Delta: 1 file changed, 8 insertions(+), 2 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Victor Gomes
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I8a8fb8aabad8b9549a9441bf53b44f12fe4e445b
Gerrit-Change-Number: 6915240
Gerrit-PatchSet: 3
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages