[heap] Extract limit computation out of Heap [v8/v8 : main]

0 views
Skip to first unread message

Etienne Pierre-Doray (Gerrit)

unread,
Dec 18, 2025, 12:28:47 PM12/18/25
to Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ

Etienne Pierre-Doray added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Etienne Pierre-Doray . resolved

PTAL

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
Submit Requirements:
  • 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: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ic53e148032e209c46b30f1948a0bdef8babf6462
Gerrit-Change-Number: 7270565
Gerrit-PatchSet: 9
Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 17:28:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Etienne Pierre-Doray (Gerrit)

unread,
Dec 18, 2025, 1:19:53 PM12/18/25
to Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ

Etienne Pierre-Doray added 1 comment

File src/heap/heap.cc
Line 301, Patchset 9 (Parent): DCHECK_EQ(0, max_old_generation_size() & (PageMetadata::kPageSize - 1));
Etienne Pierre-Doray . resolved

This is effectively a no-op, because max_old_generation_size() isn't initialized here.
But it causes problem because heap_limits_ isn't initialized either.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
Submit Requirements:
  • 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: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ic53e148032e209c46b30f1948a0bdef8babf6462
Gerrit-Change-Number: 7270565
Gerrit-PatchSet: 12
Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 18:19:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Dominik Inführ (Gerrit)

unread,
Jan 15, 2026, 7:11:49 AM (3 days ago) Jan 15
to Etienne Pierre-Doray, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
Attention needed from Etienne Pierre-Doray

Dominik Inführ added 2 comments

File src/heap/heap.h
Line 1104, Patchset 25 (Latest): HeapLimits* heap_limits() const { return heap_limits_.get(); }
Dominik Inführ . unresolved

Can we name that just `limits()`? That would make accesses a bit short. We are already in Heap, so I think it's always clear from the context "limits" means "heap_limits".

File src/heap/heap.cc
Line 5417, Patchset 25 (Latest):bool Heap::AllocationLimitOvershotByFixedMargin(
Dominik Inführ . unresolved

I see why you split that method up. Can we keep this method here for now though? IMHO splitting it up seems a bit worse than keeping it here entirely a-is (modulo adding limits()-> prefixes). I think the same applies to AllocationLimitOvershotByLargeMargin() as well and possibly other methods I haven't seen yet.

Open in Gerrit

Related details

Attention is currently required from:
  • Etienne Pierre-Doray
Submit Requirements:
    • 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: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic53e148032e209c46b30f1948a0bdef8babf6462
    Gerrit-Change-Number: 7270565
    Gerrit-PatchSet: 25
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Thu, 15 Jan 2026 12:11:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    Jan 15, 2026, 12:54:43 PM (3 days ago) Jan 15
    to Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Dominik Inführ

    Etienne Pierre-Doray added 4 comments

    Patchset-level comments
    File-level comment, Patchset 28 (Latest):
    Etienne Pierre-Doray . resolved

    PTAnL?

    File src/heap/heap.h
    Line 1104, Patchset 25: HeapLimits* heap_limits() const { return heap_limits_.get(); }
    Dominik Inführ . resolved

    Can we name that just `limits()`? That would make accesses a bit short. We are already in Heap, so I think it's always clear from the context "limits" means "heap_limits".

    Etienne Pierre-Doray

    Done

    File src/heap/heap.cc
    Line 299, Patchset 26 (Parent): // Ensure old_generation_size_ is a multiple of kPageSize.
    DCHECK_EQ(0, max_old_generation_size() & (NormalPage::kPageSize - 1));
    Etienne Pierre-Doray . resolved

    I wanted to note: this is a no-op because max_old_generation_size = 0 here (uninitialized)

    Line 5417, Patchset 25:bool Heap::AllocationLimitOvershotByFixedMargin(
    Dominik Inführ . unresolved

    I see why you split that method up. Can we keep this method here for now though? IMHO splitting it up seems a bit worse than keeping it here entirely a-is (modulo adding limits()-> prefixes). I think the same applies to AllocationLimitOvershotByLargeMargin() as well and possibly other methods I haven't seen yet.

    Etienne Pierre-Doray

    Done for AllocationLimitOvershotByFixedMargin/ByLargeMargin
    Not sure about EnsureMinimumRemainingAllocationLimit - I feel like conceptually it should mostly be in HeapLimits

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dominik Inführ
    Submit Requirements:
    • 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: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic53e148032e209c46b30f1948a0bdef8babf6462
    Gerrit-Change-Number: 7270565
    Gerrit-PatchSet: 28
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Comment-Date: Thu, 15 Jan 2026 17:54:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dominik Inführ <dinf...@chromium.org>
    unsatisfied_requirement
    open
    diffy

    Dominik Inführ (Gerrit)

    unread,
    Jan 16, 2026, 8:16:41 AM (2 days ago) Jan 16
    to Etienne Pierre-Doray, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Etienne Pierre-Doray

    Dominik Inführ added 2 comments

    File src/heap/heap-controller.h
    Line 10, Patchset 30 (Latest):#include "include/v8-isolate.h"
    Dominik Inführ . unresolved

    Do we really need that one? Maybe included by accident.

    File src/heap/heap.cc
    Line 5417, Patchset 25:bool Heap::AllocationLimitOvershotByFixedMargin(
    Dominik Inführ . unresolved

    I see why you split that method up. Can we keep this method here for now though? IMHO splitting it up seems a bit worse than keeping it here entirely a-is (modulo adding limits()-> prefixes). I think the same applies to AllocationLimitOvershotByLargeMargin() as well and possibly other methods I haven't seen yet.

    Etienne Pierre-Doray

    Done for AllocationLimitOvershotByFixedMargin/ByLargeMargin
    Not sure about EnsureMinimumRemainingAllocationLimit - I feel like conceptually it should mostly be in HeapLimits

    Dominik Inführ

    I think this applies to all three methods. They all make sense in HeapLimits. But I also think it's more important to not split the methods. This makes it a lot more cumbersome to check out what they are doing. So I think we should keep them here for now and we can move them over later.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Etienne Pierre-Doray
    Submit Requirements:
    • 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: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic53e148032e209c46b30f1948a0bdef8babf6462
    Gerrit-Change-Number: 7270565
    Gerrit-PatchSet: 30
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Fri, 16 Jan 2026 13:16:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Etienne Pierre-Doray <etie...@chromium.org>
    Comment-In-Reply-To: Dominik Inführ <dinf...@chromium.org>
    unsatisfied_requirement
    open
    diffy

    Dominik Inführ (Gerrit)

    unread,
    Jan 16, 2026, 8:17:00 AM (2 days ago) Jan 16
    to Etienne Pierre-Doray, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Etienne Pierre-Doray

    Dominik Inführ added 1 comment

    Commit Message
    Line 11, Patchset 30 (Latest):I tried to avoid circular dependancies as much as possible,
    Dominik Inführ . unresolved

    Nit: spellcheck

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Etienne Pierre-Doray
    Submit Requirements:
    • 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: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic53e148032e209c46b30f1948a0bdef8babf6462
    Gerrit-Change-Number: 7270565
    Gerrit-PatchSet: 30
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Comment-Date: Fri, 16 Jan 2026 13:16:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Etienne Pierre-Doray (Gerrit)

    unread,
    Jan 16, 2026, 11:44:48 AM (2 days ago) Jan 16
    to Dominik Inführ, V8 LUCI CQ, Hannes Payer, mlippau...@chromium.org, oilpan-r...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Dominik Inführ

    Etienne Pierre-Doray added 4 comments

    Etienne Pierre-Doray . resolved

    PTAnL?

    Commit Message
    Line 11, Patchset 30:I tried to avoid circular dependancies as much as possible,
    Dominik Inführ . resolved

    Nit: spellcheck

    Etienne Pierre-Doray

    Done

    File src/heap/heap-controller.h
    Line 10, Patchset 30:#include "include/v8-isolate.h"
    Dominik Inführ . unresolved

    Do we really need that one? Maybe included by accident.

    Etienne Pierre-Doray

    `Isolate` is used in this file - it's transitively provided through src/heap/heap.h (though that's not IWYU). I guess we can also just forward declare it.

    File src/heap/heap.cc
    Line 5417, Patchset 25:bool Heap::AllocationLimitOvershotByFixedMargin(
    Dominik Inführ . resolved

    I see why you split that method up. Can we keep this method here for now though? IMHO splitting it up seems a bit worse than keeping it here entirely a-is (modulo adding limits()-> prefixes). I think the same applies to AllocationLimitOvershotByLargeMargin() as well and possibly other methods I haven't seen yet.

    Etienne Pierre-Doray

    Done for AllocationLimitOvershotByFixedMargin/ByLargeMargin
    Not sure about EnsureMinimumRemainingAllocationLimit - I feel like conceptually it should mostly be in HeapLimits

    Dominik Inführ

    I think this applies to all three methods. They all make sense in HeapLimits. But I also think it's more important to not split the methods. This makes it a lot more cumbersome to check out what they are doing. So I think we should keep them here for now and we can move them over later.

    Etienne Pierre-Doray

    ok done for EnsureMinimumRemainingAllocationLimit.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dominik Inführ
    Submit Requirements:
    • 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: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic53e148032e209c46b30f1948a0bdef8babf6462
    Gerrit-Change-Number: 7270565
    Gerrit-PatchSet: 32
    Gerrit-Owner: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Reviewer: Etienne Pierre-Doray <etie...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Comment-Date: Fri, 16 Jan 2026 16:44:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages