Commit graph

19978 commits

Author SHA1 Message Date
Johnni Winther 818ec6db92 [cfe] Implement nnbd-top-merge
+ and use nnbd-top-merge and legacy erasure in hierarchy computation

Change-Id: I4bf06ce8d3c68a9926865ebf84b24b4029828d73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128065
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-12-13 17:19:59 +00:00
Zichang Guo c0d88da496 Revert "[dart:io] RawSocketOption.fromInt should follow the same endian as host"
This reverts commit d30be47a20.

Reason for revert: raw_datagram_socket_test failed on Mac.
https://github.com/dart-lang/sdk/issues/39782.

Original change's description:
> [dart:io] RawSocketOption.fromInt should follow the same endian as host
> 
> fromInt() uses Endian.big by default. It should be synchronized with Endian.host.
> The testDatagramSocketNulticastIf inside raw_datagram_socket_test doesn't actually run.
> 
> Bug: https://github.com/dart-lang/sdk/issues/39691
> Change-Id: I1078b643e3d8f964e1ae9cbbe03628f7de7ae487
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127489
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

TBR=asiva@google.com,zichangguo@google.com

Change-Id: I7a59e54eb3f6758e2277f583656758ea06ef2364
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/39691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128420
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-12-13 16:06:18 +00:00
Teagan Strickland 5824d3ed53 [vm] Weaken dwarf_stack_trace expected stack trace.
We only check the expected stack starting from the call to
foo in main, so we no longer depend on what is captured in
the stacktrace for how main is invoked.

Also removes the old status lines for this test, which are no
longer applicable, and cleans up the documentation a little.

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

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try
Change-Id: I61f0465dcd55d090c49db9c6af503ae9c0df6313
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128401
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-12-13 12:09:38 +00:00
Srujan Gaddam a5caa5222d Skip all html tests for d8
Bug:N/A
Change-Id: I39bccf7c6272830f8d6db52b1ea027fdb1d4c35f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128109
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-13 00:24:36 +00:00
Zichang Guo d30be47a20 [dart:io] RawSocketOption.fromInt should follow the same endian as host
fromInt() uses Endian.big by default. It should be synchronized with Endian.host.
The testDatagramSocketNulticastIf inside raw_datagram_socket_test doesn't actually run.

Bug: https://github.com/dart-lang/sdk/issues/39691
Change-Id: I1078b643e3d8f964e1ae9cbbe03628f7de7ae487
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127489
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-12-12 23:53:06 +00:00
Robert Nystrom 3455133d98 Move NNBD tests (language_2/nnbd) to new NNBD test directory.
Change-Id: I0765a1e0fb19f38d7ad1c8655ba444f2f46fbf6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128301
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-12-12 22:52:31 +00:00
Konstantin Shcheglov e51702a7a1 Issue 39752. Fix for promoting TypeParameterType twice.
Bug: https://github.com/dart-lang/sdk/issues/39752
Change-Id: Idbb1a3b11d8eb6bdb05a2916d224a4d3e08a5b05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128240
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-12 21:35:29 +00:00
Sigmund Cherem 52e0bcce0b (dart2js): escape names when creating tearoff closures
The CFE recently changed the name of the top-level deferred load library method
from `__loadLibrary` to `_#loadLibrary` (see #39682)

We were properly escaping this name when generating the method itself, but we
didn't properly escape the name when creating tearoff closures derived from it.

This is why the issue was not detected earlier.

Change-Id: Ic1487a10f521a86a3466608b1825a2b632a191be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128260
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-12 20:37:01 +00:00
Teagan Strickland 4b8fd3c412 [vm] De-obfuscate function and file names in DWARF sections.
Note that when generating unstripped ELF snapshots with --obfuscate,
this means DWARF sections in the resulting snapshot will leak
otherwise obfuscated information. To avoid this, use both --strip
to strip the generated snapshot and --save-debugging-info=<...> to
save the unobfuscated DWARF information to a separate file.

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

Change-Id: I8795e2a5623ad5fc5362257007f677e622a7700b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127166
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-12 17:54:20 +00:00
Daco Harkes 5371380e80 [vm/ffi] Split up function_callbacks_test
This simplifies manual testing.

Change-Id: I77c5ac1e9942b793f746587e44bb061eabf90297
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124328
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-12 16:48:40 +00:00
William Hesse 4b5d757bea Reland "Reland "[infra] Add failing test to test CI systems and approvals workflow""
This reverts commit 84a4bbcabc.

Reason for revert: Another try to land, to get more logging data.

Original change's description:
> Revert "Reland "[infra] Add failing test to test CI systems and approvals workflow""
> 
> This reverts commit c716068538.
> 
> Reason for revert: Trying again to diagnose failure to copy approvals.
> 
> Original change's description:
> > Reland "[infra] Add failing test to test CI systems and approvals workflow"
> > 
> > This reverts commit 25def20f5d.
> > 
> > Reason for revert: Retrying, now that we are copying CQ approvals for all commits in the blamelist of a builder.
> > 
> > Original change's description:
> > > Revert "[infra] Add failing test to test CI systems and approvals workflow"
> > > 
> > > This reverts commit e578eeb235.
> > > 
> > > Reason for revert: The reverted commit is a test of the new approvals UI for tryjobs and the CI. It includes an intentionally failing test, that we now remove again.
> > > 
> > > Original change's description:
> > > > [infra] Add failing test to test CI systems and approvals workflow
> > > > 
> > > > The failing test lib_2/collection/failing_list_test.dart is added,
> > > > which imports dart:io.  So it will be a compile-time failure on
> > > > some dart2js platforms, and a run-time failure on dart:io.
> > > > 
> > > > This commit is just to test the UI and backend for test failure
> > > > approvals on tryjobs and on CI results. It will be reverted after
> > > > the CI builders have run on it.
> > > > 
> > > > Change-Id: Icc3d11e72511cb0dbd9a62cb4fa80e754c203c8c
> > > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127883
> > > > Reviewed-by: Jonas Termansen <sortie@google.com>
> > > 
> > > TBR=whesse@google.com,sortie@google.com
> > > 
> > > Change-Id: I32b900e25dc562ac88f5cb496cdbca726fc70445
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127885
> > > Reviewed-by: William Hesse <whesse@google.com>
> > 
> > TBR=whesse@google.com,sortie@google.com
> > 
> > Change-Id: I64e528131c779c8d20c007ff715b57b599cd3f07
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127886
> > Reviewed-by: William Hesse <whesse@google.com>
> > Reviewed-by: Jonas Termansen <sortie@google.com>
> 
> TBR=whesse@google.com,sortie@google.com,athom@google.com
> 
> Change-Id: Icf68fd813d5f8f98d5ebf40c34e35811e8fffaf5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127892
> Reviewed-by: William Hesse <whesse@google.com>

TBR=whesse@google.com,sortie@google.com,athom@google.com

Change-Id: Ic63f74bf660e71e5e1853a391013368ce640bbc1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127895
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-12-12 15:40:01 +00:00
Teagan Strickland c2b6c2e1db [vm/compiler] Add --save-debugging-info flag to gen_snapshot.
The flag can be used when creating AOT snapshots. The resulting file can be
used with package:vm/dwarf/convert.dart to convert DWARF-based stack traces
to stack traces with function, file, and line number information.

Currently the saved file will be an ELF file with DWARF debugging information,
but this is subject to change in the future. To avoid being affected by any
changes in format, read the DWARF information from the file using
Dwarf.fromFile() in package:vm/dwarf/dwarf.dart.

Also adds --dwarf-stack-traces to the VM global flag list, so its value at
compilation will be read out of snapshots by the precompiled runtime.

Fixes https://github.com/dart-lang/sdk/issues/39512, which was due to
a missing compiler::target:: prefix for Instructions::HeaderSize() in
BlobImageWriter::WriteText().

Exposes the information suggested in
https://github.com/dart-lang/sdk/issues/39490 so that package:vm/dwarf
can appropriately convert absolute PC addresses to the correct virtual
address for a given DWARF line number program.

Bug: https://github.com/dart-lang/sdk/issues/35851
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I80d900fd9e5f1e2399ad3f2fd25c85131a7ea43c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121857
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-12 14:18:59 +00:00
Daco Harkes 77764838f0 [vm/ffi] Fix asan test expectations
Fixes: https://github.com/dart-lang/sdk/issues/39720

Follow up of: https://dart-review.googlesource.com/c/sdk/+/127144

Change-Id: Ic82f656e619d2ae23f102fd494e00929d69510f1
Cq-Include-Trybots: luci.dart.try:vm-kernel-asan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128066
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2019-12-12 11:40:02 +00:00
Alexander Thomas 7678c012b7 [test] Fix import in exact_selector_test
This test was moved without updating its import. Convert the test
to a static error test (multitests can't have relative imports).

Change-Id: I075bf2f7d39f0958b8c625922c406cd5a7325836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128068
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-12-12 11:19:57 +00:00
Robert Nystrom fc1b1ecc71 Move files under language_2 into subdirectories.
Change-Id: Idbcc965a27e9ffeedf5e0a1068b019de4193070f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127745
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-12-11 19:18:00 +00:00
Sam Rawlins c01b52cb0f Remove duplicate 'DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS' already reported by fasta
Fixes #39524

Change-Id: Iaf1c095a9f80809cb8b7e0edd966ab1b22c89abc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127544
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-11 16:22:48 +00:00
William Hesse 84a4bbcabc Revert "Reland "[infra] Add failing test to test CI systems and approvals workflow""
This reverts commit c716068538.

Reason for revert: Trying again to diagnose failure to copy approvals.

Original change's description:
> Reland "[infra] Add failing test to test CI systems and approvals workflow"
> 
> This reverts commit 25def20f5d.
> 
> Reason for revert: Retrying, now that we are copying CQ approvals for all commits in the blamelist of a builder.
> 
> Original change's description:
> > Revert "[infra] Add failing test to test CI systems and approvals workflow"
> > 
> > This reverts commit e578eeb235.
> > 
> > Reason for revert: The reverted commit is a test of the new approvals UI for tryjobs and the CI. It includes an intentionally failing test, that we now remove again.
> > 
> > Original change's description:
> > > [infra] Add failing test to test CI systems and approvals workflow
> > > 
> > > The failing test lib_2/collection/failing_list_test.dart is added,
> > > which imports dart:io.  So it will be a compile-time failure on
> > > some dart2js platforms, and a run-time failure on dart:io.
> > > 
> > > This commit is just to test the UI and backend for test failure
> > > approvals on tryjobs and on CI results. It will be reverted after
> > > the CI builders have run on it.
> > > 
> > > Change-Id: Icc3d11e72511cb0dbd9a62cb4fa80e754c203c8c
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127883
> > > Reviewed-by: Jonas Termansen <sortie@google.com>
> > 
> > TBR=whesse@google.com,sortie@google.com
> > 
> > Change-Id: I32b900e25dc562ac88f5cb496cdbca726fc70445
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127885
> > Reviewed-by: William Hesse <whesse@google.com>
> 
> TBR=whesse@google.com,sortie@google.com
> 
> Change-Id: I64e528131c779c8d20c007ff715b57b599cd3f07
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127886
> Reviewed-by: William Hesse <whesse@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

TBR=whesse@google.com,sortie@google.com,athom@google.com

Change-Id: Icf68fd813d5f8f98d5ebf40c34e35811e8fffaf5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127892
Reviewed-by: William Hesse <whesse@google.com>
2019-12-11 11:36:59 +00:00
William Hesse c716068538 Reland "[infra] Add failing test to test CI systems and approvals workflow"
This reverts commit 25def20f5d.

Reason for revert: Retrying, now that we are copying CQ approvals for all commits in the blamelist of a builder.

Original change's description:
> Revert "[infra] Add failing test to test CI systems and approvals workflow"
> 
> This reverts commit e578eeb235.
> 
> Reason for revert: The reverted commit is a test of the new approvals UI for tryjobs and the CI. It includes an intentionally failing test, that we now remove again.
> 
> Original change's description:
> > [infra] Add failing test to test CI systems and approvals workflow
> > 
> > The failing test lib_2/collection/failing_list_test.dart is added,
> > which imports dart:io.  So it will be a compile-time failure on
> > some dart2js platforms, and a run-time failure on dart:io.
> > 
> > This commit is just to test the UI and backend for test failure
> > approvals on tryjobs and on CI results. It will be reverted after
> > the CI builders have run on it.
> > 
> > Change-Id: Icc3d11e72511cb0dbd9a62cb4fa80e754c203c8c
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127883
> > Reviewed-by: Jonas Termansen <sortie@google.com>
> 
> TBR=whesse@google.com,sortie@google.com
> 
> Change-Id: I32b900e25dc562ac88f5cb496cdbca726fc70445
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127885
> Reviewed-by: William Hesse <whesse@google.com>

TBR=whesse@google.com,sortie@google.com

Change-Id: I64e528131c779c8d20c007ff715b57b599cd3f07
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127886
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-12-11 08:43:52 +00:00
Sam Rawlins bd008dd1e4 Allow empty URI strings in library directives
Fixes #38859

Change-Id: I1698b09bfee367634782f6f7c61f1dbda22edc0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127600
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-12-11 02:20:16 +00:00
Mayank Patke 18b2d24887 Revert "[dart2js] Mark native classes as needed if they have new-rti is-tests or"
This reverts commit bcd18e67dc.

Reason for revert: Deoptimizes native classes.

Original change's description:
> [dart2js] Mark native classes as needed if they have new-rti is-tests or
> named type variables.
> 
> Change-Id: I12af7f8595d6580cac4bc98cad5cd7795f6a71ab
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127964
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

TBR=sra@google.com,sigmund@google.com,fishythefish@google.com

Change-Id: Ia65ea6c32aef5f979d39ef83ab0af68ee503f510
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128011
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-12-11 01:36:55 +00:00
Mayank Patke bcd18e67dc [dart2js] Mark native classes as needed if they have new-rti is-tests or
named type variables.

Change-Id: I12af7f8595d6580cac4bc98cad5cd7795f6a71ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127964
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-11 00:04:08 +00:00
William Hesse 25def20f5d Revert "[infra] Add failing test to test CI systems and approvals workflow"
This reverts commit e578eeb235.

Reason for revert: The reverted commit is a test of the new approvals UI for tryjobs and the CI. It includes an intentionally failing test, that we now remove again.

Original change's description:
> [infra] Add failing test to test CI systems and approvals workflow
> 
> The failing test lib_2/collection/failing_list_test.dart is added,
> which imports dart:io.  So it will be a compile-time failure on
> some dart2js platforms, and a run-time failure on dart:io.
> 
> This commit is just to test the UI and backend for test failure
> approvals on tryjobs and on CI results. It will be reverted after
> the CI builders have run on it.
> 
> Change-Id: Icc3d11e72511cb0dbd9a62cb4fa80e754c203c8c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127883
> Reviewed-by: Jonas Termansen <sortie@google.com>

TBR=whesse@google.com,sortie@google.com

Change-Id: I32b900e25dc562ac88f5cb496cdbca726fc70445
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127885
Reviewed-by: William Hesse <whesse@google.com>
2019-12-10 17:42:31 +00:00
William Hesse e578eeb235 [infra] Add failing test to test CI systems and approvals workflow
The failing test lib_2/collection/failing_list_test.dart is added,
which imports dart:io.  So it will be a compile-time failure on
some dart2js platforms, and a run-time failure on dart:io.

This commit is just to test the UI and backend for test failure
approvals on tryjobs and on CI results. It will be reverted after
the CI builders have run on it.

Change-Id: Icc3d11e72511cb0dbd9a62cb4fa80e754c203c8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127883
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-12-10 16:11:24 +00:00
Robert Nystrom 02a8b015ad Migrate corelib tests starting with "j" to "q" to NNBD.
Change-Id: I1783f624c7ce7d3b962c301c27ac0f4422d7c28f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126824
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-12-10 01:17:24 +00:00
Ben Konyi 16e7647c86 [ VM / dart:typed_data ] Fixed issue where null could be passed for simd types in AOT
Arguments to simd type constructors were being checked in the bootstrap
natives entrypoint but not elsewhere. Checking for null in Dart code
ensures that we don't accidentally miss these checks in AOT.

The changes to sdk_nnbd are required in order to ensure the number of
arguments passed to native code match the number of arguments from the
non-NNBD implementation (we needed to remove the implicit type args
parameter).

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

Change-Id: Iaf7d8790c154f1e85db613b6dc84004c8013df9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126905
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-12-09 15:29:27 +00:00
Mayank Patke 4c442cd73a [dart2js] Remove treatAsDynamic.
Change-Id: I361de27bcd61b18e0bf1ea07516e71a84a1c3807
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126604
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-06 21:30:24 +00:00
Erik Ernst 80a400297a [cfe] Add initial version of support for nonfunction-type-aliases
Change-Id: I9ff3f0c18a31bd1e0d16ba8b6ccd0cc261250c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127005
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-12-06 13:35:30 +00:00
Jens Johansen 0dc6d59d52 [CFE] Fix crash caused by name clash of loadLibrary tearoff method
Fixes #39682

Change-Id: I0e326df9390e05ede939f0019e94f8abe1fb7983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127460
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-12-06 09:29:19 +00:00
Liam Appelbe e20ff1e054 [vm] Prevent late fields from being unboxed
When unboxed doubles are assigned to late fields, it conflicts with the
late field logic and causes a crash.

Bug: https://github.com/dart-lang/sdk/issues/38841
Bug: https://github.com/dart-lang/sdk/issues/39658
Change-Id: I641f597006114f02473a20f8c2526eeaf4fe813f
Fixes: https://github.com/dart-lang/sdk/issues/39658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127442
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-05 22:19:00 +00:00
Robert Nystrom 1ff20f1e24 Rename "inv_cse_licm.dart" to "inv_cse_licm_test.dart".
Without "_test.dart" in the name, the test runner will not actually
run it.

Change-Id: Ia4f8d33c6b294879909b0a838971df21cae4e67b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127100
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-12-05 18:49:09 +00:00
Kallen Tu 53bbe6c88c [dart2js] Added variance support for static subtype checking.
Change-Id: I0731884aad68e3dd7f84658d75e946ca5db62bbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127063
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-12-04 20:54:16 +00:00
Alexander Markov f56b0f6907 [vm/aot/tfa] Whole-program constant propagation
Size:
flutter_gallery total size -2.48% (arm), -2.3% (arm64)
flutter_gallery instructions size -2.91% (arm), -2.77% (arm64)
velocity_tracker_bench total size -7.5% (arm), -7.1% (arm64)

Performance:
SkeletalAnimation +46.02% (Intel Core i5), +37.75% (Intel Xeon), +24.86% (arm), +39.75% (arm64).
FfiMemory.Pointer* +44-64% (x64)
FfiMemory.PointerPointer +436-465% (x64), +443% (arm64).

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

Change-Id: I6221bfa02b165ccc17d4ee8b857bb89212febaff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125936
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-12-04 19:19:29 +00:00
Martin Kustermann c52acadd15 [vm/ffi] Split up some tests/ffi into vmspecific and non-vmspecific
The separation will allow flutter/flutter integration tests to run the
non-vmspecific parts.

Change-Id: I0e771f1247ec62d2f0c3faa95ee10560e62524f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127144
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-12-04 15:56:08 +00:00
Karl Klose 60afc24502 [infra] Convert some multi-tests to the new static error framework
This is the result of running the tool from
https://dart-review.googlesource.com/c/sdk/+/124128 on the
language_2 tests that contain only static multi-test annotations.

Some of the results needed manual editing and in these cases I have
also changed the formatting of the tests.

Change-Id: I4ddd16a2c5d8576adccb0a740cb1d4aabbc001b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126161
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-12-04 13:06:58 +00:00
Martin Kustermann b0155a72a7 [vm/ffi] Add script to extract existing positive ffi tests into bundle to be used for flutter/flutter integration test
The `tests/ffi/prepare_flutter_bundle.dart` script will try to discover
all synchronous, positive test from the "ffi" test suite, rewrite them
slightly and output a directory which can be used in a flutter/flutter
FFI integration test.

We split the ffi test functions into two parts, because a subset of the
C functions will issue calls to the VM via `dart_api.h`, which is not
available for the flutter/flutter integration test.

=> We make `runtime/bin/ffi_test/ffi_test_functions.cc` a pure C
   library, usable without `dart_api.h` and move the remaining VM
   specific code to .../ffi_test_functions_special.cc contains.

All tests from `tests/ffi/*_test.dart` will be included in the generated
bundle, which

   * don't use async/isolates
   * don't rely on VM api
   * don't rely on DynamicLibrary.{process,executable}
   * don't take too long to execute

The script can be used as follows:

   sdk % dart tests/ffi/prepare_flutter_bundle.dart foo
   Using SDK root: .../sdk
   The following tests will be included:
      aliasing_test.dart
      data_not_asan_test.dart
      data_test.dart
      extension_methods_test.dart
      external_typed_data_test.dart
      function_structs_test.dart
      negative_function_test.dart
      regress_37254_test.dart
      regress_39044_test.dart
      regress_39063_test.dart
      regress_39068_test.dart
      stacktrace_regress_37910_test.dart
      structs_test.dart
      variance_function_test.dart
   The following tests were filtered due to using dart_api.h/async/DynamicLibrary.{process,executable}/...
      function_callbacks_test.dart
      function_gc_test.dart
      function_test.dart
      object_gc_test.dart
      regress_37100_test.dart
      regress_37511_callbacks_test.dart
      regress_37511_test.dart
      regress_37780_test.dart

   Please copy generated files into FFI flutter test application
      * foo/lib/src/generated
      * foo/ios/Classes

Change-Id: Ia13f97df3bbc90829bb8fde8265a7e1d2c0f8260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127006
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-12-04 13:02:48 +00:00
Nicholas Shahan 2a13b1fe26 Reland "[dartdevc] Break dart:_debugger dependency on dart:html"
Original change was broken by the fact that DDC expects all types marked as
native have all their superclasses marked as native when the super classes are
compiled.

In this case `MapMixin` from dart:collection was not being marked as native and
the only reason it was working before was that the library dependency enforced
the necessary order.

* Now `MapMixin` is explicitly marked as native.
* Added a test case to use some of the API on `window.localStorage` that is
  inherited from the MapMixin class.

Change-Id: I1584bfb86179016ee12c2acc5cfbbe81d086841e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126906
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-04 00:51:18 +00:00
Konstantin Shcheglov 198fde2342 Fix language_2/nnbd/syntax/null_assertion_ambiguous_test
Change-Id: I095dd98b63e500e92b9298975f28adb75b0e7348
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126822
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-03 00:49:30 +00:00
Robert Nystrom 284f662022 Migrate the corelib_2/ tests starting with "e" through "i".
Change-Id: I764d0457da85b2935e1d83309eab4c4b5b3ea000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126204
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-12-02 23:19:10 +00:00
Robert Nystrom a4d799c402 Migrate corelib/ tests starting with b-d to NNBD.
Note that cast_test.dart isn't migrated yet due to #39517.

First patch set is just copying the tests over. The second patchset has
the actual meaningful changes.

Change-Id: I89233f20187b4305a776f865cde09a984423fa4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125920
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-12-02 23:13:10 +00:00
Konstantin Shcheglov 4fe27fd444 Report an error when 'await' is used in the initializer of a late local variable.
Change-Id: I4c610dd37e4c7ca653d250d4e0522536a70a6ca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126820
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-02 18:00:48 +00:00
Konstantin Shcheglov e4344a568f Report INVALID_OPTIONAL_PARAMETER_TYPE when default values are not allowed.
Change-Id: I8145bde238c092a50ddbc053100891737b74feb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-02 16:54:47 +00:00
Johnni Winther 1454a67e09 [cfe] Don't use multiple null-aware guards in opt-out
Change-Id: I15bd991577ffcc309569ee4a5512dfb29c7874ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126732
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-12-02 12:19:27 +00:00
Konstantin Shcheglov 3de7487a2c Report an error for 'late final' fields in classes with const constructors.
Change-Id: I6843191a2f7a0bdd856549177468ff87eec949f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126782
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-01 01:48:20 +00:00
Brian Wilkerson 0a575d8681 Unify two diagnostics into instantiate_abstract_class
Change-Id: I0d9b97b26173ec789a7937337b8ff015edd283b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-01 00:58:00 +00:00
Erik Ernst 077795b3e5 [co19] Add .gitignore to new co19 directory
Change-Id: If0477e6096af1cec41b346c0c288ed73051f61df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126644
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-11-28 11:12:44 +00:00
Kallen Tu 73fdf19b56 [dart2js] Add variance table to RTI and updated subtyping wrt variance.
Change-Id: Iac4c28d295e883997acdc2e6c7084739e60be9fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126403
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-11-27 18:45:25 +00:00
Martin Kustermann 5aa86eb123 [vm/concurrency] Run all isolate related tests with/without enabling isolate groups
Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: I0b7eca744bc49ab5ba09da3ce2a9286b1ed3c70f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126340
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-11-27 17:23:31 +00:00
Alexander Thomas 3524bb1a93 [co19] Roll co19_2 and add co19 (nnbd) to DEPS.
Initial import of co19 (nnbd) at 8767031866e8243eafdb46011d4d8a7b5705019d.

Roll co19_2 to 368bfa9e877a2df003547f64bb17e30596af10c7:
2019-11-22 irina.arkhipets@gmail.com Issue 501 fixed: correct expected result adjusted.
2019-11-22 irina.arkhipets@gmail.com Issue 501 fixed: correct expected result adjusted.
2019-11-22 irina.arkhipets@gmail.com Issue 499 fixed: correct expected result adjusted.
2019-11-22 sgrekhov@unipro.ru Fixes 500. Expected result corrected
2019-11-12 sgrekhov@unipro.ru Fixes 495. Partial fix. Explicit extension member invocation tests added
2019-11-11 sgrekhov@unipro.ru 495. Partial fix. Null-aware explicit extension member invocation tests added
2019-11-07 sgrekhov@unipro.ru Remove hint in analyzer
2019-11-07 sgrekhov@unipro.ru 495. Partial fix. Explicit extension member invocation tests for composite member invocation added
2019-11-06 sgrekhov@unipro.ru 495. Partial fix. Explicit extension member invocation tests for composite member invocation added
2019-11-05 sgrekhov@unipro.ru 495. Partial fix. Explicit extension member invocation tests for composite member invocation added
2019-10-31 sgrekhov@unipro.ru 495. Partial fix. Explicit extension member invocation tests for binary operations added
2019-10-30 sgrekhov@unipro.ru 495. Partial fix. Explicit extension member invocation tests for binary operations added
2019-10-29 sgrekhov@unipro.ru 495. Partial fix. Explicit extension member invocation tests added
2019-10-10 irina.arkhipets@gmail.com Fixed Issue 494: expected result corrected.
2019-10-09 irina.arkhipets@gmail.com Fixed Issue 493: typo corrected.
2019-10-09 irina.arkhipets@gmail.com Fixed Issue 492: typo corrected.

Failures are due to:
* Triple-shift is not yet implemented.
* https://github.com/dart-lang/sdk/issues/39527

Change-Id: I81578e1e3e18b396f1d20cee7aaa34cd4df54bbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125973
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-11-26 17:10:18 +00:00
Erik Ernst a5a9057d73 [cfe] Add non-function type alias usage tests
Change-Id: Iba19aa26d982e2a89b81c9f9856e560977c26224
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126342
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-11-26 15:44:59 +00:00
Liam Appelbe 629d4ce095 [vm] Test for late fields with complicated initializers
This exposed a bug in late_var_init_transformer, where statements that
came before the late var declaration weren't copied over. So I rewrote
it a lot simpler.

Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I7f75448179f737fa1e3b90aefd9ea15a2c4be5d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126085
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-11-25 17:21:15 +00:00
Teagan Strickland 709b2aa33d Adding a tool for using DWARF information to convert stack traces.
Also fixes the low and high PC information in the DWARF output of
inlining nodes.

Bug: https://github.com/dart-lang/sdk/issues/35851
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-mac-release-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I11c3577bdc5c12abdc88aa799c1aae3f505294df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123734
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-25 09:21:24 +00:00
Liam Appelbe f3102ab0cf [vm] Fix late final field edge case
If a late final field initializer is recursive, it can write multiple
values to the field. Only the first should succeed, and the rest should
throw.

Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I87ffdc0b8fcd429c47f102fe76a0e6a577ae6c30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125934
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-11-22 21:37:17 +00:00
Kallen Tu 029e06b8d9 [analyzer] Allow downwards inference and upper bound heuristic wrt variance.
variance_downwards_inference_test now passes.

The other part of this CL addresses https://github.com/dart-lang/language/issues/658
The code has similar logic to https://dart-review.googlesource.com/c/sdk/+/125552.

Change-Id: Ib2bc7e9c11574ccd9b16fe66472bba8c16dabd29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125486
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-22 01:31:03 +00:00
Liam Appelbe 09d22a0509 [vm] Wrap late local var initializers in a closure.
This fixes the case where a late local var initializer allocates
variables or temporaries. It's not clear where they should be
allocated, since the initializer could be called anywhere the late
variable is accessed. So we wrap the initializer in a closure, since
calling a closure only requires a single temporary.

So then we just need to allocate that temp everywhere the late var is
accessed. Since temporaries are associated with specific AST nodes,
we also need to add the ability to swap out the temporaries associated
with a node, so that we can use the getter's temp when the getter
visits the initializer.

This will also reduce code bloat for large initializers.

Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: Ice8c16babc0e56368657088edf1b51b422ee0241
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125762
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-11-21 20:39:36 +00:00
Johnni Winther acff31ed26 [cfe] Support null-aware index access
Change-Id: I54b58624722845e4b008b90e675516ec274bc2da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125960
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-21 14:36:30 +00:00
Alexander Thomas afa82d8e98 [co19] Add missing backslash to update script
Change-Id: Ia713dc14222a901f1040d2a7254ead21b5049750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125965
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-11-21 13:19:19 +00:00
Alexander Thomas 51f14eb911 [co19] Fork the update script for the co19 NNBD tests
This will allow creation of the co19 NNBD CIPD package. We'll keep the
old variant of the script to create the co19 legacy packages until the
non-NNBD tests are no longer needed.

The new layout on CIPD will be:
dart/third_party/co19 (co19's master branch)
dart/third_party/co19/legacy (co19's pre-nnbd branch)

Change-Id: I21c61083630de43be10fcead221616a2bc6f9c20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125962
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-11-21 11:16:40 +00:00
Mayank Patke eb6d7f51e2 [dart2js] Add DartTypes for T*, T?, and Never.
Type relations to be implemented in a later CL.

Also discovered some visitors were missing support for FutureOr.
Fixes: https://github.com/dart-lang/sdk/issues/38821

Change-Id: Iee494cfa2eff3b320a3fd1a2e7ffbf3f969b40e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125880
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-21 09:58:14 +00:00
Mayank Patke 539b0093e1 [dart2js] Remove unnecessary DartType predicates and replace with
is-tests.

Change-Id: I520d0893793e291d009e31ff32980194278bb0b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125923
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-11-21 08:58:54 +00:00
Kallen Tu aa2b3a5eaa [cfe] Inference constraint solving takes contravariance into account.
Implements https://github.com/dart-lang/language/issues/658.

Change-Id: I28857c40bbc5db76f7312ed540052fed40dac4b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125552
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-11-21 00:05:18 +00:00
Robert Nystrom a9c1f68135 Oops, meant to commit these changes with:
https://dart-review.googlesource.com/c/sdk/+/125727.

Change-Id: Id0bc8d8495a011aacd48ca18c845049d87fbfd39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125768
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-11-20 22:27:12 +00:00
Robert Nystrom 4ee62c3479 Migrate all of the negative language_2 tests to not be negative tests.
Also, remove the three negative tests under compiler/dart2js_extra.

Change-Id: I5d285d1e5ed2016de4e0236ee89fe0399fc008c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125727
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-11-20 21:24:02 +00:00
Simon Lightfoot 867a6e0e52 [dart:core] Update DartTime.parse to support arbitrary precision fractional seconds.
Update DartTime.parse to support arbitrary precision fractional seconds. So it now conforms to ISO8901 and RFC3339 standards.

Closes #24205

Closes #39350
https://github.com/dart-lang/sdk/pull/39350

GitOrigin-RevId: 66f15b6e646a65b7955c7b617647b8edfd680481
Change-Id: Ife2211e6cce5922b59cdde0d30ed3ef887cffcf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124903
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2019-11-20 18:16:19 +00:00
Robert Nystrom db64f9ecb2 Delete standalone_2/io/process_exit_negative_test.dart.
I am trying to migrate all of the negative tests to something more
precise. As far as I can tell, this test stopped being useful with Dart
2.0. Now that all compilation errors are reported eagerly, the file
simply doesn't run at all. It's now just another test of an unresolved
identifier.

(This is a good example of *why* I want to get rid of negative tests.
This test silently went from a desired runtime failure to a compile-time
failure.)

Change-Id: Iec3cdd32a15612c0760119e92d618e3a5ba1f5ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125555
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-11-19 18:23:30 +00:00
Robert Nystrom 2c5705ad23 Migrate some negative tests to static error tests.
Note function_type_parameter_negative_test and
function_type_parameter2_negative_test were identical as far as I could
tell, so I merged them into one.

Change-Id: I00d53bf8ec9534b0c2832b0ea2cc4da442bfd683
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125556
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-11-19 17:37:19 +00:00
Erik Ernst 26f5ea47e8 [co19] Rename status file to co19_2-co19.status
Change-Id: Ia5a397825417e2a849367efd92fc06ec682f3d1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125661
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-11-19 16:17:10 +00:00
Erik Ernst eeca3fb1cb New "general" status file added
In order to manage the implementation of nonfunction-type-aliases,
this CL adds a new status file for co19_2 (because there was no such
file, corresponding to 'language_2.status' in 'language_2', etc.).
It skips every test that has the option 'nonfunction-type-aliases',
unless the compiler is fasta.

Change-Id: Ibfd536f6e47d6e28d6d2fb23a3676e4a5875e4df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125640
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-11-19 15:07:39 +00:00
Erik Ernst 626639f11f Added nonfunction-type-alias tests, skipped for non-fasta compiler
Change-Id: I89ed80c973c5f2c76d534fcbd0f16d8141869757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125601
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-11-19 13:46:44 +00:00
Robert Nystrom 582cec84f4 Set up new test suites for migrating the tests to NNBD.
- Copies corelib_2/a*    -> corelib/
- Copies language_2/ab*  -> language/
- Copies lib_2/math/     -> lib/math/
- Copies standalone_2/a* -> standalone/

And also copies over and renames all of the status files in those
directories.

Then it migrates those tests to be static error free in NNBD.

Finally, adds support to the test_runner for the new suites.

Note that this review is split into multiple patchsets. The first
patchset is a straight copy of the existing files. Then the later
patchsets have the interesting changes.

Change-Id: Icec2ff850a3aee30b653066ac184495d1e3814d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125467
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-19 00:18:43 +00:00
Liam Appelbe bde92ca34a [vm] Late modifier for final local variables.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: Ia99a3441b4175bb16097766d57133c6d83a0e3f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125542
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-18 23:12:48 +00:00
Kallen Tu 62c67e40dc Added language test for reified torn-off methods with explicit variance.
Change-Id: I51892de84245bc31f442b5b01ab3d03ac869e86f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124913
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-18 22:50:55 +00:00
Kallen Tu 7c517ed007 [analyzer] Report invalid variance positions in fields.
Change-Id: I51a0e64907569a722fd1df58e098bb92254d53c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125481
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 22:42:15 +00:00
Aart Bik e12a7e0ca2 Fix for OSR assert (debug) or crash (release)
Rationale:
Rename traverses blocks in DOM order, not in execution order.
As a result, blocks that are directly entered from the entry
should introduce synthetic phis during OSR with non-empty stack
to make sure incoming stack values are merged properly.

https://github.com/dart-lang/sdk/issues/39193

Change-Id: Ic35961169aa535657333c2ab14fbd2c4e1f0783f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125489
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-11-18 22:33:05 +00:00
Aart Bik 29ff784ecb [dart/compiler] Loop analysis and BCE improvements
Rationale:
Loop analysis did not take outer indices used as bounds
(triangular loops) into account to enhance analysis. This
left some obvious BCE optimizations on the table (mainly AOT).

Observed improvements (performance and code size):

About 5-15% performance on golem benchmarks:
   mainly armv7, and TypedData*Bench

Minor overall code size reduction on flutter gallery (arm32,arm64)

Comparing ./orig32.json (old) to ./new32.json (new)
Old   : 6614912 bytes.
New   : 6600336 bytes.
Change: -14576 bytes.

Comparing ./orig64.json (old) to ./new64.json (new)
Old   : 6459216 bytes.
New   : 6458736 bytes.
Change: -480 bytes.

Similar on velocity_tracker_bench (arm32,arm64)

Comparing orig32.json (old) to new32.json (new)
Old   : 804280 bytes.
New   : 794552 bytes.
Change: -9728 bytes.

Comparing orig64.json (old) to new64.json (new)
Old   : 705520 bytes.
New   : 705312 bytes.
Change: -208 bytes.

Change-Id: Ifc3b3a378ae6fd98743c48944a86a9e90ce4da5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117200
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-11-18 19:51:13 +00:00
Johnni Winther 4b5589e0cb Reland "[cfe] Use StaticTypeContext for getStaticType" and more"
This relands commits
 "[cfe] Use StaticTypeContext for getStaticType"
 45033c6ad9

 "[cfe] Move caching of thisType to CoreTypes"
 fab25cbe0c

 "[vm/bytecode] Notify static type context when entering/leaving library"
 c9f88ae253

Change-Id: I407d6b0e3b3df503cedc9fcb2c834d835cf083f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125343
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-16 05:50:58 +00:00
Ryan Macnak d6b0a27665 [test] Explicitly mark streamed_conversion_json_utf8_decode_test as slow in reload test modes.
Change-Id: I60777b0fd3a20b340b12225a24529474eb75b2af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125483
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-11-16 01:14:28 +00:00
Ben Konyi 1c12878d05 [ dart:io ] Added timeline events for HttpClient connections and requests
Setting the `enableTimelineLogging` property of `HttpClient` to true results in
timeline events being created for HTTP connections and HTTP requests.
Timeline events contain general connection information, including:
  - Request type
  - Status code
  - Request / response headers
  - Cookies
  - Non-sensitive proxy information
  - Relevent error messages for failed connections

Change-Id: Ibe16a312ab5398c9ae886ea07bea5ca70b63e440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-11-16 00:46:46 +00:00
Kallen Tu a2fe9d450e [analyzer] Report invalid variance positions in methods of a class.
Change-Id: I425f81e7e64a02b29e094dab53f37318a09a3c62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125228
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-15 23:55:19 +00:00
Liam Appelbe 329d0913ca [vm] Late modifier for non-final local variables.
I also added a test for top level late variables (they already worked).

Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I6720e6476a067c7f8b21a34b87b23ab14fc866a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125224
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-11-15 23:03:16 +00:00
Kallen Tu 6ec813e07a [analyzer] Modified type inference constraints wrt variance.
Change-Id: I0502bad1c57af358453c78d27fe738880beb7b4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125021
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-15 22:02:36 +00:00
Kallen Tu 89dc1a791e Updated analyzer error messages in variance_multi_subclass_error_test.
Change-Id: If3e85c8cc6a92cdafe146769628ea5c11a5bfcab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125362
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-15 17:16:25 +00:00
Sigmund Cherem a75ffc8956 Add non-NNBD language version marker to all sdk (non-nnbd) files
This is practically a copy of the change in
https://dart-review.googlesource.com/c/sdk/+/118040 but applied to the non-nnbd
sdk.

Even though there is no intent to run the non-nnbd sdk with the non-nullable
experiment, we need to add this annotation because of how we
intend to gradually start testing NNBD. The libraries.json under
sdk_nnbd is allowed to point to libraries under the non-nnbd sdk in order to
temporarily build without errors until all patch files are migrated and all CFE
issues are addressed.

Change-Id: I53c1123a8d86c10695832a8a0ad35adb7b4d92fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125181
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-11-15 00:22:47 +00:00
Johnni Winther ef5fb7d3f4 Revert "[cfe] Use StaticTypeContext for getStaticType" and more
This reverts commits
 "[cfe] Use StaticTypeContext for getStaticType"
 45033c6ad9

 "[cfe] Move caching of thisType to CoreTypes"
 fab25cbe0c

 "[vm/bytecode] Notify static type context when entering/leaving library"
 c9f88ae253

Change-Id: I6171f6a74b97f2f4a77a36c242330fc2db94c82f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125341
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-11-14 22:51:43 +00:00
Nicholas Shahan e040b6edc1 [dart2js] Cleanup dynamic calls and downcasts in _BigIntImpl
This is some preparation for the NNBD migration where the existing downcasts and
possible nullable accesses will be errors.

- Downcasts have been replaced with covariant parameters.
- Local variables have either been declared with a specific type or given
  initial values so that they can become non-nullable in the future.

Change-Id: Ie871095ee26771833318d1dfce2b5986afaf8c69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125227
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-11-14 21:23:11 +00:00
Kallen Tu 85295c9298 [analyzer] Report incorrect type parameter superclass positions.
Change-Id: I6c55c32db2c275a199b2878909576f445a87977c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125009
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-14 19:04:44 +00:00
Dmitry Stefantsov fab25cbe0c [cfe] Move caching of thisType to CoreTypes
Closes #38225.

Bug: http://dartbug.com/38225
Change-Id: I0274bc390ca2d098896f578ea7ddf65527d82027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124325
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-14 16:01:26 +00:00
Samir Jindel 6c5033acac Re-land "[vm/async] Don't add an <asynchronous gap> marker along sync-async calls."
Original change is in patchset 1.

The issue was that the expected "_Closure.call" frame is not always present.

Change-Id: I91116861e785a72536dde300f4771de4f6fa9d3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124988
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-14 15:29:16 +00:00
Johnni Winther 45033c6ad9 [cfe] Use StaticTypeContext for getStaticType
Change Expression.getStaticType to take a StaticTypeContext instead
of a TypeEnvironment.

The StaticTypeContext provides access to the TypeEnvironment and the
current 'this type' as well as determining the nullability state of the
enclosing library.

This change is needed to support nnbd types for getStaticType and also
serves as a step towards supporting caching during static type
computations to avoid repeated computations of the same (complex)
expressions.

Change-Id: Ied974dff7f6f7c3c8f262aa80c8dea5c674662f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124683
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-11-14 09:09:26 +00:00
Liam Appelbe a0bb025024 [vm] Late static final fields
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: Ic40002ab0e6ded6d525ee5e1c218a589b9406c8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125005
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-13 17:56:08 +00:00
Kallen Tu d5d889668b [analyzer] Added variance support for upper/lower bounds.
Change-Id: I64f44a7068c6caa222787ccb7dfbb3ed8b5fd0fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124420
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-11-12 22:10:56 +00:00
Kallen Tu a65aff122d [analyzer] Changed subtype checking for variance modifiers.
Change-Id: I9fa65e13d2f8611acc50fd133029c76666b8f452
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123559
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-12 22:09:56 +00:00
Liam Appelbe 2a9af7d953 [vm] Late modifier for non-final static fields.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I8e6feef2c0ee8021bec2f849e9729516532ca91a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124641
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-12 17:27:39 +00:00
Régis Crelier b5110a59a9 Revert "[vm/async] Don't add an <asynchronous suspension> marker along sync-async calls."
This reverts commit f4d930997b.

Reason for revert: Different tests are failing on different bots.

Original change's description:
> [vm/async] Don't add an <asynchronous suspension> marker along sync-async calls.
> 
> This fixes `package:stack_trace` in the sync-start case of async/async* calls.
> 
> Change-Id: I5c41a35283439f533ab19c9fd1cc542931de4b43
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124560
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,sjindel@google.com

Change-Id: Ib3e1b303613f0393dac6b1b81e8d1ffb322052b8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124800
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-11-11 19:03:54 +00:00
Samir Jindel f4d930997b [vm/async] Don't add an <asynchronous suspension> marker along sync-async calls.
This fixes `package:stack_trace` in the sync-start case of async/async* calls.

Change-Id: I5c41a35283439f533ab19c9fd1cc542931de4b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124560
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-11 16:36:43 +00:00
Zichang Guo 4366afc6f5 [http] noFolding() should follow same check as add()
Walk through http headers class. Since http header uses case-insensitive headers, noFolding() implicitly assumes field name is lower-cases. It is used to compare to lower-cases field name. Validate the field name before it is stored and also add a test case for noFolding().

Change-Id: I58f8a0ed0d366281e1e7a8c60fd46ff81c8ee796
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121773
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-11-11 16:36:23 +00:00
Erik Ernst 7408ed4730 Added null-check selector to syntax of cascades, and test.
Change-Id: Iecfe33abaf440576127f9a2b536593328c906e12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124332
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-11-11 15:26:53 +00:00
Leaf Petersen 8ca18f1a14 Extension method prefixed import tests.
Adds tests for the change to make extension members accessible even
for prefixed imports.  Also tests that it is an error to import a
library with extensions as deferred without hiding the extensions.

Change-Id: I3a81c560694d34c8adbb4cc86ca9e6b8a129ae56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124589
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-11-08 23:17:08 +00:00
Nicholas Shahan 750a83b896 [dartdevc] Fix crash when source files contain non-UTF8 characters
* Treat the assertion condition offset as a character offset in the file.
* Allow unrecognized characters to be replaced by a placeholder character. This
  is unrelated to the fix but is just a precautionary measure.

Fixed: 39271
Change-Id: I4871ea41d3a46d26ecac5047265a1dbc1c889350
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124602
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-08 23:10:59 +00:00
Alexander Markov fa43799461 [vm/bytecode] Check number of type arguments in non-generic closures
Fixes https://github.com/dart-lang/sdk/issues/39283

Change-Id: I5a5fdf158c6a7ce068be36754ea0487cb754584b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124470
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-11-08 17:16:37 +00:00
Liam Appelbe f4780a6450 [vm] Late modifier for non-static final fields.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: Ib2b3189b20bd056b6378fa5d7a6166acef9a5c67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124465
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-11-07 23:50:57 +00:00
Kallen Tu 78fac5afc1 Added additional language tests for sound variant classes extending legacy classes.
Change-Id: I214a8869dba527671b52c275d2302155382ba45f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124140
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-07 17:49:38 +00:00
Liam Appelbe 2ae9b6f653 [vm] Handle late fields with no initializer.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I23526e7e8cc5928c22c53414dd201c07199b9610
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124210
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-11-06 23:39:22 +00:00
Liam Appelbe c154677699 [vm] Handle trivial initializers for late fields
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I9db9d4815ad27f3f97d43a7a9f1fb74f08673528
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124201
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-06 17:46:32 +00:00
Zichang Guo 46ae3e4e7a [vm] not remove port if socket was listening by other isolates
Crashes come from assertion in ReturnTokens() and new_mask() in Eventhandler.
Another issue is when multiple serversockets bind to the same address, Socket will be reused to all Dart_Ports. But Socket didn't keep track of corresponding Dart Port.
When one of isolates is killed, finalizer wakes up and close most recent Dart Port that sends data.

After this cl, Socket may not be reused by different Dart Sockets. All Dart socket will has its own Socket object. But Sockets can have same fd.
This will guarantee finalizer will close right Dart Port.

Bug: https://github.com/dart-lang/sdk/issues/36106
Change-Id: Ib4620ada5f120ffda719052297009280c73b4315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122490
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-06 16:28:12 +00:00
Konstantin Shcheglov 80fc4d54e5 Add a NNBD test that needs NNBD migrated SDK.
I tested it locally by updating `SharedOptions` to include not only
`--enable-experiment=non-nullable`, but also the forced path to NNBD
SDK: `--dart-sdk=/Users/scheglov/Applications/dart-sdk-NNBD`.

This will fail for now, I will accept current bot failures.

Change-Id: I72c9b46049de6cd25eddebd43d5c73c2fc9d7825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124168
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-06 05:26:27 +00:00
Kallen Tu 11b1433756 Allow downwards inference of sound constructor calls.
Change-Id: Iffe2c6c052cfba40000c0325f5f1fd4ce9b51b9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123941
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-11-06 00:30:07 +00:00
Liam Appelbe 1f8ef384d9 [vm] First pieces of late modifier implementation.
This implements the logic for initializing, getting, and setting
non-final instance fields that have initializers. It doesn't address
statics, finals, local variables, or the no-initializer case, and is
only implemented for bytecode.

Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I3b9e2772abdc04e3bfede56d2fcf06738f234cbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122489
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-05 19:48:03 +00:00
Sigmund Cherem e65d95e8c8 (dart2js) add indirect dynamic calls to global inference and use it to model operator==
On most apps, `==` is a very common invocation that adds lots of edges to
our global inference graph. It appears that for the most part we don't
learn much from it and that we save a considerable amount of space and
time durning global inference if we model them differently.

The amount of space varies a lot by application. Some large internal apps
show about 200K edges removed, other large apps show an incredibly large number
(1.3 M edges!)

Change-Id: I5168978f922c4d74adfae2de7fe69d56ff85ade0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-05 18:17:13 +00:00
Kallen Tu 9ba71b0fdd Modify local inference to generate constraints with respect to variance.
Change-Id: Ia746ea1bb37736d06a5e478f1fddf3e985eb16a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123560
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-11-05 17:54:13 +00:00
Stephen Adams 54b324ca04 [dart2js] new-rti: Cache non-generic types on constructor
- Cache the Rti in a property on the constructor.

- Put the dodgy closure logic behind the cache to move the _isClosure
  test off the fast path.

- Allow different closure.runtimeType.toString() results. The old result is not
  worth preserving because it shows a 'type' that does not otherwise exist. The
  actual closure.toString() is still informative.

Change-Id: I7f30e5975ce289fa6b85a22c65f76e80055ef548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124021
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-11-04 22:58:35 +00:00
Derek Xu 6d28f59c54 Added promiseToFuture function to js_util.dart
Change-Id: I1bfd3fadb0a212ec0ff150cad02bdf285e2e7edb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122240
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2019-11-04 22:56:45 +00:00
Johnni Winther 51023cbb54 [dart2js] Add test for sequence of promotions
Change-Id: I6bb08da3e32fb9cef25f1ae585da8a516d6ff237
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123725
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-01 12:41:30 +00:00
Paul Berry c4b6df5009 Move ID testing infrastructure into _fe_analyzer_shared.
Change-Id: I9f2692dbe750f3c31f8c86e86fe732f34e166517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-01 12:39:00 +00:00
Johnni Winther 00c2962db8 [cfe+analyzer] Move messages, scanner and parser to package:_fe_analyzer_shared
Change-Id: I4fa87aee65f30a9868a6cf8f0342591869ece7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-01 09:37:57 +00:00
Kallen Tu 550985189c Added errors for variance positions in fields.
When an explicitly defined type variable is used in an incorrect
variance position in a (final/non-final) field, an error is emitted.

Change-Id: Id1af7bdcd9adfe0c94ee76612c58ff63d011a1fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122881
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-31 21:29:39 +00:00
Kallen Tu 94e312f7a6 Added errors for variance positions in method members.
When an explicitly defined type variable is used in an incorrect
variance position in a method (whether in the return or the
parameters), an error is emitted.

Change-Id: I7e49687579bb2ce6e293b052b657b98741cb04f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122740
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-31 18:26:43 +00:00
Paul Berry a0ee662b7b Move shared analyzer/FE integration test data into shared package.
This moves the five test suites for flow analysis along with the
constants test suite.

Note that a few files have formatting errors.  I'll fix those in a
follow-up CL.

Change-Id: Ie9bba74c7d91e49ac6c9d3c64a96be007b6a94c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123680
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-31 15:02:03 +00:00
Martin Kustermann cdcc5282ea [vm] Add NativePort static extension to dart:ffi
This can be used in combination with `dart:ffi` to allow C code to post
messages asynchronously back to Dart.

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

Change-Id: I0293337785a3555b4147e25f1a904f333da62c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118565
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-10-31 15:00:03 +00:00
Mayank Patke bb71c3eecc [dart2js] Ensure type check metadata is generated for types
that otherwise only appear in substitutions.

Change-Id: I187975ef7c65b841c54de115da2b3084d3f1a00e
Fixes: https://github.com/dart-lang/sdk/issues/32004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123550
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-10-31 10:59:43 +00:00
Nicholas Shahan bbe2ac28c9 [dartdevc] Add runtime support for NNBD weak subtype checks
In weak mode when a subtype check fails it is performed again with more lenient
rules. If the second check passes a warning is printed to the console and it is
allowed to pass. If the second check fails it is treated as a failure.

- Add a method to set the runtime mode.
- Update test expectations for more permissive subtype checks.

Issue: #38128
Change-Id: I7d55bfffad16077c50b6b2c3bf6df8367e6f7785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123300
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-30 22:13:25 +00:00
Kallen Tu 44641fbd61 Added variance support in bounds inferencing.
Change-Id: Id3d05445491650642c40ac8d9b1ecf58162c56f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122485
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-30 20:35:23 +00:00
Nicholas Shahan f99a28407f [dartdevc] Temporarily run NNBD tests with a "hybrid" SDK
- Adds a temporary modular test suite to prevent regressions on NNBD tests.
- New modular tests build the standard SDK with the dart:_runtime library from
  the NNBD fork.
- Unblocks DDC development while the forked SDK is in a state that does not
  build.

Change-Id: If422f5d19237f9d11e26aad503f1be960b331c57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123541
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-30 20:10:13 +00:00
Anna Gringauze 33274b6fae [dartdevc] removed unnecessary '.bind(this)' + added doc comments.
Bug https://github.com/dart-lang/sdk/issues/38896

Change-Id: If5399c19c178e7b379d7827bde1277c2bf18062e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123470
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-30 18:18:01 +00:00
Aske Simon Christensen 6812504f08 [CFE] Error when an extension operation is used in a constant expression
Fixes https://github.com/dart-lang/sdk/issues/39146

Change-Id: Iba733d8887b2422d692ff18e03e126baec2f3d90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123247
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-30 12:23:34 +00:00
Mayank Patke 67db877264 [dart2js] Replace const constructors with factories on singleton DartTypes.
Change-Id: Ic396bca77523e0f907f91a378bbe328544e2fa1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123467
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-10-29 22:40:26 +00:00
Mayank Patke e2891ad8e3 [dart2js] New RTI: Support reification of erased types.
Change-Id: I351c8ab96c12f9acffefa26556897d195b3e7c17
Bug: https://github.com/dart-lang/sdk/issues/38949
Fixes: https://github.com/dart-lang/sdk/issues/38949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122026
Reviewed-by: Stephen Adams <sra@google.com>
2019-10-29 22:40:26 +00:00
Anna Gringauze 32c212e3eb [dartdevc] Add binding to 'this' for spread and 'yield' expressions
DDC does not generate correct bindings for async operations in spread,
 resulting in errors on member accesses.

```
class A {
    m1() => [1, 2];
    Future run() async {
      return [await null, ...m1()];
    }
}
```

Another case with yield:

```
class C {
    List<int> m2() => [1, 2];

    Future run() async {
      return await run3().toList();
    }

    Stream<int> run3() async* {
      for(var k in [... await m2()])
        yield k;
    }
}
```

Fixes #38896

Change-Id: I6ea28080414e5843ab647516cc223fd218f8c17e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123465
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2019-10-29 21:20:26 +00:00
Ryan Macnak acc9ffc327 [test] Remove unnecessary slow heap growth flag from streamed_conversion_json_utf8_decode_test.
This test already has several GCs under the default growth policy, so the verifier runs enough with this flag omitted.

Also, re-enable the background compiler in this test.

Change-Id: I5b874984f45766be76d5ab429df84c2f64bf7e17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123330
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-29 19:43:06 +00:00
Zichang Guo 2e15d0eb8c [dart:io] add IOOverrides.serverSocketBind to enable overriding ServerSocket.bind()
Fix: github.com/dart-lang/sdk/issues/39094
Change-Id: Iaf8b224e89210027a62815596c759034cca1d4f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123220
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-10-28 22:04:39 +00:00
Samir Jindel c885bdde1d [vm] DBC is obsolete. Remove dead code.
Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-27 18:18:29 +00:00
Nicholas Shahan d166b0be1c [dartdevc] Reorganize and add some NNBD subtype test cases
- The strong and weak tests are still identical because weak mode still executes
  with the strong mode semantics.
- This is organization prep to make it easier to all what cases are covered and
  what changes when I land the weak mode support.

Change-Id: I4b067cee9a4f88b417587f1bf6a42c15fa4f624e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123005
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-25 23:51:02 +00:00
Aart Bik 74433e70da [vm/compiler] fix assertion bug in SSA builder
Rationale:
Our "front-end" may leave CreateArray on stack
in control-flow-collection (viz. BuildMapLiteral()
and BuildListLiteral()).

https://github.com/dart-lang/sdk/issues/39071

Change-Id: I423a431aa9fac985996fb09df6a98c46aed3d696
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122960
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-25 20:11:17 +00:00
Dmitry Stefantsov 9910fa8454 [cfe] Implement the first part of NNBD-aware isSubtypeOf
This CL is a squashing of the following smaller CLs:

* https://dart-review.googlesource.com/c/sdk/+/120669/
* https://dart-review.googlesource.com/c/sdk/+/120670/
* https://dart-review.googlesource.com/c/sdk/+/121331/
* https://dart-review.googlesource.com/c/sdk/+/121381/
* https://dart-review.googlesource.com/c/sdk/+/121383/
* https://dart-review.googlesource.com/c/sdk/+/121620/
* https://dart-review.googlesource.com/c/sdk/+/121707/
* https://dart-review.googlesource.com/c/sdk/+/122144/
* https://dart-review.googlesource.com/c/sdk/+/122360/
* https://dart-review.googlesource.com/c/sdk/+/122381/
* https://dart-review.googlesource.com/c/sdk/+/122783/
* https://dart-review.googlesource.com/c/sdk/+/122787/

Change-Id: I9d850f531f0fce07055ff9b5cd39abb605752005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122868
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-25 16:37:39 +00:00
Erik Ernst 6826faf583 Update spec_parser.
Update spec_parser to enable configurableUri in deferred imports,
make cascade syntax compositional, include `extension` declarations,
add `late` as a built-in identifier, and reorder the lexical rules for
single words such that they are grouped into reserved words, built-in
identifiers, and "other words known by the grammar".

Cf. language issue #615, #627, #628, #638.

Change-Id: If60b2ba2ca0e7d4bbc9b4e886857f657fb14c809
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121991
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-10-25 08:57:44 +00:00
Kallen Tu ef742aa6f0 [ddk] Modify _isInterfaceSubtype to consider variance annotations during runtime.
Change-Id: Idc1b553d24d76bfe52d51204aae0e0334f210fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121910
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-23 21:48:17 +00:00
Nicholas Shahan eaac08be3a [dartdevc] Setup NNBD weak mode test configuration
- Copy the strong mode subtype test and change the requirement to weak mode.
  Later commits will update the test to add extra weak mode expectations.
- Update the normalization tests to run in both modes.

Change-Id: I5ccff181f12756aab003c2e6db43b52ead257b19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122589
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-23 20:58:47 +00:00
Daco Harkes 1a747c6546 [vm/ffi] Enable spilling floats in slow paths
Closes: https://github.com/dart-lang/sdk/issues/39068
Change-Id: I00d6fd82b7b5a56592bc4ab32bdc8b66fed67201
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try,flutter-engine-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122646
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-23 18:09:05 +00:00
Daco Harkes 2be376385c [vm/ffi] Support moves with temp in ffi call
Fixes: https://github.com/dart-lang/sdk/issues/39063
Change-Id: I33e86d48620dcbe90966fec3d379c5165506e380
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try,flutter-engine-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122640
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-23 17:42:41 +00:00
Martin Kustermann e82fedc345 [vm] Remove deprecated (and untested) ARMv5 support from the VM
Since we have no CQ/CI test coverage of ARMv5 and none of our customers
uses it, a breaking change request was made (see issue further down).

The breaking change has been approved and a corresponding email has been
sent out:

https://groups.google.com/a/dartlang.org/forum/?nomobile=true#!topic/announce/vRQja7di3FQ

This CL removes any armv5 related code from our codebase.

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

Change-Id: I9abf32f1980ca19a9cf882b43c9966b2127f89e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-23 14:44:33 +00:00
Daco Harkes 5fd6c8a3c1 [vm] Do not fuse constants with different representations
Issue: https://github.com/dart-lang/sdk/issues/39044
Change-Id: I19b1309adb769742b498ed0b6fe80ae38a779405
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try,flutter-engine-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122396
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-23 12:59:28 +00:00
Sigmund Cherem cccb9ffb2a Stop timer callbacks after a hot reload
Change-Id: I90f0f2311524670fe52014de917afa3a35e3037d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122522
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-10-23 04:16:06 +00:00
Nicholas Shahan c33faf391c [dartdevc] Move NNBD specific test helper methods to their own file
Allows for reuse of the standard helpers that create types with and without
NNBD.

Change-Id: I8e16483e704efb47173f56c126311f7d57ece8a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122487
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-22 21:55:26 +00:00
Ryan Macnak 6a65ea9cad [vm] Remove shared snapshot and reused instructions features.
Shared snapshots have been disused by Fuchsia deduping.
Reused instruction has been disused by Flutter code push.

Change-Id: Ia4cb570935c233a9365d521ca04a477c5550ef83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122421
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-22 19:02:26 +00:00
Kallen Tu 4601bd7bff Modified supertype check error message to be more descriptive.
Change-Id: I3068bf195eb9a746d25ac62007eaeac0296d3087
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121463
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-22 16:59:16 +00:00
Zichang Guo b942142e9e [io] add testcases for link pointing to directory
As Alex suggested, add test for links of directory. Previous cl only check links pointing to a file.
https://dart-review.googlesource.com/c/sdk/+/122028/

Change-Id: I0529c9cdde3178a3364b0d091c833b5c63a39b47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122422
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-10-21 22:31:32 +00:00
Nicholas Shahan 199a42f3c1 [dartdevc] Cache the results of subtype checks
- Save the canonical instance of a nullable or legacy types on the canonical
  instance of the non-nullable type.
- Add additional normalization when creating nullable and legacy types.

Issue: #38109
Change-Id: I1132917965db3b00f87b891a0800da46e2cc6b3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122061
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-21 19:59:18 +00:00
Daco Harkes 8b3d76dff1 [analyzer/ffi] Fix crash with dynamic field in struct
Closes: https://github.com/dart-lang/sdk/issues/38993

Change-Id: I6aaa265020709d5846a40bd8fb1c7bd1ef38903c
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122341
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-21 11:05:20 +00:00
Kallen Tu 531aaa9ad2 [ddk] Emit variance modifiers for classes, mixins, mixin applications.
Will be used for runtime subtype changes in future CLs.

Change-Id: I53ba10c994f13300541b3ae7a9e14d52c3836771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121821
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-19 01:03:41 +00:00
Zichang Guo 57a88fc33c Reland "[io] exclude links from isDirectory()"
This is a reland of 49d743f940

Original change's description:
> [io] exclude links from isDirectory()
> 
> isDirectory() should not return true for links.
> 
> Bug: https://github.com/dart-lang/sdk/issues/35102
> Change-Id: I737345a581d6a50d7bccab0dbc10f1a31a57e219
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121900
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

Bug: https://github.com/dart-lang/sdk/issues/35102
Change-Id: Ifa4317ec77172d3f196f6f75307b940d614e27bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122028
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-10-18 22:17:21 +00:00
Zichang Guo 50f9dd8941 Revert "[io] exclude links from isDirectory()"
This reverts commit 49d743f940.

Reason for revert: break vm-kernel-precomp-mac-release-simarm64 bot

Original change's description:
> [io] exclude links from isDirectory()
> 
> isDirectory() should not return true for links.
> 
> Bug: https://github.com/dart-lang/sdk/issues/35102
> Change-Id: I737345a581d6a50d7bccab0dbc10f1a31a57e219
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121900
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=asiva@google.com,zichangguo@google.com

Change-Id: I66ee7d3b3f0ae2bcf80b00e0f3c68bba3e520966
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/35102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122060
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-10-17 22:20:38 +00:00
Zichang Guo 49d743f940 [io] exclude links from isDirectory()
isDirectory() should not return true for links.

Bug: https://github.com/dart-lang/sdk/issues/35102
Change-Id: I737345a581d6a50d7bccab0dbc10f1a31a57e219
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121900
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-17 21:05:56 +00:00
Daco Harkes d2b39d1a07 [cfe/ffi] asFunction/fromFunction variance in CFE + regression test
Issue: https://github.com/dart-lang/sdk/issues/37385

Change-Id: I0a0704f3513bf8de802e7481d813f72678837e0b
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,dart-sdk-linux-try,analyzer-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107511
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-17 17:44:06 +00:00
Nicholas Shahan ba728b1368 [dartdevc] Copy nnbd subtype test to run on nnbd strong configurations
Remove shards from builder configuration for now because there is currently only
one test.

Change-Id: I5dcce5601ed46e36b28f9cab9bede1d81c1a42ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121865
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-17 17:10:22 +00:00
Paul Berry 7d4bc6a1df Fix handling of null awareness in cascade expressions.
Change-Id: Id8f9f45d04bac135c516e543542991c4cb4a0c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121909
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-17 16:09:30 +00:00
Ben Konyi 4e449069f2 [VM] Skip verbose_gc_to_bmu_test on precompiled configs
Change-Id: I3ad60a97543369e18c39b62bdb8cc098a5dd2fe8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121943
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-10-17 15:58:28 +00:00
Martin Kustermann 30719b37a9 [analyzer/ffi] Allow "Pointer<NativeType>" in native function signatures
Issue b/142788837

Change-Id: If3a25bf67525f3fa5bc964df291ed4461e0da53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121854
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-10-17 10:42:54 +00:00
Ben Konyi 0b045aea2b [ VM ] Removed tests/standalone along with any references in build bot / test runner configurations
Deleted irrelevant tests and migrated valid tests to Dart 2

Change-Id: If37611e051b7e2f128c53267f606d480d7fe23a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121902
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-17 00:41:16 +00:00
Mayank Patke 3964afdbc5 [dart2js] New RTI: Stop recognizing "dynamic" as a recipe.
Change-Id: I9c7482cc91671654e90f936ae1302c623b6cc227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121774
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-10-16 21:13:41 +00:00
Alexander Markov c19adc6355 [vm,aot] Fix handling of exported extensions in TFA tree shaker
Fixes https://github.com/flutter/flutter/issues/42845

Change-Id: If4734c16a46f74547f9fc92e4d4e26a969a9f809
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121861
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-16 21:07:26 +00:00
Samir Jindel ca669032c3 [vm/aot] Re-enable dwarf_stack_trace_test.
Fixes https://github.com/dart-lang/sdk/issues/38836

Change-Id: I8547022951a96fa69a662b56c8335ac6fbe8ffad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121702
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-16 09:27:03 +00:00
Mayank Patke 2baf675742 Add test demonstrating that FutureOr<A> <: FutureOr<B> =/=> A <: B.
Change-Id: Iedc60b57f80e77784e54b8d5ed9076c5016edd2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121653
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-15 23:07:03 +00:00
Nicholas Shahan a73eba9823 [dartdevc] Preliminary additions to support NNBD runtime subtype checks
Uses a temporary representation for nullable and legacy types that is subject to
change.

Updated subtype test to include expectations when running with strict mode
checks.

Does not yet include support for:
* Required named parameters
* Weak checking modes (currently only strict checking)
* Caching the results of a check for a later lookup

Issue: #38128
Change-Id: I60935c071affdb56c368e9555fce8f86931103e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119537
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-15 23:00:58 +00:00
Mayank Patke f10d79618a [dart2js] Use generic function type parameters in RTI subtype check.
Change-Id: Idb1409cd5db5e04857355cfc32a6366098aa882e
Bug: https://github.com/dart-lang/sdk/issues/38816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121501
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-10-15 21:53:56 +00:00
Martin Kustermann 65813f5856 [analyzer/ffi] Extends dart:ffi specific analyzer checks
This makes all tests in the ffi test suite pass:

   % tools/test.py -cdart2analyzer -mrelease -ax64 ffi

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

Change-Id: I93338ee530041e5e8cb1eb5958b12fbf1517496e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121711
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-15 21:33:27 +00:00
Daco Harkes d82ca1a9c7 [vm/ffi] Remove Struct type argument
This has coupled changes in package:ffi and package:tflite_native which are pinned in DEPS.

This CL includes the required analyzer changes from https://dart-review.googlesource.com/c/sdk/+/121647.

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

Change-Id: I712a886fd28ce0a2954fc42c90e1dfa495057732
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121422
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-15 18:35:57 +00:00
asiva a551c507bd [VM] Implement name demangling of extension methods.
Change-Id: Id64ae1aa0de89260b6bf2d6f40260a0dc9ef5c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-14 20:40:09 +00:00
Daco Harkes 91c6dc15de [vm/ffi] Pointer.asExternalTypedData to extension method
Issue: https://github.com/dart-lang/sdk/issues/38610

Change-Id: Ib07f50b23e3be2bce2d7b973c0f0196884397952
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121384
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-14 09:52:58 +00:00
Aart Bik cf60eb48b9 [vm/compiler] reduced regression test size
https://github.com/dart-lang/sdk/issues/38741

Change-Id: Ief99230c19dd55fb300f94049f320f276461c86c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121409
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-11 21:15:20 +00:00
Kallen Tu b3df8aaa12 Change subtype checking with variance for assignments and methods.
Change-Id: I2594c8749ee445a02e06f82c65cd34a62fc77a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120744
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-11 19:44:05 +00:00
Aart Bik 9515301418 [vm/compiler] fix bug on need for check
Rationale:
When the static class type does not match information found
in ICData, we require a check on a mismatch. However,
unused data should not be considered

https://github.com/dart-lang/sdk/issues/38741

Change-Id: If7717bfbce2f2a09014ce3e7cdcbf34816102b9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121141
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-11 16:45:52 +00:00
Daco Harkes 9f33e8da04 [vm/ffi] Pointer optimize indexed load and store
Follow up of https://dart-review.googlesource.com/c/sdk/+/117547

This gets rid of unnecessary allocations in hot loops with indexed loads and stores.

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

Change-Id: I37a4b1aba00084e465d47cce79bb9963e1afc104
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119645
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-11 15:54:01 +00:00
Samir Jindel e1c159d5fe [vm/ffi] Add missing sharded library dependency to ffi/data_test.dart.
Change-Id: I399882d0911b3e5de86b752048a22e96d2415e3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121420
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-10-11 15:52:37 +00:00
Samir Jindel 4ee5ef9f10 [vm/ffi] Use Pointer<Null> as the type of nullptr.
Also clean up test/benchmark/sample code using nullptr and fix pubspec.yaml in the SQLite sample.

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

Change-Id: I6fa0522374af28020ef8f096ac22b23712aedb5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121122
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-11 14:39:47 +00:00
Kallen Tu 5098e90de5 Change subtype check for overrides to handle variance.
Part of variance subtyping changes, variance handled in
overriden methods.

Change-Id: I23db9c9f8b91bb2ac5634a909da9cf47416f94cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120625
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-10 20:04:47 +00:00
Samir Jindel 8859206dba [vm/ffi] Remove Pointer.offsetBy.
Fixes https://github.com/dart-lang/sdk/issues/35883

Change-Id: Idf4b113d655a6cf7063f1ee7732ddd2001247dee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121124
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-10-10 15:44:27 +00:00
Daco Harkes cba6c8cc3d [vm/ffi] Fix high memory addresses on 32 bit
Issue: https://github.com/dart-lang/sdk/issues/38789

Change-Id: I3227b77c4953dac6aa8b42326539f565eb28ea84
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121125
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-10 15:35:47 +00:00
Samir Jindel 63d3012e68 [vm/ffi] Deprecate Pointer.allocate/free.
Fixes https://dart-review.googlesource.com/c/sdk/+/118442.

Also updates untested sample code in samples/ffi.

Change-Id: Id40a7b8fbb35c5d989269646ebb22864cebcfcac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118441
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-10 13:17:43 +00:00
Martin Kustermann 628e0434bd [vm/ffi] Enable analyzer on ffi test suite
Issue https://github.com/dart-lang/sdk/issues/35777

Change-Id: Ia8edd9901d52e671a116c7747319fdadd7da4681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121060
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-10 10:38:36 +00:00
Martin Kustermann 1dbfd1f6bc [vm/ffi] Add high memory test running in 32-bit configurations
Issue https://github.com/dart-lang/sdk/issues/37251
Issue https://github.com/dart-lang/sdk/issues/38789

Change-Id: I80b117fa190673400bdf13264ea292444c369ee1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120960
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-10-10 09:43:27 +00:00
Ryan Macnak 71ecb73a2b [vm] Fix one MSAN failure; add UBSAN configuration.
Change-Id: I5b1d43836f3eb09983195fc3792f369aa3f8079f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120750
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-09 23:38:30 +00:00
Zichang Guo 8866cdb8be [vm] throw exception if directory buffer overflows on Windows
According to https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readdirectorychangesw,
When using ReadDirectoryChangesW, buffer overflows will still return true. It ends up closing the stream without any notification.
Throw an exception to notify users.

Bug: https://github.com/dart-lang/sdk/issues/37233
Change-Id: I9aebed8b1f30b5e843ad37a51b87d234aa1d8ce6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119524
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-10-09 19:59:52 +00:00
Johnni Winther 72bae7be70 [cfe] Handle all bounds checks on extension methods.
Closes #38755

Change-Id: I3d5449950ecb3268436a3033ae16bac590a1e4b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120790
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-09 19:50:02 +00:00
Martin Kustermann 55d1c95e08 [vm] Fix instruction deduplication for bare-AOT mode
Though we disable deduplication for instance methods because switchable
calls rely on a unique PC -> Code mapping atm.

Change-Id: I80915e97f5e06c3f1251ea3176d5c4f8413a81ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120041
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-09 19:45:42 +00:00
Nate Bosch 2ffdc54d24 Handle exported extensions in dill library builder
- Add a modular test to demonstrate the bug.
- Handle `Extension` nodes in `finalizeExports`.

Change-Id: Ie16f0c97059d24a122150a607e26fba258d80cfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120926
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-10-09 18:48:54 +00:00
Alexander Thomas 7a6e62332f [co19] Prepare to roll from pre-nnbd branch
The master branch in the co19 repository is now the NNBD fork. For the
time being, we want to roll the legacy variant into co19_2. At a later
stage, we will also depend on the NNBD fork, but it will likely be a
different suite.

Change the script to use dart/try rather than the legacy bucket format.

TBR=whesse@google.com

Change-Id: I9b43d9d4a49f2cfd16b8be9cca025c6d750cf2bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120781
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-10-09 10:36:57 +00:00
asiva b12bed36a8 [VM] Implement isExtensionMember in MethodMirror and VariableMirror
Added ability to recognize a MethodMirror to be a mirror of an extension member
Added ability to recognize a VariableMirror to be a mirror of a static
extension field.

Change-Id: I56715a491bba0d8cafb2796ebb755bd339e147c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120760
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-09 00:27:30 +00:00
Kallen Tu e3ca5ee6ba Check variance of type-parameter use in supertypes.
Tests have both correct and erroneous implementations
of variance.

Change-Id: I49dd76f42399015dd6e3f9688e598c271ce7ab1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119722
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-08 21:33:40 +00:00
Leaf Petersen bb04f145b2 Update CFE expectations for extension method tests.
Change-Id: I04662433cb031043714d5ad0a1050a5398b1cf95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120740
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-10-08 20:16:39 +00:00
Daco Harkes ee0b1df4a6 [vm/ffi] Migrate tests/samples/benchmarks to extension methods
I used the regex replaces documented on the `load` and `store` deprecated methods.
I manually replaced some `.val` to `.ref` when a regex could not detect whether something was a primitive value or a struct.

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

Change-Id: I3534b6dd00d9ac45fa1a11fe75c80fb3cccc07dc
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118993
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-08 16:49:41 +00:00
Daco Harkes 597cd06aec [vm/ffi] Pointer load and store as extension methods
Issue: https://github.com/dart-lang/sdk/issues/37773
Change-Id: I836d6305b613cf05590d872874f4517831be3e08
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118992
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-08 16:49:41 +00:00
Daco Harkes d23c824435 Reland "[vm/ffi] Optimize Pointer operations for statically known types"
Original CL in patchset 1.
Fix for simdbc in patchset 4.
Fix for arm32 precompiled in: https://dart-review.googlesource.com/c/sdk/+/120660/

This CL optimizes Pointer operations in hot loops for Pointer<NativeInteger/NativeDouble/Pointer> (not for structs).

Design: go/dart-ffi-pointers-il

It provides roughly a 100x speedup for the FfiMemory benchmark. The next 5x speedup is to get rid of allocations due to `load` and `store` not being inlined.

FFI API is changed to enable optimizations:

* Disable dynamic invocations of Pointer.load / Pointer.store.
* Disallow implicit downcast of argument passed to Pointer.store.
* Stop zeroing out Pointer.address on Pointer.free().

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

Related issues:

Closes: https://github.com/dart-lang/sdk/issues/35902 (Disallowing dynamic invocations of Pointer ops.)
Closes: https://github.com/dart-lang/sdk/issues/37385 (Function variance checking)
Change-Id: I3921a595fd05026d6ca565ace496771d7c1d877b
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120661
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-08 13:04:39 +00:00
Ryan Macnak d5feab0c53 [vm] Create builds for LeakSanitizer, MemorySanitizer and ThreadSanitizer.
Change-Id: I65905ec76fcde8b7f4063cb5b80a3d034b453153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120323
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-07 16:24:22 +00:00
Daco Harkes 0eff6b38a9 Revert "[vm/ffi] Optimize Pointer operations for statically known types"
This reverts commit 3712ed27ef.

Reason for revert: Breaks Arm32 precompiled.
Issue: https://github.com/dart-lang/sdk/issues/38737

Original change's description:
> [vm/ffi] Optimize Pointer operations for statically known types
> 
> This CL optimizes Pointer operations in hot loops for Pointer<NativeInteger/NativeDouble/Pointer> (not for structs).
> 
> Design: go/dart-ffi-pointers-il
> 
> It provides roughly a 100x speedup for the FfiMemory benchmark. The next 5x speedup is to get rid of allocations due to `load` and `store` not being inlined.
> 
> FFI API is changed to enable optimizations:
> 
> * Disable dynamic invocations of Pointer.load / Pointer.store.
> * Disallow implicit downcast of argument passed to Pointer.store.
> * Stop zeroing out Pointer.address on Pointer.free().
> 
> Issue: https://github.com/dart-lang/sdk/issues/38172
> 
> Related issues:
> Closes: https://github.com/dart-lang/sdk/issues/35902 (Disallowing dynamic invocations of Pointer ops.)
> Closes: https://github.com/dart-lang/sdk/issues/37385 (Function variance checking.)
> 
> Change-Id: I96058d8b5b49052eb6999f084372e6f08b4f6f17
> Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117547
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,sjindel@google.com,dacoharkes@google.com

Change-Id: I3b7923ace45beaa9f99119e9ea20c1e52b429ad8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/38172
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, vm-ffi-android-debug-arm64-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-x64-try, vm-kernel-win-debug-ia32-try, vm-dartkb-linux-debug-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-dartkb-linux-release-x64-abi-try, vm-kernel-precomp-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120582
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-07 11:50:43 +00:00
Daco Harkes 3712ed27ef [vm/ffi] Optimize Pointer operations for statically known types
This CL optimizes Pointer operations in hot loops for Pointer<NativeInteger/NativeDouble/Pointer> (not for structs).

Design: go/dart-ffi-pointers-il

It provides roughly a 100x speedup for the FfiMemory benchmark. The next 5x speedup is to get rid of allocations due to `load` and `store` not being inlined.

FFI API is changed to enable optimizations:

* Disable dynamic invocations of Pointer.load / Pointer.store.
* Disallow implicit downcast of argument passed to Pointer.store.
* Stop zeroing out Pointer.address on Pointer.free().

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

Related issues:
Closes: https://github.com/dart-lang/sdk/issues/35902 (Disallowing dynamic invocations of Pointer ops.)
Closes: https://github.com/dart-lang/sdk/issues/37385 (Function variance checking.)

Change-Id: I96058d8b5b49052eb6999f084372e6f08b4f6f17
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117547
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-07 09:23:54 +00:00
Kallen Tu 9461df2084 Language tests for variance modifiers.
These test basic correct usages of variance modifiers in fields
and methods.

Erroneous usages will come in a future CL, as well as more complex
examples + subclassing.


Change-Id: I05d547ac1db9e22235a0bf64b05fcb3e119e3157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119169
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2019-10-05 01:18:42 +00:00
Leaf Petersen 7486512634 Update CFE expectations for extension method tests.
Change-Id: I673f5187d74cddfe2f2e54774a713713a137b081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120025
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-04 17:55:26 +00:00
Mark Zhou 26b1aca71e [dartdevc] Canonicalizing partial instantiation constants
Fixes #38703

This fixes the last whitelisted DDK test.

Change-Id: I1fd79c2bc361b2a4bf7fce60a406be521408024b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119921
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-10-03 20:45:13 +00:00
Samir Jindel b2bf860e56 [vm/ffi] Fix FfiCall on ARM_X64.
Fixes https://github.com/dart-lang/sdk/issues/38690

Change-Id: I597361ed611885bcf93584a76f8baaf1108e7026
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119940
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-03 18:51:33 +00:00
Sigmund Cherem 33494de2f9 (ddk modular test) exclude sources from dill files.
This fixes the issue we had with shared/diamond depedencies.  This also matches
more closely how DDK is invoked internally and externally.

While the change to use `--dart-sdk-summary` is not necessary, this brings the
API closer to how it is used elsewhere. It should be cleaned up in the future to
reuse the `--input-summary` flag instead.

Change-Id: Iec3695b5541ffaf7f5762a3d77f071a596237da1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119723
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-10-02 22:22:11 +00:00
Dmitry Stefantsov bdf6b9505e [cfe] Ask for subtype checking mode explicitly
The interpretation of the subtype check result depends on the mode.  In partial
NNBD mode all type errors that wouldn't be errors in non-NNBD programs should
become warnings.  In full NNBD mode all such errors are errors.  This CL adds
the mode explicitly to the interface of the subtype check as a parameter.

Bug: http://dartbug.com/38673
Change-Id: I14bcdd260618530cfdd8189c01abba7469a16679
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119545
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-02 11:30:29 +00:00