The new annotation is intended to be used on members of class, enum or mixin to opt out the @visibleForTemplate visibility restriction cascaded from class- / enum- / mixin- level.
1. Throw warning if the annotation is added to a invalid target.
2. Update @visibleForTemplate diagnostics logic to opt out members annotated with @visibleOutsideTemplate.
Change-Id: Iec546fc7785cd45f39a1b2a2cc8849ef1cf9d04a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304825
Reviewed-by: Marya Belanger <mbelanger@google.com>
Auto-Submit: Ludi Zhan <ludizhan@google.com>
Commit-Queue: Ludi Zhan <ludizhan@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
`continue` in `switch` statements need to be compiled the same way as
normal `continue`/`break` to run finalizers between the jump target and
the `continue`.
New passing test: co19/Language/Statements/Continue/async_loops_t10
Change-Id: I0cdff74b8b296691c8a90404b424487b00343427
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307780
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`.
dartdoc (449478c..2a39574):
2a395741 2023-06-07 Sam Rawlins Seal mustachio nodes (#3433)
d5bb24b2 2023-06-07 Sam Rawlins Convert Tuples to Records and split a helper out from findCanonicalModelElementFor (#3432)
http_parser (1ef3e56..19466c0):
19466c0 2023-06-07 Kevin Moore Require Dart 3.0, update lints (#74)
leak_tracker (f17da61..fc45bec):
fc45bec 2023-06-07 Polina Cherkasova Break the leak tracker code to packages. (#80)
path (f8d15c2..592505f):
592505f 2023-06-07 Kevin Moore Require Dart 3.0, update lints (#146)
pool (a10a0f9..c6b1b2c):
c6b1b2c 2023-06-07 Kevin Moore Require Dart 3.0, update lints (#71)
term_glyph (9d8956f..4daa34e):
4daa34e 2023-06-07 Kevin Moore Require Dart 3.0, update lints (#39)
typed_data (693f48e..8d29573):
8d29573 2023-06-07 Kevin Moore Require Dart 3.0, update lints (#67)
Change-Id: I11fe765858ba970f13a2051abee34abf910f4698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308161
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
We are using `epoll()` in edge-triggerred mode, which requires
us to hit `EAGAIN` on `write()` before we are guaranteed
to receive an `EPOLLOUT` event.
`_SocketStreamConsumer` looks at `_NativeSocket.writeAvailable`
after issuing a `write` to decide whether it should continue
writing or pause and wait until event handler sends us `writeEvent`.
However we did not previously set `writeAvailable` to `true` until
the first `writeEvent` arrived, which lead to a hang on some
Linux servers: we would write a small amount of bytes into a pipe
and then wait for `writeEvent`, which would never come, as `epoll()`
is only guaranteed to wake up with `EPOLLOUT` if we hit `EAGAIN`
on `write()`.
This CL also changes `_NativeSocket.nativeWrite` implementation
to write bytes into the file descriptor until it gets EAGAIN.
This reduces the number of roundtrips between Dart and
native.
Unfortunately this CL does not come with a regression test
because it is relying on concrete `epoll()` behaviour and it this
behaviour does not reproduce for me.
TEST=Tested manually on the affected servers.
FIXED=b/286346121
Fixed: 286346121
Change-Id: I37fef9aa12b1da724b035aa9577b414a8057217e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308101
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Also remove the '<anonymous signature>' check, since we stopped
generating function objects for function types before the current
minimum SDK version for the package.
Change-Id: I47c0522ae4ba778221ee98f93fdae8c22a57d688
Bug: https://github.com/flutter/flutter/issues/128402
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307860
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
The frontend is now run with sound null safety so these are no longer needed.
TEST=existing
Change-Id: I6c1776845854695ff34e310a3bb5bc9d86715f06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307901
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This fixes pkg/front_end/test/compile_dart2js_with_no_sdk_test.dart which
failed with a non-null check error in exhaustiveness checking because
all enums where generating invalid constants.
Closes https://github.com/dart-lang/sdk/issues/52474
Change-Id: I817dd44324104242cff50a7239231ec3ad550d26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307900
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This replaces the RedirectingFactoryBody with a dedicated
RedirectingFactoryTarget object on FunctionNode.
TEST=existing
Change-Id: I3cc8b9f8abf938c6d60fdbc91b1f4210686fc359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307082
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Running the check for whether to prompt about "dart fix" in the LSP server with the whole Flutter repo open took around 45s before, and around 0.45s after. Almost all time was spent resolving libraries but now resolution is skipped for any libraries that don't contain fixable errors.
In my testing, "dart fix" (from source) didn't see any significant gains (around 46s down to around 43s for flutter/packages/flutter in my testing).
Fixes https://github.com/dart-lang/sdk/issues/52633
Change-Id: I0db63f5d54c7c262fe16aeb825f817cf526199c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit 6c3c34560e.
Reason for revert: We will put the proto bindings in a separate package to prevent introducing new transitive dependencies into package:flutter.
Original change's description:
> [VM/Service] Add code for working with Perfetto protos to package:vm_service
>
> TEST=get_perfetto_vm_timeline_rpc_test and
> get_perfetto_cpu_samples_rpc_test
>
> Change-Id: I23a30629f1d7a8cd7e2c9daad2d02fae4decb338
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302421
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>
Change-Id: I3bd9ce8a09e131271f76fe46ca92288f888d6147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307968
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
ConstantEvaluator.isSubtype contains special logic to handle JS number subtyping. It then delegates any recursive subtype checking to TypeEnvironment.isSubtypeOf. TypeEnvironment.isSubtypeOf is not aware of the JS context and has no special logic for JS numbers. This leads to inconsistent behavior when numbers are nested in records. The special number logic is never applied to those nested types.
Fixes: https://github.com/dart-lang/sdk/issues/52619
Change-Id: I72c64bb0544aea79bd83bc589abdda96c851525c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307720
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
- More expensive sweeping that will also slow down the mutator from more TLB invalidation
- Might cause OOM sooner from PTE fragmentation
- Won't decrease the Dart heap capacity stat
- Unclear how often holes are at least page sized
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52571
Change-Id: I54011e451bf0ad21859c11023d1c4123cc0fa435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306902
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Fixes 'member not found' issues arising from accessing default type arguments from JS literals.
Change-Id: I7cdfddcd70ee42a2941c8cb666570e161077281b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307513
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Currently when the user configures a Dart CLI program to be run in the terminal, we ask VS Code to launch it in the terminal before we respond to the launch request. This (depending on settings) can cause VS Code to show the terminal and then switch to the Debug Console (which is both confusing and frustrating for users that opt-in to do this to access stdin of the terminal process).
This change reverses the order when using `runInTerminal` so that `launch` is responded to first.
See https://github.com/microsoft/vscode/issues/168295
Fixes https://github.com/Dart-Code/Dart-Code/issues/4287
Change-Id: If9a221361cc3329fb86fb17ba532043266b3438c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307481
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Non-strict mode static interop can still use initializers on types
like String. We should warn in this case so users don't think that
the initializers will be used with invocation-level lowering. Note
that strict mode does not need to worry about this as JS types can
not have a const initializer.
TEST=Manual as our static error checking doesn't handle warnings.
Change-Id: I4e2eeda35ca82b86adf75f6eaf069764b3c13ae7
Change-Id: Ic23bd69e652ff4f083157021777d9cf46f4a7f7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307512
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Specification of inline classes has the following rule for
closurization (tear-off creation) of inline class members:
> The operator == of the closurization returns true if and only if
> the operand is the same object.
This means that each time tear-off is taken, a new closure should be
created which compares equal only to itself. This is true iff that
closure has a non-empty context which captures 'this'.
Signature shaking can remove 'this' parameter if it is not used
and this affects equality of the tear-offs of inline class members.
This change prevents that by marking 'this' parameter of inline
class members as checked.
TEST=co19/LanguageFeatures/Inline-classes/dynamic_semantics_member_invocation_A02_t03
TEST=co19/LanguageFeatures/Inline-classes/dynamic_semantics_member_invocation_A03_t03
Issue: https://github.com/dart-lang/sdk/issues/49737
Change-Id: I4cf4f5afdb6c83a1b1eccf587cafcf9a9ca5178a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307665
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Make the free and allocated lists simply linked lists of `Metadata*`
(instead of `Metadata*` pointing to Trampoline, which - via some
logic - can be translated into next `Metadata*`).
Make the layout of the virtual address space mapping and
offsets `constexpr` functions instead of computing them at
runtime & caching in fields.
Use `uword` to represent `Trampoline` entrypoint (as we generally
use `uword` for `Code.EntryPoint()` / ...)
TEST=ci
Change-Id: If4ffa11712acc46c9295b609caff7576d2354fe4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305983
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
On Windows `_NativeSocket.nativeWrite` returning to caller does
not mean that the data was flushed into OS buffer. Overlapped
operation might still be in progress - and it will be cancelled
with data loss if we close the handle.
This means _SocketStreamConsumer should take such pending writes
into account and not issue `done` event until pending write
completes.
This change prevents data loss when communicating with
subprocesses on Windows. Previously even doing
`await process.stdin.flush()` would not guarantee data
delivery.
Fixes https://github.com/dart-lang/sdk/issues/50904
TEST=tests/standalone/io/regress_50904_test.dart
Cq-Include-Trybots: luci.dart.try:vm-win-release-x64-try,vm-win-debug-x64-try,pkg-win-release-try
Change-Id: I13ab2cc3ce45f1ff8cb3183884d26bbb2b72f7ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307043
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Currently setting exception variables in `catch` blocks assumes that the
variables are not captured and always creates a new local for the
variable.
This CL adds a new function for initializing a variables. The
implementation is similar to `VariableDeclration` visitor and handles
captured (updated or not updated) and non-captured variables. This
function is then used in `catch` blocks to initialize exception and
stack trace variables.
New passing tests:
- co19/LibTest/async/Zone/handleUncaughtError_A01_t04
- lib/async/future_test
Fixes#52556.
Change-Id: I428d8f30ab1509b5b4439f8136190134741dd4ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307042
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This annotation is unneeded as named arg external constructors
is enough to determine if an object literal is created. The one
exception is an empty object literal, but our guidance is to use
utility functions to create one instead. This is a better fit for
that purpose too as an interface for an empty object literal is
more uncommon.
CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I10cf891601b28ff7e56129842d099ea28863626d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307506
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Moved a test from `constant_test.dart` to slowly migrate it over.
Change-Id: Id7d0ef0edcfa4fced056ec8fc937b060a74f4468
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306919
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>