[L] Change in dart/sdk[main]: [cfe,vm] Add 'this' expression to super invocation nodes

0 views
Skip to first unread message

Chloe Stefantsova (Gerrit)

unread,
Jan 20, 2026, 5:05:28 AM (2 days ago) Jan 20
to Chloe Stefantsova, Johnni Winther, Alexander Markov, Commit Queue, Jens Johansen, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Alexander Markov and Johnni Winther

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
  • Johnni Winther
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9d8e96cfe5c392f93d041d8947883fc86189c142
Gerrit-Change-Number: 474320
Gerrit-PatchSet: 3
Gerrit-Owner: Chloe Stefantsova <cstefa...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Chloe Stefantsova <cstefa...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-CC: Jens Johansen <je...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Tue, 20 Jan 2026 10:05:21 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Alexander Markov (Gerrit)

unread,
Jan 20, 2026, 10:25:39 AM (2 days ago) Jan 20
to Chloe Stefantsova, Johnni Winther, Alexander Markov, Commit Queue, Jens Johansen, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Chloe Stefantsova and Johnni Winther

Alexander Markov added 5 comments

File pkg/kernel/lib/binary/ast_to_binary.dart
Line 1683, Patchset 3 (Latest): writeNode(node.thisExpression);
Alexander Markov . unresolved

Consider serializing receiver before `node.name` to match other invocation nodes and keep evaluation order consistent (receiver before value/arguments).

(also for other nodes)

File pkg/kernel/lib/src/ast/expressions.dart
Line 942, Patchset 3 (Latest): Expression thisExpression;
Alexander Markov . unresolved

Considering calling this field `receiver` to match other nodes.

(also in other nodes)

Line 945, Patchset 3 (Latest): {required Expression thisExpression})
Alexander Markov . unresolved

Consider making this parameter the first positional parameter in order to match other nodes - receiver is usually after `kind` (if any) and before `name`.

(also in other nodes)

File pkg/vm/lib/transformations/to_string_transformer.dart
Line 98, Patchset 3 (Latest): thisExpression: new ThisExpression(),
Alexander Markov . unresolved

Nit: we don't follow CFE's non-standard "always use `new`" style in pkg/vm, so `new` can be omitted.

File runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
Line 2697, Patchset 3 (Latest): SkipExpression(); // skip this_expression.
Alexander Markov . unresolved
We should serialize receiver before `value` and use it with
```
instructions += BuildExpression();
```
at L2691 instead of `LoadLocal(parsed_function()->receiver_var())`.

(also for other nodes)

Open in Gerrit

Related details

Attention is currently required from:
  • Chloe Stefantsova
  • Johnni Winther
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • 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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I9d8e96cfe5c392f93d041d8947883fc86189c142
Gerrit-Change-Number: 474320
Gerrit-PatchSet: 3
Gerrit-Owner: Chloe Stefantsova <cstefa...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Chloe Stefantsova <cstefa...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-CC: Jens Johansen <je...@google.com>
Gerrit-Attention: Chloe Stefantsova <cstefa...@google.com>
Gerrit-Attention: Johnni Winther <johnni...@google.com>
Gerrit-Comment-Date: Tue, 20 Jan 2026 15:25:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Johnni Winther (Gerrit)

unread,
Jan 21, 2026, 3:55:16 AM (20 hours ago) Jan 21
to Chloe Stefantsova, Alexander Markov, Commit Queue, Jens Johansen, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Chloe Stefantsova

Johnni Winther voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Chloe Stefantsova
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I9d8e96cfe5c392f93d041d8947883fc86189c142
    Gerrit-Change-Number: 474320
    Gerrit-PatchSet: 3
    Gerrit-Owner: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
    Gerrit-Reviewer: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-CC: Jens Johansen <je...@google.com>
    Gerrit-Attention: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Comment-Date: Wed, 21 Jan 2026 08:55:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Chloe Stefantsova (Gerrit)

    unread,
    Jan 21, 2026, 8:26:27 AM (16 hours ago) Jan 21
    to Chloe Stefantsova, Johnni Winther, Alexander Markov, Commit Queue, Jens Johansen, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Alexander Markov

    Chloe Stefantsova added 6 comments

    Patchset-level comments
    File-level comment, Patchset 4 (Latest):
    Chloe Stefantsova . resolved

    Thanks for taking a look and for the comments, Alex! I need some more of your guidance in updating `runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc`.

    File pkg/kernel/lib/binary/ast_to_binary.dart
    Line 1683, Patchset 3: writeNode(node.thisExpression);
    Alexander Markov . unresolved

    Consider serializing receiver before `node.name` to match other invocation nodes and keep evaluation order consistent (receiver before value/arguments).

    (also for other nodes)

    Chloe Stefantsova

    Good suggestion! I started applying it, but encountered an issue with modifying `runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc`, which I describe in the comment on that file.

    File pkg/kernel/lib/src/ast/expressions.dart
    Line 942, Patchset 3: Expression thisExpression;
    Alexander Markov . resolved

    Considering calling this field `receiver` to match other nodes.

    (also in other nodes)

    Chloe Stefantsova

    Done

    Line 945, Patchset 3: {required Expression thisExpression})
    Alexander Markov . resolved

    Consider making this parameter the first positional parameter in order to match other nodes - receiver is usually after `kind` (if any) and before `name`.

    (also in other nodes)

    Chloe Stefantsova

    Done

    File pkg/vm/lib/transformations/to_string_transformer.dart
    Line 98, Patchset 3: thisExpression: new ThisExpression(),
    Alexander Markov . resolved

    Nit: we don't follow CFE's non-standard "always use `new`" style in pkg/vm, so `new` can be omitted.

    Chloe Stefantsova

    Done

    File runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
    Line 2697, Patchset 3: SkipExpression(); // skip this_expression.
    Alexander Markov . unresolved
    We should serialize receiver before `value` and use it with
    ```
    instructions += BuildExpression();
    ```
    at L2691 instead of `LoadLocal(parsed_function()->receiver_var())`.

    (also for other nodes)

    Chloe Stefantsova

    I made an attempt to update the code as you're suggesting, but I still can't make the VM to compile. I'd appreciate any help :) I've uploaded the state I ended up in in this CL.

    Additionally, for that reading order to work, `receiver` should come before `value`, but after `name`, which contradicts the desire to put `receiver` before the `name` for uniformity with other invocation nodes.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alexander Markov
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I9d8e96cfe5c392f93d041d8947883fc86189c142
    Gerrit-Change-Number: 474320
    Gerrit-PatchSet: 4
    Gerrit-Owner: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
    Gerrit-Reviewer: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-CC: Jens Johansen <je...@google.com>
    Gerrit-Attention: Alexander Markov <alexm...@google.com>
    Gerrit-Comment-Date: Wed, 21 Jan 2026 13:26:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alexander Markov <alexm...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Alexander Markov (Gerrit)

    unread,
    Jan 21, 2026, 1:09:33 PM (11 hours ago) Jan 21
    to Chloe Stefantsova, Alexander Markov, Johnni Winther, Commit Queue, Jens Johansen, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Chloe Stefantsova

    Alexander Markov added 1 comment

    File runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
    Line 2697, Patchset 3: SkipExpression(); // skip this_expression.
    Alexander Markov . resolved
    We should serialize receiver before `value` and use it with
    ```
    instructions += BuildExpression();
    ```
    at L2691 instead of `LoadLocal(parsed_function()->receiver_var())`.

    (also for other nodes)

    Chloe Stefantsova

    I made an attempt to update the code as you're suggesting, but I still can't make the VM to compile. I'd appreciate any help :) I've uploaded the state I ended up in in this CL.

    Additionally, for that reading order to work, `receiver` should come before `value`, but after `name`, which contradicts the desire to put `receiver` before the `name` for uniformity with other invocation nodes.

    Alexander Markov

    It turned out to be a bit more involved, but I think I figured that out. I uploaded a patchset with the necessary changes to this CL. (We might need to find another reviewer for the VM changes as I cannot approve my own changes.)

    Maybe having a `name` before `receiver` could simplify VM's code a bit, but I think we should do this consistently on all invocation nodes if we decide it is worth doing (and separately from this CL).

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chloe Stefantsova
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I9d8e96cfe5c392f93d041d8947883fc86189c142
    Gerrit-Change-Number: 474320
    Gerrit-PatchSet: 5
    Gerrit-Owner: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
    Gerrit-Reviewer: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-CC: Jens Johansen <je...@google.com>
    Gerrit-Attention: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Comment-Date: Wed, 21 Jan 2026 18:09:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Chloe Stefantsova <cstefa...@google.com>
    Comment-In-Reply-To: Alexander Markov <alexm...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Alexander Markov (Gerrit)

    unread,
    Jan 21, 2026, 3:44:13 PM (9 hours ago) Jan 21
    to Chloe Stefantsova, Alexander Markov, Johnni Winther, Commit Queue, Jens Johansen, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Chloe Stefantsova

    Alexander Markov added 2 comments

    Patchset-level comments
    File-level comment, Patchset 6 (Latest):
    Alexander Markov . resolved

    I also added missing traversal of receiver nodes in visitors and setting parent pointers. There are still some front-end test failures, but all other bots are green.

    File pkg/kernel/lib/binary/ast_to_binary.dart
    Line 1683, Patchset 3: writeNode(node.thisExpression);
    Alexander Markov . resolved

    Consider serializing receiver before `node.name` to match other invocation nodes and keep evaluation order consistent (receiver before value/arguments).

    (also for other nodes)

    Chloe Stefantsova

    Good suggestion! I started applying it, but encountered an issue with modifying `runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc`, which I describe in the comment on that file.

    Alexander Markov

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chloe Stefantsova
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I9d8e96cfe5c392f93d041d8947883fc86189c142
    Gerrit-Change-Number: 474320
    Gerrit-PatchSet: 6
    Gerrit-Owner: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
    Gerrit-Reviewer: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-CC: Jens Johansen <je...@google.com>
    Gerrit-Attention: Chloe Stefantsova <cstefa...@google.com>
    Gerrit-Comment-Date: Wed, 21 Jan 2026 20:44:10 +0000
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages