Commit graph

9031 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
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
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
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
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
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
Ben Konyi c2734309f0 [ VM / dart:typed_data ] Fixed more cases where null was a valid parameter for typed data functions in AOT
Fixes https://github.com/dart-lang/sdk/issues/39812

Change-Id: I66d5808d16b203b8e50e77631203eca6f4452c07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129743
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-27 20:04:35 +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
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
yuanhuihui 006f611a2b support more sync event when use systrace to record timeline event
sync event is not included in the systrace, such as Timeline.startSync.
more detail, see https://github.com/dart-lang/sdk/issues/39727

Signed-off-by: yuanhuihui <gityuan@gmail.com>
Bug: issues/39727
Change-Id: I21de32d517c9cbc7c00a12d69bdcb77df572f8db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127921
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-12-20 23:37:07 +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
dimpen 0aa9ce5c57 Update math.dart:atan2 in relation to atan comment
It's a **typo**. It should say **atan(a/b).**
The way the _atan2(a,b)_ is defined _x=b, y=a => atan2(y,x) = atan(y/x) if x is positive_.

So _atan2(a,b) = atan(a/b) if b is positive._

Indeed:
```
import 'dart:math';

void main() {
    double a = 1, b = 2;
    assert(atan2(a, b) == atan(a / b));
    assert(atan2(a, b) != atan(b / a));
}
```

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

GitOrigin-RevId: 73910bb787c2dbb811bb9f7fb1bd8bab22ef92ad
Change-Id: I189030346e7f6ccf8526d444101dd0172a54ee53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125926
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-12-16 12:45: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
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
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
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
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
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
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
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
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
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