[XL] Change in dart/sdk[main]: [vm/shared] Perform deeply-immutable initialization runtime check.

0 views
Skip to first unread message

Alexander Aprelev (Gerrit)

unread,
Dec 15, 2025, 1:43:52 PM (9 days ago) Dec 15
to Alexander Aprelev, Slava Egorov, Commit Queue, Alexander Markov, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Slava Egorov

Alexander Aprelev added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Alexander Aprelev . resolved

Please let me know what you think, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Slava Egorov
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement 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: I550746c0d22ca06ffb89959e8384cc9e6d28d590
Gerrit-Change-Number: 468200
Gerrit-PatchSet: 3
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-CC: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Slava Egorov <veg...@google.com>
Gerrit-Comment-Date: Mon, 15 Dec 2025 18:43:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Slava Egorov (Gerrit)

unread,
Dec 17, 2025, 4:16:59 AM (8 days ago) Dec 17
to Alexander Aprelev, Commit Queue, Alexander Markov, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Alexander Aprelev

Slava Egorov added 4 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Slava Egorov . resolved

Initial comments.

Please ask @alexm...@google.com for review while I am away for holidays :)

File pkg/vm/lib/modular/transformations/deeply_immutable.dart
Line 178, Patchset 4 (Latest): if (dartType is FunctionType) {
Slava Egorov . unresolved

1. Please update deeply immutable documentation in the repo (e.g. in `runtime/docs` to match the semantics being implemented).

2. Please add tests to cover new functionality - including both negative and positive tests.

File runtime/vm/compiler/backend/il.h
Line 6612, Patchset 4 (Latest):class GuardFieldImmutabilityInstr : public GuardFieldInstr {
Slava Egorov . unresolved

To avoid confusion with speculative field guards I suggest we use either `CheckImmutableValue` or `AssertImmutableValue`.

Also don't make it subclass of `GuardFieldInstr` (which is `NoThrow`) - these checks are not _speculative_ and don't maintain dynamic guarded field state, they throw when value is incorrect. Thus these checks are more similar to implicit `as` casts than guards.

File runtime/vm/ffi_callback_metadata.cc
Line 428, Patchset 4 (Latest): const Context& context = Context::Handle(zone, closure.GetContext());
Slava Egorov . unresolved

Once we scanned closure - I wonder if we want to update its tag bits so that next time we come to scan the same closure we don't need to do that?

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Aprelev
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement 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: I550746c0d22ca06ffb89959e8384cc9e6d28d590
Gerrit-Change-Number: 468200
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-CC: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Alexander Aprelev <a...@google.com>
Gerrit-Comment-Date: Wed, 17 Dec 2025 09:16:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
satisfied_requirement
open
diffy

Alexander Aprelev (Gerrit)

unread,
Dec 22, 2025, 11:06:25 PM (2 days ago) Dec 22
to Alexander Aprelev, Slava Egorov, Commit Queue, Alexander Markov, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Slava Egorov

Alexander Aprelev voted and added 2 comments

Votes added by Alexander Aprelev

Commit-Queue+1

2 comments

File runtime/vm/compiler/backend/il.h
Line 6612, Patchset 4:class GuardFieldImmutabilityInstr : public GuardFieldInstr {
Slava Egorov . resolved

To avoid confusion with speculative field guards I suggest we use either `CheckImmutableValue` or `AssertImmutableValue`.

Also don't make it subclass of `GuardFieldInstr` (which is `NoThrow`) - these checks are not _speculative_ and don't maintain dynamic guarded field state, they throw when value is incorrect. Thus these checks are more similar to implicit `as` casts than guards.

Alexander Aprelev

Done

File runtime/vm/ffi_callback_metadata.cc
Line 428, Patchset 4: const Context& context = Context::Handle(zone, closure.GetContext());
Slava Egorov . resolved

Once we scanned closure - I wonder if we want to update its tag bits so that next time we come to scan the same closure we don't need to do that?

Alexander Aprelev

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Slava Egorov
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement 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: I550746c0d22ca06ffb89959e8384cc9e6d28d590
Gerrit-Change-Number: 468200
Gerrit-PatchSet: 7
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-CC: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Slava Egorov <veg...@google.com>
Gerrit-Comment-Date: Tue, 23 Dec 2025 04:06:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Slava Egorov <veg...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Aprelev (Gerrit)

unread,
Dec 23, 2025, 3:48:15 PM (yesterday) Dec 23
to Alexander Aprelev, Slava Egorov, Commit Queue, Alexander Markov, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Slava Egorov

Alexander Aprelev added 1 comment

File pkg/vm/lib/modular/transformations/deeply_immutable.dart
Line 178, Patchset 4: if (dartType is FunctionType) {
Slava Egorov . resolved

1. Please update deeply immutable documentation in the repo (e.g. in `runtime/docs` to match the semantics being implemented).

2. Please add tests to cover new functionality - including both negative and positive tests.

Alexander Aprelev

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Slava Egorov
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement 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: I550746c0d22ca06ffb89959e8384cc9e6d28d590
Gerrit-Change-Number: 468200
Gerrit-PatchSet: 9
Gerrit-Owner: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Alexander Aprelev <a...@google.com>
Gerrit-Reviewer: Slava Egorov <veg...@google.com>
Gerrit-CC: Alexander Markov <alexm...@google.com>
Gerrit-Attention: Slava Egorov <veg...@google.com>
Gerrit-Comment-Date: Tue, 23 Dec 2025 20:48:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Slava Egorov <veg...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages