[L] Change in dart/sdk[main]: [tfa] Moving `isBeingUsed` to `NativeCodeOracle`

0 views
Skip to first unread message

Daco Harkes (Gerrit)

unread,
Mar 12, 2026, 2:53:14 PMMar 12
to Alexander Markov, Commit Queue, rev...@dartlang.org
Attention needed from Alexander Markov

Daco Harkes added 5 comments

File pkg/vm/lib/transformations/type_flow/native_code.dart
Line 300, Patchset 7: library.importUri.path == 'meta/meta.dart');
Alexander Markov . unresolved

Should not be a special case - just add entry point pragmas for the RecordUse class in that library.

Daco Harkes

Unfortunately, that doesn't work. There are already package published out there without a pragma.

(Honestly, I don't think this annotation should be in a package, it should be in the SDK. But that's a different discussion to have.)

File pkg/vm/lib/transformations/type_flow/signature_shaking.dart
Line 229, Patchset 7: // `NativeCodeOracle.isMemberReferencedFromNativeCode`. This failed for the
Alexander Markov . resolved

Note that NativeCodeOracle collects all external uses by visiting AST and then provides a quick way to check if something is used externally. So instead of changing isMemberReferencedFromNativeCode consider modifying visit methods in `PragmaEntryPointsVisitor` to add corresponding classes and members to one of the sets in NativeCodeOracle.

Daco Harkes

Done

Line 233, Patchset 7: // `[@vm.unboxing-info.metadata=(i)->i]` to `[@vm.unboxing-info.metadata=[!regcc]]`.
Alexander Markov . resolved

This is not really a problem - it falls into the category of less optimizing classes and members which are recorded. There are going to be just a few of those, and not unboxing their parameters would not make any difference (they might not even have unboxable parameters).

As we discussed, ideally we should allow all optimizations (so record use does not affect the result in any way), we could just leave breadcrumbs about optimized out things (such as values of removed parameters) in order to list usages. But as long as we're not doing this, it's okay to have recorded members less optimized.

Daco Harkes

Done

File pkg/vm/lib/transformations/type_flow/transformer.dart
Line 2269, Patchset 7: // or not used by the VM in a way that requires the import.
Alexander Markov . resolved

Not sure I understand this comment. It's fine to mark RecordUse annotation as entry point and keep it if our implementation relies on it. It's fine to import it if it was previously imported.

The existing code does it another way by special casing it here, which is not needed.

Daco Harkes

Done

Line 2291, Patchset 7: // it stays as `class SomeClass`.
Alexander Markov . resolved

Ditto about less optimizing things which are being recorded.

Daco Harkes

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
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: Ia277d274046ac3b587732bc9cf853dce12427db9
Gerrit-Change-Number: 487360
Gerrit-PatchSet: 11
Gerrit-Owner: Daco Harkes <dacoh...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Daco Harkes <dacoh...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Comment-Date: Thu, 12 Mar 2026 18:53:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Markov <alexm...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages