`_checkIndex` was returning dynamic.
And it was missing for `PointerArray`.
Bug: https://github.com/dart-lang/sdk/issues/54379
TEST=tests/ffi/inline_array_test.dart
Change-Id: I148545e50463e89fb3a884757ef92444addefc61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345000
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This reverts commit 717ce7a69c.
Reason for revert: breaking Google3
Original change's description:
> options map support scaffolding in driver
>
> Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.
>
> That said a few pointers would be handy. Notably, this change:
>
> * introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
> * this is currently public but will be private once driver is more evolved to accommodate multiple options files
> * removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
> * removes context_builder and collection v2 experiments (and tests)
> * I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain
>
> This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).
>
>
>
> Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
Change-Id: Ia988c5c9cd328d0adce3d8e6ff019e389819a957
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344960
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
The Angular plugin does not exist anymore.
I don't see any use of this class in google3.
So, probably we can remove it.
Change-Id: Ied6b81d4d467e21be22c11fc53ecedd7f1c5b6a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344901
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.
Some other tidying in the test file:
* inline `byteStorePath`, only used once.
* simplify `_packagesFileContent` and `_getPackagesFileContent`
into a static getter.
* simplify `_defaultPluginContent` into a const String, so it can
be used as a function parameter default value
The diff is way bigger than the functional changes, because we sort
elements.
Change-Id: I193316316750e80268b684fdc1abe558a77994fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The former waits for the test to complete while the latter does
not. Testing this on d8 uncovered two issues which are also
addressed in this CL:
1. async_test has a Promise that is rejected before it is handled.
2. Tests that use Promises don't work correctly on dart2js + d8,
and are therefore skipped for now until the issue is resolved.
Change-Id: I1fac1f4c653bb9ee30ed683d1b0d11bfbf14a58c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343682
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.
That said a few pointers would be handy. Notably, this change:
* introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
* this is currently public but will be private once driver is more evolved to accommodate multiple options files
* removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
* removes context_builder and collection v2 experiments (and tests)
* I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain
This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).
Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
When a const list access does not have a const argument, fall back to
normal compilation. TFA optimizes const list accesses to direct calls to
`_ListBase.[]`, so the code generated by the intrinsic handler is not
any better, and the generated code in the intrinsic handler does not do
bounds check.
Fixes test standalone/array_bounds_check_generalization_test.
Change-Id: I6455826815c22a731bb830aec08b8bdd701e0d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344820
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reverts vm_service major version bump (13 -> 14) from 3.1.1, but is
otherwise identical to 3.1.2.
Change-Id: I9e6595a4a4565586284d7ab4601fd9e49711d87d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344760
Reviewed-by: Christopher Fujino <fujino@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This code appears redundant. It was adding contexts to the declarations tracker as contexts changed, but this was also being done once at the end (in the method "addContextsToDeclarationsTracker" mentioned in the comment).
Apparently at some point I added a TODO suspecting this was unnecessary but didn't realise the performance implications of it on a large project.
There are existing tests that ensure the declarations are tracked correctly (although we don't use them for completions, they're still used to resolve macros in dartdocs).
See https://github.com/dart-lang/sdk/issues/54513
Change-Id: Ibdb7d00c288e78fc44c48a4f9febff688e2db323
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Prior to this change, both `_scheduleContextFiles` and `_findPackages()` would enumerate `_analysisContext.contextRoot.analyzedFiles()`. This is an Iterable that calls `getResource()` for every item so on large folders showed up on the profile:
https://github.com/dart-lang/sdk/issues/54513#issuecomment-1877065904
This change combines them into a single method so we iterate only once.
It does slightly change the order of things (SDK files were previously scheduled before packages), but the only alternative I have is to add `toList()` but that will need to allocate (and repeatedly grow) a list which I suspect is overall worse.
Other than the order, there should be no functional changes here - I moved the body of `_scheduleContextFiles` into `_findPackages()` and renamed it (which unfortunately doesn't diff nicely because it moved in the file).
See https://github.com/dart-lang/sdk/issues/54513
Change-Id: I2a5539a93ee8ca2cdbad031efcfc9bbaf23e9ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Do not revert: The main channel version must be upgraded now that the
version 3.3 beta has been cut and reverting this change puts the
release infrastructure into an unsupported state. Please fix forward
any potential problems that occur downstream and loop me into the
discussions so we can improve the release procedures in the future.
Change-Id: I8706c3d74fe0474d34a99c5cbbb8e9a88b586cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329902
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
If a static field or getter is annotated with
@pragma("vm:platform-const-if", <cond>) and <cond> const evaluates
to true, then uses of the static field or getter are const evaluated
when a target operating system is available. If <cond> const evaluates
to any other value, then the annotation is ignored.
For example, when runtime-only code is guarded like the following,
using Flutter's kDebugMode constant, then debug mode Flutter programs
can alter the defaultTargetPlatform for testing, but in release mode,
the defaultTargetPlatform getter is const evaluated and code guarded
with defaultTargetPlatform checks can be eliminated if unreachable:
@pragma("vm:platform-const-if", !kDebugMode)
TargetPlatform get defaultTargetPlatform {
...
assert(() {
if (Platform.environment.containsKey('FLUTTER_TEST')) {
result = TestPlatform.android;
}
return true;
}());
if (kDebugMode &&
platform.debugDefaultTargetPlatformOverride != null) {
result = platform.debugDefaultTargetPlatformOverride;
}
...
}
TEST=pkg/vm/test/transformations/vm_constant_evaluator
Change-Id: I55b88502a908c56cf42a761dd06741f15c8a23d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333220
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Not sure if there's a good reason to keep this as `resolve2` since there's no simpler `resolve` to be found. If there is, please let me know and I can revert this and add a doc to `resolve2` for clarification.
Change-Id: I67c3825e9db95ec3f3c618f08664ed655394c041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
The documentation uses (or will use) 'lower_case_with_underscore', so
the messages should match. Also updated a comment.
Change-Id: Id424045c1b000929f783ce781307ded9f7c36bab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344500
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
I noticed a race while running from source today.. If you run a Dart CLI app we add --pause-isolates-on-exit to allow sending async output events before exiting, then we resume.
The stopped event is still propagated to the client (since there can be a delay between the stop and the resume while we wait for output events) and the client may ask for a StackTrace. If this arrives just after we resume the isolate, we would generate an error that could be shown to the user.
This adds a check that the thread ID is really invalid before throwing an error, and if it's valid (eg. it belongs to an earlier isolate) we just return an empty stack trace instead of an error.
Fixes https://github.com/Dart-Code/Dart-Code/issues/4907
Change-Id: I0a3241ffd634acea49b4d1dc7b3cd6b6b1c8d2d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342585
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
We accidentally started showing the stack traces in all errors rendered in VS Code. This changes the format of the message to not include the stack - although it keeps it in the payload to aid debugging when capturing logs.
It also slightly tweaks the error message for global eval to be less cryptic for VS Code.
Fixes https://github.com/Dart-Code/Dart-Code/issues/4899
Change-Id: Id4a0c4e6ef26065059e3becec62bab5d873e7be3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342621
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Consistently use file URIs when populating the `resources.json` file rather than converting them to platform-specific file paths.
Fixes https://github.com/dart-lang/sdk/issues/54129
TEST=Fix covered by existing test when ran on Windows.
Bug: https://github.com/dart-lang/sdk/issues/54129
Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,pkg-win-release-try,pkg-linux-release-try
Change-Id: Ie18f8c4ab93e25a4ccd5b1532f1786959e808ae9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343360
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This reverts commit a7e1e26446.
Reason for revert: https://github.com/flutter/flutter/issues/140881
Original change's description:
> [linter] Account for new JS interop libraries in 'avoid_web_libraries_in_flutter'
>
> Users are going to begin interacting with the DOM and JS through these libraries more and more.
>
> To avoid new warnings later on, let's account for them as soon as possible.
>
> Change-Id: Ib86e00aeb4bf42f13e104c1b68910195737667d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343700
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Auto-Submit: Parker Lougheed <parlough@gmail.com>
Change-Id: I6b3ec89ab18aa5d6a3bce43355025808256240d6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344560
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
While I was trying to better understand the implementation in this file I got confused by the unused IsConstant function. So this CL removes it and some other unused code.
TEST=ci
Change-Id: Ie8953cbb0db04c65cb15ad613fa50f738d4e804a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This use of JS returns the value with the opposite sign of what it should be (in Dart). This is because Dart uses the difference between local time and UTC, while JS uses the opposite.
Also updates the test for this to also accept the longer style of timezone names as that is what Chrome and d8 on my mac are returning. I'm assuming that's why this wasn't caught earlier.
Fixes https://github.com/dart-lang/sdk/issues/54448
CoreLibraryReviewExempt: Specific to dart2wasm backend
Bug: https://github.com/dart-lang/sdk/issues/54448
Change-Id: I54ab721fa33ef638ccd158d08738ca68273a790b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343520
Reviewed-by: Ömer Ağacan <omersa@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
To prevent breaking things on older SDKs when users chose to migrate.
CoreLibraryReviewExempt: VM & WASM only. Only adding an annotation.
Bug: https://github.com/dart-lang/sdk/issues/54250
Change-Id: Id026e34e78527117c571aa118445cd73b16f9a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344022
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Closes https://github.com/dart-lang/sdk/issues/52852
Allows importing of modules using the JS "import()" expression.
The result is a promise that resolves to a module, from which users
can then access exported members from.
CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I4c1caae689be55d1dbb038448e3243bcb80ac8b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343683
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>