Commit graph

20001 commits

Author SHA1 Message Date
Zichang Guo da9dd59eb0 Reland "Reland "fix hanging of write on Windows""
This is a reland of af4a3112c4

Original change's description:
> Reland "fix hanging of write on Windows"
> 
> This is a reland of eb075dcc21
> 
> Original change's description:
> > fix hanging of write on Windows
> > 
> > When using File::Write(), Var size in int64_t is casted to DWORD(unsigned long). When Var size is out of DWORD range, casted value will be zero. Before calling into File::Write() on Windows, validate the size.
> > 
> > Bug: https://github.com/dart-lang/sdk/issues/40339
> > Change-Id: I36fade62dfa3025f418405cb3e45c286dd6b7db1
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134440
> > Reviewed-by: Zach Anderson <zra@google.com>
> > Commit-Queue: Zichang Guo <zichangguo@google.com>
> 
> Bug: https://github.com/dart-lang/sdk/issues/40339
> Change-Id: I5a07c58709c62b996a55a76272636602dc80e20d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134783
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

Bug: https://github.com/dart-lang/sdk/issues/40339
Change-Id: I78e4bd993271cdeac9db5a1d005ae5be0f2891c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135340
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-02-14 17:49:42 +00:00
Nicholas Shahan 29c9658c51 [dartdevc] Map bottom type to Null in legacy libraries
Fix instance checks for types that are internal to the type system.

Fixes: #40610
Change-Id: I0c6c1bb4d64f25a97c53bd64a3940cf3e9f45c88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135580
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-14 16:16:07 +00:00
Daco Harkes c1467ab5d3 [vm/ffi] Change asFunction and lookFunction to extension methods
This prevents them from being called dynamically.
Moreover, it prevents asFunction from being called on a non-NativeFunction type argument, simplifying the amount of manual checks.

Note that this CL had to change the CFE and analzyer, and their tests (including mock_sdk) as well.

This can potentially be a breaking change, as the extension methods are only visible when `dart:ffi` is imported, while methods on objects are always visible.

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

Change-Id: I1e291f154228d5d9a34b21a022088bf493f6557d
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,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135463
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-14 15:46:37 +00:00
Alexander Markov 8ac7f6bce7 Revert "[vm/aot/tfa] Tree shake write-only fields"
This reverts commit ff34fd8110.

Reason: crash on the internal app
Issue: https://github.com/flutter/flutter/issues/50745

Change-Id: Ifcfbb38fa04d27558f9e78ca6b2a8637693c7d76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135794
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-14 02:04:01 +00:00
Mayank Patke 1591ddcf1e [dart2js] Normalize DartTypes.
Change-Id: I2c3ddbecf9f9bbaac8f940398a7d5949c441fca4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134941
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-14 01:59:12 +00:00
Mayank Patke 573f470615 [dart2js] Represent nullability as a field.
Change-Id: I12f4c7acfa294b0e92d3f94f7099ffa2aa9cc0a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134792
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-14 01:59:12 +00:00
Robert Nystrom 0d34bf5571 Remove another one of the unittest-like libraries.
This one was literally only used for a single test. :-/

Change-Id: I316e17ecaf9a839b3c6f27ec86971a67ab52bbfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135782
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-02-13 23:36:13 +00:00
Konstantin Shcheglov c7b501625e Validate not only errors, but also warnings.
Change-Id: I2c03711061ccd40d1609cf9148f3169b4df847d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135600
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-13 21:31:59 +00:00
Konstantin Shcheglov ed705e8c84 Move DEAD_NULL_COALESCE reporting to ErrorVerifier.
So, it is reported even when hints are disabled.

Change-Id: Id2df8faa5421fac00e01755a70aedf3d3f570f10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135492
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-13 19:42:48 +00:00
Robert Nystrom ddef611e04 Copy over the README.
That's the only thing in language_2/async_no_suspend.

A little weird, but I think it's worth copying it just to minimize the
diff between the two test directories.

Change-Id: Iac7078d8e44ac63331c38bd6465a654880bbeb98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134905
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-02-12 23:45:07 +00:00
Robert Nystrom 86f8e3438a Migrate language_2/async_nested to NNBD.
Change-Id: I16f1be4e17fa87aa94b294f281dfe14ea0129eb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134904
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-02-12 20:46:37 +00:00
Jens Johansen 81d4ac07d4 [CFE] Use package config v2
Change-Id: I32da9e8b2c1040db1521af4345f8e952c22bd30d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130864
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-12 10:07:25 +00:00
Nicholas Shahan 69d481065b [tests] Add tests for generic function type bounds with null safety
Testing that type arguments bounded by legacy types are equivalent
with nullable and non-nullable versions of the same types.

Re-landing this change with preapprovals for the VM configurations that
failed the last time.

Change-Id: Ic1709033dc3f3d9d7fc08357c0ad29bf976ed06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134867
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-11 22:31:55 +00:00
Robert Nystrom bdcde6beec Pass a "--default-language-version" flag to analyzer for legacy tests.
When the test runner runs a legacy test with the non-nullable experiment
enabled, this passes an extra command line flag to tell analyzer to
treat the test library as opted out of NNBD.

This CL also removes the guard that made the test runner skip all legacy
tests when running analyzer with the non-nullable experiment enabled.
We want to run those tests now and (when analyzer supports the new
command line flag) they should be correctly treated as opted out.

This change also removes the tests package config file since that no
longer needs to be used to set the language version. It also removes the
code to generate a package config for the multitests. This CL replaces
both of those mechanisms.

Change-Id: Iedc1e6111bc0623ac21263499f3f5d11bd6fdf7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135346
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-02-11 21:34:15 +00:00
Alexander Aprelev f352f9e5e2 Revert "Reland "fix hanging of write on Windows""
This reverts commit af4a3112c4 as it broke asan linux bot.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Reland "fix hanging of write on Windows"
> 
> This is a reland of eb075dcc21
> 
> Original change's description:
> > fix hanging of write on Windows
> > 
> > When using File::Write(), Var size in int64_t is casted to DWORD(unsigned long). When Var size is out of DWORD range, casted value will be zero. Before calling into File::Write() on Windows, validate the size.
> > 
> > Bug: https://github.com/dart-lang/sdk/issues/40339
> > Change-Id: I36fade62dfa3025f418405cb3e45c286dd6b7db1
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134440
> > Reviewed-by: Zach Anderson <zra@google.com>
> > Commit-Queue: Zichang Guo <zichangguo@google.com>
> 
> Bug: https://github.com/dart-lang/sdk/issues/40339
> Change-Id: I5a07c58709c62b996a55a76272636602dc80e20d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134783
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I5f53e42c56859a46e9fe40e1a1e7fba541e5378e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/40339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135260
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-02-11 02:58:10 +00:00
Zichang Guo af4a3112c4 Reland "fix hanging of write on Windows"
This is a reland of eb075dcc21

Original change's description:
> fix hanging of write on Windows
> 
> When using File::Write(), Var size in int64_t is casted to DWORD(unsigned long). When Var size is out of DWORD range, casted value will be zero. Before calling into File::Write() on Windows, validate the size.
> 
> Bug: https://github.com/dart-lang/sdk/issues/40339
> Change-Id: I36fade62dfa3025f418405cb3e45c286dd6b7db1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134440
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

Bug: https://github.com/dart-lang/sdk/issues/40339
Change-Id: I5a07c58709c62b996a55a76272636602dc80e20d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134783
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-02-10 22:16:55 +00:00
Ryan Macnak 0fde59b21d [vm] Further mirrors and test fixes.
Bug: https://github.com/dart-lang/sdk/issues/40497
Change-Id: Ieed8a51600f92fa4dc9137bf1f4ed58bb4cfa598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134900
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-10 20:58:05 +00:00
Robert Nystrom 8871d3bc1c Bump the version numbers in the test package config to "2.7".
2.6 matches the versions used in the existing "// @dart=2.6" comments
in the tests, but it excludes extension methods, which we have tests
for so need to enable.

Change-Id: I816baeeb308ec0cac967b21d23eeccfb32cf1733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134878
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-02-10 19:57:15 +00:00
Mark Zhou 82b73697d7 [dartdevc] Implementing generic function type object equality.
dartdevc_native tests also have to be updated to not wrap/unwrap generic function types.

Change-Id: I4115db483bb6668c171ec29ca7483dfabc470df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133285
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-10 17:36:14 +00:00
Daco Harkes 160614929a [vm/ffi] Fix sign extension for small int arguments on x64 Linux/MacOS
Sign extension of small integers is not symmetric between register arguments and register return values.
On Linux/MacOS x64, the caller is responsible for both the arguments and return value.

Previous tests only tested equality, which tests the equality of the lowest byte. However, when printing or using the small ints arithmetic all 4 bytes are used. The new tests pass back the number in a different format.
The callback tests test the number in Dart, so they did not suffer from implicit conversions. (TestTakeMaxUint8x10 in runtime/bin/ffi_test/ffi_test_functions.cc and tests/ffi_2/function_callbacks_test.dart.)

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

Change-Id: I6a57cb7cb43206926eb101a66e3b2abfacec72a0
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,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134825
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-10 17:05:14 +00:00
Teagan Strickland e01457d138 Reland "[vm/aot] Remove object wrapping of bare instructions for AOT snapshots."
Now, when writing an AOT snapshot in bare instructions mode, only
the actual instructions in the RawInstructions payload are serialized
instead of the entire RawInstructions object.

Since there are no longer RawInstructions objects in these AOT
snapshots, we also change how Code objects are serialized. Instead
of just containing a reference to the RawInstructions object, we
serialize two pieces of information: where the instructions
payload for this Code object begins and whether there was a single
entry for the instructions payload. (To save space, the single
entry bit is serialized as the low order bit of the unchecked
offset, which was already being serialized).

While we also need the length of the instructions payload, we
approximate it for all but the last Code object by subtracting
the next Code object's payload start from this Code object's
payload start. For the last Code object, we assume it extends
to the end of the instructions image.

Changes on flutter gallery in release mode:
armv7: instructions size -2.70%, total size -1.73%
armv8: instructions size -6.04%, total size -3.63%

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

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: Ia0a5c4e5e47c956776dc62503da38ec55a143c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134325
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-10 15:08:04 +00:00
Paul Berry a6d792797c Fix package_config.json configVersion field.
Change-Id: Icf35201202de43bd01b1d48254f789a5df197f25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134862
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-02-07 23:39:38 +00:00
Nicholas Shahan 35cd61819a Remove dart:mirrors library from dart2js and ddc SDKs
A followup change will delete the patches that are no longer needed once
these changes have been "mirrored" :P to the libraries files in the
flutter repos.

Change-Id: I7d255838b97922198248b29311facd4956001e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134405
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-07 17:34:54 +00:00
Jonas Termansen 3433d8cfc3 [nnbd] Migrate standalone/io to NNBD.
The tests are also now dartfmt.

Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: I8dece8097b37b70d47a5374dae2f3fadb0fc4b90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134338
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-02-07 14:41:36 +00:00
Robert Nystrom 688801cb27 Migrate language_2/assert to NNBD.
Change-Id: I4daa09afa52f76076374591b3e3f3420a46b169b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134240
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-02-06 22:47:25 +00:00
Zichang Guo 748bbb720a Revert "fix hanging of write on Windows"
This reverts commit eb075dcc21.

Reason for revert: Out of memory on IA32 and On MacOS, invalid path argument on MacOS.

Original change's description:
> fix hanging of write on Windows
> 
> When using File::Write(), Var size in int64_t is casted to DWORD(unsigned long). When Var size is out of DWORD range, casted value will be zero. Before calling into File::Write() on Windows, validate the size.
> 
> Bug: https://github.com/dart-lang/sdk/issues/40339
> Change-Id: I36fade62dfa3025f418405cb3e45c286dd6b7db1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134440
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

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

Change-Id: I9d515912ad99f523c6d19fac0c8fbbb23a897986
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/40339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134768
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-02-06 20:34:32 +00:00
Zichang Guo eb075dcc21 fix hanging of write on Windows
When using File::Write(), Var size in int64_t is casted to DWORD(unsigned long). When Var size is out of DWORD range, casted value will be zero. Before calling into File::Write() on Windows, validate the size.

Bug: https://github.com/dart-lang/sdk/issues/40339
Change-Id: I36fade62dfa3025f418405cb3e45c286dd6b7db1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134440
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-02-06 19:58:52 +00:00
Alexander Markov ff34fd8110 [vm/aot/tfa] Tree shake write-only fields
So far tree shaking was removing fields which are not used at all.
This change improves tree shaking of fields so fields
which are only written or used as interface targets can be removed.

The following limitations apply:

* Field is not removed if there is a constant object with that field, as
  it may impact identity of constant objects which is an observable
  behavior.
* Field is not removed if it has a non-trivial initializer as it may
  have side-effects.
* Late final fields are not removed, as writing such fields may have
  side-effect.
* When field is removed, we may need to introduce an abstract getter
  or abstract setter if field is used as a target of an interface call.
  If a field was written, then setter would be non-abstract (but empty).

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

Change-Id: I79c00158b8eb658081a647c5dbdecde481fddb41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134204
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-06 19:31:32 +00:00
Robert Nystrom cb6b535108 Create a package_config.json file for the SDK tests.
This (assuming it works right) tells Dart implementations to treat all
of the libraries in the legacy test directories as opting out of NNBD.

Change-Id: I36e5cd966921f759306f5b4bb50f18ae6049d4db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134409
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-02-06 19:27:12 +00:00
Robert Nystrom 4a76bafa5a Migrate lib_2/typed_data/typed_data_view_sublist_test.dart to NNBD.
Change-Id: I70eb2c4ffcff7bf0ed788e9586694daca945e831
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134603
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-06 14:59:11 +00:00
Mark Zhou bf66cba15e [tests] Updating tests to not depend on type variable names being conserved.
Change-Id: Id34fb4bbc4bb88241fd984acc490097e604d16cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134410
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-02-05 19:18:49 +00:00
Daco Harkes a71d60c1cf [vm/ffi] Support Linux on Arm 32-bit (hardfp)
Implement the hardfp calling convention.

Tested QEMU locally as the bots are not online yet.

tools/test.py -m debug -a arm -c dartkp --use-qemu ffi_2 ; tools/test.py -m debug -a arm -c dartk --use-qemu ffi_2
Test configuration:
    custom configuration(architecture: arm, compiler: dartkp, mode: debug, runtime: dart_precompiled, system: linux, use-qemu)
Suites tested: ffi_2
[00:45 | 100% | +  189 | -    0]
Test configuration:
    custom configuration(architecture: arm, compiler: dartk, mode: debug, runtime: vm, system: linux, use-qemu)
Suites tested: ffi_2
[09:52 | 100% | +  189 | -    0]

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

Change-Id: Ic34175bdf9b9f359f1126aeb157362e76443921a
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,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124136
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-05 14:22:59 +00:00
Jake Macdonald 12b5e23084 Revert "[dart:io] Backport semantic changes from the dart:io NNBD migration."
This reverts commit 4cd6243d77.

Reason for revert: Breaks anything using the bazel_worker package (which is used for modular compilation with build_runner).  https://travis-ci.org/dart-lang/build/jobs/645748778

Original change's description:
> [dart:io] Backport semantic changes from the dart:io NNBD migration.
> 
> The NNBD migration required making subtle changes to some dart:io
> semantics in order to provide a better API. This change backports these
> semantic changes to the unmigrated SDK so any issues can be discovered
> now instead of blocking the future SDK unfork.
> 
> The Process class will now throw a StateError if the process is detached
> upon accessing the stdin, stdout, stderr, and exitCode getters.
> 
> The Socket class will now throw a SocketException if the socket has been
> destroyed or upgraded to a secure socket upon setting or getting socket
> options.
> 
> Change-Id: I956fd07e713e51ebd479ebbfe4790d8d2fdf0744
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133989
> Commit-Queue: Jonas Termansen <sortie@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I744662fcd14ca232bf44a584bb6f3974d48da69a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134361
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-02-05 10:03:47 +00:00
Lasse R.H. Nielsen 3a36439abe Tests for language operators and constructs with (non-)nullable operands.
Test that the NNBD implementation does not allow a nullable expression
where a non-null value is expected for language constructs.

Similarly that null-aware operations used on non=-nullable values
are caught.

Change-Id: I877e9b464666698b7f25b355b0474eb171bfc4b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134160
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-02-05 10:00:27 +00:00
Mayank Patke 450924a8cd [dart2js] Remove typedefs from backend.
Change-Id: Ia170535b5d35d97003cff93acbf33cb3fe75725f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134206
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-05 01:09:47 +00:00
Nicholas Shahan f831f121d7 Revert "[tests] Add tests for generic function type bounds with null safety"
This reverts commit 21535e540f.

Reason for revert: VM test bots are failing and the approval system is down so I can't turn them green again. Reverting until I can approve the failures.

Original change's description:
> [tests] Add tests for generic function type bounds with null safety
> 
> Testing that type arguments bounded by legacy types are equivalent
> with nullable and non-nullable versions of the same types.
> 
> Change-Id: Ibd1166af68a74041920940789464cbb8afb091ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132969
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Erik Ernst <eernst@google.com>

TBR=leafp@google.com,rnystrom@google.com,eernst@google.com,nshahan@google.com

Change-Id: Iad45fcd1498bdd46bfb908cd40df7ca38ef47d2d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134461
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-05 00:58:27 +00:00
Nicholas Shahan 21535e540f [tests] Add tests for generic function type bounds with null safety
Testing that type arguments bounded by legacy types are equivalent
with nullable and non-nullable versions of the same types.

Change-Id: Ibd1166af68a74041920940789464cbb8afb091ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132969
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 22:37:35 +00:00
Erik Ernst 3fb7f6a724 Adjusted language/assign/to_type_test.dart to avoid irrelevant
nnbd type error.

By the way, I don't understand why the trybots didn't complain about
this, all trybots were green when
https://dart-review.googlesource.com/c/sdk/+/134224 was auto-submitted.

Change-Id: Id410fc18e9ebf9be6c180740067857e2309f47ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134291
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
2020-02-04 22:04:40 +00:00
Robert Nystrom 68e904e444 Migrate language_2/abstract to NNBD.
Change-Id: I265933f36f68df6f8e542a3f85ce0b04e1dfd549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134205
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-02-04 18:57:26 +00:00
Liam Appelbe a793c36c77 [test] Run late field tests in optimised mode
Fix the tests by disabling the optimisation that turns getter calls into
raw gets if the field is late, and by calling recording the null init
store in bytecode mode.

Change-Id: I8f12e3237cd32c890b5cef8d00c32940e937330d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134180
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-04 16:51:38 +00:00
Robert Nystrom c5cba24124 Migrate language_2/argument to NNBD.
Change-Id: Ic1963eb1962bc1341a68783e9c44f3e04bfbc43a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134223
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 15:07:11 +00:00
Robert Nystrom 3414b51675 Migrate language_2/assign to NNBD.
Change-Id: I71947bc5726f168fc036a7fece8a3b6b7bf964f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134224
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 10:37:43 +00:00
Robert Nystrom 56ca547c8c Migrate language_2/accessor_conflict to NNBD.
Change-Id: I136befc5fa77bfa2a118f9bd032250abcde2da68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134222
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 09:52:03 +00:00
Dmitry Stefantsov 3183573a79 [cfe] Account for signatures when inserting noSuchMethod forwarders
It is possible for an abstract member to be overridden with another
abstract member with different signature (that has, for example, more
optional parameters).  In such cases, the noSuchMethod forwarders should
be generated for each distinct signature.

Closes #40248.

Bug: http://dartbug.com/40248
Change-Id: I7974415f0ecb78f05d7265ecf9d57cc0d38e6c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132661
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 07:58:00 +00:00
Ryan Macnak 342535bb88 Mark typed_data/zeroed_allocation_test as slow on reload bots.
Change-Id: I7008ce0b5e68b092067f34e1f7ef6ee32487dc51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134260
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-02-04 00:41:36 +00:00
Nicholas Shahan 703bc0086d [tests] Create null is T tests in legacy and null safe libraries
Change-Id: I2054b6da8b66e7c6de81d9fb18fdc1c264db376c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132420
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-03 23:12:02 +00:00
Ben Konyi 30f25ba735 [ VM / typed_data ] Fixed inconsistent results for -Float32x4.zero().clamp and -Float64x2.zero().clamp
The fuzzer found an issue where clamping negative zero would result in
conflicting answers depending on whether or not the clamp operation had
been optimized in JIT mode.

The MINPS and MAXPS instructions will always return the second operand
if the values being compared are -0 and 0, which is the opposite of what
the C implementation of clamp was doing.

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

Change-Id: I3afb725bd0c8643758dbe753d863ba93c86ad747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134093
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-03 21:59:48 +00:00
Mark Zhou e7a524e8c4 Cleaning up corelib test migrations.
Change-Id: Ib235c213861f819ed11a887283cad085582eaac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132941
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-02-03 19:06:17 +00:00
Ryan Macnak 1efba58d22 Reapply "[vm] Initialize large typed arrays only once."
Change-Id: I92eb6c96db97e0951ae34315ad8d744e06064b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133764
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-02-03 17:22:05 +00:00
Jonas Termansen 4cd6243d77 [dart:io] Backport semantic changes from the dart:io NNBD migration.
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports these
semantic changes to the unmigrated SDK so any issues can be discovered
now instead of blocking the future SDK unfork.

The Process class will now throw a StateError if the process is detached
upon accessing the stdin, stdout, stderr, and exitCode getters.

The Socket class will now throw a SocketException if the socket has been
destroyed or upgraded to a secure socket upon setting or getting socket
options.

Change-Id: I956fd07e713e51ebd479ebbfe4790d8d2fdf0744
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133989
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-02-03 15:10:45 +00:00