Commit graph

465 commits

Author SHA1 Message Date
asiva e33d023fa0 [BUILD] - Format gn files, this is being done to ensure the unfork CL
doesn't show these formatting changes as diffs.

Change-Id: I69ccbf4adabc66d88371cece785a2c1bce60f133
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138962
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-10 21:56:11 +00:00
Sigmund Cherem 2c68152847 [ddc] cleanup: use Never direclty in nnbd tests
Change-Id: I67aceaccb819ad6033bdb9c7d9870b05859c1064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138900
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-03-10 19:13:33 +00:00
Mark Zhou 44a4f366e2 [sdk] Updating Stream.contains to accept null values.
Change-Id: Icdb4e3fb04625b8e0ffabe1214b196cd7a9eb1ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138888
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-03-10 15:58:26 +00:00
Alexander Markov 7e0139e0c0 [vm/corelib] Improve performance of list copying
With NNBD core libraries:
ListCopy.toList.100(RunTime) 4129 -> 2376 us.

With default core libraries:
ListCopy.toList.100(RunTime) 3006 -> 2140 us.

Issue: https://github.com/dart-lang/sdk/issues/40917
Change-Id: I7a319b6a150eeb5c4765c299dd45638bed2b4406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138720
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-03-10 15:58:06 +00:00
Mark Zhou ec8941b189 [dartdevc] Hoisting subtype caches to addTypeCaches.
This lets us avoid some runtime polymorphicity of JS objects.

Contains a subset of optimizations in https://dart-review.googlesource.com/c/sdk/+/136845

Change-Id: I6cdcf6c58a51074ad860ea225db512f28fff5436
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138564
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-03-10 15:57:08 +00:00
Kaushlendra Pratap f1369d7896 Updated the invalid Example in num.dart
Closes #35400

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

GitOrigin-RevId: a147cc095cf414431c7c9749a6ea4f53139c02da
Change-Id: I3bbe858e4872be067abc710864fa130ac507ffa2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138792
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-03-10 00:00:25 +00:00
Sigmund Cherem db378a2f0d [ddc] let compiler generate instanceof and == of types directly.
Change-Id: I87cb00cc4592125001d50505e9023c2ab45d95c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138722
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-03-09 22:38:20 +00:00
Ben Konyi b01cb58320 Revert "Re-land "[vm] Add type to _AsyncAwaitCompleter.start.""
This reverts commit 4049ab54e4.

Reason for revert: Appears to break standalone_2/dwarf_stack_trace_test and other related tests.

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8886276259895791440/+/steps/test_results/0/logs/new_test_failures__logs_/0

Original change's description:
> Re-land "[vm] Add type to _AsyncAwaitCompleter.start."
> 
> We need to relax vm/dart/causal_stacks/async_throws_stack_no_causal_test
> 
> Change-Id: I40c08d432afeac839ce4f49bbf48c3707b23ef7f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138804
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>

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

Change-Id: Ib77bdb5ba9927cf5a9a588570a5d70641e912aed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138791
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-03-09 22:16:39 +00:00
Samir Jindel 4049ab54e4 Re-land "[vm] Add type to _AsyncAwaitCompleter.start."
We need to relax vm/dart/causal_stacks/async_throws_stack_no_causal_test

Change-Id: I40c08d432afeac839ce4f49bbf48c3707b23ef7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138804
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2020-03-09 19:23:20 +00:00
Mark Zhou 8fb4645cae [dartdevc] Adding nnbd semantics for static and late fields.
Fixes #40375

Change-Id: I53863291a8c6a3cc694d088311a9e09b9b00a790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138723
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-03-09 19:15:49 +00:00
Alexander Markov f17919b559 [nnbd/corelib] Fix performance regression in _SyncIterator.moveNext
In Iteration.deeptree.syncstar benchmark _SyncIterator.moveNext takes
majority of time. If _moveNextFn is cached in a local variable,
then loading a function object out of _moveNextFn closure is hoisted
out of the loop and executed even if _moveNextFn is not called.
The function and cached moveNextFn are also saved to frame.
This extra code results in a slight slowdown of _SyncIterator.moveNext
when _yieldEachIterator != null.

Iteration.deeptree.syncstar(RunTime) 98877 -> 81541 us
(with NNBD core libraries)

Change-Id: Ieac94e106632f9c923eb72d9221bcdecb52fa652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138609
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-03-09 16:59:37 +00:00
Nicholas Shahan 6f47790fb6 [dartdevc] Optimize subtype check
Mark _isSubtypeOf() as never returning null so we don't have to test the
values it returns. Omits the dart.dtest() calls on the result in the
compiled output.

Change-Id: If9ae3b9f0ee6af83dba9fa2474547cc6d168a5fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138611
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-03-07 01:02:24 +00:00
Nicholas Shahan 4799f38767 [dartdevc] Optimize cast operation
Avoid checking for legacy, nullable, null and top. These checks should
all return false because if they were true the dispatch would have gone
directly to the as() or _check() methods on LegacyType, NullableType,
Null, DynamicType, and VoidType. Object? is dispatched through
NullableType.

Add is(), as(), and _check() instance methods to VoidType with logic
similar to DynamicType.

Change-Id: Ib28f40605c66fa7e8569ace405eba51035f2079a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138668
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-03-07 00:29:34 +00:00
Sigmund Cherem c1cf29b2d4 [ddc] improve generated code for wrapType.isNormalized
* adding the bool type changes from dart.dtest to dart.test

* making it positional and not named removes objects creations when calling
  wrapType and loading the value is more direct

* marking it @notNull gets rid of dart.test.

Change-Id: Ib372e165b0b4117606a7a96f29e560ea0199aa18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138669
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-03-07 00:28:44 +00:00
Sigmund Cherem 6eae8db839 [ddc] remove dcall when accessing .type
Change-Id: I9c2bd2d0599dfccec2d9273694e7688b963db27b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138665
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-03-07 00:28:44 +00:00
Mayank Patke 81c3208c10 [dart2js] Special case null is T.
Change-Id: Iec5212db2d4493797257753f9eaa63799d047253
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138574
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-03-06 21:33:53 +00:00
Lasse R.H. Nielsen 93ff9530aa Document difference between Stream.transform and Stream.map.
Fixes #36351

Bug: http://dartbug.com/36351
Change-Id: I75f98b8fdc3a34578adab96e9993089ea69e84bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98346
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-03-06 13:19:34 +00:00
Stephen Adams 8ae984c54a [dart2js] Use a Symbol to access JavaScript Array Rti
Use a JavaScript Symbol() for Array rti property. This makes the
property non-enumerable, avoiding making the property visible via
JS-interop.

The code is feature-tested so that IE11 still works with an enumerable
String property.

Bug: 40535
Change-Id: Ic8b64dac5751989fe4b8d023b0626c3db04676c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137245
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-06 01:20:31 +00:00
Nate Bosch 9d76737487 Remove support for --emit-metadata in DDC
This flag is unused and the behavior it enables was only useful along with
`dart:mirrors`.

- Remove the flag and the field on the options object.
- Prune code branches that are no longer reachable.
- Remove or inline some functions that became either empty or trivially small.
- Remove the manual check for a `dart:mirrors` import since this is handled by
  the CFE now.
- Remove references to the flag in tests.
- Remove test files which only existed to enable the flag for other tests.

Change-Id: I21bf594271fb4eeb5b73fcbf07da736e9e8d1f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138018
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2020-03-05 23:26:13 +00:00
Joshua Litt a731b98113 [dart2js] Fix signature of identityHashCode.
Change-Id: I9a9bd3e3675f3a9e0d13fde0b87944eaf5f16a62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138601
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-05 22:02:59 +00:00
Samir Jindel 1cf9d7a0c5 Revert "[vm] Add type to _AsyncAwaitCompleter.start."
This reverts commit 9983424a3c.

Reason for revert: Breaks vm/dart/causal_stacks/async_throws_stack_no_causal_test

Original change's description:
> [vm] Add type to _AsyncAwaitCompleter.start.
> 
> Without the type, the call to the the parameter f() was being handled
> as a dynamic InstanceCall (smiable), so we had a megamorphic call to one
> of the Closure_XXXX_call methods (there are many copies of this method
> for different signatures) which in turn calls the closure.
> 
> Now that the type is present, we do a direct ClosureCall to the target.
> 
> This gives a measurable improvement to an important internal benchmark.
> 
> Change-Id: Ia9429879f69257465a2537616d8f8595fb1eefa8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138520
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>

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

Change-Id: I2deeebc24d80a7f444f4f53c5c8959b747fd1b29
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138502
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2020-03-05 17:52:44 +00:00
Samir Jindel 9983424a3c [vm] Add type to _AsyncAwaitCompleter.start.
Without the type, the call to the the parameter f() was being handled
as a dynamic InstanceCall (smiable), so we had a megamorphic call to one
of the Closure_XXXX_call methods (there are many copies of this method
for different signatures) which in turn calls the closure.

Now that the type is present, we do a direct ClosureCall to the target.

This gives a measurable improvement to an important internal benchmark.

Change-Id: Ia9429879f69257465a2537616d8f8595fb1eefa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138520
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2020-03-05 16:51:44 +00:00
Mark Zhou db63e89fcf [dartdevc] Appending and checking nullability caches earlier for performance.
Because we cache on instances of type objects, all "type"-ish constructs in DDC must be pre-initialized if we want to avoid any hasOwnProperty checks (which are slow).

1) We now consult legacy/nullable caches earlier when wrapping types, as the downstream logic can be much slower than a lookup.

2) We cache on nullble and legacy wrappers themselves as well as just the underlying object (formerly we cached on just the latter) for faster lookups.

3) We attach local caches upfront, maintaining monomorphicity during hot code paths.

This improves regressions for opt-out worst-case tests from (120 us -> 2100 us) to (120 us -> 500 us) and weak mode tests from (120 us -> 1100 us) to (120 us -> 330 us).

Change-Id: I98a26064404e746162ca3feb22b0993c3b39e63c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138330
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-05 16:30:54 +00:00
Victor Lima b951498903 [vm/aot] Allow static methods to have unboxed args and return
Static methods and constructors may receive unboxed parameters.
This change adds a bitmap to the RawFunction object indicating
which parameters are unboxed and their types. Also, the stack frame
bitmap was updated to include new bits for those parameters.

The ArgumentsDescriptor object was updated to store not only the number
of arguments, but also their size, since 32-bit platforms would use two
words for each int64 and double value.

In addition, static methods that return non-nullable integers
and doubles may return these values unboxed.

Dart AOT x64:

TypedData.Uint8ClampedListViewVarBench  +11.73%
DeltaBlue                               +9.32%
Meteor (Intel Xeon)                     +4.64%

Flutter release android-armv8:

velocity_tracker_bench                  -2.32% (less is better)

flutter_gallery_readonlydata_size       +0.18%
flutter_gallery_total_size              +0.13%
flutter_gallery_instructions_size       +0.12%

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

Change-Id: I97e310f8f30213920af2333fbdedf193d03db5c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135313
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-03-05 15:17:04 +00:00
Alexander Markov 1fcce005b1 [nnbd/corelib] Fix performance regression in List.generate
Fixes https://github.com/dart-lang/sdk/issues/40878

Change-Id: I58278280e49514aef07c0af28aa5235242664083
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138382
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-03-05 01:40:43 +00:00
Alexander Markov 65254a4518 [nnbd/corelib] Fix performance regressions due to casts in 'get current' in iterators
Fixes https://github.com/dart-lang/sdk/issues/40877

Change-Id: I6ae70ba53bccf6634953adcba6e92554236d82ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138327
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-03-04 21:07:16 +00:00
Mark Zhou c426b60da4 [dartdevc] Using hasOwnProperty instead of getOwnPropertyDescriptor.value.
getOwnPropertyDescriptor is significantly slower than hasOwnProperty, and we didn't seem to be using any behavior specific to the descriptor besides the value.

Change-Id: I3329177ee78a5ca823e554dd4f7b0bd26e1d5be0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138331
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-04 20:26:06 +00:00
Mayank Patke 6f4876849b [dart2js] Add flag to enable printing '*' on legacy types.
Change-Id: Ie0b191e6da39fa6e48601caeeadc492699f07045
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138326
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-03-04 20:22:26 +00:00
Mayank Patke 3c2a6c26e2 [dart2js] Erase '*' in runtime type objects.
Change-Id: Ieeb98b79cd03a81cacd10506c977e96306a6330b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137822
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-03-04 16:15:05 +00:00
Mayank Patke a0c3b4fedb [dart2js] Fix some types in NNBD SDK.
Change-Id: Ie401c5f6bae54f7394f5c30c7c1b9a28b70126dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-04 16:15:05 +00:00
Daco Harkes 54903e5bf0 [vm/ffi] Rename members in NativeApi to not contain nativeApi
Follow up of: https://dart-review.googlesource.com/c/sdk/+/136962

Change-Id: Icdc8e7f701b0dbc7e476a140e68bcb15b3ac64ae
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138283
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-03-04 15:21:55 +00:00
Régis Crelier 5701c4fd3b [VM/nnbd] Remove propagation of library mode to runtime after spec change.
On 1/27/20, the nnbd specification changed weak and strong mode instance checks
to make them behave uniformly across legacy and opted-in libraries.
Therefore, it is not necessary anymore to propagate the library mode in
generated code to the runtime.

Change-Id: I42d3ddc6e9a921899aeac21be6374c7893a6d27c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138111
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-03-03 20:30:32 +00:00
Nicholas Shahan ab30452db5 [dartdevc] Add normalization of FutureOr types
These changes are also being back ported into the existing SDK
with minimal differences that will be gone when we unfork the
dart:_runtime library. In the current back port:
* FutureOr<Null>? is normalized to Future<Null>* instead of
  Future<Null>?.
* There is no runtime normalization of FutureOr<T?>?. This
  should have no effect since nullable types can not yet
  appear.

Fixes: #40611, #40720
Change-Id: Ib3ddffbf3778f0f571cf95f58b6142d3ee0bf59b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136160
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-03-03 16:59:56 +00:00
asiva 75de086f1d [VM/Libraries] Fix all errors reported by CFE when the option
performNnbdChecks is turned on.

Bug:40424
Change-Id: I97a283c4a2d54f570def04d938baa9a4ced08667
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137250
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-03-02 23:03:51 +00:00
Zichang Guo 0b819161d7 [dart:io] update return type of native calls
Some cleans up coming from https://dart-review.googlesource.com/c/sdk/+/136322.
Update some inaccurate return types of native calls.
Also update null checks for resourceInfo with nnbd flavor.

Change-Id: I937f204e5cd8331df454c81d58e5893be616862e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137140
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-03-02 18:06:32 +00:00
Srujan Gaddam 5b23373f7e Modify fields in some abstract and native classes
Since we transitioned to natives for dart:html, manually written native
fields should be rewritten. Similarly, if there are fields in abstract
classes that represent interfaces, they should be converted. Fields in
abstract classes that are used in that class are left alone.

Change-Id: I924363639a4430b88b810b7348815bbc3f040e7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137642
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-29 01:29:35 +00:00
Srujan Gaddam 9f79dfc37d Address analyzer errors in golden files in dart:html
New analyzer errors are reported for dart:html around nullability.
Non-nullable fields are translated to native getters and setters if part
of a concrete class and normal getters and setters if abstract.

Change-Id: I2fd87803a08872b2a7eae4de0af704f184997c7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137481
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-29 01:29:35 +00:00
Srujan Gaddam 80f84e1942 Change all fields to native getters/setters
Bug: https://github.com/dart-lang/sdk/issues/40772

Attributes are translated to native getters and setters regardless of
NNBD. Some logic was removed for fields that no longer apply due to this
change.

Change-Id: Ia1a05778ff8c6f082506a1c95a3057a7c5f7f896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136880
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-29 01:29:35 +00:00
Srujan Gaddam 3ec6ec2a2d Change getters/setters to native for nnbd
NNBD fields that were non-nullable or final were transformed to getters
so that they were compilable. They need to be transformed to natives now
for performance.

Change-Id: Ice0082f9468c542098a6d12083a826438d15eba4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135860
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-29 01:29:35 +00:00
Daco Harkes f7192b63cb [vm/ffi] Expose dart_native_api.h symbols via dart:ffi
This enables dynamic linking of the symbols in dart_native_api.h to work around the Windows linking issue and Dart embedders not exposing symbols.

Issue: https://github.com/dart-lang/sdk/issues/40607
Closes: https://github.com/dart-lang/sdk/issues/40564

Change-Id: I6f797cc915b53ec63fa5953529f17c40e52a2aed
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136962
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-28 18:44:45 +00:00
Mayank Patke e1f2fea5a4 [dart2js] Use NNBD types in TYPE_REF and add LEGACY_TYPE_REF.
Change-Id: I23c6ce55fabb53bf12bb92fedc9bd1338f06f03d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137734
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-28 18:24:55 +00:00
Lasse Reichstein Holst Nielsen 043d08a6b1 Don't use an error message as a name in checkNotNullable.
One message is enough.

Change-Id: I0d1b6d98af9f5815f810edc4bd13f46a676ddfda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137780
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-02-28 09:39:06 +00:00
Nicholas Shahan 15b6f19008 [dartdevc] Allow mutual subtypes in type argument bounds
Back-porting a breaking change for Null Safety to the existing SDK to
help front load any issues (we expect them to be minimal).
https://github.com/dart-lang/sdk/issues/40633

We are now allowing the type argument bounds in generic function
subtypes to differ if the bounds are mutual subtypes.

Change-Id: I2b093c08f772a1b866dbe1324b605e6143d3a0b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137289
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-27 23:35:53 +00:00
Robert Nystrom 16f072c783 Migrate language_2/async to NNBD.
Change-Id: Id66e712eaf52fda2069ce5177aa091e373ad52c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134244
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-02-27 23:04:03 +00:00
Mayank Patke a6ad1915eb [dart2js] Give TYPE_REF a return type.
Change-Id: Iaa49426d7a938ef5b9de6df6a04a0c101d63084a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137684
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-27 22:03:33 +00:00
Lasse R.H. Nielsen 14983d6c0a Add null-checking helper function for NNBD libraries.
Change-Id: I4d53ac27fd347c2d81b1d68d023e1da5abd9e3ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136631
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-27 12:22:28 +00:00
Mayank Patke 01064e7b6c [dart2js] Migrate DartTypes to use a wrapper representation for
nullability instead of a field/getter.

Change-Id: I2ca61d1b3a789f2ee4f34a99f66ae237bf9687ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137283
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-27 09:08:47 +00:00
Nicholas Shahan 4017a5ca7c [dartdevc] Fix analysis error in dart:collection patch file
If hashcode is null it gets set on line 128 to dart.hashcode which
is a top level method in the dart:_runtime library.

Change-Id: Ib26a70dc84305dfa11eb15206abd36f003adcd9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137401
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-27 01:19:14 +00:00
Alexander Aprelev 305399c15c [vm/vmservice] Validate getIsolate response before attempting to retrieve pauseEvent from it.
Bug: b/150193047
Change-Id: I6e8f8e27ef2a9894138b1d877597ad3a5f3f9e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137281
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-02-25 23:19:44 +00:00
Zichang Guo 94009bf980 [dart:io] issue another read in _NativeSocket.read to drain pipe
if NativeSocket.read() has not specified `len`, I will expect caller wants all bytes(this is not documented, correct me if I'm wrong).

Check the available bytes after read(), if there are leftover, issue another read(). This will eventually drain the pipe.

Bug: https://github.com/dart-lang/sdk/issues/40589
Change-Id: I3b0be9ef8258defd1f71f85b3154702401e0f31c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136322
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-02-25 18:40:21 +00:00