Commit Graph

13143 Commits

Author SHA1 Message Date
Alexander Markov de2ce18841 [vm/nnbd] Fix nullability and bounds of type parameters
Nullability of declared type parameters is changed to be undetermined or
non-nullable in opted-in libraries depending on the bound.
This fixes sharing of type arguments vectors with superclasses.

Also, while reading bounds of type parameters we may create new
TypeParameter types with different nullabilities, derived from
declared type parameter types. When those derived type parameters
are created, original type parameters may not have bound yet, so
derived type parameter types were getting null bounds.
This change fixes bounds of those derived type parameter types after
bounds of all type parameters were constructed.

Change-Id: I4bf50b383142ae70f194d103501bcbd10bf792e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133745
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-01-29 23:16:08 +00:00
Filip Filmar 5c42f91362 Revert "[i18n] Replaces fuchsia.deprecatedtimezone"
This reverts commit c063f5d0c3.

Reason for revert: release blocker

Original change's description:
> [i18n] Replaces fuchsia.deprecatedtimezone
>
> The FIDL library fuchsia.deprecatedtimezone is going away.  There are
> different and better ways to obtain the same functionality.
>
> Fixes #39650
>
> Change-Id: If4e4234568c276d3cd2be34863f00165b6e97e0e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129005
> Commit-Queue: Filip Filmar <fmil@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

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

Change-Id: I0a74a537c4269075eb13282c5738a30b263c706e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133747
Reviewed-by: Filip Filmar <fmil@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
2020-01-29 21:10:40 +00:00
Victor Lima b18b27706c [vm] Avoid inlining dynamic calls for simd operations
Dynamic invocation forwarders have the same recognized kind
as the method they are forwarding to.
That causes us to inline the recognized method and not the
dyn: forwarder itself.
It is not safe for user-implementable types. This is triggered
in some of the existing tests when unboxed integer fields are
allowed in AOT.

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

Change-Id: Id518c6b13ccd08998ec78384e55c97c64546098a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133561
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-29 11:58:40 +00:00
Martin Kustermann 9eb09b64be [vm/concurrency] Add locking for any access to [FixedCache].
The [FixedCache] will be accessible by multiple isolates within an isolate
group as well as the GC, so we add locking around it's accessors.

This is a preparation step for the shared heap.

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

Change-Id: Ief113419b3f7a69eda02084ce36cef0e25984315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133580
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-29 11:46:50 +00:00
Alexander Aprelev 7131264848 [vm/isolates] Disallow sending of function types.
Fixes dartbug.com/37294

Change-Id: Ia39790f4ed7ef25988b0ce2849d10429027bbf92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132805
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-01-29 03:30:52 +00:00
Ryan Macnak 52da0b14f1 Revert "[vm] Initialize large typed arrays only once."
This reverts commit 6fcee199af.

Reason for revert: Wrong size logic

Original change's description:
> [vm] Initialize large typed arrays only once.
> 
> Previously large (>256k) typed arrays would be initialized 3 times:
>  - The OS initializing the new virtual memory to zero
>  - Object::InitializeObject initializing to object null
>  - TypedData::New reinitializing to zero
> 
> Change-Id: I432944919ab68aecb2038bba245594bbbaed9093
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130928
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,aam@google.com,rmacnak@google.com

Change-Id: I92818954ddd715f295c1cbe413733236970a991e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133661
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-29 00:18:34 +00:00
Ryan Macnak 6fcee199af [vm] Initialize large typed arrays only once.
Previously large (>256k) typed arrays would be initialized 3 times:
 - The OS initializing the new virtual memory to zero
 - Object::InitializeObject initializing to object null
 - TypedData::New reinitializing to zero

Change-Id: I432944919ab68aecb2038bba245594bbbaed9093
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130928
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-28 21:22:20 +00:00
Liam Appelbe 61b4bbcb6b [vm] Set non_nullable_flag() to true
We'll leave the deletion and cleanup of this function until later, so
that this CL is as easy to rollback as possible.

Bug: https://github.com/dart-lang/sdk/issues/40179
Change-Id: Ie583aaabd117ae06ea27a539c3bc904240a0e6bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133429
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-01-28 16:47:58 +00:00
Victor Lima 14f7e334d3 [vm] Add checks to parameters of math functions before inlining
Make sure to inline functions such as sqrt only when the parameters
are double.

Change-Id: I1a11dc09e804f157f57d9d04b7b9f2aa830ab2a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133236
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-28 14:16:37 +00:00
Ryan Macnak 40f23c735f [vm, docs] Describe which VM service features are available in which VM modes.
Change-Id: Icafc5cbea40eb74caf5be26def5641ce3dd855d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133427
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-28 01:14:48 +00:00
Ryan Macnak ea089033d7 [vm, gc] Use the compactor for the GC of last resort.
Change-Id: I858ff7b93321c8810d3ebe19e7cd18108f91764a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95963
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-27 22:26:17 +00:00
Ryan Macnak 155c0d1b92 Reapply "[vm, gc] Sweep non-executable large pages concurrently."
Wait for the concurrent sweeper to visit processing large pages before visiting the card tables during a scavenge.

Bug: https://github.com/flutter/flutter/issues/48360
Bug: b/147582727
Change-Id: Iaec22f05e22d9ded75017aa1d8463c1be64858aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131703
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-27 19:43:09 +00:00
Liam Appelbe 93c5134a69 [vm] Add nullability variations for snapshot singletons
This fixes snapshot_test.cc in legacy mode.

Bug: https://github.com/dart-lang/sdk/issues/40169
Change-Id: Ibb47634be296b3b9159af9fe0500d64f9d279b60
Fixes: https://github.com/dart-lang/sdk/issues/40169
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133148
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-27 18:27:39 +00:00
Victor Lima 3fa4194008 [vm] Update offsets
Make the offsets extracted reflect changes in classes that have
fields that do not exist in product mode, since it affects the
entity size.

Change-Id: I0ec277663ba3ddc956ca651ccc0395e39ba185f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133229
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
2020-01-27 15:59:56 +00:00
Victor Lima 17fff9b721 [vm] Generate different offsets for dart_precompiled_runtime
Some raw objects have fields that do not exist in
dart_precompiled_runtime, making the instance size of such objects
smaller. The offsets extractor should therefore generate different
offsets for the precompiled runtime in order to reflect those
differences.

Change-Id: I367e20744fe5b2f8ffaba03bd19b2c74a422c750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133064
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
2020-01-24 22:03:05 +00:00
Ryan Macnak a067265272 [vm] Scrub and qualify names without allocating on the Dart heap.
Sometimes we needs to produce these names in a NoSafepointScope, such as when generating a snapshot.

Bug: https://github.com/dart-lang/sdk/issues/40143
Change-Id: I0d66134c936313b16c38f8699b33a7c7bd443e75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133153
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-24 20:36:18 +00:00
Daco Harkes 41b0a6b8c0 [vm/ffi] Split up compiler/ffi.cc into separate files
This CL is a code cleanup landed separately from https://dart-review.googlesource.com/c/sdk/+/129081 to make the CL size smaller.

Refactorings:
* Split up runtime/vm/compiler/ffi.{cc,h} in multiple files.
* Move FrameRebase to compiler/ffi and prevent it from modifying Locations.
* Remove use of <algorithm>.

Change-Id: Ice2a96470a3242a731255383b9647fabab107ac5
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/+/133224
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-24 15:34:59 +00:00
Clement Skau 173ae210d1 [SDK] Fixes service/break_on_default_constructor_test for --lazy-async-stacks.
With this fix, all 'service' target tests now pass with --lazy-async-stacks
on by default for {dartk,dartkp,dartkb-mixed}-{debug,product,release}.

Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I2c21f6d2f054fdbb261eb8dfbf422b3950cf9648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132903
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-24 12:33:29 +00:00
Clement Skau da1e42a11c [SDK] Fixes async* stack unwinding.
For `foo() async* {}` frames we find the "caller" by finding out
what closure is registered as listener on the _AsyncStreamController.

There can be two cases:

a) The caller does a regular `foo().listen((_) {})`:
  The stack trace will have the closure as the caller and unwinding stops.

b) The caller uses 'await for (... foo())':
  In this case the listener will be a StreamIterator.

This CL changes our unwinding code to get the awaiter of `await it.moveNext()`.


Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I13f76025a15682aaf55fd968088fc2059982d842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132841
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-24 09:04:56 +00:00
Ryan Macnak 3aabdc8d23 [test] Run some service tests in AOT.
Tests involving breakpoints, stepping, evaluation or coverage are expected to fail.
Tests involving introspection, heap analysis, extensions, timeline events or profiling are expected to pass.

 - Fix crash when `debugger` is called.
 - Fix crash when metrics are queried.
 - Replace unnecessary use of `eval` with `invoke`, allowing more tests to run on AOT, AppJIT and simulators.

Bug: https://github.com/dart-lang/sdk/issues/40274
Bug: https://github.com/dart-lang/sdk/issues/40275
Change-Id: I3023af7cbfda745238c487d9a3a3a99e56a30244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132942
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-23 17:52:40 +00:00
Martin Kustermann 5581307ae6 [vm] Extend cpu_arm.cc to support devices using ARMv8 in "Processor" field
Issue https://github.com/flutter/flutter/issues/48923

Change-Id: I1074dfec8d704c04f3777b6d458afd931aa23964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132901
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-22 21:17:58 +00:00
Liam Appelbe 14cb25d095 [vm] Fix function type testing in NNBD legacy mode.
This fixes co19_2/Language/Generics/typedef_A04_t06 in legacy mode.

Note: There's still an underlying issue that we'll probably run into
when switching to strong mode:
https://github.com/dart-lang/sdk/issues/40258

Bug: https://github.com/dart-lang/sdk/issues/40171
Change-Id: I335addf887dabdb0ae96aca95f187974dac50215
Fixes: https://github.com/dart-lang/sdk/issues/40171
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132702
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-22 18:38:18 +00:00
Clement Skau e047ece7e7 [SDK] Fixes stack trace service API tests.
Fixes an issue where stack['asyncCausalFrames'] would be populated in
if --lazy-async-stacks was set.
The field should be filled iff the stack contains an async function -
regardless of whether it's sync-async.

Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: Ia68f113402962c07a1e9a38ea9320b44140241e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132820
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-22 15:14:58 +00:00
Filip Filmar 842c54809e Replace fuchsia.deprecatedtimezone
The FIDL library fuchsia.deprecatedtimezone is going away.  There are
different and better ways to obtain the same functionality.

Fixed reland of:
https://dart-review.googlesource.com/c/sdk/+/129005
Original rollback at:
https://dart-review.googlesource.com/c/sdk/+/132172

Fixes #39650

Change-Id: I7ed73c0b50215daa28491e1f9445f15f8207675b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132444
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
2020-01-21 19:09:09 +00:00
Victor Lima da1b47cace [vm/aot] Fix FlowGraphCompiler::TryIntrinsifyHelper issue
for implicit getters and setters of unboxed fields

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

Change-Id: If11545eca4a87cfded52d7586de2a628d3246b90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132664
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-21 16:38:12 +00:00
Martin Kustermann a4da4843ad [vm/aot] Fix optimization bug in aliasing analysis / redundancy elimination
The LoadUntagged(v1) was not considered to be aliasing "v1", which
caused an incorrect removal of non-redundant LoadIndexedInstrl.

Fixes https://github.com/flutter/flutter/issues/48114

Change-Id: Ie92457d4999e8b7f65d089da7417b3a9ca7a5ae1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132004
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-20 16:36:58 +00:00
Martin Kustermann feb73b2677 [vm/compiler] Replace uses of constant phis with constants
Issue https://github.com/dart-lang/sdk/issues/40189

Change-Id: I4b1b3c92b27833691563e964cc996d309f5005ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132000
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-20 16:07:28 +00:00
Liam Appelbe f5a830a087 [vm] Update late final fields with init to match new spec
Spec was updated here: https://github.com/dart-lang/language/pull/720

Bug: https://github.com/dart-lang/sdk/issues/40204
Change-Id: Id4f5bc9a62d9cf5c0b3e4d12a13b3049cbe07a56
Fixed: https://github.com/dart-lang/sdk/issues/40204
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132408
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-01-17 23:51:59 +00:00
Alexander Aprelev e2aadc7a07 Reland "[vm/fieldtable] Move current field values out of Field object into separate table."
This reverts commit c8f8c11b70 with the fix for https://github.com/flutter/flutter/issues/49008 in Patchset 2.

Change-Id: I85406b92a69ed950d0ba945f96997658be3cae64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132302
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-01-17 18:12:24 +00:00
yuanhuihui 72b0501791 Support timeline conversion to iOS platform trace
using Instruments to track these events.

Signed-off-by: yuanhuihui <gityuan@gmail.com>
Bug: https://github.com/dart-lang/sdk/issues/40076
Change-Id: I590081c516923f82a2a3dbf4b109afe75b8f5fc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131360
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-17 18:10:04 +00:00
Alexander Aprelev 843bd29908 Revert "[i18n] Replaces fuchsia.deprecatedtimezone"
This reverts commit c063f5d0c3 as it broke
dart->flutter engine roller, fuchsia build.

Change-Id: I60c8e758dff005569be7c96f2af1a0217019cb41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132172
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-01-17 02:41:55 +00:00
Filip Filmar c063f5d0c3 [i18n] Replaces fuchsia.deprecatedtimezone
The FIDL library fuchsia.deprecatedtimezone is going away.  There are
different and better ways to obtain the same functionality.

Fixes #39650

Change-Id: If4e4234568c276d3cd2be34863f00165b6e97e0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129005
Commit-Queue: Filip Filmar <fmil@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-17 00:37:35 +00:00
Alexander Aprelev c8f8c11b70 Revert "[vm/fieldtable] Move current field values out of Field object into separate table."
This reverts commit 85e396a1de as it broke internal app running on android arm in release mode.

Change-Id: Iaff0cf3c1ef859e35b4eaeb3ac8243ce3c6737b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132168
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-01-17 00:24:20 +00:00
Liam Appelbe e33b9e2d26 [vm, test] Update dart_api_impl_test to be nnbd clean
Bug: https://github.com/dart-lang/sdk/issues/40170
Fixes: https://github.com/dart-lang/sdk/issues/40170
Change-Id: I8f202da92dc24e471e0516a04c8abc5654e434fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131922
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-16 17:54:06 +00:00
Samir Jindel d0909e068a Reland "[vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object."
This reverts commit 5f81efb4a3.

Reason for revert: 3xH bot is green again.

Original change's description:
> Revert "[vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object."
> 
> This reverts commit ab2026af45.
> 
> Reason for revert: Flutter 3xH is broken on Golem.
> 
> Original change's description:
> > [vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object.
> > 
> > Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
> > Flutter Gallery ARMv7: -0.7% total, -1.2% instructions
> > 
> > There are some performance regressions, in four categories:
> > 
> > 1. Arithmetic on num types (e.g. MinLib, MaxLib):
> >    We believe arithmetic on num types is rare in practice, and can be optimized later
> >    by specializing the call-sites.
> > 
> > 2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
> >    These (and similar benchmarks) are written in a very untyped style, which is not
> >    representative of Dart 2 style. We've confirmed that the regressions disappear if
> >    the benchmarks are annotated with appropriate types.
> > 
> > 3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
> >    DeltaBlue uses string interpolation in one place, so the toString() method in the
> >    string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
> >    string interpolation is used much more frequently and with different types, so it's very
> >    unlikely that this call would be monomorphic. When string interpolation is removed, there's
> >    a remaining 1.3% regression on DeltaBlue which is not yet accounted for.
> > 
> > 4. Noisy benchmarks
> >    The remaining regressions are on benchmarks which show frequent jitter historically.
> > 
> > There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
> > many of them, look at the graphs).
> > 
> > For the reasons above, we believe the regressions justified by the code size improvement.
> > 
> > Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
> > Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
> > Commit-Queue: Samir Jindel <sjindel@google.com>
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
> > Reviewed-by: Martin Kustermann <kustermann@google.com>
> 
> TBR=kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,sjindel@google.com
> 
> Change-Id: I411aae4b230f2a08146ad3bf3e7a10aa6592db0e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131660
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I36e4e9d598033fcc934c2cdf5b061aa11255d3b2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131837
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2020-01-16 14:21:16 +00:00
Martin Kustermann 9520235bfe [vm/async] Ensure all service tests run with both, --causal-async-stacks/--lazy-async-stacks
Running all existing tests with/without lazy async stacks ensures that
the existing functionality for --lazy-async-stacks does not regress.

There are still a few smaller things to be done in the debugger for lazy
async stacks.

This CL also ensures:

   * The inner closure, i.e. AsyncClosure/AsyncGenClosure, is not
     inlined if FLAG_lazy_async_stacks is on.

   * Fixes a crash in dartkb mode, when the function of the Bytecode
     object is null.

   * Does a simple integration of the lazy async stacks in debugger.cc -
     to ensure a stack is returned via vm-service.

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

Change-Id: Ibc1e887a457e2c456ae65d9ed5fa92434f122a32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131825
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-16 12:47:03 +00:00
Victor Lima afa98b977a [vm] Ensure abstract classes are marked as such and get a size of 0 in shared class table.
Change-Id: If19444e702a2b73a829bd9f581ff36ad041ecf41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131801
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-16 10:34:53 +00:00
Johnni Winther d302d7f10a [cfe] Insert member signatures for nnbd aware inheritance
Change-Id: I86dbbd586434af81b6dc4f4ae748cbd8177d06e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129080
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-15 07:36:28 +00:00
Aske Simon Christensen 1d026781b5 [vm] Fix some issues with round trip serialization.
- Update the flow graph and block order in the call specializer after
  round trip serialization. This ensures that compiler passes using the
  call specializer operate on the deserialized flow graph rather than
  the original one.

- Add 2 instead of 1 to the highest seen SSA temp index after
  deserialization to obtain the current SSA temp index. This makes room
  for values that expand into two SSA slots during some optimizations,
  e.g. unboxed integers on 32-bit platforms.

The changes expose an issue with early round-trip serialization,
described in https://github.com/dart-lang/sdk/issues/40120

Change-Id: I21e22fa1bab595fb5764ab72b599a3c663b4ff47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128405
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Teagan Strickland <sstrickl@google.com>
2020-01-14 17:17:25 +00:00
Samir Jindel 5f81efb4a3 Revert "[vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object."
This reverts commit ab2026af45.

Reason for revert: Flutter 3xH is broken on Golem.

Original change's description:
> [vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object.
> 
> Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
> Flutter Gallery ARMv7: -0.7% total, -1.2% instructions
> 
> There are some performance regressions, in four categories:
> 
> 1. Arithmetic on num types (e.g. MinLib, MaxLib):
>    We believe arithmetic on num types is rare in practice, and can be optimized later
>    by specializing the call-sites.
> 
> 2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
>    These (and similar benchmarks) are written in a very untyped style, which is not
>    representative of Dart 2 style. We've confirmed that the regressions disappear if
>    the benchmarks are annotated with appropriate types.
> 
> 3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
>    DeltaBlue uses string interpolation in one place, so the toString() method in the
>    string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
>    string interpolation is used much more frequently and with different types, so it's very
>    unlikely that this call would be monomorphic. When string interpolation is removed, there's
>    a remaining 1.3% regression on DeltaBlue which is not yet accounted for.
> 
> 4. Noisy benchmarks
>    The remaining regressions are on benchmarks which show frequent jitter historically.
> 
> There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
> many of them, look at the graphs).
> 
> For the reasons above, we believe the regressions justified by the code size improvement.
> 
> Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
> Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

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

Change-Id: I411aae4b230f2a08146ad3bf3e7a10aa6592db0e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131660
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2020-01-14 14:58:45 +00:00
Samir Jindel ab2026af45 [vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object.
Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
Flutter Gallery ARMv7: -0.7% total, -1.2% instructions

There are some performance regressions, in four categories:

1. Arithmetic on num types (e.g. MinLib, MaxLib):
   We believe arithmetic on num types is rare in practice, and can be optimized later
   by specializing the call-sites.

2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
   These (and similar benchmarks) are written in a very untyped style, which is not
   representative of Dart 2 style. We've confirmed that the regressions disappear if
   the benchmarks are annotated with appropriate types.

3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
   DeltaBlue uses string interpolation in one place, so the toString() method in the
   string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
   string interpolation is used much more frequently and with different types, so it's very
   unlikely that this call would be monomorphic. When string interpolation is removed, there's
   a remaining 1.3% regression on DeltaBlue which is not yet accounted for.

4. Noisy benchmarks
   The remaining regressions are on benchmarks which show frequent jitter historically.

There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
many of them, look at the graphs).

For the reasons above, we believe the regressions justified by the code size improvement.

Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-14 13:18:05 +00:00
Samir Jindel 8617867757 [vm] Clone boxes for unboxed numeric fields upon rematerialization.
Fixes https://github.com/dart-lang/sdk/issues/39112

Change-Id: I0d6a7686fdef6182bba16fdceb2ff773650a0e28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128062
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-14 12:57:55 +00:00
Alexander Markov 5357052714 [vm/compiler] Fix handling of function types in type tests for type parameters
Fixes https://github.com/dart-lang/sdk/issues/40066

Change-Id: I90f74c8162e5a369e656666e98e0e427bb179822
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131200
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-13 20:55:26 +00:00
Alexander Markov b3c6af3e1e [vm/compiler] Introduce base class for instance calls in IL
This change introduces a base class for all kinds of instance calls
(InstanceCallInstr and PolymorphicInstanceCallInstr for now).
This allows us to have common code which works with both of them
uniformly and remove forwarding from PolymorphicInstanceCallInstr to
InstanceCallInstr.

Change-Id: If39aed06a52b52dbe6ec7bff3e4e3db246e67c7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130935
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-13 20:32:36 +00:00
Ryan Macnak 67f3cf325d Revert "[vm, gc] Sweep non-executable large pages concurrently."
Race between sweeper and scavenger accessing card tables.

This reverts commit 4f1270655c.

Bug: b/147582727
Change-Id: I824f8ddbbd48bd69bda565b4ead0238b57482ef9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131422
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-13 20:26:06 +00:00
Ryan Macnak 4495c2b30a [vm, gc] Run weak processing in parallel for old-space GCs.
Allow updating weak handles, weak pointers, the object id ring and the remembered set to happen in parallel with work-stealing.

Change-Id: I70c15cde412e0ce8737c13b4b682f408596def7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131161
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-13 18:31:36 +00:00
Ryan Macnak 9c9c283c78 [vm, gc] Remove dead allocation stats code.
This should have been removed in 545b10389d.

Bug: https://github.com/dart-lang/sdk/issues/37678
Change-Id: Ie679e68b76e339843fcfe00e866be6478b9cc98b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131201
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-13 17:21:16 +00:00
Martin Kustermann a4207fd03c [vm/aot] Avoid loading the code register (in bare-AOT) and zeroing IC data reg (in AOT) for closure calls
This removes two instructions per closure call and makes them faster.

Change-Id: I0fe3befe694dd8fab50d382d84459e7896865d21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131062
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-13 11:08:54 +00:00
Régis Crelier d36805e0ac [VM//nnbd] Update code generation of 'is instance of' for NNBD.
This also fixes the implementation of 'null is T' in legacy vs opted-in library
by making it independent of strong/weak mode.
Includes updates to type propagation and call specializer.

Change-Id: I2d347ef277e08cef779faf51a972e863244ef095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130922
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-01-11 01:28:52 +00:00
Ryan Macnak a51c6ba6b5 [vm, service] Fix broken references to dual-mapped Instructions in heap snapshots.
The heap snapshot was assigning these Instructions ids based on their writable addresses, then attempting to write references based on their executable addresses. This made the Instructions unreachable from the perspective of the snapshot analysis.

Change-Id: If15493a18a0967355eb4c168b9b29558511be514
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130962
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-10 23:48:07 +00:00