Commit Graph

6018 Commits

Author SHA1 Message Date
Paul Berry 8857836b62 Ensure that flow analysis sees the correct type of late-lowered local variables.
Change-Id: Id6f3d2ddff5b1d6b496710103d0b557eaed4dc08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166791
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-09 21:14:07 +00:00
Joshua Litt cbbd76ef2c [dart2js] Port deferred_loading_test to features.
Change-Id: I683f82fe1096963392f78f9dd3b640b66765b8b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166604
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-09 21:10:17 +00:00
Paul Berry 586bbcb514 Update flow analysis properly when desugaring late local variables.
Fixes #43723.

Bug: https://github.com/dart-lang/sdk/issues/43723
Change-Id: If050f28beec1229ba2476b78225fb19466b2c255
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-09 20:09:57 +00:00
Dmitry Stefantsov 46a712d925 [cfe] Add tests for #43716
Bug: https://github.com/dart-lang/sdk/issues/43716
Change-Id: Ie5d664af306870efdde5cd63512af42e206c1dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166842
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-09 14:35:56 +00:00
Johnni Winther d120dfc0fe [cfe] Share override dependencies between getters and setters
Closes #42694

Change-Id: I0df60076e1ebb462c474d4e971ce981ea6e653c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166636
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-09 14:20:26 +00:00
Dmitry Stefantsov 319c02c3c0 [cfe] Implement the update in UP for FutureOr types
Closes #43721.
Closes #43677.

Bug: https://github.com/dart-lang/sdk/issues/43721
Bug: https://github.com/dart-lang/sdk/issues/43677
Change-Id: Iac7840e7699809946830067cd709314c6302986e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166639
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-10-09 13:39:16 +00:00
Johnni Winther 16ea8422d5 [cfe] Fix encoding for sync*/async/async* extension tear-offs
The internal closure was wrongly marked with the async marker of the
torn-off method.

Change-Id: Ie29eee6ed77fb07e9c0992bd0e49590cc10edd3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166634
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-09 10:42:56 +00:00
Johnni Winther b2e33ee550 [cfe] Check getter/setter types on top level and extension members
Closes #43714

Change-Id: I07ee20cb3a65758dda2139e965aeb4fb36cf38c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166628
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-09 07:16:06 +00:00
Paul Berry 2601fa6d78 Ensure that && and || expressions promote properly in unreachable code.
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: Ib06449624de9320f5229957511ebaaee92c75ec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166606
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-08 21:42:14 +00:00
Paul Berry 51c6ba0edb Introduce distinct subclasses for _SimpleContext.
Note that due to https://github.com/dart-lang/sdk/issues/43725 we
can't yet downcast to these subclasses in all cases; added a test case
that would fail if we did.

Change-Id: Idd498840484a6a4c60a0cf2f8e01092ba75e7d2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166722
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-08 17:15:55 +00:00
Johnni Winther aa376d1520 [cfe] Check types and initialization on extensions, extension members and factories
Closes #43211

Change-Id: I45bb0ee59bbdc4fdd63861e6e434d95bdcb5791a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166481
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-08 16:19:05 +00:00
Johnni Winther 5a2a435b6e [cfe] Use combined member signature for override inference.
Closes #43381

Change-Id: Id3ba97d717556f807eac1115e1c3570662cab87c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166240
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-08 15:29:05 +00:00
Johnni Winther 1c0c0a1e86 [cfe] Resolve "Never" as "Null" in opt-out libraries
Closes #43499

Change-Id: I5d0ba97a626248019d7aab4e7a5a68d0a566a87a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166440
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-08 15:08:05 +00:00
Jens Johansen 34e4a6d814 [CFE] Remove inconsistency where visitIsExpression called .accept directly
Change-Id: I81d0e99e6908f24d082cfa57454db8fdc3b333be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166625
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-08 13:23:45 +00:00
Paul Berry 57932cfb4f Ensure that conditional expressions promote properly in unreachable code
Change-Id: I8680b81b44be789a047238b1e2d008ff240e59c2
Bug: https://github.com/dart-lang/sdk/issues/40009
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165405
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 18:16:52 +00:00
Paul Berry 8b65c31fec Fix CFE flow analysis of conditional expressions.
It turns out we didn't have enough id test coverage to tell that we
were passing the wrong value for `conditional_end`'s
`conditionalExpression` argument.

This change fixes the call site and adds an id test that would have
caught the bug.

Change-Id: Ie99b1b7045e757ee78d72fcb435222fd27d680d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166307
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 18:16:52 +00:00
Alexander Markov 0e9b2b8a36 [vm/compiler] Fix assertion when assigning type to a Phi in ComputeSSA
Fixes https://github.com/dart-lang/sdk/issues/43682

Change-Id: I6b123ac5ba153b1f4177148341619419c3058684
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166304
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-07 16:30:17 +00:00
Paul Berry ed2f45d56d Ensure that if statements promote properly in unreachable code
Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I04a5af558bb70b861d92b5379a8fb84489d5c9f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165402
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 15:32:25 +00:00
Paul Berry e933e91aaa Reland "Flow analysis: promote to non-nullable on initialization"
This is a reland of 6a1c54ec30

Original change's description:
> Flow analysis: promote to non-nullable on initialization
>
> When flow analysis encounters a variable declaration of the form `T? x
> = expr;`, if the type of `expr` is `T`, then the variable is
> immediately promoted to type `T`.
>
> Fixes #43099.
>
> Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
> Bug: https://github.com/dart-lang/sdk/issues/43099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

Bug: https://github.com/dart-lang/sdk/issues/43099
Change-Id: I7530bb0f7c24674a7b500558b89d50b35e045aca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166305
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-07 13:14:55 +00:00
Paul Berry 19995ba7cd Replace flow ranalysis reachability bool with a stack.
Currently we don't push or pop anything on the stack, we just
manipulate the single value that's on the stack.  So there's no
functional change.  Logic that pushes and pops the stack will be added
in a follow-up CL.

Bug: https://github.com/dart-lang/sdk/issues/40009
Change-Id: I4deb4cbe06644a2b2c9b5e2c1dc140fb4cd805cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165145
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 12:13:54 +00:00
Johnni Winther 749b622a6b [cfe] Don't override language version of opt-out libraries in strong mode
This change compiles opt-out libraries with opt-out semantics even when
sound null safety was requested. The compile-time error that libraries
cannot opt out with sound null safety is still produces but spurious errors
from interpreting opt-out as opt-in are avoided.

This also aligns the compilation of from-source with from-dill for the
case of opt-out libraries in face of sound null safety.

Closes #43327

Change-Id: I19d659219b7c7b357d15fc5f1ca4415fe1fc4592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166243
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-07 08:43:25 +00:00
Dmitry Stefantsov 3b4fe0dc06 [cfe] Use computeRawType in Null Safe UP and DOWN
Closes #43536.

Bug: https://github.com/dart-lang/sdk/issues/43536
Change-Id: I6616739e7ac0eb0be084988cef0460e916a3b448
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165804
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-07 08:40:34 +00:00
Jens Johansen f59c86160c [CFE] Short-circuit certain types in ConstantEvaluators _evaluateSubexpression
TL;DR on the below: On a big internal app, this makes the constant
evaluator ~17% faster and use less ram.

Details:

Detauls for 5 runs before this CL and with this CL when compiling a big
internal app with dart2js (stopping at around "stopAfterClosedWorld"
with instrumented code available as patch-set #1):

Original:
Spend 9829 ms in ConstantEvaluator.
Spend 9935 ms in ConstantEvaluator.
Spend 9769 ms in ConstantEvaluator.
Spend 9725 ms in ConstantEvaluator.
Spend 9915 ms in ConstantEvaluator.

With this CL:
Spend 8110 ms in ConstantEvaluator.
Spend 8080 ms in ConstantEvaluator.
Spend 8183 ms in ConstantEvaluator.
Spend 8174 ms in ConstantEvaluator.
Spend 8155 ms in ConstantEvaluator.

Difference at 95.0% confidence
        -1694.2 +/- 103.924
        -17.2269% +/- 1.05672%
        (Student's t, pooled s = 71.2569)

Original:
Maximum resident set size (kbytes): 13164908
Maximum resident set size (kbytes): 13179968
Maximum resident set size (kbytes): 13226748
Maximum resident set size (kbytes): 13296908
Maximum resident set size (kbytes): 13220740

With this CL:
Maximum resident set size (kbytes): 13006996
Maximum resident set size (kbytes): 13006720
Maximum resident set size (kbytes): 13020884
Maximum resident set size (kbytes): 13018172
Maximum resident set size (kbytes): 13160120

Difference at 95.0% confidence
        -175276 +/- 86297.8
        -1.32605% +/- 0.652888%
        (Student's t, pooled s = 59171.2)

Original:
Minor (reclaiming a frame) page faults: 5720311
Minor (reclaiming a frame) page faults: 5688423
Minor (reclaiming a frame) page faults: 5693923
Minor (reclaiming a frame) page faults: 5699729
Minor (reclaiming a frame) page faults: 5650061

With this CL:
Minor (reclaiming a frame) page faults: 5612492
Minor (reclaiming a frame) page faults: 5603543
Minor (reclaiming a frame) page faults: 5600394
Minor (reclaiming a frame) page faults: 5628675
Minor (reclaiming a frame) page faults: 5621994

Difference at 95.0% confidence
        -77069.8 +/- 29166.7
        -1.35436% +/- 0.512552%
        (Student's t, pooled s = 19998.5)


Said another way, we have some confidence that this change decrease the
runtime of the constant evaluator with ~17% on this application.
Similar we have some confidence that this change decrease the memory
usage with ~1.3% overall for dart2js (note though, again, stopping
early), or something like ~170MB less memory in this case.
(And having a similar percetage less minor page faults).

Change-Id: Ib269ad50f705b967e0e60e88fdcbfd9b050b3a24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166105
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-07 07:33:35 +00:00
Johnni Winther a49217bc3a [cfe] Add test to verify legacy main method requirements
Change-Id: I3173d85ffe1d92840458fb28fcf2073bec3899ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166241
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-07 06:48:03 +00:00
Paul Berry 2c40d6a22a Fix CFE legacy type promotion.
The previous implementation of type promotion in the CFE was unsound,
didn't follow the spec, and contained a lot of unnecessary logic
related to experiments that eventually led to flow analysis.  This
change updates type promotion to be nearly spec compliant and removes
most of the unnecessary logic.

The lack of spec compliance went (astonishingly) unnoticed for over
three years, probably mostly due to the fact that for the most part it
promoted more eagerly than it should; as a result, any code that was
erroneously accepted by the CFE was rejected by the analyzer.
Unfortunately, in at least one case the erroneous promotion led to
incorrect VM behavior (issue #43640).

There's one aspect in which the CFE implementation is still not spec
compliant.  The spec says that when analyzing an expression `e1 &&
e2`, if `e2` shows that a variable `v` has type `T`, but `e1` assigns
to `v`, then promotion does not occur.  This turns out to be difficult
to model in the existing architecture, since much of the type
promotion logic happens during parsing, and any assignments that occur
in `e1` are parsed prior to figuring out that a logical and is in
progress.  Fortunately, this is a rare circumstance, and allowing type
promotion in this situation is sound, so it should not lead to
incorrect VM behavior.  Considering how long the other incorrect logic
(which was much more severe) went unnoticed, it seems unlikely that it
will cause problems for users.

Bug: https://github.com/dart-lang/sdk/issues/43640
Change-Id: If97293733e64e286780de5079a703717b8f6f142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166040
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-06 18:12:13 +00:00
Johnni Winther 3ffd9a9d90 [cfe] Add failing circular test
Change-Id: I64b9daa94aecc3ed001af86ff1ff072b6d725a31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166100
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-06 15:32:05 +00:00
Johnni Winther 4292d9cc28 [cfe] Handle required parameters in subtype check
+ use legacy erasure on weak mode const object checking
+ changes Null to subtype of Never when ignoring nullabilities

Closes #43606
Closes #43624

Change-Id: Ief695829c550562ec1bfd0c1145cc33c584a4b8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165805
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-06 08:34:23 +00:00
David Morgan 7d00f6239a Add http, http_parser and logging to null safety allowlist.
Change-Id: Ic019c13540cfd6b6f489cef17e3d7cd18df43f81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166020
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-10-06 08:03:03 +00:00
Johnni Winther 28c6ab316d [cfe] Report errors on incompatible getter/setter types
Closes #42702

Change-Id: I9af4b8d616c4368c9f955f658f27e581352a3cd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165806
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-05 21:53:42 +00:00
Johnni Winther 4c29f26fc6 [cfe] Report errors in invalid main declarations
Closes #43554
Closes #43556
Closes #43558

Change-Id: Ib3e2b891473f07bad7b4a373152be684095619b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165904
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-05 14:37:33 +00:00
Jens Johansen 266fa3f354 [CFE] Add 'InvalidKernelSdkVersionError' to list of errors the incremental compiler ignored silently
When the incremental compiler tries to initialize from a previous dill
it loads it and performs some tests. If any of this fails, in some
cases we want to swallow the error, ignore it, and not initialize from
the dill - whereas in others (unanticipated) cases we want to give a
warning.

This CL adds the InvalidKernelSdkVersionError error to the list of
anticipated errors that we silently ignore as we don't want to give
warnings whenever people upgrade the sdk.

Change-Id: Ib9e701fb61fa78690b024192054e28f4cca51717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166060
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-05 13:29:53 +00:00
Jens Johansen d69a2110ef [CFE] Remove old dill test, suit etc.
This is no longer necessary with the VM only supporting the latest
version and kernel (optionally) including a git-checksum to match up
VM and dills.

Change-Id: Ifccfd0d12333cd99258100cda30e1536cc230bc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166024
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-05 12:52:49 +00:00
Jens Johansen 94b2490f6c [CFE] Fix infinite recursion / stack overflow in constant evaluator
Fixes #43431.

Change-Id: I8def4f0132ced2fa860bd29f2138b32fb4089927
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165802
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-05 12:20:49 +00:00
Jens Johansen dc54ec7d4e [CFE] Put constant evaluator errors on library, not component
Change-Id: I67373522cbccf199a3bc39ec577f66ac68f681aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165803
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-05 10:30:05 +00:00
Jens Johansen 61e97d010c [CFE] Remove unreachable/unused code in constant evaluator
Change-Id: I0b30c7386ae9f2d201137189710efe0c722f627c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165801
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-05 08:08:16 +00:00
Johnni Winther 8b07d1902c [kernel] Remove DirectPropertyGet/DirectPropertySet/DirectMethodInvocation
These nodes are no longer used.

Change-Id: I40c8df7376f0c40a4122c22d934fb3c6f6fd520d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165902
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-03 19:15:41 +00:00
Johnni Winther e96698d5da [ffi] Remove use of DirectPropertyGet
Use PropertyGet instead. DirectPropertyGet is retiring.

Change-Id: Ia178e99e89c12eeba8634f5bea97baccac8dc635
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165901
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-10-03 19:15:41 +00:00
Nate Bosch 3efed86147 Allow null safety for pub_semver
Change-Id: I73e2e718feb82a11131dc8479a792bb3dbe49b6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165920
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-10-02 23:58:21 +00:00
Jacob MacDonald d63d5d93a5 add flutter_driver to the allow list
Change-Id: I747999ae50a9f87a1e55bfc2f289ca2ff868f529
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165871
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2020-10-02 22:47:41 +00:00
Johnni Winther bc06a90a0e [cfe] Stop using DirectPropertyGet for enum encoding
DirectPropertyGet is a statically bound instance access used in the
VM mixin tranformation to encode fully resolved super access. The
access to `this.name` generated in `toString` of an enum is _not_
a statically bound instance access but just a regular instance access
whose runtime target happens to be known statically because the code
is generated. In JavaScript backend a statically bound instance access
requires a unique getter to avoid the dynamic lookup, and therefore,
though using DirectPropertyGet is an optimization
to the VM, it would be a regression to the JavaScript backends if
they didn't handle DirectPropertyGet as a PropertyGet.

This CL removes the misuse and thus enables JavaScript backends to
handle DirectPropertyGet with the intended semantics.

Change-Id: Ie41aefbf19e8c63244f10a1afda1ddbfdf7d3c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164085
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-02 20:21:30 +00:00
Paul Berry 7704cc9dbe Fix flow analysis of a late initializer that is an assignment expression
Fixes #43621.

Bug: https://github.com/dart-lang/sdk/issues/43621
Change-Id: I5847e34fba9d892085dd8e388f6d96912c46eb5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165682
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-02 12:09:08 +00:00
Jens Johansen aaff0b67f0 [CFE] Enable 'unrelated_type_equality_checks' lint
Change-Id: I9cf739ca6e08203f1c2a33c680193777aef5c0c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165761
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-02 11:22:27 +00:00
Johnni Winther d34287af1b [cfe] Show regeneration command on unittest expectation failures
Closes #43633

Change-Id: I57f39367c5bf0827a2f0cb62e2e796692e152949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-02 09:52:17 +00:00
Jens Johansen fc7de901ee [kernel] Make LogicalExpression operator an enum (and rename)
Change-Id: I6054e8e44133d2419582d74700c4223d51495978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165606
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-02 09:41:12 +00:00
Jens Johansen 8cdbfe947e [CFE] Remove contextChain from constant evaluator; don't use try-finally
Change-Id: If62e71ae1aee5b33d00a361e5221f871331407aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165603
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-02 09:37:56 +00:00
Johnni Winther 7863f59dba [cfe] Update uriUsesLegacyLanguageVersion to use experiment release version
The method 'uriUsesLegacyLanguageVersion' is used for automagically
running opt-in libraries in strong mode. This was still using the sdk
version as bar for opting in to null safety.

Closes #43605

Change-Id: Ic9a1836e022f60106d2bcf9a6c3d50aa56966028
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165720
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-02 09:33:06 +00:00
Dmitry Stefantsov 0c8109c964 [cfe] Adjust error location for const constructors with late fields
Closes #43354.

Bug: https://github.com/dart-lang/sdk/issues/43354
Change-Id: Idc8f4757a5589638eb4e3ce08cda2c5afa8d5202
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165604
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-02 08:30:16 +00:00
Dmitry Stefantsov 8881446fea [cfe] Exclude Object from top types in NNBD instantiate-to-bound
Closes #42429.

Bug: https://github.com/dart-lang/sdk/issues/42429
Change-Id: I97ba450fae324ee04aedb3ff5c8bbe59062b94cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165640
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-10-02 07:08:36 +00:00
jlcontreras 8e283cb8c8 [cfe] Implements addToString to value class transformations
Change-Id: I431f72a103142788f886bce03f59320a67cd7d71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164961
Commit-Queue: Javier López-Contreras <jlcontreras@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-01 16:00:48 +00:00
jlcontreras 2dc59dd372 [cfe] Add tests for copyWith call sites in valueClass
Change-Id: I097d4a17109ff450fe37ae8bd492c301d51ffa7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164960
Commit-Queue: Javier López-Contreras <jlcontreras@google.com>
Reviewed-by: Javier López-Contreras <jlcontreras@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-01 14:13:52 +00:00