[compiler][turboshaft] Decouple eager and lazy frame states [v8/v8 : main]

0 views
Skip to first unread message

Darius Mercadier (Gerrit)

unread,
7:35 AM (14 hours ago) 7:35 AM
to Nico Hartmann, Daniel Lehmann, Marco Vitale, android-bu...@system.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, dmercadi...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Daniel Lehmann and Nico Hartmann

Darius Mercadier voted and added 1 comment

Votes added by Darius Mercadier

Auto-Submit+1

1 comment

Patchset-level comments
File-level comment, Patchset 32:
Darius Mercadier . resolved

Nico, PTAL overall; Daniel PTAL Wasm.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Lehmann
  • Nico Hartmann
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: I2bae959258aefb8cbb43cf4eead4d919d5523b54
Gerrit-Change-Number: 7852381
Gerrit-PatchSet: 33
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Marco Vitale <mrc...@chromium.org>
Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Tue, 19 May 2026 11:35:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Daniel Lehmann (Gerrit)

unread,
8:11 AM (13 hours ago) 8:11 AM
to Darius Mercadier, Matthias Liedtke, Paolo Severini, Nico Hartmann, Marco Vitale, android-bu...@system.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, dmercadi...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Darius Mercadier and Nico Hartmann

Daniel Lehmann added 4 comments

Patchset-level comments
Darius Mercadier . resolved

Nico, PTAL overall; Daniel PTAL Wasm.

Daniel Lehmann

I reviewed the Wasm parts but have some high-level questions to fill my knowledge gap/uncertainty about eager vs. lazy frame states. Also CC'ing Matthias and Paolo, just FYI since we dealt with a bunch of issues in the wrapper/Wasm inlining in the past.

File src/compiler/turboshaft/wasm-in-js-inlining-reducer-inl.h
Line 1193, Patchset 34 (Latest): return __ template FrameState<EagerFrameState>(
Daniel Lehmann . unresolved

This might be a stupid question or I might simply be missing background knowledge about eager vs. lazy frame states:
Why is this frame state for the inlined Wasm body an `EagerFrameState`, but the one for the continuation a `LazyFrameState` one? Is it because the first is used when we throw an exception in the inlined Wasm body vs. the other is when a transitively called JS function causes a lazy deopt of the caller into which the Wasm body was inlined?
My understanding still seems to be a bit hazy, sometimes we chose eager vs. lazy based on the operation (e.g., `Call` always has a `LazyFrameState` attached?), sometimes based on whether the frame state describes the state of the execution before the operation vs. after, and sometimes based on the type of deopt that consumes the frame state, and theoretically all these should come to the same conclusion, but I'm not sure.

Line 47, Patchset 34 (Latest): V<LazyFrameState> frame_state) {
Daniel Lehmann . unresolved

What I don't understand is: here, where we basically strip/unwrap the `ProcessWasmArgument` ops, this `frame_state` is declared as a `LazyFrameState`, but below in `REDUCE_INPUT_GRAPH(Call)`, we stash it in `pending_caller_frame_state_` as an `EagerFrameState`. Which is correct?
From my understanding, we use the `pending_caller_frame_state_` in the eager deopts during JS-to-Wasm argument conversion, i.e., it should be an eager frame state, right?

Also, given that this change intends to make accidental misused of eager vs. lazy frame states harder, how come there is no cast here, even though the type apparently changes?

File src/compiler/turboshaft/wasm-js-lowering-reducer.h
Line 70, Patchset 34 (Latest): // TODO(dmercadier, dlehmann): Since this frame state is only used for stack
Daniel Lehmann . unresolved

Makes sense, but if we do that, we'd have to "make sure" we don't use it for anything that needs locals etc. in the future. At the very least by renaming this function to something like `CreateFrameStateForStackTrace` or something, or maybe something more robust, some `DCHECK`?

Open in Gerrit

Related details

Attention is currently required from:
  • Darius Mercadier
  • Nico Hartmann
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: I2bae959258aefb8cbb43cf4eead4d919d5523b54
    Gerrit-Change-Number: 7852381
    Gerrit-PatchSet: 34
    Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
    Gerrit-CC: Marco Vitale <mrc...@chromium.org>
    Gerrit-CC: Matthias Liedtke <mlie...@chromium.org>
    Gerrit-CC: Paolo Severini <paol...@microsoft.com>
    Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
    Gerrit-Comment-Date: Tue, 19 May 2026 12:11:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Darius Mercadier <dmerc...@chromium.org>
    unsatisfied_requirement
    open
    diffy

    Matthias Liedtke (Gerrit)

    unread,
    8:26 AM (13 hours ago) 8:26 AM
    to Darius Mercadier, Paolo Severini, Nico Hartmann, Daniel Lehmann, Marco Vitale, android-bu...@system.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, dmercadi...@chromium.org, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Darius Mercadier and Nico Hartmann

    Matthias Liedtke voted and added 2 comments

    Votes added by Matthias Liedtke

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 34 (Latest):
    Matthias Liedtke . resolved

    LGTM, thanks a lot!

    File src/compiler/turboshaft/wasm-in-js-inlining-reducer-inl.h
    Line 1193, Patchset 34 (Latest): return __ template FrameState<EagerFrameState>(
    Daniel Lehmann . unresolved

    This might be a stupid question or I might simply be missing background knowledge about eager vs. lazy frame states:
    Why is this frame state for the inlined Wasm body an `EagerFrameState`, but the one for the continuation a `LazyFrameState` one? Is it because the first is used when we throw an exception in the inlined Wasm body vs. the other is when a transitively called JS function causes a lazy deopt of the caller into which the Wasm body was inlined?
    My understanding still seems to be a bit hazy, sometimes we chose eager vs. lazy based on the operation (e.g., `Call` always has a `LazyFrameState` attached?), sometimes based on whether the frame state describes the state of the execution before the operation vs. after, and sometimes based on the type of deopt that consumes the frame state, and theoretically all these should come to the same conclusion, but I'm not sure.

    Matthias Liedtke

    I mean this is the same as below where eager vs. lazy doesn't really mean anything as it's for error locations only?
    It would only matter if we started performing deopts (e.g. for a "deopt on throw" for any of these traps)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Darius Mercadier
    • Nico Hartmann
    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: I2bae959258aefb8cbb43cf4eead4d919d5523b54
    Gerrit-Change-Number: 7852381
    Gerrit-PatchSet: 34
    Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
    Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
    Gerrit-CC: Marco Vitale <mrc...@chromium.org>
    Gerrit-Comment-Date: Tue, 19 May 2026 12:26:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Daniel Lehmann <dleh...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Lehmann (Gerrit)

    unread,
    8:43 AM (13 hours ago) 8:43 AM
    to Darius Mercadier, Matthias Liedtke, Paolo Severini, Nico Hartmann, Marco Vitale, android-bu...@system.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, dmercadi...@chromium.org, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Darius Mercadier and Nico Hartmann

    Daniel Lehmann added 1 comment

    File src/compiler/turboshaft/wasm-in-js-inlining-reducer-inl.h
    Line 1193, Patchset 34 (Latest): return __ template FrameState<EagerFrameState>(
    Daniel Lehmann . unresolved

    This might be a stupid question or I might simply be missing background knowledge about eager vs. lazy frame states:
    Why is this frame state for the inlined Wasm body an `EagerFrameState`, but the one for the continuation a `LazyFrameState` one? Is it because the first is used when we throw an exception in the inlined Wasm body vs. the other is when a transitively called JS function causes a lazy deopt of the caller into which the Wasm body was inlined?
    My understanding still seems to be a bit hazy, sometimes we chose eager vs. lazy based on the operation (e.g., `Call` always has a `LazyFrameState` attached?), sometimes based on whether the frame state describes the state of the execution before the operation vs. after, and sometimes based on the type of deopt that consumes the frame state, and theoretically all these should come to the same conclusion, but I'm not sure.

    Matthias Liedtke

    I mean this is the same as below where eager vs. lazy doesn't really mean anything as it's for error locations only?
    It would only matter if we started performing deopts (e.g. for a "deopt on throw" for any of these traps)

    Daniel Lehmann

    Ah, good point: the frame state for the inlined Wasm body is used for trapping Wasm ops, and in that case we are not continuing execution after the trap anyway, so eager vs. lazy simply doesn't matter. Maybe we should add that as a comment.

    Gerrit-Comment-Date: Tue, 19 May 2026 12:43:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Daniel Lehmann <dleh...@chromium.org>
    Comment-In-Reply-To: Matthias Liedtke <mlie...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Darius Mercadier (Gerrit)

    unread,
    10:08 AM (11 hours ago) 10:08 AM
    to Nico Hartmann, Matthias Liedtke, Paolo Severini, Daniel Lehmann, Marco Vitale, android-bu...@system.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, dmercadi...@chromium.org, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Daniel Lehmann and Nico Hartmann

    Darius Mercadier voted and added 3 comments

    Votes added by Darius Mercadier

    Auto-Submit+1

    3 comments

    File src/compiler/turboshaft/wasm-in-js-inlining-reducer-inl.h
    Line 1193, Patchset 34: return __ template FrameState<EagerFrameState>(
    Daniel Lehmann . resolved

    This might be a stupid question or I might simply be missing background knowledge about eager vs. lazy frame states:
    Why is this frame state for the inlined Wasm body an `EagerFrameState`, but the one for the continuation a `LazyFrameState` one? Is it because the first is used when we throw an exception in the inlined Wasm body vs. the other is when a transitively called JS function causes a lazy deopt of the caller into which the Wasm body was inlined?
    My understanding still seems to be a bit hazy, sometimes we chose eager vs. lazy based on the operation (e.g., `Call` always has a `LazyFrameState` attached?), sometimes based on whether the frame state describes the state of the execution before the operation vs. after, and sometimes based on the type of deopt that consumes the frame state, and theoretically all these should come to the same conclusion, but I'm not sure.

    Matthias Liedtke

    I mean this is the same as below where eager vs. lazy doesn't really mean anything as it's for error locations only?
    It would only matter if we started performing deopts (e.g. for a "deopt on throw" for any of these traps)

    Daniel Lehmann

    Ah, good point: the frame state for the inlined Wasm body is used for trapping Wasm ops, and in that case we are not continuing execution after the trap anyway, so eager vs. lazy simply doesn't matter. Maybe we should add that as a comment.

    Darius Mercadier

    I've added a comment. This is again a weird Wasm case where we don't perform a real deopt but just need a FrameState for error location.

    Line 47, Patchset 34: V<LazyFrameState> frame_state) {
    Daniel Lehmann . resolved

    What I don't understand is: here, where we basically strip/unwrap the `ProcessWasmArgument` ops, this `frame_state` is declared as a `LazyFrameState`, but below in `REDUCE_INPUT_GRAPH(Call)`, we stash it in `pending_caller_frame_state_` as an `EagerFrameState`. Which is correct?
    From my understanding, we use the `pending_caller_frame_state_` in the eager deopts during JS-to-Wasm argument conversion, i.e., it should be an eager frame state, right?

    Also, given that this change intends to make accidental misused of eager vs. lazy frame states harder, how come there is no cast here, even though the type apparently changes?

    Darius Mercadier

    Whups, good catch.

    REDUCE methods are called in a generic way that passes raw OpIndex as arguments, which are convertible to both LazyFrameState and EagerFrameState... maybe we could add some verification to REDUCE that the list of arguments actually matches what the constructor of the operation expects; I'll think about it, but that will be for a follow-up.

    (and yea, this should be an Eager frame state, not a Lazy one)

    File src/compiler/turboshaft/wasm-js-lowering-reducer.h
    Line 70, Patchset 34: // TODO(dmercadier, dlehmann): Since this frame state is only used for stack
    Daniel Lehmann . resolved

    Makes sense, but if we do that, we'd have to "make sure" we don't use it for anything that needs locals etc. in the future. At the very least by renaming this function to something like `CreateFrameStateForStackTrace` or something, or maybe something more robust, some `DCHECK`?

    Darius Mercadier

    DCHECKing anything useful here is hard, but I've at least renamed the function.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Lehmann
    • Nico Hartmann
    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: I2bae959258aefb8cbb43cf4eead4d919d5523b54
      Gerrit-Change-Number: 7852381
      Gerrit-PatchSet: 37
      Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
      Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
      Gerrit-CC: Marco Vitale <mrc...@chromium.org>
      Gerrit-CC: Paolo Severini <paol...@microsoft.com>
      Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
      Gerrit-Comment-Date: Tue, 19 May 2026 14:08:10 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Daniel Lehmann (Gerrit)

      unread,
      10:12 AM (11 hours ago) 10:12 AM
      to Darius Mercadier, Nico Hartmann, Matthias Liedtke, Paolo Severini, Marco Vitale, android-bu...@system.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, dmercadi...@chromium.org, v8-re...@googlegroups.com, was...@google.com
      Attention needed from Darius Mercadier and Nico Hartmann

      Daniel Lehmann voted and added 2 comments

      Votes added by Daniel Lehmann

      Code-Review+1

      2 comments

      Patchset-level comments
      File-level comment, Patchset 37 (Latest):
      Daniel Lehmann . resolved

      Thanks for the additional background!

      File src/compiler/turboshaft/wasm-in-js-inlining-reducer-inl.h
      Line 1193, Patchset 34: return __ template FrameState<EagerFrameState>(
      Daniel Lehmann . resolved

      This might be a stupid question or I might simply be missing background knowledge about eager vs. lazy frame states:
      Why is this frame state for the inlined Wasm body an `EagerFrameState`, but the one for the continuation a `LazyFrameState` one? Is it because the first is used when we throw an exception in the inlined Wasm body vs. the other is when a transitively called JS function causes a lazy deopt of the caller into which the Wasm body was inlined?
      My understanding still seems to be a bit hazy, sometimes we chose eager vs. lazy based on the operation (e.g., `Call` always has a `LazyFrameState` attached?), sometimes based on whether the frame state describes the state of the execution before the operation vs. after, and sometimes based on the type of deopt that consumes the frame state, and theoretically all these should come to the same conclusion, but I'm not sure.

      Matthias Liedtke

      I mean this is the same as below where eager vs. lazy doesn't really mean anything as it's for error locations only?
      It would only matter if we started performing deopts (e.g. for a "deopt on throw" for any of these traps)

      Daniel Lehmann

      Ah, good point: the frame state for the inlined Wasm body is used for trapping Wasm ops, and in that case we are not continuing execution after the trap anyway, so eager vs. lazy simply doesn't matter. Maybe we should add that as a comment.

      Darius Mercadier

      I've added a comment. This is again a weird Wasm case where we don't perform a real deopt but just need a FrameState for error location.

      Daniel Lehmann

      Thanks, comment looks good!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Darius Mercadier
      • Nico Hartmann
      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: I2bae959258aefb8cbb43cf4eead4d919d5523b54
      Gerrit-Change-Number: 7852381
      Gerrit-PatchSet: 37
      Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
      Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
      Gerrit-CC: Marco Vitale <mrc...@chromium.org>
      Gerrit-CC: Paolo Severini <paol...@microsoft.com>
      Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
      Gerrit-Comment-Date: Tue, 19 May 2026 14:12:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Darius Mercadier <dmerc...@chromium.org>
      satisfied_requirement
      open
      diffy

      Nico Hartmann (Gerrit)

      unread,
      10:13 AM (11 hours ago) 10:13 AM
      to Darius Mercadier, Daniel Lehmann, Matthias Liedtke, Paolo Severini, Marco Vitale, android-bu...@system.gserviceaccount.com, v8-s...@luci-project-accounts.iam.gserviceaccount.com, dmercadi...@chromium.org, v8-re...@googlegroups.com, was...@google.com
      Attention needed from Darius Mercadier

      Nico Hartmann voted and added 1 comment

      Votes added by Nico Hartmann

      Code-Review+1
      Commit-Queue+2

      1 comment

      Patchset-level comments
      Nico Hartmann . resolved

      LGTM

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Darius Mercadier
      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: I2bae959258aefb8cbb43cf4eead4d919d5523b54
      Gerrit-Change-Number: 7852381
      Gerrit-PatchSet: 37
      Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
      Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
      Gerrit-CC: Marco Vitale <mrc...@chromium.org>
      Gerrit-CC: Paolo Severini <paol...@microsoft.com>
      Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Comment-Date: Tue, 19 May 2026 14:13:45 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      v8-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

      unread,
      10:51 AM (10 hours ago) 10:51 AM
      to Darius Mercadier, Nico Hartmann, Daniel Lehmann, Matthias Liedtke, Paolo Severini, Marco Vitale, android-bu...@system.gserviceaccount.com, dmercadi...@chromium.org, v8-re...@googlegroups.com, was...@google.com

      v8-s...@luci-project-accounts.iam.gserviceaccount.com submitted the change

      Change information

      Commit message:
      [turboshaft] Decouple eager and lazy frame states

      This CL decouples turboshaft::FrameState into three distinct types:
      EagerFrameState, LazyFrameState, and AnyFrameState (an untagged
      union).

      Previously, a single generic FrameState type was used all over
      the compiler. This lacked type safety and made it easy to accidentally
      pass lazy frame states to eager deopt instructions or vice versa.

      Detailed changes:
      - Introduced EagerFrameState, LazyFrameState, and AnyFrameState in
      index.h.
      - Enforced strict, non-implicit compile-time typing by ensuring that
      specific frame states (EagerFrameState / LazyFrameState) are never
      implicitly constructible from the generic AnyFrameState. Any
      retargeting or conversion between eager and lazy deopt points must
      be explicitly cast in the source code.
      - Added compile-time static assertions inside OperationT::input<T>()
      to permanently prevent AnyFrameState from being used as an input type
      in all Turboshaft Operation classes (except FrameStateOp which uses
      an explicit manual cast bypass for parent frame states).
      - Refactored all Reducers to enforce precise eager/lazy frame states.

      NO_IFTTT=only updates V<> types, which don't exist in Maglev; no
      functional change.

      TAG=agy
      CONV=6bf1b779-ee18-485a-b5fd-ff1cccf6330c
      Change-Id: I2bae959258aefb8cbb43cf4eead4d919d5523b54
      Reviewed-by: Matthias Liedtke <mlie...@chromium.org>
      Commit-Queue: Nico Hartmann <nicoha...@chromium.org>
      Auto-Submit: Darius Mercadier <dmerc...@chromium.org>
      Reviewed-by: Daniel Lehmann <dleh...@chromium.org>
      Reviewed-by: Nico Hartmann <nicoha...@chromium.org>
      Commit-Queue: Darius Mercadier <dmerc...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#107428}
      Files:
      • M src/codegen/turboshaft-builtins-assembler-inl.h
      • M src/compiler/backend/instruction-selector.h
      • M src/compiler/turboshaft/assembler.h
      • M src/compiler/turboshaft/branch-elimination-reducer.h
      • M src/compiler/turboshaft/copying-phase.h
      • M src/compiler/turboshaft/deopt-data.h
      • M src/compiler/turboshaft/fast-api-call-lowering-reducer.h
      • M src/compiler/turboshaft/graph-builder.cc
      • M src/compiler/turboshaft/index.h
      • M src/compiler/turboshaft/int64-lowering-reducer.h
      • M src/compiler/turboshaft/js-generic-lowering-reducer.h
      • M src/compiler/turboshaft/machine-lowering-reducer-inl.h
      • M src/compiler/turboshaft/machine-optimization-reducer.h
      • M src/compiler/turboshaft/operations.h
      • M src/compiler/turboshaft/runtime-call-descriptors.h
      • M src/compiler/turboshaft/simplified-optimization-reducer.h
      • M src/compiler/turboshaft/stack-check-lowering-reducer.h
      • M src/compiler/turboshaft/string-escape-analysis-reducer.cc
      • M src/compiler/turboshaft/string-escape-analysis-reducer.h
      • M src/compiler/turboshaft/turbolev-early-lowering-reducer-inl.h
      • M src/compiler/turboshaft/turbolev-graph-builder.cc
      • M src/compiler/turboshaft/variable-reducer.h
      • M src/compiler/turboshaft/wasm-in-js-inlining-reducer-inl.h
      • M src/compiler/turboshaft/wasm-js-lowering-reducer.h
      • M src/compiler/turboshaft/wasm-lowering-reducer.h
      • M src/compiler/turboshaft/wasm-wrappers-inl.h
      • M src/compiler/turboshaft/wasm-wrappers.h
      • M src/wasm/turboshaft-graph-interface.cc
      • M src/wasm/turboshaft-graph-interface.h
      • M test/unittests/compiler/turboshaft/reducer-test.h
      Change size: XL
      Delta: 30 files changed, 578 insertions(+), 497 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Nico Hartmann, +1 by Matthias Liedtke, +1 by Daniel Lehmann
      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: I2bae959258aefb8cbb43cf4eead4d919d5523b54
      Gerrit-Change-Number: 7852381
      Gerrit-PatchSet: 38
      Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
      Gerrit-Reviewer: Matthias Liedtke <mlie...@chromium.org>
      Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages