Commit graph

293 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Johnni Winther 59fcd8d378 [vm] Fix process_patch.dart in sdk_nnbd for Windows
Creating a process with arguments resulted in a late initialization error.

Change-Id: Ibde46da576628a7941fa36042201494ba02eaeda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136967
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-25 11:38:00 +00:00
Vijay Menon 279230e898 [dartdevc/nnbd] fix bug in last cl to re-enable warnings
Change-Id: If2729a745c6424151b960a47592924baa1db89ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137044
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-02-24 23:49:44 +00:00
Vijay Menon b5a08c916c [dartdevc/nnbd] fix null checks in primitive casts
These should go through the `cast` operation to fail in strong and pass with warning in weak.

Change-Id: I1863b507835c0c9993357318b9e7038154e47151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136902
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-02-24 21:42:58 +00:00
Zichang Guo 95b2b8c43b [dart:io] Set isDirectory to false for filesystem delete event
According to the `FileSystemEvent` api page, isDirectory should always be false for delete events.

Bug: https://github.com/dart-lang/sdk/issues/35032
Change-Id: Ic277aa366db09c016979350d7369e004f9a8a152
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136405
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-02-24 17:10:55 +00:00
Alexander Markov 623b3fee52 [nnbd/dart:io] Fix nullability in _EventHandler._sendData
_EventHandler._sendData is assigned to VMLibraryHooks.eventHandlerSendData
and being called using VMLibraryHooks.eventHandlerSendData with null
sender (from timer_impl.dart).

Implementation of _EventHandler._sendData in the VM actually supports
null sender - it explicitly handles null sender at
732cd81f05/runtime/bin/eventhandler.cc (L131-L132)

Given the above, _EventHandler._sendData should take 'Object? sender'
instead of 'Object sender'.

Change-Id: I13a4b11a27e992ecbd27f68da27ea0d568dd0bdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136782
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-24 16:49:05 +00:00
Nicholas Shahan d41e419904 [dartdevc] Fix nullability of function types and typedefs
These fixes also prepare for an upcoming change to normalize FutureOr
types.

- Cache and emit the hoisted function type at the top level without
  nullability wrappers.
- Always emit nullability wrappers at the use site.
- Fix issue where sometimes the return type would be double wrapped.

Change-Id: If4a0c94e62eca626f271cc3c259c813911075d9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136404
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-22 01:20:21 +00:00
Vijay Menon a578c646c3 [dartdevc/nnbd] warn on null param in weak mode
This warns only the first time per (callee/param) location, which reduces the noise significantly.

Change-Id: I9674c366ca38a097fcc93fd2a0716366da57c9d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136400
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-02-22 00:53:51 +00:00
Joshua Litt 5aeb1a3f11 [dart2js] Update libraries.yaml with migrated dart2js.
Change-Id: Ibd70ce90d3b965d438a153654efb5e5bff94a201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135798
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-02-21 18:37:40 +00:00
Lasse R.H. Nielsen 98b4635aa9 Make TypeError no longer implement AssertionError.
This means that TypeError no longer inherits a spurious `message` member.
The message of a platform-thrown TypeError is still available as `toString()`.

Fixes #40317

Bug: http://dartbug.com/40317
Change-Id: I77312859ebae3f92c2e56aeea6283b075b71c8d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136129
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-21 14:02:57 +00:00
Alexander Markov 87f63c3573 [nnbd/vm/corelib] Fixes in VM core libraries for NNBD strong mode
These fixes allow "hello world" to run in NNBD strong mode on the VM.

Change-Id: I3c17b8e1b7ab64086d830298ef8f7601bf1acb68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136706
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-20 20:23:25 +00:00
Mark Zhou 2d720be9ef [dartdevc] Adding performance optimizations for common legacy cases.
Changes include:
* Explicitly declaring Type to prevent extraneous type checks.
* Separating null comparison maps from other type comparison maps.
* Hoisting legacy null comparisons outside of isSubtypeOf and into cast.

Change-Id: Ieb2196261998fdaa1d60f0e97223c1d89bf9ad7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134879
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-02-20 19:32:36 +00:00