Commit graph

19978 commits

Author SHA1 Message Date
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
Johnni Winther 8991dc33d2 Fix language/operator/invalid_operators_test
Closes #40415

Change-Id: If179bc6802e6193aea4c011d889f9ecbfa3020b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133993
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-03 13:35:15 +00:00
Sigmund Cherem 07675de0c0 Fix type error within _EventStream.onData
The constructor was wrapping the onData handler to hide the type-mismatch. This
copies the same logic to the onData handler.

In non-nnbd code this code was not exercised. The migration of dart:async
made this code reachable on our tests. That's because Stream.first used to
do:

  var subscription;
  this.listen(() => ... cancel subscription here, ...)

it now avoids making subscription nullable by registering the onData handler
later:

  var subscrition = stream.listen(null, ...);
  subscription.onData(() => ... cancel subscription here);

This change fixes the following 6 html tests under nnbd:
html/history_test/history/history
html/transferables_test
html/transition_event_test
html/websocket_test
html/worker_test/functional/functional
html/xhr_test


Change-Id: I095ea8d545e65b047504af0367586884bba84d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134120
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-02-02 05:58:24 +00:00
Mayank Patke ed441e48d0 Update all Slow tests to be Slow, Pass.
Change-Id: I610b272355b045eab80cf941210774fb12d775eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134103
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-01 00:17:42 +00:00
Zichang Guo 91a3ea89c8 Revert "[dart:io] Stop forcing lower case on HttpHeaders"
This reverts commit b2b7337ad4.

Reason for revert: flutter build broke!!

Original change's description:
> [dart:io] Stop forcing lower case on HttpHeaders
> 
> This is a breaking change. Request: https://github.com/dart-lang/sdk/issues/33501
> 
> HttpHeaders use lowercase by default for all headers, since it is supposed to be case insensitive. Some servers incorrectly treat case as significant, however, and expect headers with capitalization or in uppercase. The current implementation forces headers to be lower cases when adding values. Users cannot even manually modify the headers.
> 
> This change removes this restriction here so that users can modify the headers to whatever form they want. The new behavior is backwards compatible except if class was implemented. All headers inside http.dart are written as lower cases, adding values to HttpHeaders is still receiving lower cases input.
> 
> The other cl (https://dart-review.googlesource.com/c/http_multi_server/+/121411) migrates multi_headers.dart to be compatible with this change.
> 
> Bug: https://github.com/dart-lang/sdk/issues/33501
> Change-Id: I6f7f2ef907b229773c283140c07f2de4cd500981
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119100
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

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

Change-Id: I4d4299393ad6549b250053df8823e726855e2baf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/33501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134102
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-31 22:32:22 +00:00
Mayank Patke a5cfdf6586 [dart2js] Use flags to choose between legacy/NNBD in RTI.
Change-Id: I42705320aabcdfecc12098f40ca16a2c623a1033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134091
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-31 20:04:52 +00:00
Zichang Guo b2b7337ad4 [dart:io] Stop forcing lower case on HttpHeaders
This is a breaking change. Request: https://github.com/dart-lang/sdk/issues/33501

HttpHeaders use lowercase by default for all headers, since it is supposed to be case insensitive. Some servers incorrectly treat case as significant, however, and expect headers with capitalization or in uppercase. The current implementation forces headers to be lower cases when adding values. Users cannot even manually modify the headers.

This change removes this restriction here so that users can modify the headers to whatever form they want. The new behavior is backwards compatible except if class was implemented. All headers inside http.dart are written as lower cases, adding values to HttpHeaders is still receiving lower cases input.

The other cl (https://dart-review.googlesource.com/c/http_multi_server/+/121411) migrates multi_headers.dart to be compatible with this change.

Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I6f7f2ef907b229773c283140c07f2de4cd500981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119100
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-31 17:08:52 +00:00
Johnni Winther 42246f7f96 [cfe,analyzer] Disallow type parameters on operator methods
This was never supported by the grammar but unfortunately allowed by
both the analyzer and the CFE.

Change-Id: Id669c934fe08eda41973d6d2cef8340da2e7d72c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133591
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-31 14:05:02 +00:00
Victor Lima b68d95ec9e [vm] Reland support for real unboxed floating point fields in AOT
Issue https://github.com/dart-lang/sdk/issues/40404

Change-Id: Icfa801ff0640a6b27bb3c13d0b737c40452cbf7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133983
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-31 12:56:31 +00:00
Clement Skau 26ada4363a [SDK] Fixes remaining issues with --lazy-async-stacks on.
- Handle bytecode for e.g. dartkb-simarm64 does not have source position.
- Use existing GetCallerSp() instead of working across frames.
- Nit: Adds clarifying comments to test.
- Nit: Updates name of non-async-stack test to clarify flags used.

Tested:
- CQ with --lazy-async-stacks on by default.
- vm/dart/causal_stacks and language_2/vm/causal_async_exception_stack_test with current flags.

Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: Ie6581a734cdcafbd4fb641bd86bffc03ed241532
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133063
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-31 10:45:21 +00:00
Zichang Guo 162d6c5634 Revert "[vm] Add support for real unboxed floating point fields in AOT"
This reverts commit 9eb531bde4.

Reason for revert: Bots are red. Some tests are failing.

https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-obfuscate-linux-release-x64/6039

https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-android-release-arm_x64/957

Original change's description:
> [vm] Add support for real unboxed floating point fields in AOT
> 
> Non-nullable floating point fields (double, Float32x4, Float64x2)
> are fully unboxed in their classes.
> 
> A bitmap for each class was added to the shared class table in order to keep
> track of the pointers of the classes. Since all classes in Flutter Gallery
> have less than 64 fields, the bitmap is represented by a 64 bit integer and
> fields whose offset is more than 64 words are not unboxed.
> 
> The instance sizes and field offsets might change between target and host
> in cross-compilation, since the number of words used to store unboxed fields
> may differ.
> 
> dart-aot Xeon
> 
>   SplayLatency               -4.62%
>   SplayHarderLatency         -4.17%
>   NavierStokes               -2.20%
>   Tracer                      8.72%
>   ParticleSystemPaint         2.90%
>   NBodySIMD                   8.35%
>   NBody                      25.59%
> 
> With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:
> 
> flutter arm-v8:
> 
>   gallery total size: -1%
> 
>   matrix_utils_transform_rect_perspective   -16.70% (less is better)
>   matrix_utils_transform_rect_affine        -31.82% (less is better)
>   matrix_utils_transform_point_perspective  -24.90% (less is better)
>   matrix_utils_transform_point_affine)      -27.26% (less is better)
>   rrect_contains_bench                      -4.719% (less is better)
> 
> Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
> Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

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

Change-Id: Ic73858f6adb7f55c4129d4f46ff4731b378cb634
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134020
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-30 18:13:28 +00:00
Mayank Patke a52d6ea9b9 [dart2js] Fork backend subtyping into legacy and null-safe variants.
Change-Id: I64a20b5c64d700b873ac6210e5845c8d59192991
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133331
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-30 17:02:38 +00:00
Sam Rawlins 637a801e64 Use 'enum' and 'mixin' with undefined getters, methods, operators, setters
Fixes #40177

Change-Id: I0b416a4e77d3d1c5afc1712301c5cf1ea4cfc8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133043
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-30 17:01:58 +00:00
Victor Lima 9eb531bde4 [vm] Add support for real unboxed floating point fields in AOT
Non-nullable floating point fields (double, Float32x4, Float64x2)
are fully unboxed in their classes.

A bitmap for each class was added to the shared class table in order to keep
track of the pointers of the classes. Since all classes in Flutter Gallery
have less than 64 fields, the bitmap is represented by a 64 bit integer and
fields whose offset is more than 64 words are not unboxed.

The instance sizes and field offsets might change between target and host
in cross-compilation, since the number of words used to store unboxed fields
may differ.

dart-aot Xeon

  SplayLatency               -4.62%
  SplayHarderLatency         -4.17%
  NavierStokes               -2.20%
  Tracer                      8.72%
  ParticleSystemPaint         2.90%
  NBodySIMD                   8.35%
  NBody                      25.59%

With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:

flutter arm-v8:

  gallery total size: -1%

  matrix_utils_transform_rect_perspective   -16.70% (less is better)
  matrix_utils_transform_rect_affine        -31.82% (less is better)
  matrix_utils_transform_point_perspective  -24.90% (less is better)
  matrix_utils_transform_point_affine)      -27.26% (less is better)
  rrect_contains_bench                      -4.719% (less is better)

Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2020-01-30 13:45:08 +00:00
Ryan Macnak c053468de0 [vm, service] Add a test to exercise all timeline recorders.
Change-Id: Ifbb2e95c2f4f4e2ea6513589987ccc3527af79b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133743
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-30 01:26:51 +00:00
asiva b1df4db728 [VM/tests] - First step to migrate dart:cli tests for NNBD.
Copy dart:cli tests from standalone_2/io directory to standalone/io directory.

Change-Id: I050a2a6bd9e98482ed3b7f691563f384874d7151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133766
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-01-30 00:34:31 +00:00
Stephen Adams deae9152e0 [dart2js] Use HInvokeExternal for native calls
A new instruction, HInvokeExternal, codes a variety of calls to JavaScript.
'native' and js-interop calls use this instruction instead of
HForeignCode. This leads to fewer places generating similar JavaScript
patterns, and slightly better scheduling around call sites.
More js-interop calls are now lowered to direct JavaScript calls rather
than interceptor calls.

Change-Id: I8d30827bb099d27f4cc2ad469449769418ccb6da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133021
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-29 21:19:00 +00:00
Konstantin Shcheglov e98085fdd8 Issue 40333. Verify types of static getters / setters.
Bug: https://github.com/dart-lang/sdk/issues/40333
Change-Id: I10f366d4f451a94f8afa7b30cd6daa99073d7eda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133665
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-29 18:05:36 +00:00
Daco Harkes 9920801424 [vm/ffi] Split FFI tests in NNBD and legacy
Closes: https://github.com/dart-lang/sdk/issues/40233

This CL creates nnbd versions of the tests and runs them on the nnbd sdk.

This CL does not (1) migrate sdk_nnbd/lib/ffi fully yet, and does not (2) fix all the tests/ffi (which is NNBD tests) yet.

Uncovered new issues:
Issue: https://github.com/dart-lang/sdk/issues/40234 nullptr should have type Pointer<Never>.
Issue: https://github.com/dart-lang/sdk/issues/40247 Structs need external fields.
Issue: https://github.com/dart-lang/sdk/issues/40271 Callbacks hit assert in debug.

Change-Id: Icb1b83577e03ed283165eb17703fc8dfc7fa5960
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,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/+/132604
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-01-29 14:04:41 +00:00
Martin Kustermann 6199853cad [infra] Fix test runner to correctly parse android adb output and fix test to always expect compile-time error
Change-Id: Ib7c7bf92f929092693437231ea69ada8a6b719c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133585
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-29 12:26:40 +00:00
Konstantin Shcheglov b3a1f053a3 Issue 40333. Extract GetterSetterTypesVerifier, report GETTER_NOT_SUBTYPE_SETTER_TYPES for NNBD.
Bug: https://github.com/dart-lang/sdk/issues/40333
Change-Id: I265d535956204644859b05d02dd39a0bfdc8c19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-29 02:37:14 +00:00
Sigmund Cherem bf6c439e9a [dart2js] SSA: Avoid emitting generate-at-use twice
This seems to happen in a check-chain when the input is unnamed.  I'd
rather name something than do this, since it interferes with counting
occurrences for sharing constants.

Fixed: 40349
Change-Id: I6a077707b172cee7505130119e41f856244f9424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133624
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-01-29 00:26:37 +00:00
Zichang Guo 06fa701c95 [http] fix hanging when parser failed to parser body of response/request
* Some cleanups on http parser.
* When parsing body of the http response/request, errors should not go to _controller, where it is paused. This leads to hanging.
* Fix another bug: (byte < 0x30 && 0x39 < byte)

Bug: https://github.com/dart-lang/sdk/issues/40132

Change-Id: Iaf3fb6a409c92889f50b86220a2c6c2318012c47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132964
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-28 23:43:42 +00:00
Nate Bosch 534e85866d Assert that allowInterop is used with constructors
Fixes a missing case where DDC allows unwrapped functions to flow to
JavaScript through constructor calls or anonymous object instantiation.

- Pass the `Member` through to `_emitArgumentList` in the case of
  constructor calls and object literals so that `isJsInterop` can be
  determined.
- Pass an optional `isJsArgument` member through for emitting named
  expressions. Previously I thought that no named arguments would be
  used for javascript calls, but they are used to create object literals
  for anonymous JS types.
- Add both anonymous and non-anonymous constructor invocation examples
  to the JS interop test.

Change-Id: I004642f3b2caccc0d8c26786f2bdcb081d135898
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131462
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2020-01-28 16:59:58 +00:00