Commit graph

238 commits

Author SHA1 Message Date
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
Jacob MacDonald e57ac16a85 Reland of https://dart-review.googlesource.com/c/sdk/+/130134
Leaves the snapshot output location in root_out_dir so that it doesn't conflict, and hardcodes an exception for _full_sdk_snapshots to look in that directory.

Change-Id: I69cd5d87ba240052c039b7b8920092fd6a78ab08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130500
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-09 16:07:56 +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
Martin Kustermann c0ca187f26 Revert "Create the frontend_server snapshot as a part of the sdk"
This reverts commit 24a0601d5b.

Reason for revert: This breaks the flutter build because flutter has
a build target producing the same "gen/frontend_server.dart.snapshot" file and is therefore conflicting.

See e.g. head-head-head bot failure:

    https://ci.chromium.org/p/dart/builders/ci.sandbox/flutter-engine-linux/9747


Original change's description:
> Create the frontend_server snapshot as a part of the sdk
> 
> This will allow us to use it from webdev, as it now supports DDC output.
> 
> Change-Id: I4b82d1c45d2c058abb062dddd2a2c41cc6318c45
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130134
> Reviewed-by: Keerti Parthasarathy <keertip@google.com>
> Reviewed-by: Jonah Williams <jonahwilliams@google.com>
> Reviewed-by: Vijay Menon <vsm@google.com>
> Commit-Queue: Jake Macdonald <jakemac@google.com>

TBR=keertip@google.com,jakemac@google.com,vsm@google.com,jonahwilliams@google.com

Change-Id: Ib2d782560cc005416ece429f9506dca055bffd9b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130377
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-07 15:10:23 +00:00
Jacob MacDonald 24a0601d5b Create the frontend_server snapshot as a part of the sdk
This will allow us to use it from webdev, as it now supports DDC output.

Change-Id: I4b82d1c45d2c058abb062dddd2a2c41cc6318c45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130134
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-01-06 22:05:19 +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
Sigmund Cherem 561e8242ce Support building under git-worktree
This makes the location of the `.git` folder a GN argument, so it
can be configured differently when using git-worktree.

See sdk_args.gn for documentation on how to use this.

Fixes #33619 (http://dartbug.com/33619)



Change-Id: Ia8144f401c462a6fbb91a965979949f286b04d1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127485
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-12-19 23:12:53 +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
Liam Appelbe 6d7985d020 [analyzer] Use non-nullable experiment when running with nnbd sdk
This is a follow up to https://dart-review.googlesource.com/c/sdk/+/127984

Change-Id: I8513ff36cd8b4500e895ccb846c3437d5939cb2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128461
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-12-16 22:32:38 +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
Liam Appelbe 3166b7d976 [vm] Enable nnbd experiment when building the SDK with --nnbd
This is necessary as of https://dart-review.googlesource.com/c/sdk/+/127961
to use the experiment flag in the VM.

Tested: Late modifier tests that had stopped building now pass again.

Change-Id: I49a5f1e99f40c6e8d785b28a333b44e6fac67eca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127984
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-12-13 20:13:20 +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
Nicholas Shahan 2015c55277 [dartdevc] Remove ability to run analyzer based DDC
This is the first step in deleting legacy DDC!
* Default all invocations of DDC to run the kernel version.
* Disable all tests that run analyzer DDC.
* Detect the most likely case when invoked with an analyzer
  summary and print instruction to update build_web_compilers
  dependency.

I will follow up with deletions, and a rename of the test configurations/
builders to reclaim the names (ddc vs ddk, dartdevc vs dartdevk).

Issue #38777

Change-Id: I1477f0274b6b7f345a5e19d2b3f93797c454a09e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127067
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-09 22:11:22 +00:00