Add annotation-based creation location tracking

Closes https://github.com/dart-lang/sdk/pull/63011

GitOrigin-RevId: 926534c2f5d3cd1e9629cf25f6b028ab34c00e64
Change-Id: I88460a060faabeae8f611e88f23b2eb5fc99f21a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491702
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
Kilian Schulte
2026-04-28 03:06:03 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent efff5f70c1
commit 9e8fdef17c
58 changed files with 1851 additions and 205 deletions
+1
View File
@@ -23,6 +23,7 @@ These pragmas are part of the VM's API and are safe for use in external code.
| `vm:align-loops` | Tells compiler to align all loop headers inside the function to an architecture specific boundary: currently 32 bytes on X64 and ARM64 (except Apple Silicon, which explicitly discourages aligning branch targets) |
| `vm:no-sanitize-thread` | Disable ThreadSanitizer instrumentation |
| `external-effect` | Declares a static method which will be treated as live code when performing any analysis of the program. The call itself (and its arguments) are then dropped from the running program.
| `track-creation-locations` | Marks a class, instances of which should have their creation locations tracked. Tracked creation locations are stored in a private field of the class and can be accessed through the `CreationLocation.of(object)` method in `dart:developer`. |
## Unsafe pragmas for general use