Commit graph

83092 commits

Author SHA1 Message Date
pq 18afd94995 bump to linter 1.17.1
Change-Id: I6bb19fcda3ee3a093b75626e0668812026f7c548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-12-16 22:19:59 +00:00
Daco Harkes acdf82de17 [vm/ffi] ABI-specific integers
This CL adds support for users defining integers which are mapped to
differing sizes and signedness based on the application binary interface
the Dart VM is running on.

Notable implementation design decisions:
- ABIs are open world, so that adding an ABI to the Dart VM does not
  break existing definitions. Thus, we only figure out in the VM that
  we're missing a mapping. We throw compile-time errors.
  - In AOT, these show up in the precompilation step.
  - In JIT, these show up as `_CompileTimeError` at runtime. Note that
    these can be caught. So in subsequent compilation steps we need to
    ensure that we also throw the same compile-time error.
- We match on the call-sites (streaming_flowgraph_builder) rather than
  method bodies (kernel_to_il) of AbiSpecific loads and stores so that
  we can compile for the int-size of the call site.

API design decisions:
https://github.com/dart-lang/sdk/issues/42563#issuecomment-981774001

Closes: https://github.com/dart-lang/sdk/issues/42563

TEST=tests/ffi_2/abi_*_test.dart
TEST=tests/ffi/function_*_generated_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart
Change-Id: I8c8df36fab939b6fb614c5f1ee8e1bf46b6e9521
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,benchmark-linux-try,dart-sdk-linux-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-fuchsia-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64c-try,vm-kernel-mac-debug-x64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221501
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-12-16 22:07:00 +00:00
Alexander Markov b80e682cbf [vm] Introduce --target-unknown-cpu option and use it for app-jit snapshots
App-jit and core-jit snapshots generated on one machine can be copied to
another machine with different CPU family/model, so it is incorrect to
use CPU features of the host machine to generate code for snapshots.

This change adds --target-unknown-cpu option and enables it when
generating app-jit and core-jit snapshots in standalone Dart VM and
gen_snapshot.

Currently, this flag disables SSE4.1, popcnt and ABM on ia32 and x64,
and integer division instruction on ARM. Also, new flag enables
testing of roundsd instruction availability at run time on x64
(similarly to AOT).

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47907
Fixes https://github.com/flutter/flutter/issues/94181

Change-Id: Id28448052a21df4bae30b39e62b8532e55d4c901
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223960
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-12-16 21:33:49 +00:00
Jake Macdonald 8784f9682d Move macro apis to _fe_analyzer_shared from the language repo.
I could do a separate package if you think that would be better, but putting it here I think makes things simpler.

Change-Id: I4e62bc18dcd9d3bb84a7aceb8f4e2821c84d1361
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224280
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-12-16 19:10:21 +00:00
Riley Porter fc8a65d4c8 [dart:html] Add gap, rowGap, gridRowGap, and gridColumnGap properties.
Adds gap, rowGap, gridRowGap, and gridColumnGap CSS style properties.
The columnGap property was already included through WebKit.

Relevant bugs:
https://github.com/dart-lang/sdk/issues/46077
https://github.com/dart-lang/sdk/issues/45789


Verified properties are accessible with this `foo.dart` file:
https://paste.googleplex.com/6379738705690624
Loaded with ddb in Chrome:
https://screenshot.googleplex.com/9hN4MTCFxY5EYQn.png

Change-Id: Ia62807a6588cd0fd21b204a2a98a120fa4c4b07b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224500
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-12-16 18:47:11 +00:00
Sam Rawlins 6cde2fb662 DDS: Add missing returns to nullably-typed functions
Bug: https://github.com/dart-lang/sdk/issues/46656
Change-Id: I130903d6c009d60bcf3c1fee2378abb96c28714f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224381
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-12-16 18:43:09 +00:00
Ben Konyi 3657251778 Revert "[vm] Add analyze_snapshot tool for AOT snapshot inspection"
This reverts commit 19e5749308.

Reason for revert: Multiple configurations failing (https://github.com/dart-lang/sdk/issues/47950)

Original change's description:
> [vm] Add analyze_snapshot tool for AOT snapshot inspection
>
> Current skeleton to allow for instrumentation snapshots that can be
> built alongside Dart compilation artifacts and easily referenced for
> specific versions between Snapshot hash <-> DartSDK <-> Flutter Engine
>
> TEST=runtime/tests/vm/dart/analyze_snapshot_binary_test.dart
>
> Change-Id: Ie3757a265bbf457506c72fb62a625fea7bedcb68
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221087
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Slava Egorov <vegorov@google.com>

TBR=vegorov@google.com,cmevans@google.com

Change-Id: Iaaeeeba04ac3283d2df3db8155389db2b358b60a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224601
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-12-16 18:32:20 +00:00
Alexander Markov 1e2c40071b [vm/compiler] Handle yield continuations inside unreachable code
Previously, when concatenating two fragments of flow graph

  F1(entry1, end1)
  F2(entry2, end2)

we discarded F2 if F1 is closed. This is not correct
when F2 contains yield continuation point in the middle,
because later we add a branch targeting that continuation point,
making end2 reachable.

This change fixes concatenation of fragments to continue building
flow graph with the fragment

  F(entry1, end2)

even if F1 is closed (but we don't link end1 to entry2
in such case).

TEST=runtime/tests/vm/dart/regress_flutter66765_test.dart

Issue: https://github.com/flutter/flutter/issues/66765
Change-Id: I145cb4a8952e29665353688dccd232b3e9268878
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-12-16 17:52:29 +00:00
Konstantin Shcheglov 333192e8ff Share implementation for instantiating ExtensionElement(s) between analyzer and server.
Change-Id: I524f55a0ba6a4eb045a479ad3b53a314f3e1bf16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223741
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-12-16 17:41:18 +00:00
Danny Tuppeny 295aea1eda [analysis_server] Don't use Dart analysis driver to obtain LineInfos for non-Dart files
Change-Id: I80eead30caecf855385b5cc6c2cd7995de8a9349
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-12-16 16:42:49 +00:00
Paul Berry 64939f59b9 Rewrite element resolver tests using the new PubPackageResolutionTest style.
Using this style makes the tests more robust to refactoring the
analyzer, since the tests exercise the analyzer in end-to-end fashion.

Change-Id: I7038e542109cb6556f3db190d7a0e527f32e1788
Bug: https://github.com/dart-lang/sdk/issues/44522
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-12-16 16:18:39 +00:00
Chris Evans 19e5749308 [vm] Add analyze_snapshot tool for AOT snapshot inspection
Current skeleton to allow for instrumentation snapshots that can be
built alongside Dart compilation artifacts and easily referenced for
specific versions between Snapshot hash <-> DartSDK <-> Flutter Engine

TEST=runtime/tests/vm/dart/analyze_snapshot_binary_test.dart

Change-Id: Ie3757a265bbf457506c72fb62a625fea7bedcb68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221087
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-12-16 15:21:14 +00:00
Vyacheslav Egorov 2a963e7d9f [vm] Avoid random bytes in InstructionTable::Data
Make sure that the whole InstructionsTable::Data structure
is zeroed out before writing it out into the snapshot.

Otherwise we end up writing random garbage bytes into it which
makes AOT snapshot build bitwise unstable: running build twice
should produce bitwise equivalent snapshots but it does not.

Fixes https://github.com/dart-lang/sdk/issues/47949

TEST=vm/dart_2/use_save_debugging_info_flag_test on dartkp-win-release-x64

Bug: 47949
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-win-release-x64-try
Change-Id: I0475d617ebff6dff2f108e0d6338848f4668fba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224524
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-12-16 14:49:11 +00:00
Alexander Thomas 3208831c7e [infra] Upgrade checked-in SDKs to 2.15.1
Change-Id: Ib944f36313879941edb5f572d1d68770375eb590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224207
Reviewed-by: Jonas Termansen <sortie@google.com>
2021-12-16 11:52:49 +00:00
Vyacheslav Egorov 13d27d669d [vm] Improve Code cluster layout for startup
This change bakes binary search table which maps PC ranges
to corresponding stack maps and Code objects (if still present
in the snapshot) into RO data section of the snapshot - instead
of constructing it at load time.

This allows to considerably reduce amount of work done when
loading Code cluster for programs which have majority of their
Code objects discarded (i.e. in DWARF stack traces mode): as
we no longer write / read any information for discarded Code
objects.

This CL also changes program visitor to deduplicate Code objects
if their instructions are deduplicated in AOT mode. Only a single
Code object can be choose as a representative for the given
PC range so it does not make sense to write multiple Code objects
into the snapshot which refer to the same Instructions.

The overall improvement is hard to quantify but ReadProgramSnapshot
shows the following improvement when starting a large
Flutter application on a slow Android device:

  before  223.55±59.94 (192.02 .. 391.74) ms
  after   178.06±47.03 (151.31 .. 291.34) ms

This CL packs CompressedStackMaps next to the binary search table
itself allowing us to address them via offsets instead of
pointers.

Snapshot sizes are actually affected positively by this change. On
the same large Flutter application I see

  DWARF stack traces on:  -1.34% total SO size
  DWARF stack traces off: -1.63% total SO size

Issue https://github.com/dart-lang/sdk/issues/46116

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: Ic997045a33daa81ec68df462a0792915885df66b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220766
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-12-16 10:39:49 +00:00
Srujan Gaddam 7701bfb3e9 [pkg:js] Update CHANGELOG, README, and WORKAROUNDS
Updates documentation now that static interop features are
available. This should be the last component before the new
`package:js` version is published.

Change-Id: I9ddb494a5723036ca699bdcf10a000f7670cdfd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224401
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-12-16 03:11:57 +00:00
Liam Appelbe a9b33cfcd2 [vm] Change the encoding of token positions in the coverage array
The source report RPC needs to be able to distinguish branch coverage vs
normal coverage token positions. So encode normal positions as 2 * pos
and branch positions as 2 * pos + 1.

TEST=CI

Change-Id: I247796d1eb4c97947f9b38aa56bc318ecea09425
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224320
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2021-12-15 23:12:19 +00:00
Nate Bosch 9aedcb47b0 Update to the latest package:path
Change-Id: I8b663f073ae76bb941e0a8f70eaf4e3bdfc76039
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224083
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2021-12-15 23:04:45 +00:00
Sam Rawlins fe561449fe Fix breakage due to new three-word comment references
The breakage is due to this analyzer exception:

```
Unhandled exception:
type 'ConstructorReferenceImpl' is not a subtype of type 'Identifier' in type cast
```

I cannot figure out how to reproduce this in a unit test, but this patch fixes google3.

Bug: b/210848863
Change-Id: I8c340b6ff80d03d9493fdc481b8f17071ff969ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-12-15 23:03:46 +00:00
Ryan Macnak 4b2309c15a [standalone] Fix reuse of va_list in syslog_android.cc.
Also add some missing va_end.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/47939
Change-Id: Iadfbf72493d987dfb1d102922db1b353249a4728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224240
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-12-15 22:22:36 +00:00
Joshua Litt 59979dc973 [dart2js] Cleanup old holders code.
Change-Id: I5eafeb06cf2d6e32e9fdd1abee19ea18e1091ace
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221991
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-12-15 16:53:36 +00:00
Konstantin Shcheglov d09da53c11 Issue 47896. Evaluate ConditionalExpression with unknown condition to valid, but unknown.
Bug: https://github.com/dart-lang/sdk/issues/47896
Change-Id: I88e858046cfbd1e689fe6c1c758808c2ad72838d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224120
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-12-15 16:44:26 +00:00
Tess Strickland f9939de8b8 [gardening] Fix MSAN failure in assert.h.
The failure is within std::ostringstream without any obvious errors
on our side, but just appending to std::string instead should be
fine for a failure case.

TEST=vm/cc/IsolateReload_PendingUnqualifiedCall_StaticToInstance on MSAN trybot

Change-Id: I36e91c4ba4019856c709834d29ce9c4595e6a336
Cq-Include-Trybots: luci.dart.try:vm-kernel-msan-linux-release-x64-try
Bug: https://github.com/dart-lang/sdk/issues/47933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224200
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-12-15 13:49:56 +00:00
Johnni Winther 81ee883c98 [cfe] Separate entry-point read from imports/exports/parts
This separates the reading of entry-points, which do not have an
accessor library, from reading of imports, exports and parts, which must
have an access library.

This change also disallows access to platform private libraries, like
dart:_internal, as entry-points.

Change-Id: I017ca30231eb99dc8463266dca0973a02f6f0e30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223423
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-12-15 11:42:42 +00:00
Alexander Thomas 169f8e9f10 [infra] Upgrade gsutil to 5.5
Change-Id: Ida732167c7cbf7a8daec16220b7c3c4bc951dfa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223804
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-12-15 08:39:15 +00:00
Sam Rawlins cb78badbac analyzer: Prefer to doc-comment getters; refactor tests
Change-Id: I4f1660bd535e659193bac1953af6cf4701f79151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-12-15 05:41:05 +00:00
Ben Konyi 78b7fc5ac1 [ CLI / Gardening ] Wait for process to exit before cleaning up test
directory

Fixes https://github.com/dart-lang/sdk/issues/47700

Change-Id: Ifc0783409bdea308ba861f8021489ea8e58022c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224080
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-12-15 01:13:15 +00:00
Ben Konyi e3867c0512 [ Gardening ] Mark service tests as Slow for IA32 configurations
Fixes https://github.com/dart-lang/sdk/issues/47920

Fixed: 47920

TEST=N/A

Change-Id: I4cd05e0aaf8b257ecae2ee521b47b0028dd3c553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224081
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-12-15 00:04:30 +00:00
Sam Rawlins cb34251c5c Support for three-word references in Doc Comments
This expands the front_end's and analyzer's support for doc comment
references to include `/// [a.b.c]`. Such a reference must be to a
getter, setter, method, or constructor of a class or extension which
is referenced with an import prefix, such as `[async.Future.value]`.

In the existing support for two words, the two words are named
"prefix" and "token". In a three-word reference, the _first_ word
must be an import prefix, but I've chosen the new names,
"leadingPrefix", "prefix", and "token", to minimize the change.

If an improved change is desirable, considering the names from scratch,
I might choose something like "prefix", "container", and "identifier".
But these names will be applied to one-word and two-word references as
well, so `[async.Future]`, a reference to the Future class provided by
an import prefixed as 'async', would have a 'prefix' of null, a
'container' of 'async', and an identifier of 'Future'.

Bug: https://github.com/dart-lang/sdk/issues/47444
Change-Id: I7758ec16872677221c456dd1dd6dc2a4df0f6102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223661
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-12-14 23:51:10 +00:00
Liam Appelbe ac7bca37a8 [vm] Add an isolate group flag for branch coverage.
Branch coverage can't be enabled by a simple global flag, because this
causes problems when functions in an app-jit snapshot that didn't have
the flag enabled are compiled by a VM that has the flag enabled. In
particular, the coverage array will see a different set of token
positions, causing some important asserts to fail.

Change-Id: I35227252b5d271f20b01de99466c06708ec83ed8
TEST=CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223360
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2021-12-14 22:53:36 +00:00
Sam Rawlins 296167d3c9 Add flutter/gallery to flutter-analyze bot
Fixes https://github.com/dart-lang/sdk/issues/47527

Change-Id: I24a7b20f9756197a058eefd507dc139d19762642
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222660
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-12-14 22:38:45 +00:00
Alexander Aprelev 55f21df0c0 [build] Use flutter/engine rules for linking against atomic library.
Don't need to explicitly specify atomic library when using clang.

Fixes b/210496462
TEST=manual build, ci

Change-Id: I18d9e1f17541fad0a0bc28ab046bb79805c0da9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-12-14 22:20:05 +00:00
Liam Appelbe 53e64e2dc2 [vm] Return token position from BuildStatement.
Not every statement has a serialized position we can use for coverage.
For example, the otherwise part of an if statement doesn't have a
position. So for branch coverage, BuildStatement needs to return a token
position of the statement, so that we can pass it to the record coverage
instruction.

For example, if statement's otherwise fragment will look like this:

TokenPosition other_pos = TokenPosition::kNoSource;
Fragment otherwise_statement = BuildStatement(&other_pos);
otherwise_fragment += flow_graph_builder_->RecordCoverage(other_pos);
otherwise_fragment += otherwise_statement;

TEST=CI
Change-Id: Ibfb7b81bf0b98b12e850e60f565fcc0ced521f04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223900
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2021-12-14 21:50:44 +00:00
asiva 784ea0bed5 [VM / Test] Add an API test for sending external typed data to a native
port.

TEST=new test added.

Change-Id: I90dddb169bef0d36a94e15ece85e6b591d07927a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223720
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-12-14 21:37:35 +00:00
Ryan Macnak 5f45f9f46d [vm, compiler] Assume availability of VFP when targeting ARM32.
This is not implied by ARMv7 per se, but is implied by the Debian and Android ABIs.

TEST=ci
Change-Id: Ie838eeec0e7e2e7e64e29e9ad69338532df16cbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223740
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-12-14 20:05:55 +00:00
Konstantin Shcheglov e3e44ea410 Add which() for multi checks.
Change-Id: I07dff9db3c7870b8799477d949b23a45ba689130
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223920
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-12-14 19:31:35 +00:00
Chloe Stefantsova 2f7a1cef8e [cfe] Handle synthesized super initializers in super-parameters
Part of https://github.com/dart-lang/sdk/issues/47525

Change-Id: I768dce70465a77a94609af03b21c64d4bf4a1386
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223800
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-12-14 18:33:33 +00:00
Paul Berry 9ca2bcdcaf Use the full ResolverVisitor when testing ElementResolver and StaticTypeAnalyzer
I'm experimenting with refactoring some code in a way that changes the
interface between the ResolverVisitor and the two visitors that
invokes (ElementResolver and StaticTypeAnalyzer).  The division of
responsibility among these three classes is not very well-defined or
consistent due to their highly coupled nature and the fact that they
are always invoked in tandem.  This makes it difficult to refactor
them without causing churn on the ElementResolver and StaticAnalyzer
unit tests.

This change reduces the churn by changing the ElementResolver and
StaticAnalyzer unit tests to invoke the full ResolverVisitor; this
makes the interface among the three classes a fully private
implementation detail, so that we can adjust it without causing any
test breakages.

Change-Id: Ice4c0d98138e59bac52ed67eecf3ee535ca75e1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223141
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-12-14 18:30:54 +00:00
Ryan Macnak 98baaa0ee3 [vm, compiler] Add missing tests for ARM64 disassembly.
- Fix disassembly of 32-bit stxr/ldxr/stlr/ldar.
 - Add missing disassembly of rbit.
 - Use the standard names for arithmetic/logical ops with immediates.
 - Fix name of csel.
 - Fix operand ordering for conditional moves.
 - Add preferred disassembly 'ret lr' -> 'ret'.
 - Add preferred disassembly 'ands zr, a, b' -> 'tst a, b'.
 - Add preferred disassembly 'sub a, zr, b' -> 'neg a, b'.

Overall our disassembly is nearly the same as standard A64 disassembly, except we use a "w" suffix for 32-bit operations instead of using "w" versus "x" register names, and we use our own register names.

TEST=ci
Change-Id: Ifb4e587b5cc490beb4c6a09145149d95b09d412d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-12-14 18:17:34 +00:00
Konstantin Shcheglov c872cc38ea Issue 47915. Add more data to debug.
Bug: https://github.com/dart-lang/sdk/issues/47915
Change-Id: I726bc85a9459acbb4f6d94b9112bc808d7666a53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223743
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-12-14 17:57:39 +00:00
Joshua Litt 47646ff6c7 [dart2js] Avoid trimming entryLibrary from components.
Change-Id: I28d1c36279ed7407bb6a82d100bf062d327bc7d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-12-14 17:50:34 +00:00
Konstantin Shcheglov 7b31338938 Add isNotNull and isNull checks.
Change-Id: Ib8fb64e15dcc2458667d48cd6c86c83f6b45d25c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-12-14 17:11:34 +00:00
Sam Rawlins efe92fb822 front_end: Add null returns to functions with implicit returns and nullable return types
Bug: https://github.com/dart-lang/sdk/issues/46656
Change-Id: I2e0069460f9f63b7d985169656273a1c5ffd76d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223540
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-12-14 16:41:06 +00:00
asiva 0b7c7e09b0 [VM / Runtime] Fix GetLastErrorAsString to use the correct status on
Windows

TEST=cq

Bug:47911
Change-Id: I52184d34d8dc61a98416b3836cc994e3090b2f04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223742
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-12-14 16:27:44 +00:00
Alexander Thomas 81723904c8 [infra] Fix flutter-frontend
The third_party directory was removed in d45d838266

Change-Id: Ib487b801d7446a151b6a1f231e3761ef6158a73f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223801
Reviewed-by: William Hesse <whesse@google.com>
2021-12-14 12:21:04 +00:00
Alexander Thomas d2da75a5e0 [release] Add 2.15.1 to the changelog
Change-Id: I16329c5526533bde598c0557bf3d538b42e19046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223802
Reviewed-by: Michael Thomsen <mit@google.com>
2021-12-14 12:00:35 +00:00
Alexander Thomas baf56df325 [infra] Remove client directory
Change-Id: If4b76234e5b8988faef4ed4df66df7d7d6ec5638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223422
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-12-14 06:11:18 +00:00
Nicholas Shahan d33e94f1a7 [ddc] Migrate js_typerep libraries to null safety
Change-Id: I73a1f7da1c62bc12d832da7d22a5288425ee99aa
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223362
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-12-14 01:31:15 +00:00
Stephen Adams b628d00b00 [dart2js] Correct evaluation order of named arguments in redirecting/super initializers
Minor refactoring to share building the map from argument names to
compiled instructions.

Fixes #47047

Change-Id: I20b8d37673bd4cb18aa8b2091af79e40ec498370
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223381
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-12-14 00:27:24 +00:00
Nicholas Shahan 0868f39099 [ddc] Migrate js_interop library to null safety
Change-Id: Ic08b68dcc50e22826203efdc491f7d56dc95ec2b
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223363
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-12-14 00:23:54 +00:00