[maglev] Port HeapNumber to the new VirtualObject model [v8/v8 : main]

0 views
Skip to first unread message

Jakob Linke (Gerrit)

unread,
Sep 23, 2025, 2:42:22 AM (4 days ago) Sep 23
to V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org

Jakob Linke added 1 comment

File src/maglev/maglev-code-generator.cc
Line 1559, Patchset 1 (Latest): // TODO(jgruber): Could we use the standard path below instead?
Jakob Linke . unresolved

I'm curious about this one. We already manually build inline allocs to handle mutable HN fields in the graph builder, but haven't checked yet how all the pieces fit together here.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ia6fcea8246e756137d6c9818857c5d6a266a32aa
Gerrit-Change-Number: 6975984
Gerrit-PatchSet: 1
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Sep 2025 06:42:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Victor Gomes (Gerrit)

unread,
Sep 23, 2025, 3:16:45 AM (4 days ago) Sep 23
to Jakob Linke, V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Jakob Linke

Victor Gomes added 3 comments

File src/maglev/maglev-code-generator.cc
Line 1558, Patchset 1 (Latest): if (object->object_type() == vobj::ObjectType::kHeapNumber) {
Victor Gomes . unresolved

Can we check the map for HN and ConsString here instead of the type?

Line 1559, Patchset 1 (Latest): // TODO(jgruber): Could we use the standard path below instead?
Jakob Linke . unresolved

I'm curious about this one. We already manually build inline allocs to handle mutable HN fields in the graph builder, but haven't checked yet how all the pieces fit together here.

Victor Gomes

These are 2 different things. It depends if the object was elided or escaped. If we did emit the first one (and did not remove it, since we remove it later), the object is escaped, this will never be called.
Otherwise if the object was elided and we deopt, we need to re-materialize the object, this will ensure that.

File src/maglev/maglev-ir.h
Line 6106, Patchset 1 (Latest): kHeapNumber,
Victor Gomes . unresolved

I thought we would be able to get rid of these... :/

Open in Gerrit

Related details

Attention is currently required from:
  • Jakob Linke
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ia6fcea8246e756137d6c9818857c5d6a266a32aa
Gerrit-Change-Number: 6975984
Gerrit-PatchSet: 1
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Jakob Linke <jgr...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Sep 2025 07:16:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jakob Linke <jgr...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Jakob Linke (Gerrit)

unread,
Sep 23, 2025, 4:52:59 AM (4 days ago) Sep 23
to Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Victor Gomes

Jakob Linke voted and added 3 comments

Votes added by Jakob Linke

Auto-Submit+1

3 comments

File src/maglev/maglev-code-generator.cc
Line 1558, Patchset 1 (Latest): if (object->object_type() == vobj::ObjectType::kHeapNumber) {
Victor Gomes . unresolved

Can we check the map for HN and ConsString here instead of the type?

Jakob Linke

ConsString: no, the map may be non-constant. For HN, yes but IMO there is little benefit as long as we still take custom paths for materialization.

Line 1559, Patchset 1 (Latest): // TODO(jgruber): Could we use the standard path below instead?
Jakob Linke . resolved

I'm curious about this one. We already manually build inline allocs to handle mutable HN fields in the graph builder, but haven't checked yet how all the pieces fit together here.

Victor Gomes

These are 2 different things. It depends if the object was elided or escaped. If we did emit the first one (and did not remove it, since we remove it later), the object is escaped, this will never be called.
Otherwise if the object was elided and we deopt, we need to re-materialize the object, this will ensure that.

Jakob Linke

Got it. The question remains if we can use the standard path, and it looks like "probably yes" if we tweak Float64Constant reification. But I'd like to look at that separately after FDA and HN have landed.

File src/maglev/maglev-ir.h
Victor Gomes . resolved

I thought we would be able to get rid of these... :/

Jakob Linke

Yeah it's unfortunate. With some effort we can unify a bit more, but as long as some types have special deopt handling we'll always have to distinguish between them.

On the upside, it's now clear where behavior diverges, instead of HN/CS/FDA being completely custom.

Open in Gerrit

Related details

Attention is currently required from:
  • Victor Gomes
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ia6fcea8246e756137d6c9818857c5d6a266a32aa
Gerrit-Change-Number: 6975984
Gerrit-PatchSet: 1
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Victor Gomes <victo...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Sep 2025 08:52:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Jakob Linke <jgr...@chromium.org>
Comment-In-Reply-To: Victor Gomes <victo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Victor Gomes (Gerrit)

unread,
Sep 23, 2025, 6:55:42 AM (4 days ago) Sep 23
to Jakob Linke, V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Jakob Linke

Victor Gomes voted and added 2 comments

Votes added by Victor Gomes

Code-Review+1

2 comments

File src/maglev/maglev-code-generator.cc
Line 1558, Patchset 1: if (object->object_type() == vobj::ObjectType::kHeapNumber) {
Victor Gomes . resolved

Can we check the map for HN and ConsString here instead of the type?

Jakob Linke

ConsString: no, the map may be non-constant. For HN, yes but IMO there is little benefit as long as we still take custom paths for materialization.

Victor Gomes

Acknowledged

Line 1559, Patchset 1: // TODO(jgruber): Could we use the standard path below instead?
Jakob Linke . resolved

I'm curious about this one. We already manually build inline allocs to handle mutable HN fields in the graph builder, but haven't checked yet how all the pieces fit together here.

Victor Gomes

These are 2 different things. It depends if the object was elided or escaped. If we did emit the first one (and did not remove it, since we remove it later), the object is escaped, this will never be called.
Otherwise if the object was elided and we deopt, we need to re-materialize the object, this will ensure that.

Jakob Linke

Got it. The question remains if we can use the standard path, and it looks like "probably yes" if we tweak Float64Constant reification. But I'd like to look at that separately after FDA and HN have landed.

Victor Gomes

Ack.

Open in Gerrit

Related details

Attention is currently required from:
  • Jakob Linke
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: Ia6fcea8246e756137d6c9818857c5d6a266a32aa
Gerrit-Change-Number: 6975984
Gerrit-PatchSet: 3
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Jakob Linke <jgr...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Sep 2025 10:55:38 +0000
satisfied_requirement
open
diffy

Jakob Linke (Gerrit)

unread,
Sep 23, 2025, 8:06:41 AM (4 days ago) Sep 23
to Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org

Jakob Linke voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
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: Ia6fcea8246e756137d6c9818857c5d6a266a32aa
Gerrit-Change-Number: 6975984
Gerrit-PatchSet: 4
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Sep 2025 12:06:36 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

V8 LUCI CQ (Gerrit)

unread,
Sep 23, 2025, 8:08:52 AM (4 days ago) Sep 23
to Jakob Linke, Victor Gomes, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org

V8 LUCI CQ submitted the change

Unreviewed changes

3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Change information

Commit message:
[maglev] Port HeapNumber to the new VirtualObject model
Change-Id: Ia6fcea8246e756137d6c9818857c5d6a266a32aa
Auto-Submit: Jakob Linke <jgr...@chromium.org>
Reviewed-by: Victor Gomes <victo...@chromium.org>
Commit-Queue: Jakob Linke <jgr...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#102688}
Files:
  • M src/compiler/turboshaft/turbolev-graph-builder.cc
  • M src/maglev/maglev-code-generator.cc
  • M src/maglev/maglev-graph-builder.cc
  • M src/maglev/maglev-graph-builder.h
  • M src/maglev/maglev-ir.h
  • M src/objects/heap-number.h
Change size: M
Delta: 6 files changed, 100 insertions(+), 93 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: Ia6fcea8246e756137d6c9818857c5d6a266a32aa
Gerrit-Change-Number: 6975984
Gerrit-PatchSet: 5
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
open
diffy
satisfied_requirement

Matthias Liedtke (Gerrit)

unread,
Sep 23, 2025, 8:16:20 AM (4 days ago) Sep 23
to Jakob Linke, V8 LUCI CQ, Victor Gomes, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org

Matthias Liedtke has created a revert of this change

Related details

Attention set is empty
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: revert
satisfied_requirement
open
diffy

Jakob Linke (Gerrit)

unread,
Sep 25, 2025, 8:55:24 AM (2 days ago) Sep 25
to Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Victor Gomes

Jakob Linke added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Victor Gomes
Submit Requirements:
  • 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: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Id31340b774ab5de5d54607add5a52232d3591dcd
Gerrit-Change-Number: 6983284
Gerrit-PatchSet: 1
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Victor Gomes <victo...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Sep 2025 12:55:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Jakob Linke (Gerrit)

unread,
Sep 25, 2025, 9:17:06 AM (2 days ago) Sep 25
to Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Victor Gomes

Jakob Linke voted Auto-Submit+1

Auto-Submit+1
Open in Gerrit

Related details

Attention is currently required from:
  • Victor Gomes
Submit Requirements:
  • 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: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Id31340b774ab5de5d54607add5a52232d3591dcd
Gerrit-Change-Number: 6983284
Gerrit-PatchSet: 2
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Victor Gomes <victo...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Sep 2025 13:17:02 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Victor Gomes (Gerrit)

unread,
Sep 25, 2025, 9:24:49 AM (2 days ago) Sep 25
to Jakob Linke, V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org
Attention needed from Jakob Linke

Victor Gomes voted and added 2 comments

Votes added by Victor Gomes

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Victor Gomes . resolved

LGTM!

File src/maglev/maglev-ir.h
Line 6498, Patchset 2 (Latest): ForEachSlotIterationMode mode = ForEachSlotIterationMode::kDefault) {
Victor Gomes . unresolved

I wonder if all iterations should be kForDeopt iterations.

Open in Gerrit

Related details

Attention is currently required from:
  • Jakob Linke
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
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: Id31340b774ab5de5d54607add5a52232d3591dcd
Gerrit-Change-Number: 6983284
Gerrit-PatchSet: 2
Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Jakob Linke <jgr...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Sep 2025 13:24:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Jakob Linke (Gerrit)

unread,
Sep 26, 2025, 1:10:07 AM (yesterday) Sep 26
to Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org

Jakob Linke voted and added 2 comments

Votes added by Jakob Linke

Commit-Queue+2

2 comments

Patchset-level comments
Jakob Linke . resolved

Thanks!

File src/maglev/maglev-ir.h
Line 6498, Patchset 2 (Latest): ForEachSlotIterationMode mode = ForEachSlotIterationMode::kDefault) {
Victor Gomes . resolved

I wonder if all iterations should be kForDeopt iterations.

Jakob Linke

Usually it does make sense to visit all slots. Examples: clearing all slots in the ctor, and building stores for the InlinedAllocation.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • 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: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Id31340b774ab5de5d54607add5a52232d3591dcd
    Gerrit-Change-Number: 6983284
    Gerrit-PatchSet: 2
    Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
    Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
    Gerrit-Reviewer: Victor Gomes <victo...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Sep 2025 05:10:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Victor Gomes <victo...@chromium.org>
    satisfied_requirement
    open
    diffy

    V8 LUCI CQ (Gerrit)

    unread,
    Sep 26, 2025, 1:11:41 AM (yesterday) Sep 26
    to Jakob Linke, Victor Gomes, dmercadi...@chromium.org, leszek...@chromium.org, v8-re...@googlegroups.com, verwaes...@chromium.org, victorgo...@chromium.org

    V8 LUCI CQ submitted the change

    Change information

    Commit message:
    [maglev] Port HeapNumber to the new VirtualObject model
    Change-Id: Id31340b774ab5de5d54607add5a52232d3591dcd
    Auto-Submit: Jakob Linke <jgr...@chromium.org>
    Commit-Queue: Jakob Linke <jgr...@chromium.org>
    Reviewed-by: Victor Gomes <victo...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#102777}
    Files:
    • M src/compiler/turboshaft/turbolev-graph-builder.cc
    • M src/maglev/maglev-code-generator.cc
    • M src/maglev/maglev-graph-builder.cc
    • M src/maglev/maglev-graph-builder.h
    • M src/maglev/maglev-ir.h
    • M src/objects/heap-number.h
    Change size: M
    Delta: 6 files changed, 98 insertions(+), 93 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Victor Gomes
    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: Id31340b774ab5de5d54607add5a52232d3591dcd
    Gerrit-Change-Number: 6983284
    Gerrit-PatchSet: 3
    Gerrit-Owner: Jakob Linke <jgr...@chromium.org>
    Gerrit-Reviewer: Jakob Linke <jgr...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages