Should avoid exceptions as thrown in https://github.com/flutter/flutter/issues/138326
Only register source code if there is content in the byte array so we know when we should try to read from file. And when trying to read contents of a file for diagnostics, if we fail to read the file then fail gracefully by using position information.
Change-Id: Ic7e2bdcba0b093a48735aa26670509354f953861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336480
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Rather than emit a different node than what is expected (the Block rather than the enclosed statement), we can manually emit the necessary braces.
Change-Id: I0bf2a27a56828cb6d292479c73fdaec8f4072116
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Revisions updated by `dart tools/rev_sdk_deps.dart`.
lints (f58fd77..3810f8b):
3810f8b 2023-11-14 Devon Carew add a section on upgrading to the latest lint set to the readme (#171)
mockito (fcb9779..fb8a2b5):
fb8a2b5 2023-11-16 Kevin Moore No public description
2f41028 2023-11-16 Copybara-Service Merge pull request #719 from dart-lang:latest_lints
8b5036b 2023-11-16 Kevin Moore release later
ecc62f6 2023-11-16 Kevin Moore Update to the latest lints, require Dart 3.1, prepare release
dc3eb65 2023-11-15 Ilya Yanok Generate valid functions with optional non-nullable arguments
sse (8ddb95f..0f6ca11):
0f6ca11 2023-11-15 Kevin Moore Require Dart 3.2, use pkg:web (#92)
tools (2e36b8d..4649307):
4649307 2023-11-15 Elias Yishak Add terminal info to flutter command event (#204)
4e75286 2023-11-13 Devon Carew remove duplicate settings from analysis_options files (#201)
Change-Id: Ie0d8c1897e22ca04563bdc0320cf7485f6e63f7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336825
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
I also cleaned up a bunch of places that referred to them.
Change-Id: I45f68818c892f8620ea04257885ffa3763374bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335863
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Simplify the js_ast printer - it should not transform the program
while printing.
js_ast:
- Don't skip blocks containing a single statement.
- Don't rewrite arrow functions.
dart2js:
- Fix rewrite_async.dart to avoid a few singleton blocks.
- Static initializer thunks are transformed in arrow functions with expression bodies.
Change-Id: I4ab75c6ca7f580835a6c9d4eb45240d76df9d895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336820
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Ran against the code used in flutter customer_testing.
Change-Id: I330e528b3184c7a05ab34f9040a802dc06146b97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Create a _typedDataIndexCheck abstraction for the conditional throwing
of IndexError in TypedData indexing operations. Recognize that
abstraction in the inliner and replace it with the equivalent CheckBound
instruction.
Do the same for byte offset checking in ByteData operations.
TEST=vm/dart/typed_list_index_checkbound
Change-Id: Ia6c4a3b7ae4667af69aa5bf214d4f187557dac06
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-linux-debug-x64-try,vm-eager-optimization-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330800
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
The current `String.fromCharCodes` behavior, throwing if `start`
or `end` is larger than the length of the `charCodes` iterable,
is inconsistent with the argument being an `Iterable<int>`,
which the user is not expected to know the length of.
Most other operations that accepts or produces an `Iterable` and
restricts it to a range, will allow the range to exceed the length
of the iterable, acting like `.take(end).skip(start)`, just without
needing to create wrappers that hide the original value.
(`List.setRange` is another exception, and should probably be fixed
by allowing the range to be partially filled, since it's too hard
to change it to require a `List` argument.)
Fixes#50253, #53937
Tested: Added to `corelib/string_fromcharcodes_test.dart`
Bug: https://dartbug.com/53937, https://dartbug.com/50253, https://dartbug.com/23282
Change-Id: Ie19c5fa8e715ea1c58c9c77c247f2a563654c1aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333921
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
This is a reland of commit 6f29e7fce4
Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
TEST=Existing tests covers.
Change-Id: I384e77744c74774a250be413358a7fa176117167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332684
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
These were unintentionally removed in go/dart-reviews/335442.
Bug: b/310114753
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try
Change-Id: I55e69fdef0acfe68fe0ade92a20fbc296e09f3a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336900
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This should tidy up the last ones. 🤞
Sorry for the noise!
Change-Id: I7104fc33282184acb0c843eae6e73f6fcc77d892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336723
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This reverts commit 6027bcb1e2.
Reason for revert: We are seeing TSAN failures in the bot runs
Original change's description:
> Call tzset() before localtime_r().
>
> POSIX and glibc do not guarantee that tzset() is called by localtime_r(). tzset sets the timezone name, UTC offset and whether or not it is daylight savings time.
>
> Android <= 7.1.1 did *not* call tzset() in localtime_r(), which means that users will see their timezone as "GMT".
>
> macOS/iOS seem to guarantee that tzset() is called by localtime_r() but the wording is vague:
>
> localtime_r() and gmtime_r() functions provide the same functionality
> as localtime() and gmtime()...
>
> N.B.: localtime() is guaranteed to call tzset().
>
> tzset() must be called before each localtime_r() to catch the case where the user changes the timezone while the application is running.
>
> Bug:https://github.com/dart-lang/sdk/issues/53276
> Change-Id: I0503a0a109aa6c281c9a3aefe8ba0b54841a42a7
> Tested: manually tested on Android 7.1.1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336240
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Brian Quinlan <bquinlan@google.com>
Bug: https://github.com/dart-lang/sdk/issues/53276
Change-Id: I4bbadf2b69eeac583b7da605c0686bcc6f72081f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336721
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Also tests/language_2 (which hopefully we can delete soon).
Change-Id: I4c7086ecb1b374c2068be9d1366f76323435e57f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336624
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
I'm fairly sure the failing tests are recent breakages. I was only able
to break it without noticing because we didn't have adequate testing.
The next CL should fix the tests.
Change-Id: I69f5fde6e7cd2e872b2ffab38905467d366caa9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336625
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Adds tests to cover constant values flowing into `Handle` parameters
of `@Native external` functions.
The first test is a repro of the failure from
https://dart-review.googlesource.com/c/sdk/+/333840
The other tests construct more extreme cases.
Handles can't be passed to leaf functions, so no `isLeaf`.
Split off reland:
https://dart-review.googlesource.com/c/sdk/+/333841
TEST=tests/ffi/ffi_native_handles_test.dart
Change-Id: I89d31a940f5a63793a03a9eb364231a54164a328
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336661
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
This test would sometimes fail when trying to resume the main isolate in
the target program when it was not yet runnable. Waiting for the main
isolate to pause at start before resuming should fix this.
Change-Id: Ie242a222199a01e2c84d7c7be56376e616f9989e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336700
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
`_Closure` is the implementation class for function objects. When used
as a type, it translated to the same Wasm type as the `Function` type,
but in the type system it missed the special property of `Function`
that it is a supertype of all functions. Instead, it was translated
into an interface type, leading to incorrect type check results.
Thus, we must always use the `Function` type when referring to any
function.
The problem was hidden by the type check specialization for simple
interface type checks and exposed by `--verify-type-checks`.
Change-Id: I384d35506c0c8cd932ba789e977f8257e684b8d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336423
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Apart from improving the performance of type checks, this avoids type
checks inside type checks, which could lead to infinite recursion.
The recursion problem was hidden by the type check specialization for
simple interface type checks and exposed by `--verify-type-checks`.
Change-Id: Icbaebd6d68e6576a784fe3efaee81d4479adba5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336422
Reviewed-by: Ömer Ağacan <omersa@google.com>
This adds a `--verify-type-checks` option to dart2wasm to instrument
the code such that whenever we are able to generate specialized code
for a type check, we generate both the specialized code and also call
the general fallback path, then compare the results.
This can be used to expose bugs in the type check specializations, or
in the reference implementation, as it may be.
Change-Id: I081540a8eedc7d029b332919283810220b21b3ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336023
Reviewed-by: Ömer Ağacan <omersa@google.com>
In the current slow implementation of SIMD lists we can't check for
aliasing (as we don't know the storage type) and can't do `memmove`, so
for now we copy the iterable to a list before setting the elements.
Fixes#52979.
Change-Id: I2ebf69c6e0cef32b762cf9f35534d03fb9918f39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336363
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This adds support using experimental features in id testing in DDC and
uses it to add tests for scopes in extensions, extension types and
mixins.
The tests show that the DartScopeBuilder and DartScopeBuilder2 differ
on the scope on instance members in extensions and extension types for
the synthetic #this variable.
Change-Id: Iec0f3b938da567578b1245ada885370fb2a8b33f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335824
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Generated code for modulo is not as good as bitwise-and, even after
inlining modulo as we inline truncating division in [12e0690][1].
Bitwise-and saves 0.3% binary space in the TypedData benchmark. It
should also be faster.
[1]: 12e0690dfe
Change-Id: I4ebac592d7c93d0e81e8b28e789f671ce261780a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336361
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>