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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
_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>
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>
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>
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>
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>
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>