Commit graph

465 commits

Author SHA1 Message Date
Ben Konyi 49850e6919 [ VM / Service ] Fixed mismatching type in migrated NNBD service code
Change-Id: If2bd92c48893adf46a7fe08e725d908f50317e2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134782
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-02-06 21:06:11 +00:00
Joshua Litt 9781d3dc9f Fix minor bug with NNBD and Math.exp
This cl simply adds a missing nullcheck to Math.exp

Change-Id: I5a5a145b1c60e31d956891c530cba2bb9a718b4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134761
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-02-06 20:41:07 +00:00
asiva 83fdfde140 [VM/libraries] - Fix signature of waitFor.
This should fix issue 40472.

Bug: 40472
Change-Id: I5cfa7cf25778b6a5430168707dd9370b202d3e6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134565
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-02-05 22:48:50 +00:00
Sigmund Cherem 40a03f472a [dart2js] Make dart:_native_type_data null safe.
This mostly copies the changes from DDC to the dart2js implementation.

Change-Id: Ib56b607a6cea3df0e319e32cd4afa6b5b55b03d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134463
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-05 19:34:59 +00:00
Sigmund Cherem eb54b5bb9b Formatting changes to dart:_native_type_data to make dart2js and ddc more similar.
Mostly changes to the comment syntax, removing optional `new`, and using the
same kind of quotes on strings.

Change-Id: Ia6d7f38523312f67cfa30cd30cef994759d40ef1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134480
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-02-05 19:34:59 +00:00
Sigmund Cherem 20745941ad [ddc,dart2js] make dart:typed_data the same in dart2js and ddc and opt-in to null safety.
Change-Id: If325a2ea11afef1d784fd01830999d5a4c9d4daf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134049
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2020-02-05 19:29:10 +00:00
Ben Konyi 763bcae067 Reland "[ VM / Service ] Added getClientName, setClientName and requireResumeApproval RPCs"
This reverts commit 37f4a44a27.

Reason for revert: Relanding after infra issues cleared

Original change's description:
> Revert "[ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs"
> 
> This reverts commit 48808f7dce.
> 
> Reason for revert: Unable to approve failures.
> 
> Original change's description:
> > [ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs
> > 
> > Add support for naming VM service clients which allows for resume
> > permissions to be set for all clients of the same name. If a client
> > name requires resume approval, an isolate won't be resumed until all
> > clients which require resume approval have called the `resume` RPC.
> > 
> > Resume approvals can be set for the following pause events:
> > - PauseOnStart
> > - PausePostRequest (issued after `reloadSources(pause: true)`)
> > - PauseOnExit
> > 
> > Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
> > Commit-Queue: Ben Konyi <bkonyi@google.com>
> > Reviewed-by: Siva Annamalai <asiva@google.com>
> > Reviewed-by: Gary Roumanis <grouma@google.com>
> 
> TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com
> 
> Change-Id: I8e60416ad8cbec9ad93f4e34e9bf9af5a516c6dc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134465
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com

Change-Id: Ibd9d831774e5c4dd500da026f41b173589a9aefd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134415
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-05 18:14:39 +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
Ben Konyi 37f4a44a27 Revert "[ VM / Service ] Added getClientName, setClientName and requireResumeApproval RPCs"
This reverts commit 48808f7dce.

Reason for revert: Unable to approve failures.

Original change's description:
> [ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs
> 
> Add support for naming VM service clients which allows for resume
> permissions to be set for all clients of the same name. If a client
> name requires resume approval, an isolate won't be resumed until all
> clients which require resume approval have called the `resume` RPC.
> 
> Resume approvals can be set for the following pause events:
> - PauseOnStart
> - PausePostRequest (issued after `reloadSources(pause: true)`)
> - PauseOnExit
> 
> Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Gary Roumanis <grouma@google.com>

TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com

Change-Id: I8e60416ad8cbec9ad93f4e34e9bf9af5a516c6dc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134465
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-05 01:13:17 +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
Ben Konyi 48808f7dce [ VM / Service ] Added getClientName, setClientName and requireResumeApproval RPCs
Add support for naming VM service clients which allows for resume
permissions to be set for all clients of the same name. If a client
name requires resume approval, an isolate won't be resumed until all
clients which require resume approval have called the `resume` RPC.

Resume approvals can be set for the following pause events:
- PauseOnStart
- PausePostRequest (issued after `reloadSources(pause: true)`)
- PauseOnExit

Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2020-02-05 00:02:17 +00:00
Vijay Menon ce21fd034e [dartdevc,nnbd] fix type errors in dart:_interceptors
Change-Id: If842fbab8bc043c9331529d1280c57faa7ce6769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134407
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-02-04 23:46:37 +00:00
asiva 1f32305392 [VM/libraries] - Fix issues in ported patch files that cause dart2js to fail (https://github.com/dart-lang/sdk/issues/40463)
- List<String> should be List<Object?> because entries in the stack can be either Map or Strings
- _divRem has some cached values which are marked late but are used
before they are initialized resulting in exceptions, these four cached
values are now made nullable.

Bug: 40463
Change-Id: I469692e95bf6ef74665d14209dd3e2cd556c1f06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134408
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-04 23:43:27 +00:00
Sigmund Cherem d798004ba3 [ddc,dart2js] remove web patches for dart:cli
Since dart:cli is not in the libraries.yaml/json for ddc and dart2js, imports to
it are not allowed on web code. The patch files were not needed and can be
removed.

Change-Id: I46acf8a540f4b2d0a2aa7dcc50b572adab564b68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134048
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-04 23:32:47 +00:00
asiva 0e5a7275d0 [VM/library] Fix signature of waitFor to account for potential null return value.
This should fix the breakage in the NNBD on test standalone/io/issue_32052_test

Change-Id: I58192dffa9a9d7f5c492dd58e7f570fabcb69b86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134243
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-02-04 16:55:08 +00:00
Srujan Gaddam 851912cc1d Change nnbd_src files to be null-safe
Translates the forked nnbd_src files to address analyzer issues.

Change-Id: Ida21988bff63a6c5a037b548d0c8b11208317b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130131
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-04 01:57:39 +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
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
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
Sigmund Cherem f07c805656 Fix based64 decoder.
The non-nnbd code doesn't have this extra `if`. It appears
that this conditional was added during the migration but
it is accidentally hiding the update to the _state.

This change restores the algorithm to how it was before
the migration and fixes lib_2/convert/base64_test/none

Change-Id: I72dd2e870056bb55158bbd053d8a3c8825a1d144
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134090
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-01-31 19:00:32 +00:00
Mayank Patke 023f286772 [dart2js] Update generic function subtyping.
We now test bounds for mutual subtyping rather than structural equality
up to renaming of bound type variables and equating all top types.

Change-Id: I7dd23a3211a1631e463ea90c3173f3deae46ca23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134042
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-31 18:33:02 +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
Zichang Guo 0ed9f7179d [vm] seperate error and unknown types for getStdioHandletype
Infer other types as kPipe which is sync with Win platform.

Bug: https://github.com/dart-lang/sdk/issues/40354
Change-Id: I8bf40a143573685833a689ff2c724a421b308234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133623
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-31 17:07:22 +00:00
Johnni Winther 906c6ea21c Avoid implicit downcast in nnbd sdk
The least upper bound of _SyncBroadcastStreamController and
_SyncStreamController is StreamController (according to the CFE) leading
to an implicit downcast from StreamController to _StreamControllerBase.

The analyzer and CFE sometimes disagree on the hierarchy depth
computation (see https://github.com/dart-lang/sdk/issues/38377)
which is probably the root cause of this.

Change-Id: I276bdc894d3926eae603b023b29462571c620c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133980
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-31 11:58:31 +00:00
Nicholas Shahan eafa17ccfb [dartdevc] Update subtype check to allow mutual subtypes in bounds
Generic functions with bounds on the type parameters should be allowed
to differ in that legacy type bound should be considered equivalent to
a nullable or non-nullable version of the same type bound.

Fixes test failures:
lib_2/async/async_await_zones_test
lib_2/async/stream_listen_zone_test
lib_2/async/zone_bind_callback_test
lib_2/async/zone_bind_callback_unary_test
lib_2/async/zone_debug_test
lib_2/async/zone_fork_test
lib_2/async/zone_register_callback_test
lib_2/async/zone_register_callback_unary_test
lib_2/async/zone_run_guarded_test
lib_2/async/zone_run_test
lib_2/async/zone_run_unary_test


Change-Id: I8bbb2ebae20f4e67bdaf8f321609b3307d92c6d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133245
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-31 06:37:02 +00:00
Jonas Termansen f6e0200523 [nnbd] Migrate dart:io to NNBD.
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.

Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: I68e22873932c68a3fac549c0f742dd49d0a60dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133060
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-01-30 15:46:08 +00:00
asiva f24c0f0837 [VM/tests] Second step of porting dart:cli tests for NNBD
Turn on the dart:cli tests in the nnbd bot.

Change-Id: I2c521b217300839deb7ad47a820768172b8f0e26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133866
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-30 02:42:11 +00:00
Srujan Gaddam 28917d8b1d Handle invalid overrides in template and src dart files
Several functions did not override their parents' function signatures
correctly for nnbd.

Change-Id: Ibd935ffa39b3175db65bb43d15396134700d2f78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129143
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-29 22:22:50 +00:00
Srujan Gaddam 151dc015c0 Add $#NAME syntax to emitter to allow subtemplates
NNBD will require explicit casts in various locations in the dart:html
libraries. To avoid taking on this overhead in the pre-nnbd dart:html
library, syntax is introduced in the emitter to allow tokens with
arguments.

Test: emitter_test.py

Change-Id: Ie6de714f491e0cda654f33ee389a91b765cacc9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133333
Reviewed-by: Stephen Adams <sra@google.com>
2020-01-29 22:22:50 +00:00
Martin Kustermann 37d562d2a4 [vm/async] Ensure --lazy-async-stacks also works inside custom zones with error handlers
Issue https://github.com/dart-lang/sdk/issues/37668

Change-Id: Ib7fb8299fbc8b7f73e154414f37451a488297a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133583
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-01-29 11:17:50 +00:00
Srujan Gaddam 7db61c6b01 Changing the dart:html generator scripts to generate null-safe/nnbd code
Change-Id: I4a8b097b126864366076b1e73cf3e0296600380e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128376
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-01-29 00:20:42 +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
jonahwilliams 96ff3276f4 [vmservice] allow fallback on port bind failure
Work towards https://github.com/flutter/flutter/issues/46724

Background:

on the latest versions of iOS today, we have to use mdns to discover the observatory port and authentication code. For a variety of reasons this can fail, leaving us with no way to connect.

An alternative approach is to specify the observatory port and disable the authentication code. If binding to this port fails, however, we would still like to attempt connecting with mdns.

Overview:

This adds a new flag to the dart SDK, --enable-service-port-fallback. This amends the behavior of the vmservice with a specified port. After failing to bind 3 times to a non-zero port, update the port selection to 0.

Results:

Tested locally two dart VMs with the same specified port:

```
jonahwilliams@jonahwilliams0:~/Documents/engine/src/out/host_debug_unopt$ ./dart --enable-service-port-fallback --observe=8080 example.dart
Observatory server failed to start after 1 tries
Falling back to automatic port selection

vm-service: isolate(2785434094928835)  'main' has no debugger attached and is paused at exit.  Connect to Observatory to debug.
Observatory listening on http://127.0.0.1:45663/62A5IHjmv9E=/
```
Change-Id: I582ab402a457330928e5b490f9718fcd52b56720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133434
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2020-01-28 23:36:14 +00:00
asiva c2fb631d99 [VM/libraries] Fix final set of warnings in dart:core and dart:typed_data
Change-Id: If05b13eba924fbeaad2a82598a5255f12ba6b1b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133323
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-27 19:51:14 +00:00
asiva 5d0c08b5de [VM/libraries] Port some of the changes made in the sdk version of typed_data_patch.dart over to the sdk_nnbd version too.
Change-Id: I30a60395a7d828a5f44afa2fadbef152af832753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133362
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-01-25 01:54:14 +00:00
Jonah Williams cdeb9a7a8c Revert "[vmservice] allow fallback on port bind failure"
This reverts commit 6ff7e9ebad.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vmservice] allow fallback on port bind failure
> 
> Work towards https://github.com/flutter/flutter/issues/46724
> 
> Background:
> 
> on the latest versions of iOS today, we have to use mdns to discover the observatory port and authentication code. For a variety of reasons this can fail, leaving us with no way to connect.
> 
> An alternative approach is to specify the observatory port and disable the authentication code. If binding to this port fails, however, we would still like to attempt connecting with mdns.
> 
> Overview:
> 
> This adds a new flag to the dart SDK, --enable-service-port-fallback. This amends the behavior of the vmservice with a specified port. After failing to bind once to a non-zero port, update the port selection to 0.
> 
> Results:
> 
> Tested locally two dart VMs with the same specified port:
> 
> ```
> jonahwilliams@jonahwilliams0:~/Documents/engine/src/out/host_debug_unopt$ ./dart --enable-service-port-fallback --observe=8080 example.dart
> Observatory server failed to start after 1 tries
> Falling back to automatic port selection
> vm-service: isolate(2785434094928835)  'main' has no debugger attached and is paused at exit.  Connect to Observatory to debug.
> Observatory listening on http://127.0.0.1:45663/62A5IHjmv9E=/
> ```
> 
> Change-Id: I371583edcb603325428f1cb760992e39b9f3b6dc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130441
> Commit-Queue: Jonah Williams <jonahwilliams@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,jonahwilliams@google.com

Change-Id: I337b2d549e33ef9c616c276a48ce894a14b1c317
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133327
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2020-01-24 21:47:34 +00:00
jonahwilliams 6ff7e9ebad [vmservice] allow fallback on port bind failure
Work towards https://github.com/flutter/flutter/issues/46724

Background:

on the latest versions of iOS today, we have to use mdns to discover the observatory port and authentication code. For a variety of reasons this can fail, leaving us with no way to connect.

An alternative approach is to specify the observatory port and disable the authentication code. If binding to this port fails, however, we would still like to attempt connecting with mdns.

Overview:

This adds a new flag to the dart SDK, --enable-service-port-fallback. This amends the behavior of the vmservice with a specified port. After failing to bind once to a non-zero port, update the port selection to 0.

Results:

Tested locally two dart VMs with the same specified port:

```
jonahwilliams@jonahwilliams0:~/Documents/engine/src/out/host_debug_unopt$ ./dart --enable-service-port-fallback --observe=8080 example.dart
Observatory server failed to start after 1 tries
Falling back to automatic port selection
vm-service: isolate(2785434094928835)  'main' has no debugger attached and is paused at exit.  Connect to Observatory to debug.
Observatory listening on http://127.0.0.1:45663/62A5IHjmv9E=/
```

Change-Id: I371583edcb603325428f1cb760992e39b9f3b6dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130441
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-24 20:28:15 +00:00
asiva 22d55c39d8 [VM/libraries] Fix final set of warnings from dart:async patch files.
Change-Id: I784cccddaa244c972c44e9b37896ff48161b5ce5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133168
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-24 19:05:03 +00:00
Mark Zhou 4d839404c9 Updating iterable.current comments and behavior to be consistent.
Change-Id: I57226491571272aa483aec8b5e14dc00c55511ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132812
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-24 17:35:39 +00:00
Lasse Reichstein Holst Nielsen a0a0580a56 Update iterator.dart to fully spec moveNext()
The `moveNext` docs should contain all the information necessary to implement it. There is otherwise no mention that this method is also used to set `current` to the initial element.

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

GitOrigin-RevId: c921486f7e104d7fad5b10ba2744f01b0a814dbc
Change-Id: I06736889c6e904e17027f27b7c5831eff495ce1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127455
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-01-24 16:17:29 +00:00
Lasse Reichstein Holst Nielsen 95511b314c Stop using List() constructor in NNBD code.
The List constructor has been disallowed in NNBD code, so the NNBD SDK
should not be using it.

This changes all uses, not just in the already migrated libraries.
(Also found some bad typing in the `RegExpMatch` class along the way).

Change-Id: Ic61bd64427c0961c23aaf7ce59af5c2c271890ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132282
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-01-24 15:59:29 +00:00
Lasse R.H. Nielsen fc3af737c7 Update typed-data constructor documentation.
Make it explicit that the allocating constructors allocate precisly the
needed amount of bytes.

Fixes #40261

Bug: http://dartbug.com/40261
Change-Id: I059a9e3e387fee116e2221a0761557aedc948aee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132844
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-24 09:53:26 +00:00
Clement Skau da1e42a11c [SDK] Fixes async* stack unwinding.
For `foo() async* {}` frames we find the "caller" by finding out
what closure is registered as listener on the _AsyncStreamController.

There can be two cases:

a) The caller does a regular `foo().listen((_) {})`:
  The stack trace will have the closure as the caller and unwinding stops.

b) The caller uses 'await for (... foo())':
  In this case the listener will be a StreamIterator.

This CL changes our unwinding code to get the awaiter of `await it.moveNext()`.


Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I13f76025a15682aaf55fd968088fc2059982d842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132841
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-24 09:04:56 +00:00
asiva eda80b2148 [VM/libraries] Address code review comment from previous CL.
Change-Id: Ic92ec245ab54e8addb77c79bcb79e8394d3fdcd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133142
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-01-23 23:18:51 +00:00
asiva e4d44fde43 [VM/libraries] Fix more analyzer warnings related to NNBD in patch files.
Change-Id: I82b85950144103bfd37d5a59353900f45b4e61bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133040
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-23 21:23:09 +00:00
Ryan Macnak 3aabdc8d23 [test] Run some service tests in AOT.
Tests involving breakpoints, stepping, evaluation or coverage are expected to fail.
Tests involving introspection, heap analysis, extensions, timeline events or profiling are expected to pass.

 - Fix crash when `debugger` is called.
 - Fix crash when metrics are queried.
 - Replace unnecessary use of `eval` with `invoke`, allowing more tests to run on AOT, AppJIT and simulators.

Bug: https://github.com/dart-lang/sdk/issues/40274
Bug: https://github.com/dart-lang/sdk/issues/40275
Change-Id: I3023af7cbfda745238c487d9a3a3a99e56a30244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132942
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-23 17:52:40 +00:00
asiva d6762df562 [VM/libraries] Fix more analyzer errors in patch files.
Change-Id: I51c4aaa38a3eb01f2a6914a0e4b5d25f103fa797
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132449
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-23 03:11:21 +00:00
Mark Zhou 3679239379 [dartdevc] Normalizing legacy null to null.
Change-Id: I3d0ede71e4e979e060e0c8aeed4760cf1e6ceee4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133002
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-01-23 00:42:31 +00:00
Mark Zhou f2903daa5e [dartdevc] Fixing null coercions in linked_hash_map.dart.
Our first-pass migration resulted in leftover @notNull checks being
applied to the wrong lines. @notNull applied to a line that
subsequently compares with null emits '===' instead of '==', which
bypassed our undefined to null coercion.

Change-Id: Ia7a5831c1ba42674d9013dc636ab4ea5714c58f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132982
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-01-22 23:47:49 +00:00
Nicholas Shahan 22c0c9fd83 [dartdevc] Fix nullability wrapping for Never and Bottom types
Created helper for emitting the nullability wrapper around a type. I'm also
using this helper as a way to reduce the number of places we check if the
null safety experiment is enabled to make that easier to cleanup in the near
future.

Change-Id: I928d098b9bdadd96759026f49c58c8fc86cf1aae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-22 22:25:59 +00:00
Vijay Menon 4e20b392a9 [nnbd] remove opt-out for dart:_js
No other changes appear necessary.

Change-Id: I791a35aeec54c39849a219430cfc45f3c21e71b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132746
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-22 21:39:56 +00:00
Ryan Macnak b07b710b93 [lib] Be explicit about the type parameter for positional argument lists.
Widen `reflect` and `setField` to accept dynamic. `Object` will soon no longer be a top type, and dynamic is more consistent with other reflective inputs and `reflectee`.

Bug: https://github.com/dart-lang/sdk/issues/40045
Change-Id: Ic1e3a26aaea5de078cc616846cb52417c7975d11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132720
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-22 21:36:03 +00:00
Mark Zhou d2806f79a3 [dartdevc] Cleaning up generic function processing logic and formatting.
Change-Id: If055d61daf4c43c7c3212796914ac5cada45afba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132922
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-01-22 20:50:08 +00:00
Lasse R.H. Nielsen 0c71fb2d95 Add new constructors to TypedData classes.
The new constructor creates a view of a (sub range) of the elements of another TypedData object.
It works for both typed lists and ByteData.

The advantage over the .view constructors is that it handles other views properly, including their
offsetInBytes in the start computation, which it is easy to forget to do when you call

  SomethingList.view(other.buffer)

directly, and that constructor cannot compensate for the information because it only existed on the object
that the buffer was extracted from, not on the buffer itself.

Change-Id: I8abafbf2a81a32ea67f5d4c0f65dcfea08b49bb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127321
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-01-22 14:39:48 +00:00
Mark Zhou ec28afcaa7 [dartdevc] Adding support for function type object normalization.
Change-Id: I05f0eeb57c93e8ad0a9faacf5308bd73baabed18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132402
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-22 00:58:14 +00:00
Mark Zhou fdba2483b2 Moving DoubleLinkedQueueEntry's null check to firstEntry and lastEntry.
Change-Id: I9fa24ca0a5ff430a2070c9d754adb0751ba545f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132407
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-01-21 22:01:39 +00:00
Lasse R.H. Nielsen 98bafeeb3a Include [AssertionError.message] in [AssertionError.toString] value.
Fixes #40245
BUG= http://dartbug.com/40245

Change-Id: Ice1e9ff2cd37d32a16918ca2464d2637203361ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132640
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-01-21 14:18:32 +00:00
Vlad Doster de87449847 docs(Update list.dart)
Referencing #37793
Updated so that the comments no longer point to a deprecated collection.

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

GitOrigin-RevId: 7ed75046e5e2cc1196cad5093b1fae0825539904
Change-Id: I7cd512025b707e8532bcdd1af08f3b3ba70327af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132620
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-01-21 12:17:52 +00:00
Alex dae1a28884 Fix: Typo in elementAt() method description
Closes https://github.com/dart-lang/sdk/pull/39981
https://github.com/dart-lang/sdk/pull/39981

GitOrigin-RevId: aae2ce577ec133a9c604182e1531be5604f2a81a
Change-Id: Ied889bd8bede949f727e867913dee7df25f2aa14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130182
Reviewed-by: Michael Thomsen <mit@google.com>
2020-01-21 12:13:16 +00:00
Lasse R.H. Nielsen 8a52941c2e Clean-up. Fixes List.generate and Stream.isEmpty documentation.
The List.generate didn't fail on negative values, and could be simpler.
The isEmpty documentation was wrong, and fixed for non-NNBD in a separate CL.

Fixes #40229.

Bug: http://dartbug.com/40229
Change-Id: I2413d44d8be435f4124156cde3ba03d9b1835484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132643
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-01-21 12:11:51 +00:00
Lasse R.H. Nielsen 8b4a4e470f Make the NNBD List.empty default to non-growable.
Since a growable list can be created using `[]`, you never need to call
`List.empty` with anything but `growable: false` or `growable: dynamicValue`.
That means that the default should be non-growable (which also matches
`List.filled` and apparently user expectations - since there is already one bug where
I assumed it would be non-grwowble while migrating List.generate).

Ensure it's implemented by dart2js too and used where there were comments
saying to use it when available.

Change-Id: Ied20d69346ecfb93640ee2cec718e30e6f8980e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132600
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-01-20 20:19:18 +00:00
asiva 7e6939643d [VM/patch libraries] - Fix analyzer errors/warnings.
Change-Id: Ia3a7df0801df3b17685df0389a299acb4134d972
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132307
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-18 02:37:08 +00:00
Mark Zhou 626f29208e [dartdevc] Cleaning up unsafe JS FFI invocations.
Fixes #40151

Change-Id: Ib3b4f0c42c971547993819784000e2dad9a61ed9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132403
Auto-Submit: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-01-18 00:08:57 +00:00
Vijay Menon 3bd63c92ec [nnbd] port web patch files for dart:isolate
Change-Id: Icf54d76d264c8e5754023c0cf51d5e28db22d52f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132201
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-17 23:21:26 +00:00
Sigmund Cherem 53134fc57c [dartdevc] Using a single cache for _typeObject and normalized types.
Change-Id: I7e3c994b7eec2cb4bc25a153fa177a39d5217b38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132101
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-01-17 20:53:46 +00:00
Vijay Menon 6b193a3dd9 Restore looser type on JSArray.indexOf
This is a bit annoying, but our native List (VM and Web) have a looser
type here than the public List.  Matching would be a breaking change
on something like:

main() {
  List list = <int>[1, 2];
  print(list.indexOf('hello'));
  print(list.lastIndexOf('hello'));
}

This restores the looser type for nnbd.

Change-Id: I3db45817834279d0c46abf04caae3713bfca89d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132173
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-17 15:59:04 +00:00
Vijay Menon 9447686d82 [nnbd] port dart:js_util to nnbd
Change-Id: I5ec29e77dd747aaab28cf3b1b20fd47b21e2d129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132181
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-17 01:19:35 +00:00
Vijay Menon 05632be0ce [nnbd/collection] fix infinite loop in nnbd sdk
See https://dart-ci.appspot.com/log/ddc-nnbd-linux-release-chrome/dartdevk-weak-linux-release-chrome/1460/corelib_2/collection_of_test

Change-Id: I5575cb1db89985f5dc84343412835cccc54b9d47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132160
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-16 22:19:08 +00:00
Mayank Patke d7784dd889 [dart2js] Fix typo: handleIdentifer -> handleIdentifier.
Also add util for `!==`.

Change-Id: Ic93b542a08db25ec93846a47ea46f8b48d65a71f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131960
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-16 21:55:08 +00:00
Stephen Adams b099832be9 [js_runtime] Check Rti on JSArray is from same program
Bug: 40152

Change-Id: Ie54192e61dc255c02483142b606ab0a31e28a0b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131902
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-01-16 19:45:03 +00:00
Vijay Menon 17f80f0d1f [nnbd] port dart:js to nnbd
This tests static analysis on the ddc patch, but not the dart2js one yet.

It also fixes js/null_test.dart to ensure it passes.  Note, that test was broken independent of NNBD.

Change-Id: I5a6bfdfaac845eaba6f154d30f2c1e30199574d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131300
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-16 19:26:18 +00:00
asiva 7bc0885d31 [VM/library:typed_data] Fix some errors reported by the analyzer.
Change-Id: I7b6b695c5ed06b147f4777e20d2cc7e3c407f86d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131923
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-01-16 18:13:27 +00:00
asiva 7bc25eca34 [VM/developer] Opt libraries dart:developer and dart:nativewrappers into NNBD
Change-Id: Ifb7696d53e03bf77c69b4df7d96691a31e2d01ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131900
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-16 17:56:57 +00:00
Ben Konyi 22bdda9fc6 [ dart:vmservice ] Cleanup dart:vmservice to better conform to recommended Dart styling
Change-Id: I88fc595101b6a334e979ea9fe689f9b38d9c6a36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131921
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-16 17:46:04 +00:00
jonahwilliams db0665223c [sdk] remove (hopefully) dead type checks
Update/Remove checks of the form:

ReturnType methodName(Type type) {
  if (type is! Type) throw ArgumentError(...);
}

Post Dart 2 transition, these checks can now only account for the condition when type is null (though some are redundant with other null checks). Using "is" checks is unnecessary and likely adds a small overhead over a straight null check, in addition to a worse error message.

Since the nnbd SDK declares many of these types to be non-nullable, the checks can be entirely removed. In the regular, SDK I've replaced them with null checks. I'm not sure if this quite follows the intention of the nnbd_sdk.

Change-Id: Icccdd7d7eba4b6c9d08fbc9b6c127ce38cc0b78d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129986
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-16 17:03:56 +00:00
Ben Konyi f6d8302028 [ dart:vmservice / NNBD ] Fixed NNBD analysis issues
Change-Id: I5fbaf410d157a9f1b6b0cf062f7a8c04ab3b99be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131883
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-01-16 06:37:31 +00:00
Mark Zhou 515d4bd7ad [dartdevc] Emitting equality checks that disregard 'legacy' wrappers for type objects.
Currently does not work for function and generic function types.

Type object equality ignores legacy modifiers but preserves other nullability
semantics. This scheme constructs the runtime type object (normalized) at runtime,
caching it if necessary. This avoids the space overhead of emitting canonicalized
normalized types at compile-time but incurs a cost when runtimeType is called
for the first time per recursive subtype.

See: https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/feature-specification.md#runtime-semantics

Change-Id: I76d714c5e618d77f334d90862bb7d3c9b0b8d305
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130727
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-01-15 21:21:27 +00:00
Nicholas Shahan a5a8ea008b [dart:async] Fix error in NNBD fork
The `is!` check is causing test failures when null flows through as `value`.
There is still no type promotion in place to make this work without the cast.

`null is! int*` is true while `null as int*` is a safe cast.

Fixes runtime failures in:
- language_2/async/identifier_test
- language_2/await/and_ifnull_test
- language_2/invalid_returns/async_invalid_return_00_test/none
- language_2/invalid_returns/async_invalid_return_01_test/none
- language_2/invalid_returns/async_invalid_return_02_test/none
- language_2/invalid_returns/async_invalid_return_03_test/none
- language_2/invalid_returns/async_invalid_return_04_test/none
- language_2/invalid_returns/async_valid_returns_test
- language_2/regress/regress26668_test
- lib/async/future_foreach_test
- lib/async/futures_test
- lib_2/async/future_foreach_test

Change-Id: I25d0dfb10d558ef7c167f99d1fba11f379cd8815
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131719
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-15 18:25:04 +00:00
asiva 1564d596bb [VM/isolate] Migrate 'dart:isolate' and patch files for NNBD
Change-Id: I1e894815599d9b1dbb0551428eb7a679a23edd6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131483
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-15 18:09:04 +00:00
Daco Harkes 8ee8f882ea [vm/ffi] Migrate dart:ffi to nnbd
Everything in FFI is nonnullable, because C does not accept null values or return null values (nullptr == 0, not null).
The only thing that needed migration in the FFI api is operator == (dynamic other) --> operator == (Object other).

This CL does not migrate any tests as the VM cannot run any tests yet.

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

Change-Id: I5efc772b61228bd1bd4d95be1b7bcd969f0c9ac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131380
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-01-15 09:47:44 +00:00
Vijay Menon 4a488b16b7 Reland "De-dup js_util between ddc and dart2js"
Fixes the original CL by restoring files temporarily needed by Flutter (until cleaned
up on Flutter side).

Change-Id: I2561339c797e1d5168646e59782ca0fcd10d79af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131582
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-15 02:08:04 +00:00
Ben Konyi 93c3c28d2b [ VM / dart:vmservice ] Migrate dart:vmservice to NNBD, cleanup outdated code
Change-Id: I84ef4cea95a20171d842ea0f0db668c1dbbe5dae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131480
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-15 01:00:34 +00:00
Ryan Macnak e0c366a3c8 [vm] Update dart:mirrors for Dart 3.
Also back-ports all non-type changes to the Dart 2 version for the sake of testing.

Bug: https://github.com/dart-lang/sdk/issues/40045
Change-Id: Idda6b6c5e8508efe4db79f27f41d0a2485b9f197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131485
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-15 00:56:24 +00:00
asiva 7c54ab73ad [Dart/CLI] : Migrate dart:cli for NNBD.
Change-Id: Ic529d8a69e0073123d68d9b3a190b5cfea4a78ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131487
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-01-14 18:23:36 +00:00
Liam Appelbe 6592e8c6ec [vm, library] Migrate dart:wasm to NNBD
Tested by running the wasm tests with nnbd enabled.

Bug: https://github.com/dart-lang/sdk/issues/40043
Change-Id: I5cd6fb95713f513539a39443f8e7906e2936a27b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131421
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-01-14 17:55:55 +00:00
Lasse R.H. Nielsen af75314a9b Fix bug in NNBD stream controller.
Add regression test.

Change-Id: I8c6501cbac86122f9a0441c5e0155a823ce99028
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130862
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-14 09:17:45 +00:00
Vijay Menon 43ceb5c6a2 Revert "De-dup js_util between ddc and dart2js"
This reverts commit 2a7789de18.

I forgot to revert the deleted files - this is breaking flutter hhh.  Will reland properly tomorrow.

TBR=sigmund@google.com

Change-Id: I76ff774e34167b3a35315dbf4883b22dd1499837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131560
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-14 04:36:54 +00:00
Ben Konyi 83fba7bd54 [ VM ] Move vmservice_io code from runtime/bin to dart:_internal/vm/bin
Change-Id: I3966366268ac88c0bc3b639fc76ae543cde5653c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131502
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-14 01:42:14 +00:00
Stephen Adams 5169a52b2a Use @patch for List.of factory constructor
This will permit List.of to be specialize for the different platforms.

Change-Id: I63583566354625b683d0897da619fc8cd23d0b7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131281
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-14 00:17:33 +00:00
Vijay Menon 2a7789de18 De-dup js_util between ddc and dart2js
Change-Id: I2fc3e676eda71bfb1dce4844fa9a3d16d301fcac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131262
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-01-14 00:11:43 +00:00
Nicholas Shahan 5d96b23928 [dartdevc] Fix analysis error in runtime library
Change-Id: I4aa4a580bc8fd1c7db96578a9e715e191af7fbda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131500
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-13 23:44:13 +00:00
Vijay Menon 28c335d5a2 Move dart:js to patch format
This is prep for nnbd port to ensure APIs remain consistent across DDC and Dart2JS.

Change-Id: I8ec6c5b152eb87868038570f2275e82af3325fb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131000
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-12 01:13:53 +00:00
Mayank Patke b3457c8cc2 [dart2js] Fork the RTI subtyping algorithm into legacy and NNBD
variants.

Change-Id: I6344afdd7ed063e8672df93925e53b77921a560f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-11 02:27:22 +00:00
Mayank Patke 12984eee89 [dart2js] Remove redundant (incorrect) assert from evalTypeVariable.
Change-Id: Ib2150b52b1397192c022792e384a184efcf88167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130930
Reviewed-by: Stephen Adams <sra@google.com>
2020-01-10 20:32:59 +00:00
Vijay Menon f4848eb112 [dartdevc,nnbd] fix static async errors
Change-Id: I903f4483f33f737aea877a49999d02a82558dd1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130923
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-10 18:32:24 +00:00
Vijay Menon 50202487c8 [dartdevc,nnbd] restore bound on JS helper
Change-Id: I13af4695ec6c764c87992c0dfcfffdbf5edb89e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130924
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-10 17:56:57 +00:00
Nicholas Shahan 0a13661c55 [dart:async] Cleanup workaround in NNBD fork
Now that the LUB has been updated in the CFE we no longer need this workaround
to avoid errors.

Issue: #39534
Change-Id: I570efd0cb92755731572d1ddb4b1b9a018e85750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130582
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-10 17:53:57 +00:00
jonahwilliams 8c2ecadf70 [http] cleanups in sdk/sdk_nnbd
Attempt some basic cleanups in both sdk/sdk_nnbd _http library

* Replace references to deprecated constants
* Remove unused catch clauses from sdk _http
* Remove unused code from sdk _http
* Fix typo in sdk_nnbd _http
* replace int.parse/onError with tryParse/??

Change-Id: Ifbffa0867653cb117560473d956d0c62dd19af6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129982
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2020-01-10 16:52:37 +00:00
Mayank Patke 9860a07ef7 [dart2js] New RTI: Use new algorithm structure for runtime subtype checks.
Change-Id: I266bc76240c65597bb46c372ccdfb70153a6a055
Fixes: https://github.com/dart-lang/sdk/issues/38907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125441
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-10 01:20:06 +00:00
Mark Zhou 96cea64fa6 Cleaning up NNBD tests and migrations.
Change-Id: I0a63a6864c568491ad5e20b6eb490760e620a889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130200
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-09 17:11:46 +00:00
Martin Kustermann eeca7c5bea [vm/nnbd] Second set of changes for migrating VM patch files for NNBD
Issue https://github.com/dart-lang/sdk/issues/39754

Change-Id: Icfbeed29a2c81c3b118686a14071d5156452e352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130370
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-09 10:46:03 +00:00
Nate Bosch 1daaee444d Remove redundant detail from doc comment
The information is expressed in the signature now, previously the return
type was implicitly `dynamic`.

Change-Id: Ib4a0106c94dc394e8126773442cd0886f81e0c79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130739
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-09 09:09:08 +00:00
asiva b1e26b3543 [VM/Library] Opt-in all the patch files of core libraries for NNBD
- opt-in NNBD all the patch files of core libraries.
- dart:io patch files are not yet opted in.

Change-Id: Iaef21d49f2949406450c41a878ede697f61556d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130820
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-01-09 02:00:27 +00:00
Sigmund Cherem 83850274fe Fix typo from migrating stream_controller
I believe this fixes `language_2/await/await_test`, but there might be other
tests affected.

Change-Id: I573beda1b40540691f58fb38bda56814b70a9343
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130730
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-01-08 23:37:25 +00:00
Nicholas Shahan 21bca08b14 [dartdevc] Ensure null is Object* evaluates to true
Fixes test failures:
corelib_2/is_operator_basic_types_test
corelib_2/iterable_where_type_test
corelib_2/null_test
language_2/is/object_test
language_2/null/is2_test
language_2/null/is_test
language_2/unsorted/extract_type_arguments_test
lib_2/async/futures_test

Change-Id: I9108f1540f29f4f5f0b2269e6bb7cf0410f5bfc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130723
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-08 20:21:50 +00:00
Vijay Menon a21f295da9 [dartdevc] fix nnbd static errors on sdk
See https://github.com/dart-lang/sdk/issues/40022 - we get 30+ errors due to that.
Suppressing for now.

Change-Id: I7b14203c7b479e67fbbb0bc396162cdf23b38b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130741
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-08 20:09:20 +00:00
Nicholas Shahan e92be54398 [dartdevc] Update extractTypeArguments to handle nullability wrappers
Change-Id: I4dbec963406ff56c5ca2523b79a25ccabca909e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130661
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-08 18:18:50 +00:00
Nicholas Shahan 99c5ec5c75 [dart:_internal] Update signature of extractTypeArguments()
Object -> Object? in the NNBD fork.

Change-Id: Id17827327f77d61266f1a478abb735348dbc7312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130564
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-01-08 16:23:59 +00:00
Mayank Patke 0c51615dd9 [dart2js] Add TYPE_REF<T>().
Change-Id: I0cb576502575cd67031f3189a11d80e51dd70f0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125462
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-07 19:51:30 +00:00
Mark Zhou 5696cd8d09 [dartdevc] Emitting nullability wrappers for generic classes and type parameters.
We are establishing a convention that nullability wrappers will be emitted at the
call sites of 'is', 'as', and '_check' calls (when necessary). Additional wrappers
will be emitted when forward-declaring generic types at the top level - but only
around the generic parameters themselves.

For example, declaring List<int>, List<int?>, List<int>?, and List<int?>? results
in two top-level classes: ListOfInt(int) and ListOfInt$(dart.nullable(int)).

Change-Id: I2d91e170d8e1e911ad9eb70d6b4d67f1cc4cdbc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129921
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-07 18:33:35 +00:00
Sigmund Cherem d735f1f12d (dart2js): enable new-rti by default
This change:
* adds the `--use-old-rti` flag to revert to the old behavior
* enables the new behavior by default
* changes the -rti- builders to run the old rti instead of the new rti
* documents the change in CHANGELOG.md

I've kept around the logic as `useNewRti` to avoid swapping all the conditions
in the compiler.

Change-Id: I773ac33b658cb60f72e0b6beef83375abec31bad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127492
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-01-04 00:44:25 +00:00
Mark Zhou a0393edd6a Inlining list copy in Queue.toList.
Change-Id: I2fdf9a780365b52ebea9810752e053cd94b5bfe0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130100
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-01-03 18:26:59 +00:00
Samir Jindel 445ae73b32 [vm/tfa] Use pragma to pass type arguments to exact return types.
Change-Id: Ie2a1de07653c53e8b9506c54a0a66a5fe6503b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129160
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-03 14:08:19 +00:00
Ryan Macnak 5804537b83 [vm, timeline] Following switch from Duration events to Begin-End event pairs, avoid separate native call transitions to query the monotonic and thread clocks.
Bug: https://github.com/dart-lang/sdk/issues/39727
Change-Id: Ie38947c63845f13d660cb4a367681fed31796473
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128564
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-02 23:13:06 +00:00
Nicholas Shahan 2f57602411 [dartdevc] Update is, as, and _check methods for null safety
Change-Id: I67e97c988a0c7a0e9d04e84e85c07152f8f35306
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129202
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-02 22:29:16 +00:00
Nate Bosch 113ff6c993 Enforce that allowInterop is used in DDC
Fixes #39074

DDC emits Dart code that can usually be called with the same semantics
as JS there is no guarantee that a function passed to JS and then
invoked successfully was wrapped with `allowInterop`. The wrapping is
always required in Dart2JS. To make DDC more strict, add interceptors
that check for the usage of `allowInterop`.

Whenever a JS interop function or setter is passed an argument which is
statically typed as a Function, but not wrapped with `allowInterop` at
the call site, wrap it with `assertInterop` which will check the
argument at call time and fail with a clear error if it was not wrapped.

Whenever a JS interop function is torn off, either at the top level or
from an instance, wrap it with a function that will also inject these
checks at runtime.

There are still holes where we can't catch the mistake:
- An argument which is statically dynamic and a Function at runtime
  won't be caught.
- A Function which is stored in a collection won't be caught.
- A JS interop definition where a getter returns a Function which takes
  a Function as an argument is not checked.
- A dynamic call through to javascript is not checked.

Changes:

- Refactor `_isJsLibrary` and add `isJsMember`, and `isAllowInterop`
  utilities to determine what needs wrapping.
- Update `assertInterop` to give a more clear error when it fails, and
  to ignore non function arguments.
- Add `tearoffInterop` to wrap a function an ensure that any function
  typed arguments are wrapped.
- Inject `assertInterop` around Function arguments passed to JS methods.
- Inject `assertInterop` around Function arguments passed to static or
  instance JS setters.
- Inject a runtime wrapper around static or instance Function tearoffs.
- Add a test covering all flavors of checks that are supported.
- Change the interop expando to an `Expando<dynamic>` in the NNBD SDK to work
  around a stricter type check. https://github.com/dart-lang/sdk/issues/39971

Potential improvements:

If the `tearoffInterop` turns out to be too heavy, we could loosen it so
that we only wrap methods if any of their argument types are statically
declared to be a Function.

Change-Id: Ibc92df5b54e1a041b4102a07b8398b774b6bd1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128462
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-02 20:24:26 +00:00
Martin Kustermann 4e9a8c8e18 [vm/nnbd] First start on migrating VM patch files for NNBD
Issue https://github.com/dart-lang/sdk/issues/39754

Change-Id: Id0322ee6bde9b3af5483feacf73b590cdafbc62d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127160
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-02 13:53:36 +00:00
Zichang Guo d3b40e59c6 [vm/io] add endian.host to RawSocketOption.fromInt
This is the reland of 127489 with fix on Mac. IPv6 and IPv4 behave differently in setsockopt(). IPv6 requires an index instead of an address.
https://dart-review.googlesource.com/c/sdk/+/127489

Bug: https://github.com/dart-lang/sdk/issues/39691
Change-Id: Idc0449e88be47663851f2de90cdbbf3f13466221
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128367
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-12-30 09:34:18 +00:00
asiva b1c6d89fb0 [VM/runtime] Remove support for loading URLs through service isolate
- Removes the load port functionality from the service isolate, this was
  used to load sources in Dart 1 and is pretty much dead code in Dart 2
- Moves resolution of URIs and Package URI (based on package map) to the
  individual isolates instead of sending a request to the service isolate
- Setups the package map lazily as it is needed only if resolveURI is
  called in Dart code, it is not needed for loading/compiling sources
  (this is now done in the front end).
- Removed Dart_ServiceWaitForLoadPort() methods from the Dart C API as
  it is not used anywhere.

Change-Id: I6c3704bc431bdcd49bf074eb58bee1ed492ccccb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129742
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-27 17:30:05 +00:00
Ben Konyi 93c9ebabd6 [ VM / dart:io / Service ] Add service extension RPCs to dart:io to allow for HttpClient.enableTimelineLogging to be set remotely.
It isn't possible to do this with evaluate since we are unable to access
classes from private libraries exposed through dart:io like dart:_http.

Change-Id: I3d4168d919dbcf5008da60b14165fd9b89f22cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129322
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-12-26 23:23:34 +00:00
Mark Zhou c815b89647 [dartdevc] Adding nullability check to is expressions.
Change-Id: I60764c10cc245fb3593803f0ae6d034baabcacc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129741
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-12-26 20:27:34 +00:00
Ben Konyi 017ea8b54a [ VM / dart:io ] Added lastReadTime, lastWriteTime to socket profiling
Change-Id: I8dc7c271b44bdecf5fcc081c1324ce809ca9c140
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129562
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-12-26 16:22:34 +00:00
Stephen Adams b1acde8d70 [js_runtime] Address leaks in _HashMap, _HashSet and _LinkedHashSet
The remove method needs to delete the reference to the 'bucket' array
to avoid a pathological case of nearly unbounded empty buckets.

Bug: 39638
Change-Id: I5cb85817036f36aeec92f560aa4ec57ee9c88638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129263
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-23 21:19:00 +00:00
Martin Kustermann 72f4a831aa Revert "[SDK] Switch to is_sync to identify sync/async running."
This reverts commit 886615d0f9.

Reason for revert:

There was an unexpected slowdown in some async benchmarks, e.g. Calls.AwaitAsyncCall.

Will revert for now and investigate next year.


Original change's description:
> [SDK] Switch to is_sync to identify sync/async running.
> 
> This should address the regression introduced by https://dart-review.googlesource.com/c/sdk/+/124988
> 
> Bug: https://github.com/dart-lang/sdk/issues/39525
> Change-Id: Id163b649bdd0363297c186559fa84ff87f908e4b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129062
> Reviewed-by: Clement Skau <cskau@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>

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

Change-Id: I5cda795cbccc01f22e0f8192473c171a4e9fca4b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/39525
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129285
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-12-20 19:06:54 +00:00
Clement Skau 886615d0f9 [SDK] Switch to is_sync to identify sync/async running.
This should address the regression introduced by https://dart-review.googlesource.com/c/sdk/+/124988

Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: Id163b649bdd0363297c186559fa84ff87f908e4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129062
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-12-20 11:07:10 +00:00
Régis Crelier b92fefdfe9 [VM/nnbd] Pass nnbd mode from compiler via generated code or bytecode to runtime functions performing type checks or type reification.
This continues the work started in https://dart-review.googlesource.com/c/sdk/+/124105
The nnbd mode is now part of the type arguments instantiation cache,
since the resulting vector depends on the mode.

Change-Id: I803c07fa9473024557db8585e87286f16681169a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128307
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2019-12-20 03:26:29 +00:00
Samir Jindel fee4ed7840 [vm/tfa] Factor type arguments into result type of _List constructor.
Addresses https://github.com/dart-lang/sdk/issues/39769

Benchmark results:
  Meteor improved 11.35%
  Havlak improved 8.9%
  Fannkuch improved 36%
  BuildTable{Idiomatic,Buffer}: 3.5%

Some improvements may be shared with https://dart-review.googlesource.com/c/sdk/+/128880,
although Havlak is unique and the other improvements are higher.

Change-Id: I5b5976f14c4814ec48139cea6dee918908fef2cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129082
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-19 16:41:32 +00:00
Samir Jindel f8200991d7 [vm] Remove redundant type-tests from min/max.
MinLib: 4% improvement
MaxLib: 10% improvement

Change-Id: I26459d5cefdbeaa8af3d9e226b401e12eace9ca2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128883
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-12-18 22:33:21 +00:00
Clement Skau 3764928769 [SDK] Switch to isSync to determine if async func. is running sync-async.
Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I1e23a726bf0fbff2c02891e25c714ea599330c47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128666
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-18 08:57:00 +00:00
Nicholas Shahan 2aa6e73ae7 [dartdevc] Cleanup all temporary nnbd modular tests
All of these tests are now running under the regular test infrastructure.
The only reason they were created as modular tests was because we wanted more
control over the SDK sources used.

Change-Id: I2ad5aa616ff8bccd10cfac2d49bfaa39ab50c192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128801
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-18 00:43:44 +00:00
Nicholas Shahan c13ab9dce2 [dartdevc] Start emitting type wrappers for null safety
Legacy and nullable types will get wrapped with their respective wrappers when
compiling applications with null safety enabled.

Change-Id: I1defe4fc9d5d9b5eacf23a479178eca060ea716b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128379
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-18 00:14:34 +00:00
Lasse Reichstein Holst Nielsen b431cbc6c6 Migrate dart:_http to NNBD.
Change-Id: I2a27ebcb06776637411021a62d29daf80dae0850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126649
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-12-16 13:49:40 +00:00
Dim Pen 9d1dfe3dfa Update math.dart:atan2 in relation to atan comment - Follow-up for sdk_nnbd
Same update needed on sdk_nnbd as described for the sdk here:
https://dart-review.googlesource.com/q/I189030346e7f6ccf8526d444101dd0172a54ee53


Change-Id: I546895c115df818a584f71552eaee82403b3675d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126020
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-12-16 12:49:27 +00:00
Srujan Gaddam a865b9c379 Change Future lists to use dynamic
Bug: https://github.com/dart-lang/sdk/issues/39627

Lists in a future should be typed with dynamic since they come from JS
interop.

Change-Id: I93d4da16eb27c3af23820a170cfad7cc5c3b4472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128368
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2019-12-14 00:23:54 +00:00
Srujan Gaddam b84d6ba0f8 Change type MediaDeviceInfo to dynamic in Future
Bug: https://github.com/dart-lang/sdk/issues/39627

Lists in a future should be typed with dynamic since they come from JS
interop.

Results from running tools/dom/scripts/go.sh

Change-Id: I4ed37d6f5fa570beef71652dcad17c3bcf7560ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2019-12-13 22:17:11 +00:00
Mark Zhou 4589145939 [dartdevc] Cleaning up analysis errors.
Change-Id: I5af7281af4500f939b335a1df97abefe9386f347
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128080
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-12-13 17:40:49 +00:00
Nicholas Shahan e3a9dec3e6 [dartdevc] Remove dead code that handles functions in asserts
This code is causing an issue when running tests with the NNBD SDK. As I
understand it used to be possible to pass a function to assert but that feature
was removed from the language. We might as well remove it from DDC too :)

Change-Id: Ia62c653ec9d4c98694986b2c326d2b1b027b9ed9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128308
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-13 17:14:29 +00:00
Nicholas Shahan 598fba0147 [dartdevc] Actually use the libraries from the NNBD fork of the SDK
This change fixes the issues causing build failures when using the
forked NNBD SDK sources and trying to build the dartdevc_kernel_sdk
target.

The end result is a dart_sdk.js file that is known to be incorrect
(missing uses of the legacy and nullable type wrapping) but serves
as a baseline for improvement. Some tests of the runtime directly
will correctly pass.

Following changes will turn on the type wrapping and we can start
diagnosing and fixing the issues that appear.

Fixes: #38665

Change-Id: Iddcf31ef2520fa54bf7d9ae6262c2264636b9b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127780
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-13 17:11:19 +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
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
Stephen Adams 964c9d8c20 [dart2js] new-rti: debug print of named type variable miss
Change-Id: Ib344442c1dc15136408df761852e901abf4b80c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127221
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-12-09 23:20:33 +00:00
Régis Crelier b37f391f34 [VM/nnbd] Make runtimeType return a non-nullable type when the NNBD experiment is enabled.
The nullability of runtimeType must be consistent with the nullability of
a class DeclarationType. Currently, it is always kLegacy. However, this
needs to be set to kNonNullable when the NNBD experiment is enabled.
Note that the nullability of the null instance remains kNullable.

Change-Id: I4ba974c2551c3a7fbd190b02175804090f9b48b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125721
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-12-09 18:27:04 +00:00
Régis Crelier 8894b88467 [VM/nnbd] Implement syntactic type equality.
Legacy types are considered equal to their non-nullable variant.
Type hash is modified to be consistent with the new definition.

Change-Id: If90f7f13cf77e519d5b90b57d9dbf4988f71be13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126283
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-09 18:18:59 +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
Nicholas Shahan eb862ca54d [dartdevc] Revert change to libraries.yaml to fix analyzer test bot
This is the simplest fix until we have the DDC build actually working to
make get the analyzer test bot for nnbd working again.

Change-Id: I1357d0ef1509293649f32a01cd83c85398923c1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127540
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-07 23:42:55 +00:00
Nicholas Shahan 942c58f32d [dartdevc] Fix build errors in runtime patch files
Change-Id: I98bb1435e9fe888158a4ccad7dc4a39ee73fb936
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127491
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-12-07 01:17:14 +00:00
Mark Zhou afdc8caca8 [dartdevc] Finishing migration of dart:_interceptors and dart:_runtime.
Change-Id: I511e0bc701dea8fbccb135802ef79b3f678a3e52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126088
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-12-06 22:24:34 +00:00
Sigmund Cherem 16bc1806ea (html) remove type parameter from callback argument
This was a case missed when fixing #33891, and fixes #36798

Change-Id: I96e177a7d8020635e191d829afdec45f888658a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127500
Reviewed-by: Alan Knight <alanknight@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-06 19:02:02 +00:00
Jonas Termansen daa400bada [sdk] Fix all uses of the view() constructor to always use offsetInBytes.
The list being viewed can sometimes itself be a sublist view, but the
default view() constructor doesn't take that into account, and instead the
caller needs to be aware of the case. This change makes all such uses use
offsetInBytes, even in cases that's not needed, so it's trivial to audit
that it's always used correctly. In the cases it's not needed, it just gets
the value 0 and it's a no-operation. In the cases it's needed, it fixes a
bug, such as in _WebSocketProtocolTransformer.add().

Closes #39589

Change-Id: I6e9bd5510f48ce378bdec2c64b56fe789dfb27ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127165
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2019-12-06 10:37:00 +00:00
Kallen Tu e11cf75bd9 [dart2js] Propagate kernel variance to emit annotations in RTI table.
Change-Id: I4612c50828f5d85115e15838e2cc2117446b07ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127201
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-12-06 01:26:58 +00:00
asiva b99599bae1 More cleanup of the loader code.
Change-Id: I8ee048f2a06f8aa54cb5efb832740a53b2bd042d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127444
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-12-05 23:07:55 +00:00
Nicholas Shahan baf1afa902 [dartdevc] Opt in dart:collection patch file for NNBD support
Pairs best with https://dart-review.googlesource.com/c/sdk/+/127161

Change-Id: I7450128ddc7a59e05c518d22301b1a493a39e16a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127222
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-05 22:49:00 +00:00
asiva f7aff739bd Fix Isolate.packageRoot to account for the fact that it returns a Future.
Change-Id: If4b7c3a66aa3071beadf29a57ac84a8e2228ffb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127341
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-12-05 19:23:19 +00:00
Nicholas Shahan bef857b6cb Fix dart:collection analysis errors in NNBD fork
Change-Id: Id4a5e5b100ca1c429070263555ab730622644d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127161
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-05 18:20:09 +00:00
asiva 5ff9a2ed37 Cleanup the loader code to remove some unused pieces.
Change-Id: I026b2b0dfb964c2dd67a9022260e4aba9c019e9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125444
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-12-05 02:44:18 +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
Mark Zhou a4bac1fb10 [dartdevc] Migrating dart:_js_helper and dart:_interceptors to NNBD.
Subsumes the reland of https://dart-review.googlesource.com/c/sdk/+/125994

Change-Id: Ie12c8d473303d0ce7379828caf7523b26733ab75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126610
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-12-04 18:23:29 +00:00
Martin Kustermann 1bbbc9f599 [vm/aot] Check in test to ensure in PRODUCT mode we don't retain any code in dart:vmservice_io/dart:_vmservice
The CL also updates a number of pragma annotations to be conditional on
non-product mode.

Change-Id: Ia00b5089d54bbb8f6f6006ef67d65859ab56c132
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127004
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-12-04 15:30:58 +00:00
Clement Skau f9327d3bac [SDK] Adds --lazy-async-stack support for async*.
Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I53cd334243649901ea8e0f9799d9f41c126e3627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126729
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-04 12:47: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
Nicholas Shahan 19fc1016da [dart:core] BREAKING CHANGE: Fix analysis errors in NNBD fork
NOTE:
Includes a change to RuneIterator.rawIndex that should be considered
breaking when we unfork the SDK.

Change-Id: I91c1be25b7be7afb828b5c92de133a7d6b161363
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126420
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-12-03 20:04:58 +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
Zichang Guo bf69257c5f [dart:io] socket profiler in dart:io
Add socket profiler functionality through service extension.

Change-Id: I717b72fbb1c53503dfb8fa08789417c18300565d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124582
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-12-02 19:11:18 +00:00
Lasse Reichstein Holst Nielsen 3f32196958 Make LateInitialziationError abstract and uninstantiable.
Change-Id: I82ad71f3db9a7c04d87cad62662760f1b104ad68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126733
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-12-02 15:03:37 +00:00
Johnni Winther 5013ce6e5d [cfe] Use correct types and errors in late lowering
Change-Id: I6e7dcbd96e151a69fc67a6cd5e5af1620760b02a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126647
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-12-02 15:00:18 +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
Nicholas Shahan 96e7a4ff30 [dart:async] Temporarily work around compilation errors
The front end is failing to consistently find the correct LUB for function types
with generic type arguments (especially with nullability).

We should revert this change after it is fixed.
https://github.com/dart-lang/sdk/issues/39534

Change-Id: Ie7f6856ccc269c6b287a1f96f264bdd53a2d1782
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126404
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-27 16:09:30 +00:00
Ivan Inozemtsev 3e5ae6adaf Revert "[dartdevc] Break dart:_debugger dependency on dart:html"
This reverts commit 134e0e28cd.

Reason for revert: breaks internal tests

Original change's description:
> [dartdevc] Break dart:_debugger dependency on dart:html
> 
> Change-Id: I6b259429f3e78d0540147a8c99b9adbd026a8328
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126120
> Reviewed-by: Mark Zhou <markzipan@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

TBR=sigmund@google.com,alanknight@google.com,nshahan@google.com,markzipan@google.com

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

Change-Id: Ia785538a5e082a8da0857bd11d2c42061ec63d29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126500
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2019-11-27 10:38:10 +00:00
Nicholas Shahan 461b80a0e4 [dartdevc] Fix analysis errors in NNBD dart:core patch file
Remove the language version comment from dart:_js_helper but it has not yet
been fully migrated. This only makes the necessary changes to fix errors in
dart:core.

Change-Id: Ib0dafd7838ad46e5e0284cefb751e12504c318b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126401
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-11-26 23:12:15 +00:00
Nicholas Shahan 1d914d2e7e Revert "[dartdevc] Migrating dart:_js_helper to NNBD."
This change breaks the dartdevc_platform target for nnbd because it removes
the language version comment from only some of the part files in the
dart:_js_helper library. At the same time we need to migrate:
 * annotations.dart
 * linked_hash_map.dart
 * identity_hash_map.dart
 * custom_hash_map.dart
 * native_helper.dart
 * regexp_helper.dart
 * string_helper.dart
 * js_rti.dart

This reverts commit 3e86e8f8fb.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [dartdevc] Migrating dart:_js_helper to NNBD.
>
> Change-Id: Ic204b43221f876c945cc1b973a2165131a3f40b2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125994
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

TBR=sigmund@google.com,nshahan@google.com,markzipan@google.com

Change-Id: Ie199fd5e93c0eb99cbf1bddc4e8588a325922a61
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126300
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-26 18:25:13 +00:00
Clement Skau d5dbf10672 [SDK] Adds non-eager async stack frame collector.
This is done by collecting all frames on the current stack until an async/async* frame is hit
which has yielded before (i.e. is not in sync-async case).
From there on it finds the closure of the async/async* frame and starts traversing the listeners:
  while (closure != null) {
    yield_index = closure.context[Context::kAsyncJumpVarIndex]
    pc = closure.function.code.pc_descriptors.LookupPcFromYieldIndex(yield_index);
    <emit pc in frame>
    closure = closure.context[Context::kAsyncCompleterVarIndex]._future._resultOrListeners.callback;
  }

Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: I97030d22e529bf8a74ecd30a8a2589cfe57ad330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122644
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-26 11:51:27 +00:00
Sigmund Cherem 42ec44a6a4 Reland "Revamp patch_sdk.dart mainly to use libraries.json."
This is a reland of 3c9e924073

Original change's description:
> Revamp patch_sdk.dart mainly to use libraries.json.
> 
> This will make it possible to use the script to create a patched sdk
> for dart2js and the vm (some followup needed), which will be useful
> to migrate their libraries to nnbd.
> 
> In the future, we should be able to leverage this new logic to
> write tests that ensure our sdk is warning-free (there are > 80 real
> warnings today even on the non-nnbd sdk)
> 
> In detail, this CL includes:
> 
> * loading the libraries data from libraries.json, this removes the need for a
>    hand-crafted libraries.dart that replicates the data in libraries.json.
> 
> * auto-generates a libraries.dart in the patched sdk that can be used to run
>  dartanalyzer or to compile an sdk with dartdevc-legacy.
> 
> * script simplifications in patch_sdk.dart
>     * removed tracking of modification stamps. This didn't appeared to be
>       used by the ninja rules. I believe it was used to reduce local
>       iteration cycles when we were first developing the sdk itself.
> 
>     * use Uri directly instead of package:path - this simplifies things,
>       especially since the libraries_specification is Uri-based as well.
> 
>     * switch to use package:args for parsing options
> 
>  * added an option to merge part files in a single file. I've noticed that the
>  analyzer provides some false positive errors in part files, but once merged
>  they are no longer shown. In particular, we are clearly hitting limitations of
>  dartanalyzer on the patched sdk. At this time the old patch-script generated
>  an sdk with 1500 warnings, this new script reduces it to 500 (not sure why),
>  with merging of part files it goes down to 80.
> 
> 
> Change-Id: I6bbaf92ef4554f00c8bf6b38d19bf79d44fb3e94
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125780
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Commit-Queue: Sigmund Cherem <sigmund@google.com>

Change-Id: Ifcb9dbef36452e41e8e96e086761d76b5a3d988e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125998
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Sigmund Cherem <sigmund@google.com>
2019-11-26 01:40:53 +00:00
Mark Zhou 3e86e8f8fb [dartdevc] Migrating dart:_js_helper to NNBD.
Change-Id: Ic204b43221f876c945cc1b973a2165131a3f40b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125994
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-11-26 00:27:19 +00:00
Nicholas Shahan 965fb9942f [dartdevc] Restore dart:core imports in dart:_internal patch file
The lack of these imports are breaking the `dartdevc_platform` build target when
using the `--nnbd` flag.

Change-Id: Ib8b8368286c24b5435ad4d141ad68aea8ba6be0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126220
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-11-25 21:38:46 +00:00
Nicholas Shahan 134e0e28cd [dartdevc] Break dart:_debugger dependency on dart:html
Change-Id: I6b259429f3e78d0540147a8c99b9adbd026a8328
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126120
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-25 17:55:55 +00:00
Mark Zhou 16cbabec3a [dartdevc] Migrating dart:_isolate_helper to NNBD.
Change-Id: I89477260419832a91b4cbbf1f96da06de7c2954e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125997
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-23 01:09:07 +00:00
Mark Zhou 74a57acfbe [dartdevc] Migrating dart:_foreign_helper to NNBD.
Change-Id: I557d4a544f03f7aaf9985dc30d0671fc7aa603ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-11-22 01:03:33 +00:00
Vijay Menon 8295efc541 Revert "Revamp patch_sdk.dart mainly to use libraries.json."
This reverts commit 3c9e924073.

This CL was breaking the internal build.

Change-Id: Ic4e6df070f2a87ac88ef97f0e6b07d53c13ceadc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125925
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2019-11-21 14:36:55 +00:00
Sigmund Cherem 3c9e924073 Revamp patch_sdk.dart mainly to use libraries.json.
This will make it possible to use the script to create a patched sdk
for dart2js and the vm (some followup needed), which will be useful
to migrate their libraries to nnbd.

In the future, we should be able to leverage this new logic to
write tests that ensure our sdk is warning-free (there are > 80 real
warnings today even on the non-nnbd sdk)

In detail, this CL includes:

* loading the libraries data from libraries.json, this removes the need for a
   hand-crafted libraries.dart that replicates the data in libraries.json.

* auto-generates a libraries.dart in the patched sdk that can be used to run
 dartanalyzer or to compile an sdk with dartdevc-legacy.

* script simplifications in patch_sdk.dart
    * removed tracking of modification stamps. This didn't appeared to be
      used by the ninja rules. I believe it was used to reduce local
      iteration cycles when we were first developing the sdk itself.

    * use Uri directly instead of package:path - this simplifies things,
      especially since the libraries_specification is Uri-based as well.

    * switch to use package:args for parsing options

 * added an option to merge part files in a single file. I've noticed that the
 analyzer provides some false positive errors in part files, but once merged
 they are no longer shown. In particular, we are clearly hitting limitations of
 dartanalyzer on the patched sdk. At this time the old patch-script generated
 an sdk with 1500 warnings, this new script reduces it to 500 (not sure why),
 with merging of part files it goes down to 80.


Change-Id: I6bbaf92ef4554f00c8bf6b38d19bf79d44fb3e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-11-20 22:51:42 +00:00
Nicholas Shahan 488daa270c [dartdevc] Fix analysis errors in patched dart:core library
Change-Id: Iab9efe67cee6f1c7ea9c42120bc08ddcf5ff2086
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125700
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-20 20:09: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
Kevin Moore 8342ec2c71 Fix pub.dev URLs throughout SDK repo
Change-Id: I5bcb7c40be12ee1dc887620281b4807469d67bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125729
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2019-11-20 11:30:48 +00:00
Mark Zhou 453aca82a7 [dartdevc] Migrating dart:_debugger to nnbd.
Change-Id: I5b1d0ff2cef8f6da2256b8d4f9dc88e09e89fb2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125740
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-11-20 01:19:48 +00:00
Nicholas Shahan 28de386937 [dart:core] Update num operator == parameter type in NNBD fork
Should the type agree with operator on Object?

Change-Id: I4a0257cec08a92898cb302c34e66a2fda4cfce6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125728
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-20 01:10:08 +00:00
Mark Zhou 5b72c1c669 [dartdevc] Migrating internal_patch to nnbd.
Change-Id: I1ec8cde975ca7ea60c2730ca5b3afa113d783e7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125581
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-11-19 01:03:53 +00:00
Nicholas Shahan 7c5f81eb0f [dartdevc] Cleanup unused optional parameter from NoSuchMethodError
Some preparation for NNBD migration.

This was not part of the public API and only part of the DDC patch. I could not
find any use besides passing null which was the default anyway.

Change-Id: Icab2bb3f24e228afd4f0a57c9a2474121f27a67b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125466
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-19 00:55:43 +00:00
Nicholas Shahan baa2d8125f [dartdevc] 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.
- Remove a pointless `is! int` type check. The parameter is an int.

Change-Id: I3a0358d83a181eee5576c2062128d89d197ba3e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125303
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-19 00:16:43 +00:00
Nicholas Shahan 93c9f97715 [dart:core] Fix analysis error in NNBD fork
Use a local variable to get type promotion of the nullable Function.

Change-Id: I271a53044afbfb40999706c486dc27b8883190af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125580
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-18 23:12:49 +00:00
Mark Zhou c38cde958d [dartdevc] Finishing NNBD migration of dart:typed_data.
Change-Id: I77a00abbb6e00c1bf1edaae0289b08e9faa1955c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125160
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-18 23:07:05 +00:00
Mark Zhou 6f00b19174 Migrating dart:convert patch files to NNBD.
Change-Id: Ib1127853bc50682e674ccc783f958e7865118b6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125063
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-11-18 22:56:05 +00:00
Nicholas Shahan c3607e3d48 [dart:_internal] Fix some analyzer errors in the NNBD fork
Change-Id: Ie2ea74469c9308a619a3fb2af381c10dff2e249a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125547
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-18 22:41:25 +00:00
Ben Konyi cfd226a27f [ dart:http ] Fix issue where setting HttpClient.enableTimelineLogging wasn't actually enabling timeline logging
Change-Id: I12134eaf1cd79516376d266b9919535987f7703b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125565
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-11-18 22:17:55 +00:00
Mark Zhou c825038296 [dartdevc] Migrating dart:async patch files for DDC to be nnbd-compliant.
Change-Id: I822fc9db7ddfe95a6f561ef1acfc88f96f2635dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125060
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-18 22:16:55 +00:00
Lasse Reichstein Holst Nielsen 7b67303318 Make json.fuse(utf8) work correctly.
Change-Id: Ie4d5164759c1d4a8c19e216bfac50b116271f1a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125342
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-11-16 13:45:59 +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
Nicholas Shahan 6239777983 [dart2js] Fix a few missing and one unneeded covariants
Change-Id: Ic5fe4ec2230b233301c628fee8436471a0dbfdb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125445
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-16 00:08:06 +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
Sigmund Cherem d2c63991ae Improve NNBD testing support
The goal of this change is to make it possible to start iterating on nnbd tests
for DDC. This keeps the current philosophy of keeping NNBD and non-NNBD build
configurations separate, except that NNBD builds are allowed to consume library
sources from the non-nnbd sdk.

This change addresses the first set of errors that are encountered when trying
to build a fully NNBD configuration:
  * CFE has issues with type promotion, for that reason we remove
    `--enable-experiment=non-nullable` in vm build rules, and we use a smaller
    training data when creating the dartdevc app-jit snapshot.
  * We'd hit compile-time errors with nnbd libraries with inconsistent
  patchfiles. To avoid that, the libarries.json points to the non-nnbd SDK
  sources for most dart:* libraries.

Change-Id: Ie6226b3bd8a92b4a1632dd84a5db2f04238fd4f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125080
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-11-14 18:28:20 +00:00
Mark Zhou 1d6584720b Migrating DDC dart:developer patch files.
Change-Id: I99fb8004433ac0b518c6da23dfb7d73d2a30e769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124421
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-11-11 17:43:23 +00:00