Commit graph

68146 commits

Author SHA1 Message Date
pq
bb29b1545b linter 0.1.104
Change-Id: I03b72ba583146d1c3224f6941bdaaaa68a6997e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124915
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-11-14 14:30:06 +00:00
Samir Jindel
dd7760a07d [vm] Support disassembling snapshot code at runtime for JIT and AOT snapshots.
--code-comments should be passed both at compile/training-time and run-time to get
comments in the disassembled instructions.

The required --disassemble-* flags need only be passed at run-time. Flow-graph printing
is not yet supported because we don't save flow-graph like assembly comments.

This functionality is excluded from product builds.

Change-Id: If35fbb08cff6eae40069f916ecec9c6f589c0cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124989
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-14 14:09:21 +00:00
Paul Berry
3bd7ed38fb Migration: fix handling of bound -> type param downcast.
I don't recall what I was thinking when I decided to change the
nullability of the type to "always" when doing this downcast--AFAICT
it doesn't make any sense.

Change-Id: I41d1d2a30722010d2b9b93bb53979ce881e24319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124905
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-14 14:03:16 +00:00
Clement Skau
7b3aa88ebe [SDK] Adds background compiler skip for annotations.
A similar abort was removed in the refactor in 5cce1e4a.

Change-Id: I9921c3f9f2bbe36c4560388471f93356c2d1f12d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125200
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-14 14:01:16 +00:00
Teagan Strickland
dc808f3fcb [vm/compiler] Canonicalize CompressedStackMaps payloads when possible.
When we are writing a snapshot, canonicalize all entries within
CompressedStackMaps payloads. We do this by creating a global table
of stack map information (bit counts + bit payload) that we store
in the isolate object store, and then for each existing CSM, we
replace it with an alternate version that refers to the global table.
This gets back some of the canonicalization we lost when we moved from
individual StackMap objects to per-Code CompressedStackMaps objects.

Here, we also represent the global table as a CompressedStackMaps
object. This means that there are three types of CompressedStackMaps:
 * The original version that directly contains all entry information.
 * The version where each entry is just the PC offset delta and an
   offset into the global table payload.
 * A version representing the global table where the entries are like
   the original version except they don't contain a PC offset delta.

-----

The impact on AOT snapshot size when compiling the Flutter Gallery
in release mode:

   armv7: Total size -0.88% (Isolate RO: -5.05%, Isolate snapshot: +0.00%)
   armv8: Total size -1.04% (Isolate RO: -5.28%, Isolate snapshot: +0.00%)

-----

Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: I1ce0f8b3cc58e2f11584f3c218e0fdf8984b799b
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/+/120667
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-14 12:49:06 +00:00
Johnni Winther
6e85f3337a [cfe] Support null-aware cascade
Change-Id: I1db4125b4469e6a8b6adc5ec6e4dcafc0a26da4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124680
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-14 12:39:16 +00:00
Johnni Winther
3855eeaae7 [cfe] Move shared id-tests into id_tests folder
Change-Id: I5e6efe43c7b0f0b65028cda0a192497e3a378aad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124994
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-14 10:16:16 +00:00
Johnni Winther
45033c6ad9 [cfe] Use StaticTypeContext for getStaticType
Change Expression.getStaticType to take a StaticTypeContext instead
of a TypeEnvironment.

The StaticTypeContext provides access to the TypeEnvironment and the
current 'this type' as well as determining the nullability state of the
enclosing library.

This change is needed to support nnbd types for getStaticType and also
serves as a step towards supporting caching during static type
computations to avoid repeated computations of the same (complex)
expressions.

Change-Id: Ied974dff7f6f7c3c8f262aa80c8dea5c674662f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124683
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-11-14 09:09:26 +00:00
Alexander Aprelev
efbfda2e6d [gardening] Fix frontend-server-test uri vs file path use.
Also fix bracketing for "reject" compiler output (flutter/issues/35924).

Change-Id: I0a0d14665520cf5eb4594cc4e5e552c0b35a136e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124914
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-11-14 04:14:26 +00:00
Régis Crelier
dc35290111 [VM/nnbd] Reland of 3 reverted CLs and fix for canonicalization of legacy types.
The 3 relanded CLs are:
https://dart-review.googlesource.com/c/sdk/+/124480
https://dart-review.googlesource.com/c/sdk/+/124587
https://dart-review.googlesource.com/c/sdk/+/124920

The additional fix is:
https://dart-review.googlesource.com/c/sdk/+/125128

This fixes https://buganizer.corp.google.com/issues/144304690

Change-Id: Ica5ae249d738cab0b5d1885a01ddef2757c07174
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124906
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-11-14 02:10:15 +00:00
Ryan Macnak
9223b9d844 [vm, gc] Change CollectAllGarbage to ensure there is no floating garbage caused by incremental marking.
Fix vm/cc/OldGC_Unsync to not change FLAG_marker_tasks while incremental marking is in progress.

Fix vm/cc/IterateReadOnly to not mark the heap as read-only while marking or sweeping are in progress.

Remove unnecessary WaitForGCTasks leftover from background finalization.

Bug: https://github.com/dart-lang/sdk/issues/39299
Change-Id: Ib3340e514b44230b9735b74b1f2012ca9b998d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124824
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-11-14 02:08:35 +00:00
Fizaa Luthra
e5655d5cfe [dartfuzz] Make generic types explicit when using API table
Bug: https://github.com/dart-lang/sdk/issues/39356
Change-Id: I04244bbac578dd6b399e664d381f1dab0a5852da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124910
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Fizaa Luthra <fizaaluthra@google.com>
2019-11-14 01:19:15 +00:00
Sam Rawlins
06aef10d76 nnbd preview: Remove descriptionPrefix; don't link Details which will link to some bizarre Never node
Bug: https://github.com/dart-lang/sdk/issues/39247
Change-Id: I6f34ecf745e8db75534affdeadc3d47acac079b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125062
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-14 01:09:35 +00:00
Ryan Macnak
9cd6c01bfd [vm, gc] Add a release barrier to prevent header initialization during promotion from being ordered after publishing stores of that object.
Compare 6354b0b97d, which did the same for direct old-space allocations.

Change-Id: Ifc047b48dfa10891ea7f1b39794f5fdbc7cf2ec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124841
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-14 00:50:46 +00:00
Alexander Aprelev
c1c4470da6 [gardening] Fix pkg/vm/test/modular_kernel_plus_aot_test on Windows.
Follow-up to https://dart-review.googlesource.com/c/sdk/+/124993.

Change-Id: I40c6bb4ec1fc074740ad6f8344b99d6e6cedb5a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124909
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-11-14 00:00:30 +00:00
Stephen Adams
6f11d998d0 [dart2js] Allocate minified type$ names in more stable manner
Change-Id: I0657f1b74f9b5afed02ab72e07eddb479e6b5cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125013
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-13 23:56:10 +00:00
Brian Wilkerson
de498e9655 Add the generation date as a footer to the preview page
Change-Id: Ic9e3141046c85facdae5883abf8767a29f90f6d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124907
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-13 23:44:00 +00:00
Konstantin Shcheglov
2928b6179c Test interfaces of opt-in and opt-out mixes.
Change-Id: I0a3433216b9e8b3b1a2df03c3823697c1e8ae017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124904
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-13 23:31:18 +00:00
Paul Berry
22b2a35b9f Add failing test for issue #39376
Change-Id: I3dc72f24824c13a54542602fdf4d10055bfec6f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125122
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-11-13 23:10:15 +00:00
Paul Berry
5767cc1bfd Migration: do not use "always" node for dynamic dispatches in EdgeBuilder.
Change-Id: Ic9b62287d11e4adfe14082834fde8bee01624a28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-11-13 23:10:15 +00:00
Paul Berry
8452d2d188 Migration: change behavior of dynamic.
Previously, when the migration engine found a type that was implicitly
or explicitly dynamic, it assumed the type was meant to be nullable.
This seemed reasonable (since, after migration, `dynamic` indeed
allows null), but it caused unnecessary nullabilities to be
propagated.  With this change, the migration engine tracks whether
dynamic types can be nullable or not, just as it does for all other
types.  This cleans up a number of tricky corner cases in the
migration engine that were getting in the way of fixing up uses of
`always` and `never` nodes.

Note that if a `dynamic` type is determined to be non-nullable, it
will still be `dynamic` after migration; this change merely prevents
nullabilities from being needlessly propagated from that dynamic type
to other types.

Note that we still assume `dynamic` is nullable when it occurs in an
already-migrated library or as the result of a dynamic dispatch.

Change-Id: I380d0907f3489d0b84f3fdd7164113daae24274e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125084
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-11-13 23:10:15 +00:00
Konstantin Shcheglov
30690b1526 Issue 39357. Catch FormatError and report FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION.
Bug: https://github.com/dart-lang/sdk/issues/39357
Change-Id: Ia0d5eb7907dbe16ad03dd70a4f3ede226c2edaaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125129
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-13 22:41:55 +00:00
Konstantin Shcheglov
a8e48405dd Share search methods in FindElement and ImportFindElement.
Change-Id: I511c23440fbd95b3a27a50d7b80c66c9a8a7f558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125125
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-13 22:22:25 +00:00
Sam Rawlins
26f160b9c4 nnbd preview: Fix positioning of #content HTML, allowing for footer
Change-Id: I93ce26fe337758a047f02f8026eeab21b0004de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125127
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-11-13 22:09:35 +00:00
Ryan Macnak
64329c879d [vm, docs] Describe how to run size analysis for Flutter apps.
Change-Id: I11d9ca7f3668a8705753bb9a0db261a3871fb93e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125126
Reviewed-by: Zach Anderson <zra@google.com>
2019-11-13 21:34:57 +00:00
Brian Wilkerson
bc4ced0738 Fix the list of migrated files to not include non-migrated files
Change-Id: I87010a5f1e318ef074791fd706d3d6a32262a0bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125142
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-13 20:31:44 +00:00
Martin Kustermann
7a0d9455e4 [vm/aot] Ensure interface targets are re-resolved after deduping of mixin application classes
When the CFE compiles an application as a whole (reads in all source
code), the interface targets to members of mixin applications are the
original mixin classes.

When the CFE compiles an application modularly (dependencies are
supplied as kernel files), the interface targets to members of mixin
applications are the copied members in the mixin application classes.

This slight difference does not surface in any test failures. Yet if we
start running our AOT kernel pipeline, we will deduplicate the mixin
application classes. This leaves dangling references (with no target).

The C++ AOT compiler, `gen_snapshot`, will crash if it hits any of
those.

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

Change-Id: I17a57370a87cfbdc174829c2e68ecdb7c4a9757e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124993
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-11-13 20:03:04 +00:00
Sam Rawlins
858265d0b4 NNBD preview: Link to spans rather than anchors
Fixes https://github.com/dart-lang/sdk/issues/39374

Change-Id: Ifcde796822a5c58608f5432874d70b0a17d69217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-11-13 19:42:44 +00:00
Kallen Tu
df2093362d [analyzer] Clean up casting for variance and related tests.
Change-Id: Ieb73919e41ee500c29c17d64f6b4525978378a00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-13 19:26:41 +00:00
Sam Rawlins
39194779c1 nnbd preview tool: Add better text for dynamic values
Change-Id: I926970d765a9cfb9b2d96f8180e8388516d8ebfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-11-13 18:36:00 +00:00
Liam Appelbe
a0bb025024 [vm] Late static final fields
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: Ic40002ab0e6ded6d525ee5e1c218a589b9406c8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125005
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-13 17:56:08 +00:00
Brian Wilkerson
ffbd2eb7ee Address comments from an earlier CL
Change-Id: I6a47cb76e6babeea422791fb6b1887dd244c2f5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125120
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-13 17:10:09 +00:00
Konstantin Shcheglov
7c71115b28 Remove unused type parameter from VariableMember.
R=brianwilkerson@google.com

Change-Id: I45858e91df5831c44fc8dbd4ed58d0d3527a7d6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-13 15:29:48 +00:00
Robert Nystrom
cd22f16f0b Fix crash when building //utils/dartdevc:dartdevc_kernel_sdk.
That build step still *fails* because of other static errors in the
migrated corelibs + patch files, but it no longer *crashes*.

Change-Id: Ia763a13bd45cecb148e02ce22d4ed2cc6fdfdfa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125002
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-11-13 10:34:29 +00:00
Johnni Winther
f443bc918e [cfe] Add tests for inheritance from opt-out libraries
Change-Id: If139945dfdd808da0c24ac550ecfa235b41d3c23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123737
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-13 10:08:08 +00:00
Johnni Winther
6ed0fcaa12 [analysis_server] Remove last dependency on front_end+kernel
Change-Id: I0a8d1692ac1c8297bc7848a3f37fe97f8a8d3b29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123735
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-13 10:07:48 +00:00
Jens Johansen
2b94bd678d [CFE] Fix renames from test to suite and move of parser
Change-Id: Ica6b0acd8fe6acd32b4a6776cb3203cef8ff7210
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124990
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-11-13 09:26:47 +00:00
Johnni Winther
d4f1512e00 [cfe] Support forEffect and readOnlyReceiver in IndexSet
Change-Id: I17aeac01ad4330fe873e7fe693fd2fd6e427d120
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124986
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-13 08:50:57 +00:00
Siva Annamalai
082c10aab7 Revert "[VM/nnbd] Pass nullability when creating Class::DeclarationType."
This reverts commit ea57b1e62c.

Reason for revert: Please see https://buganizer.corp.google.com/issues/144304690

Original change's description:
> [VM/nnbd] Pass nullability when creating Class::DeclarationType.
> 
> Passing nullability rather than forcing kLegacy helps slightly reduce the number
> of Types in the VM and in snapshots.
> This allows to remove the kludge about declaration type of Null being kNullable.
> Also pass nullability when creating a simple type may help.
> 
> Note that CFE is still producing super types and some interface types that are
> non-nullable, even with nnbd features disabled. But this should get fixed and
> further reduce the number of types in the snapshot.
> 
> Change-Id: I397f00902026ee5bc91d36328f4156427702efdb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124480
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com,regis@google.com

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

Change-Id: Icae0a69cda6cc531bba4d5d12471e7267a277340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125102
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-11-13 02:06:02 +00:00
Siva Annamalai
b4779e8f72 Revert "[VM/nnbd] Make Nullability and NNBDMode class enums to avoid name conflicts."
This reverts commit d45c3d15cb.

Reason for revert: Please see https://buganizer.corp.google.com/issues/144304690
(This CL is dependent on https://dart-review.googlesource.com/c/sdk/+/124480 which caused the regression).

Original change's description:
> [VM/nnbd] Make Nullability and NNBDMode class enums to avoid name conflicts.
> 
> Change-Id: Ic78d3f48964bb61cbd1d90a69fcd68b4f29071e4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124587
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=alexmarkov@google.com,regis@google.com

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

Change-Id: I24603236f04bd2ec1ad80789d78cca89e70fb1d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125101
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-11-13 02:01:44 +00:00
Siva Annamalai
82aa7e79af Revert "[VM/nnbd] Force the DeclarationType of a class to have legacy nullability."
This reverts commit 3771dddf43.

Reason for revert: see https://buganizer.corp.google.com/issues/144304690
(This CL is dependent on https://dart-review.googlesource.com/c/sdk/+/124480 which caused the regression).

Original change's description:
> [VM/nnbd] Force the DeclarationType of a class to have legacy nullability.
> 
> This is a workaround to avoid caching a non-legacy type (possibly provided
> by the CFE) as the canonical type of a non-generic class and later returned as
> the runtime type of an instance of this class.
> 
> Hopefully fixes https://buganizer.corp.google.com/issues/144304690
> 
> Change-Id: Iaea364b9b743b05bde600f0aa784d5a8105728d7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124920
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Régis Crelier <regis@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com,regis@google.com

Change-Id: If8b2671f3cf4b0d080ba9f0472738326fec701d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125100
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-11-13 01:55:18 +00:00
asiva
a7472ba4c6 Cache value of "non-nullable" flag so it can be used in the VM code without having to search through the array of experimental flags array.
Change-Id: I297dca48711ef2bdd80a102086dea1bb075ea357
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125081
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-11-13 01:40:36 +00:00
Paul Berry
8938a5ed2d Migration: make an edge origin for assignments of dynamic.
Change-Id: I75d037aa7ee890488a92e113f58094b5733a9b8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125004
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-13 00:27:32 +00:00
Konstantin Shcheglov
c9ef7cc5e3 Deprecate Member.baseElement, use Element.declaration in analyzer.
Change-Id: I91d23558c7d0bd8ffa2e251e5d615d4e026923b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124940
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-12 22:35:07 +00:00
Paul Berry
3793a40e6a Migration: stop using always for decorating the type of explicit nulls.
Change-Id: I950c9b8e80bc647c5a42b5cb5c66babd7c4d41e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125008
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-12 22:19:16 +00:00
Paul Berry
12265c4e42 Hacky prototype of how to fix the seventh item from #39247
The issue is:

  lib/src/logger.html, line 107, inserted !:

  In this case the single reason detail reads "node with no info (type(2171))" with no destination.

The problem is that InstrumentationInformation.nodeInfoFor is only
considering a limited set of possible sources of nullability nodes
(the primary nodes of decorated types passed to the instrumentation
listener methods `implicitReturnType`, `implicitType`, and
`implicitTypeArguments`).  It needs to also consider decorated types
passed to `explicitTypeNullability`, `externalDecoratedType`, and
`externalDecoratedTypeParameterBound`, and it needs to walk these
decorated types recursively to discover all the nodes they point to.

Additionally, the logic in InstrumentationInformation.nodeInfoFor is
inefficient; it walks through all the implicit types in every source
file, which means that it is O(N) in the size of the code being
migrated.  Since it is called O(N) times, this is an overall runtime
complexity of O(N^2).

I've prototyped a possible fix using an expando to compute
NodeInformation for each node once at the time it's reported to
instrumentation.  This is incomplete and intended as a starting point
for discussion.  Work that still needs to be done:

- We don't produce a sensible description string for nullability nodes
  associated with AST nodes, so we present unhelpful text to the user
  like "A nullable value can't be used as the explicit type ???"; it
  would be nicer to say something like "A nullable value can't be used
  as positional argument 0 of Level.>=".  We may want to consider
  modifying the instrumentation API to make it easier to generate a
  useful string here.

- I haven't verified that the description string we produce for
  external decorated types is helpful.

- I haven't verified that the we produce a useful link for external
  decorated types.

- We should probably get rid of the data structure
  NodeInformation.explicitTypeNullability (which has similar
  inefficiencies) and change over code that was using it to use the
  new approach.

Change-Id: I2cf2fe47cd70d7e5cc6e3da309851288668e8a62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124902
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-12 22:18:01 +00:00
Kallen Tu
d5d889668b [analyzer] Added variance support for upper/lower bounds.
Change-Id: I64f44a7068c6caa222787ccb7dfbb3ed8b5fd0fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124420
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-11-12 22:10:56 +00:00
Kallen Tu
a65aff122d [analyzer] Changed subtype checking for variance modifiers.
Change-Id: I9fa65e13d2f8611acc50fd133029c76666b8f452
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123559
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-12 22:09:56 +00:00
Konstantin Shcheglov
a520e771f6 More subtyping tests.
R=brianwilkerson@google.com

Change-Id: I078639191f3574cba7baaa49bfb4330f0b35c206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-12 22:00:49 +00:00
Mike Fairhurst
942419e6ba [analysis_server] Funnel sendServerErrorNotification through logException
Change-Id: I266a8b3c404da8c9892aa6e1a49e1f1c9bdcf530
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124163
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-11-12 21:45:24 +00:00