Commit graph

67399 commits

Author SHA1 Message Date
Ben Konyi 8fd83cb222 [ dart:developer ] Remove optional 'parent' parameter from TimelineTask.withTaskId to avoid ID collisions
If parent is a param in the TimelineTask.withTaskId() constructor, we have the possibility of running into this situation:

TimelineTaskA - id 0

TimelineTaskB - id 1
TimelineTaskC - id 2 - parentId 1
TimelineTaskD - id 0 - parentId 2 (this task created with TimelineTask.withTaskId(0, parent: C))
TimelineTaskE - id 3 - parentId 0 (now who is the parent of E? D or A?)

If we do not allow the user to specify parent in the withTaskId() constructor, we remove the possibility of this clash. This clash happens because the user was able to inject an event with id 0 into an async tree defined by the parent parameter.

By removing the parent parameter from the withTaskId() constructor, we can rely on different sources of truth for the different TimelineTask constructors.
  - If taskId is specified via TimelineTask.withTaskId(), then that is the source of truth for inferring the async event tree (events with the same async id are in the same async tree).
  - If parent is specified via TimelineTask(parent: parent), then that is the source of truth for inferring the async event tree.
  - If neither taskId nor parent are specified (e.g. TimelineTask()), we default to timestamp inference.

Change-Id: I491a20cf1d1aaea744ab92e56602269390e73fb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121680
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2019-10-14 23:37:48 +00:00
Robert Nystrom aab88791b8 Change experiment flag name in test runner and test config.
Use "enable-experiment" to be consistent with other tools.

Change-Id: If9598f667517443a4f61ef91955ff57a477f0a5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121681
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-14 23:24:58 +00:00
Robert Nystrom 4a2adf5734 Allow an unspecified error expectation to match multiple errors.
Fix #38792.

Change-Id: I6fc98538f75ed03612cd25ba4f0c12054819a3fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121406
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-10-14 23:11:58 +00:00
asiva fa3f88efe9 Fix AOT build breakage (new extension method names were failing as demangling is not done in AOT builds).
Change-Id: Ifa4432fb22934cbf451addb63c8ef2b82432e956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121651
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-14 22:49:22 +00:00
Konstantin Shcheglov 15fe929bbb Don't use LocalElementBuilder in top-level inference.
Change-Id: Ia390441fae26ac53abcd4fff65e8244f727e152d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121648
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 22:15:57 +00:00
Janice Collins c891fa858e Update dartdoc to v0.28.8.
Release notes:  https://github.com/dart-lang/dartdoc/releases/tag/v0.28.8

This also reverts the workaround in ff23f546db by dacoharkes@.

Instead of crashing, dartdoc v0.28.8 displays some fairly spammy warnings that the functionality is unimplemented.

  warning: Comment reference resolution inside extension methods is not yet implemented, from dart-ffi.DoublePointer.value: Field value.location
  warning: unresolved doc reference [address], from dart-ffi.DoublePointer.value: Field value.location
  warning: unresolved doc reference [Double], from dart-ffi.DoublePointer.value: Field value.location
  warning: unresolved doc reference [value], from dart-ffi.DoublePointer.value: Field value.location
  warning: unresolved doc reference [Float], from dart-ffi.DoublePointer.value: Field value.location

Issue: https://github.com/dart-lang/sdk/issues/38786
Change-Id: Ie8fef572f5d50bd7f031b498c0cd066a4765c493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121644
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-14 21:42:39 +00:00
asiva a551c507bd [VM] Implement name demangling of extension methods.
Change-Id: Id64ae1aa0de89260b6bf2d6f40260a0dc9ef5c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-14 20:40:09 +00:00
Alexander Markov 017a7a6221 Revert "[vm/compiler] Further compress the information previously in StackMaps."
This reverts commit d77f4913a1.

Reason for revert: large number of flaky crashes on flakiness dashboard (https://github.com/dart-lang/sdk/issues/38873); crashes on vm-kernel-mac-debug-simdbc64 bot.

Original change's description:
> [vm/compiler] Further compress the information previously in StackMaps.
> 
> Lifting the PC offset in a2bb730 was a small, lightweight change that
> gave us big gains, at least on 32-bit architectures. Here, we make
> much more invasive changes that will improve the amount of memory used
> by the information previously stored in StackMap objects.
> 
> Instead of allocating separate objects for StackMaps, we instead compress
> all StackMap information for a given Code object into a single object
> (CompressedStackMaps, or CSM for short). This replaces the Array used to
> store PC offsets (as Smis) and the individual StackMap objects.
> 
> While we lose all canonicalization for individual StackMap entries, the
> drop in space required to store stack map information more than offsets that.
> 
> -----
> 
> The impact on AOT snapshot size when compiling the Flutter Gallery
> in release mode:
> 
>    armv7: Total size -2.58% (Isolate RO: +14.46%, Isolate snapshot: -22.93%)
>    armv8: Total size -1.85% (Isolate RO: +15.69%, Isolate snapshot: -22.97%)
> 
> The impact on in-memory, not on-disk, size for the Flutter Gallery as seen
> in the Observatory while running a profile (not release) build:
> 
>    armv7: Drops from 7.1 MB to 6.2MB (-0.9 MB)
>    armv8: Drops from 13.5MB to 11.7MB (-1.8 MB)
> 
> -----
> 
> Bug: https://github.com/dart-lang/sdk/issues/35274
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try
> Change-Id: Ie3bb898d557215146260a560423f5fa27bdff512
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119640
> Commit-Queue: Teagan Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

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

Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: Ib844b4d52e3aa4aca62a896cfe349c680bda7461
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121642
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-14 20:20:58 +00:00
Konstantin Shcheglov 127b582a2f Update instantiateElementTypeToBounds() to use precomputed default types for type parameters.
Change-Id: I0f0c1af192dc44368203373fc0a824d1e262bae8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121541
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-10-14 20:19:09 +00:00
Paul Berry f2dd0465dc Migration: share code for figuring out when an access is null-aware
Change-Id: Id61ebfe16ce277e30a3059f67c250b3a0d9a6b17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121524
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-14 19:44:10 +00:00
Paul Berry cf7e48bec7 Migration: Handle members of Object properly in FixBuilder.
This code is shared with similar code in EdgeBuilder.

Change-Id: I807269a21472be396e7ba42a89f20efa15eca7fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121523
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:44:10 +00:00
Paul Berry 7bdbbc4ec4 Fix "unused variable" warning
Change-Id: I425e82b1eb67b76dc56c7c450c9c20f7c6eb4a00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:44:10 +00:00
Paul Berry 878458d7b5 Migration: Add FixBuilder support for property accesses and prefixed identifiers.
Change-Id: I15bbcf6674432c50871aecdd1354c58a2174a6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:44:10 +00:00
Paul Berry c9c8e4d84f Resolver fix: set auxiliaryElements properly for property accesses.
Previously we only set it for index expressions, prefixed identifiers,
and simple identifiers.

Change-Id: Ib666aa936f0e7bf7421cb74e491d35ab5507d412
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:44:10 +00:00
Konstantin Shcheglov b74c9f073b Don't use '.type' in EdgeBuilder.
Change-Id: I737b90d07d7894a691fca65aca00924b392c3adb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121662
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:43:00 +00:00
Konstantin Shcheglov 10ad0c3830 Don't use '.type' in FindElement.
R=brianwilkerson@google.com

Change-Id: I8c73bea747f1ad771351f06cd7bea41b2ade6e8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 19:03:48 +00:00
Brian Wilkerson af671211ab Add more ffi related checks
There are still two checks that I'm aware of that are not being performed
(there are TODOs for them) and two diagnostics that need to be removed
because `Struct` will soon not take a type argument.

Change-Id: I17424a32225eeff7e3b2c0e0f36cfc6ccd45e0a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121640
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 18:36:25 +00:00
Ari Aye 70a7ef3f58 Implement pointer mixture network
Here we can see the mixture network is assigning probability mass
to a new, project-specific name by reference https://i.imgur.com/6Zbs2qf.png.

I also took this opportunity to decrease model size targeting 100M, in line
with our original size goals.

My initial strategy was to implement a separate pointer network
in https://dart-review.googlesource.com/c/sdk/+/117005 but having
a single network that can assign probability mass across local
references and vocabulary lexemes is better since

1) only one network and model file
2) no need to coalesce predictions from multiple models

Change-Id: I23cfc2ece61ce30bb69785149a5a6cf1604af18d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121461
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-14 18:25:56 +00:00
Brian Wilkerson 263bfd9635 Use relative URLs for navigation to enable publishing the output
Change-Id: I6948fb10ec44abbb87c72dfc3f1a7277ec1ee7c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-14 18:19:36 +00:00
Alexander Markov 3c3bd8d7c9 [vm,aot,bytecode] Support obfuscation
In order to support obfuscation, string constants are decoupled
from public names in bytecode (names are obfuscated, but string
constants aren't). List of protected names is written in a separate
section in bytecode component.

Obfuscator is extended to support getter and setter
names coming from bytecode.

Change-Id: I8e8d820d1a8b97e32e8ad1b064b827bdb017430b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121261
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-14 18:12:29 +00:00
Konstantin Shcheglov dc0db066e6 Remove ChangeSet from engine.dart
Change-Id: I289c5edd0c3e52a873013f8c52d8202bf29cf3be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 17:45:56 +00:00
Konstantin Shcheglov aeacf565ab Check for missing required arguments using parameter elements.
Bug: https://buganizer.corp.google.com/issues/140314870
Change-Id: I42a615fbd17af2b3d3b424f847a4b75463415377
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-14 17:40:36 +00:00
Ryan Macnak b5bbc97566 Revert "[vm, linux] Try to attach names to all VirtualMemory allocations using memfd."
This reverts commit 48e93d3d3b.

Reason for revert: ~10% regression on Isolate.SendReceiveBytes benchmarks, likely heavy allocation and freeing of large heap pages

Original change's description:
> [vm, linux] Try to attach names to all VirtualMemory allocations using memfd.
>
> For example,
>
> $ cat /proc/<pid>/smaps
> ...
> 7fe527158000-7fe527be0000 rw-s 00000000 00:05 35765318                   /memfd:dart-profiler (deleted)
> 7fe527be0000-7fe527ea5000 rw-s 00000000 00:05 35765317                   /memfd:dart-timeline (deleted)
> 7fe528a40000-7fe528a51000 rw-s 00000000 00:05 35762832                   /memfd:dart-heap (deleted)
> ...
>
> Change-Id: I10452a1261cec26719ceadf569aadd864be5378e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120981
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=rmacnak@google.com,zra@google.com,regis@google.com

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

Change-Id: Ic839bd0ce67d8ac438916d6b4c626f0f7d6991d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121412
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-14 16:59:31 +00:00
Konstantin Shcheglov 6ad5c2e0b9 Combine elements building with TypeName(s) resolution.
This CL passes presubmit in google3.
https://test.corp.google.com/ui#id=OCL:273879967:BASE:274371532:1570918058929:7943e848

Change-Id: Icea75f6544dcdb01602ff3ef1a899bb59729c6a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120820
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-14 16:57:51 +00:00
Keerti Parthasarathy 6d468d1377 Add a script and target to run dartfix
Change-Id: I68df635359b898ef4b6054292f6523d81f46448a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121149
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-10-14 15:50:21 +00:00
Ben Konyi 85093bed12 [ dartfuzz ] Initial refactor of Dartfuzz
- Started cleaning up places where we emit matching parens/braces manually
- Started handling indentation in less places
- Started de-duping code
- Started using constants where possible

Output code is still logically and structurally the same, although it formats
differently.

Change-Id: I367c8629174139c7083f6a12b7221230d884e628
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120742
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-10-14 15:47:43 +00:00
Stephen Adams 892fcf2c45 Avoid constructing RegExp for every BigInt.tryParse
Change-Id: I323089a17b4fa167ac3d660f5313cc1e6873a994
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118681
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-10-14 14:04:11 +00:00
Daco Harkes b4751d5e16 [vm/ffi] Pointer.asExternalTypedData to extension method - Fix Flutter
Fixes imports (the order of patch files is not defined, so the imports need to be equal in all files).

Change-Id: I2dc16f4930253b25c7ae6ab6b0699581f9e2dd46
Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121428
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-14 13:04:00 +00:00
Daco Harkes 91c6dc15de [vm/ffi] Pointer.asExternalTypedData to extension method
Issue: https://github.com/dart-lang/sdk/issues/38610

Change-Id: Ib07f50b23e3be2bce2d7b973c0f0196884397952
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-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-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-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121384
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-14 09:52:58 +00:00
Mark Egli 545a06b19e Fix typo in zone documentation.
Closes #38848
https://github.com/dart-lang/sdk/pull/38848

GitOrigin-RevId: 646ee0189aaa25aced290aff2134f70e920b5bb9
Change-Id: I76ca2106011fdc43c7ab0b1da0a2162e68d79243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121413
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2019-10-12 21:28:25 +00:00
Paul Berry 1e3cbd4344 Migration: Add IndexExpression support to FixBuilder.
Change-Id: I870047d12304c70cfe89e64d4864cc1809b7e4ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121408
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 5594981c2a Migration: add isCompound parameter to FixBuilder.visitAssignmentTarget.
When visiting an assignment target that is an index expression
(`x[y]`) we'll need to know whether we are doing a compound assignment
or not, because this will influence whether the type context for the
index expression (`y`) should come from `operator[]` or `operator[]=`.

So before adding index expression support to FixBuilder, let's add an
`isCompound` boolean to indicate whether the assignment context is a
compound assignment or not.

Change-Id: I26a41544e10ef9c9ba042c1d7862563bd9d18b68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121407
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 13f6d8213b Migration: add FixBuilder support for prefix/postfix expressions.
Change-Id: I62a705af1c8d9944a417d074373aca4c93e99b6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121402
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 0121a1fce1 Migration: finish EdgeBuilder support for prefix/postfix expressions.
A few changes here:

- Prefix expressions didn't support dynamic invocations.

- Prefix expressions didn't support generic types.

- Postfix expressions were handled incorrectly (we used the return
  type of operator+ for `x++`, whereas the type should have been the
  same as the type of `x`).

Change-Id: I35077b82a6e9c4e4f6ad8bb1264f5d725ec0d9a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121401
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry d2f9e83861 Migration: integrate flow analysis of ?? into FixBuilder
Change-Id: I3d576c704ffd0b3b44fff0ceb442e355790ecb84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121342
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 04d800af49 Migration: add fixBuilder support for throw and conditional expressions
Change-Id: Iea9bc71cb7f173340b7eb56f241985bd2c90f609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121341
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 4f4d1bdf10 Migration: Add if-statement and block-statement support to FixBuilder.
Change-Id: I3e3f0b3824a9a51b63f9ee8ffbe414415fc2b2e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121340
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 27967490f6 Migration: add FixBuilder support for typed lists of expressions.
Change-Id: I30a36e9925fdd5a409b87a98962709de1ed3168b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121263
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 14d4b93349 Migration: update FixBuilder to handle simple statements.
We now handle expression statements and variable declaration
statements where the variable type is an interface type.

Change-Id: I00f53a326495bcbeeba785b25c46abf1f3e9ab49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121260
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 61790a17b6 Flow analysis: add support for non-null assertion operator.
Change-Id: I7a60944a4389b6f7c8e182d5c9b402fcbb05b624
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-12 03:11:03 +00:00
Paul Berry 4e9220efdb Flow analysis: change the way parenthesized expressions are handled.
Instead of forcing the client to provide a way to de-parenthesize an
expression, the client informs flow analysis when a parenthesized
expression is encountered.  This reduces the runtime overhead to zero
for non-parenthesized expressions, and it saves the front end from
having to worry about support for parenthesized expressions (since its
internal representation doesn't care about parentheses).

Change-Id: I0bb6e91c87acaa05591e1b075da18700b11e4aae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121080
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-10-12 03:11:03 +00:00
Régis Crelier 5fad012d02 [gardening] Skip slow vm test in hot-reload mode.
Change-Id: Ib3bc25f3fe7c5261daa117aa1287aea4b98c84b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121415
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-10-11 23:39:29 +00:00
Mayank Patke fe0b56fdd1 [dart2js] New RTI: Remove TODO from thrown string.
Change-Id: If3659d50d64a45c832bc2ed56b395f8a603bd351
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121464
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-11 23:19:19 +00:00
Aart Bik 6f9a9f083e [vm/compiler] push arguments assert in flow graph checker
Rationale:
Adds stricter asserts on push arguments to flow graph
checker and fixes various places where the environment
assumptions on push arguments were violated.

https://github.com/dart-lang/sdk/issues/38577

Change-Id: I30b827c6400daaa8597e7957bd71b5d91d729cd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120722
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-11 23:11:49 +00:00
Ryan Macnak 20dd7c88e9 [vm] Use VirtualMemory with a cache for small Zone::Segements.
tcmalloc and jemalloc have both been observed to hold onto lots of free'd zone segments (jemalloc to the point of causing OOM), so instead of using malloc to allocate segments, we allocate directly from mmap/zx_vmo_create/VirtualAlloc, and cache a small number of the normal sized segments.

flutter doctor at exit ("idle")
Process::MaxRSS()     261009408 -> 258756608 (-0.86%)
Process::CurrentRSS() 252932096 -> 205881344 (-18.6%)

Bug: https://github.com/dart-lang/sdk/issues/38820
Change-Id: I319069678b9d44383a9921ec03a963517991dd11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121264
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-10-11 22:25:23 +00:00
Aart Bik cf60eb48b9 [vm/compiler] reduced regression test size
https://github.com/dart-lang/sdk/issues/38741

Change-Id: Ief99230c19dd55fb300f94049f320f276461c86c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121409
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-11 21:15:20 +00:00
Alexander Markov 8f679ab9f9 [vm,bytecode] Swap == operands in switch cases
For a switch statement

  switch(foo) {
    case c_1: ...
    ...
    case c_N: ...
  }

Bytecode was calling foo.operator==(c_i). This is less efficient than
c_i.operator==(foo), as c_i is a constant with a known actual type
and operator== can be always devirtualized and inlined.

Change-Id: I786ea193de1fa1830854602318e436f601296f5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121405
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-11 21:11:40 +00:00
Robert Nystrom 90ff37e011 Plumb the configuration's experiments flags through to tools.
Both a test file and now a test configuration can specify that
experiment flags should be enabled. Since they both can, passing those
to the tools is a little tricky because we need to merge the two
command line arguments. It's made worse by the fact that this corner of
test_runner is riddled with poorly factored code.

This doesn't fix the redundant code, but does merge and pass the flags
through. Right now, it parses them from the test file by looking for
them in the SharedOptions line, which is where they currently appear.

That's pretty hacky. Eventually, we should change these tests to use:

// Requirements=

Fixes #38386, #38387, #38388, and #38389.

Change-Id: I1aea1482b30b9ba19c427319f895822d81ee12ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121262
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-11 20:33:36 +00:00
Stephen Adams a7d95d4755 [dart2js] Defer ground type recipes until assembly
Change-Id: I9f2ba6c0feec1600b3dbbf3828a4954b35608f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120621
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-10-11 20:12:06 +00:00
Alexander Aprelev 5f198ae1c8 [vm/benchmarks] Add IsolateSpawn spawn latency and memory benchmarks.
The benchmark spawns an isolate that compiles hello world app with dart2js, measures time it takes for spawned isolate to get up and running, measures delta rss when isolate is spawned.

This also adds analysis_options.yaml that helps with keeping the code lint-free.

Change-Id: I5f1ffa9706766cd00bf1ea3fdad76957952de8a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119538
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-10-11 19:52:12 +00:00