In addition, with sound null safety there is no difference in subtyping
semantic between 'is' and 'as' type checks, so SubtypeTestKind is also
removed.
TEST=ci
Change-Id: Id75ef6a93b115c44b844ef0a32dc8dca5cc61861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382900
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
* Inline small `get iterator` & `get current` iterator methods
* Inline bodies that are small compared to arguments
* Make AST node counter more precise
* Manually mark ListIterator methods as prefer inline
CoreLibraryReviewExempt: Only adds annotation to existing functions
Change-Id: Ib6379e73713cd47a88e5cc67cecd4b5c8344adcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382882
Reviewed-by: Slava Egorov <vegorov@google.com>
It used `ObjectVisitor` to peak into constant objects. The visitor
called `AddConstObject` directly while keeping raw pointers around.
This is unsafe because `AddConstObject` can cause GC for several
different reasons - which would potentially invalidate those raw
pointers.
I have added `NoSafepointScope` around `VisitPointers` but this
does not actually easily reveal the bug because allocations are
really sporadic and often require to be running in PRODUCT mode
to trigger corresponding code path. Unfortunately we don't have
any existing infrastructure to catch "allocation from unsafe
place" which works across all build modes and catches even
situations where allocation can _potentially_ happen.
Fixes https://github.com/flutter/flutter/issues/153358
TEST=manually with a reproduction provided by internal user.
R=kustermann@google.com
Change-Id: I0c9e14a137b1f8ac749443d80f6904f1e9b20ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382883
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This removes usages of makeListFixedLength/makeFixedListUnmodifiable
in wasm core library implementation.
Furthermore we establish a guarantee that the backing store of
fixed length lists (modifiable or unmodifiable) always has the same
size as the actual list (and not larger).
This in return allows the fixed length iterators to not need a separate
length to track, as the backing WasmArray<Object?>'s length is
sufficient.
Change-Id: I1fe44781c6044187a3a129615a5065f08dfc53a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382860
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
With sound null safety front-end guarantees that all logical
expressions have a non-nullable bool type, so legacy AssertBoolean
checks are no longer needed and can be removed.
TEST=ci
Change-Id: If952da7bd0ac83c43de3e5d98845c5e5d8d29f6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382744
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This is the core implementation of the "plugin server" that will support the API described at https://docs.google.com/document/d/1T8P323DJxsc3YPzveNIaSKWFkrJp9ydTR4jp_XFb7XQ/edit?resourcekey=0-f8Ue29KMUizqXNGhATp1tg#heading=h.23fjh5hfm2is
This is heavily curbed from the ServerPlugin class at
`package:analyzer_plugin/plugin/plugin.dart`, but does not depend on it.
It depends on two concepts from the analyzer_plugin package: (1) the
protocol used for de/serializing requests, responses, etc. And (2) the
`PluginCommunicationChannel` class. This is also just a utility for
communicating between the analysis server and the plugin server.
This plugin server is capable of "registering" individual "plugins",
which allows plugins to register individual (maybe multiple) lint rules,
and individual (maybe multiple) quick fixes.
The plugin server for now only responds essentially to three requests:
* `ANALYSIS_REQUEST_SET_CONTEXT_ROOTS`
* `EDIT_REQUEST_GET_FIXES`
* `PLUGIN_REQUEST_VERSION_CHECK`
All files are analyzed during `handleAnalysisSetContextRoots`, and
quick fixes are calculated during `handleEditGetFixes`.
There are many TODOs, but the included test shows that this plugin
server can notify the analysis server of lint diagnostics to be
reported, and can respond to a query for quick fixes.
Change-Id: Ibc93332319220a2caf49d20ab480940041a15049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
service/get_object_rpc_test was failing because one ID in it hadn't been
updated to the new format.
service/bad_reload_test was failing because `ServiceEvent::PrintJSON`
was attempting to populate the `reloadError` property of every `Event`
of kind `IsolateReload` with an `@Error`, but it was not possible to
allocate IDs for these `@Error`s because `ReloadSources` runs for an
isolate group, not for an individual isolate. I fixed this by removing
the `reloadError` property and adding a `reloadFailureReason` property
with type `string`.
TEST=confirmed that service/bad_reload_test and
service/get_object_rpc_test complete successfully on a local build of
the linux-debug-x64 SDK, vm-linux-debug-x64 tryjob
Issue: https://github.com/dart-lang/sdk/issues/55869
Change-Id: Ibf507aa0e475a6b9bed42b055e9d19b54aa81844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382661
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
* Make dynamic module entry point fully compatible to script main
function (allow taking optional parameters and up to 2 arguments).
* Fix reading of function types within generic members.
* Add crashing tests to status files to avoid generation of
core dumps on the bots.
TEST=ci (vm-aot-dyn-linux-debug-x64)
Change-Id: Ibe8651ca13734101f2df2c8634f70ebf421dccef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382640
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
* Use AllocateClosure instruction for closure instantiations in order
to initialize closure entry point.
* Fix null handling in operator== to be before argument type checks.
* Add _InvocationMirror._withType to dynamic interface as it is
implicitly used by noSuchMethod forwarders.
* Fix AssertAssignable for null objects.
TEST=language tests in vm-aot-dyn-linux-debug-x64 configuration
Change-Id: I7b1a037d4fde4d22ed32969e0f099b31ea4432ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382500
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Assembler::AddressCanHoldConstantIndex, which is used by
MakeLocationSummary to determine whether to keep the index constant or
to allocate a register for it, performs the check:
const int64_t disp =
index * index_scale +
(is_external ? 0 : target::Instance::DataOffsetFor(cid) - kHeapObjectTag);
return Utils::IsInt(32, disp);
However, in Assembler::ElementAddressForIntIndex, used by EmitNativeCode to
produce an appropriate Address for the constant index, the code performs
a slightly different check:
const int64_t disp = static_cast<int64_t>(index) * index_scale +
target::Instance::DataOffsetFor(cid);
ASSERT(Utils::IsInt(32, disp));
return FieldAddress(array, static_cast<int32_t>(disp));
Thus, if a constant index produces the displacement kMaxInt32 + 1,
MakeLocationSummary will appropriately keep the index as a constant, but
the ASSERT in ElementAddressForIntIndex will trigger.
Modify ElementAddressForIntIndex in the X64 and IA32 assemblers so that
the same displacement is checked in both places.
TEST=vm/cc/IRTest_Regress_56588
Fixes: https://github.com/dart-lang/sdk/issues/56588
Change-Id: I504d6f92230540d74409a99b64b444acdb9c85f7
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382801
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Brand types encode an integer as a struct type and allow us to break the equivalence relation between similar types in different rec groups.
We now compute equivalence classes at the rec group level reducing the number of brand types we have to assign.
We also improves the equivalence class computation by exiting earlier when a group/type is found to be part of an equivalence class. This is enough information to tell us which brand type it needs so we can exit the inner loop early.
Change-Id: I8c5e1cfc679f1fcb6b7f0e79bd71719f345784d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381960
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This new flag uses a new algorithm to generate the module's type section. The new algorithm is able to produce smaller type sections reducing the overall size of the wasm binary.
For flute.complex at -O4 using this flag produced a wasm file 2.5% smaller.
Change-Id: Iaa7905174c496d637dc3d8d4533df6fd6f056597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382462
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Unsharded tests have access to the buildtools/ directory, but cannot
find it. This is used in the dart-lang/native tests which are rolled
in to the Dart SDK.
Before this CL we already had the c compiler, linker, and archiver
available in environment vars. This CL extends that pattern to also
provide the paths to common utilities that come with the c compiler.
Change-Id: Ie254da729211865e7a7e5c3c9c8a7e147fe71553
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382560
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This CL primarily adds a lint for fields with `StackTrace.current`
which is often useful for debugging, but shouldn't be left in.
* Add an ast visitor after the "explicit creation test",
finding - for now - `StackTrace.current` calls in fields.
This should have caught the left-in debug such in
https://dart-review.googlesource.com/c/sdk/+/379281.
* Renamed explicit_creation to compile_and_lint
* Remove (for some time) unused "smoke_test_quick" files.
* Add kernel to the compile_and_lint suite, but ignore it for explicit
creation (i.e. kernel will also be checked for fields
with `StackTrace.current`).
Change-Id: Ib886d23a8945e7063dc673a7f99cbb3a6adc1139
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382361
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Also add a SignedBitField alias so that sign extended BitFields can
be declared with default positions and/or sizes.
TEST=ci
Change-Id: I46bf7f9e378e0f20e7f2e4b4e7ed3e242946d9bb
Cq-Include-Trybots: luci.dart.try:vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-linux-release-x64-try,vm-aot-mac-release-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-win-release-arm64-try,vm-aot-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382404
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>