Commit Graph

1972 Commits

Author SHA1 Message Date
Johnni Winther c41fabbb48 [cfe] Use CombinedMemberSignature to create noSuchMethod forwarders
This is relanding https://dart-review.googlesource.com/c/sdk/+/168201
after it was reverted due to a problem in
https://dart-review.googlesource.com/c/sdk/+/168200

Change-Id: I350ae8af38b48d909716289c99092be2a638f3fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168643
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-22 07:45:29 +00:00
Regis Crelier 0ace625d6d [VM/finalizer] Remove checks from finalizer now performed in CFE.
Also stop passing the class 'being parsed' to finalization methods.

Change-Id: I7c2256c2a8ace468021ba0ba5be10b6bfb839480
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168621
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-10-21 19:36:56 +00:00
Johnni Winther 5c51990a80 [cfe] Handle void as return context in sync function expressions
Closes #43174

Change-Id: I6b1cc04cbf2d65d9b877dfabf3e0f535f2491a94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168542
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-21 13:43:03 +00:00
Johnni Winther 81e345ca64 [cfe] Add test that exercises super member override checks for covariant parameters.
The code exercised by the test is located in ClassBuilder.handleSeenCovariant

Change-Id: I140e60fff01f60461ebaa6edfe193dbb7858c641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168642
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-21 12:55:13 +00:00
Clement Skau 7f0bd5e811 [VM] Removes _Future's and _StreamImpl's _awaiter.
Changes debugger.cc to use the 'lazy async stack' mechanism for
unwinding async stacks, which means we no longer have to manually
keep track of the caller.

This also allows us to get rid of _asyncStarListenHelper.

Bug: https://github.com/dart-lang/sdk/issues/42457
Change-Id: I536e9da4af275998140ae5f05e3a43e07c77cfc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167561
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-10-21 12:38:23 +00:00
Johnni Winther 10c03da2c2 [cfe] Add regression test for issue 43864
Change-Id: Id0f6c18c5d47a1fbf234cc7c0a43abb6035a0c4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168540
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-21 07:58:32 +00:00
Johnni Winther 137c7b6c84 [cfe] Explicitly run front_end unittest without non-nullable
This prepares front_end unittests for turning on non-nullable by default.

Change-Id: I9588a2d026ab9f5b1dcf08a140d25bd5dca3d5bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168346
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-20 13:13:33 +00:00
Michal Terepeta 5f18d498a0 Revert "[cfe] Avoid transforming members in other classes to no-such-method forwarders"
This reverts commit 87d3e03bf8.

Reason for revert: Breaks internal builds (http://b/171258924)


Revert "[cfe] Use CombinedMemberSignature to create noSuchMethod forwarders"

This reverts commit 13b7a83d57.

Reason for revert: Depends on a commit that breaks internal builds
(http://b/171258924)


Revert "[cfe] Use CombinedMemberSignature for creating simple legacy member signatures"

This reverts commit 170f05f91b.

Reason for revert: Depends on a commit that breaks internal builds
(http://b/171258924)


Revert "[cfe] Use origin location for member signatures"

This reverts commit 354dcf4386.

Reason for revert: Depends on a commit that breaks internal builds
(http://b/171258924)

Change-Id: I51f524949f259351336a77f43847bf1d0d11f104
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168487
Reviewed-by: David Morgan <davidmorgan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2020-10-20 12:23:53 +00:00
Jens Johansen a7137f4e59 [CFE] Fix weird artifacts when evaluating lists/sets/maps with unevaluated constants in them
Change-Id: Id391521d2e4549cbf2b8658c2d1b07ecf77f4ab3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167340
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-20 10:21:12 +00:00
Johnni Winther 1d96c40dc4 [cfe] Fix static extension field lookup
Lookup of the setter of an assignable static extension field loaded
from dill failed because the DillExtensionFieldBuilder didn't identify
itself as a field.

Change-Id: I379e0002ec8180b0ac1c5b1440bf9725a87e889e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168480
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-20 07:22:02 +00:00
Anna Gringauze f04bc85e4f Refined scope calculation in expression compiler
- make sure nested blocks scopes are visited
- make sure variable definitions do not leak beyond block scopes
- properly collect scopes for loops, if statements, constructors
- add calculation of fileEndOffsets for blocks
- save block file offsets to dill
  - update binary format version
  - change kernel readers and writers to read and write block offsets
  - change vm readers to read and block offsets for new version
- add missing fileOffsets and fileEndOffsets on functions for
  late fields
- add missing fileOffsets and fileEndOffsets on functions for
  extensions
- add errors on failures to find scope
- find libraries for private fields correctly
- add more expression compilation tests
- add test to verify fileOffsets and fileEndOffsets are set for
  SDK summary (will add full dill tests later)

Closes: https://github.com/dart-lang/sdk/issues/40278
Related: https://github.com/dart-lang/sdk/issues/34942

Change-Id: I5bc1bb645543045b689d8d61069ee77dc4ee9025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167541
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-20 01:44:52 +00:00
Johnni Winther 354dcf4386 [cfe] Use origin location for member signatures
Change-Id: Iee3f79db7aa7600e9116e402d2d921308b07f8f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168203
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-19 15:34:17 +00:00
Johnni Winther 170f05f91b [cfe] Use CombinedMemberSignature for creating simple legacy member signatures
Change-Id: I0b13b7f7c3c3cc4f52ce6590e481f9f214e0dacf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168202
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-19 15:34:17 +00:00
Johnni Winther 13b7a83d57 [cfe] Use CombinedMemberSignature to create noSuchMethod forwarders
Change-Id: Ic265483d1788faf65c925ea0bba512310316b182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168201
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-19 15:34:17 +00:00
Johnni Winther 87d3e03bf8 [cfe] Avoid transforming members in other classes to no-such-method forwarders
Change-Id: Ic4b5e914c1ab6ae2a3bef98e9d16a3a73f5a44d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168200
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-19 07:59:36 +00:00
Jens Johansen a9ddd4bb96 [CFE] Change Set-literal transformation from nested let to BlockExpression
Fixes #43756.

Change-Id: Ib126ba8b91ae0d0c222383b51418b3d9f730bcfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168022
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-19 07:16:36 +00:00
Daco Harkes b13c37726c [cfe/ffi] Transformation changes for structs-by-value
Changes the kernel representation of structs in two ways.
1. `_addressOf` field of `Struct` gets type `Object` because it will be
   either `TypedData` or `Pointer` in structs by value CL.
2. Subtypes of `Struct` get a pragma `vm:ffi:struct-fields` which
   contains a const list of the native types of the fields of the struct
   which will be read in the VM to do compute the locations of structs
   in the target ABI.

Split off from https://dart-review.googlesource.com/c/sdk/+/140290/23
to make that CL smaller. That CL will no longer have changes to the
kernel representation of FFI code after this CL lands separately.

These changes are not consumed in the VM in this CL, but they are tested
by the expect files.

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

Change-Id: I5d3babd5be07f78c6d2bd80bbc1fd492c51bc01f
Cq-Include-Trybots: luci.dart.try:front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167280
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-10-16 11:16:02 +00:00
Johnni Winther a39f93cd4c [cfe] Add non-dill test for flutter issue 68092
This issue was fixed by https://dart-review.googlesource.com/c/sdk/+/167568

The added test would have hit the same problem without the use of .dill files.

Change-Id: I32e0a32da888b7136795e7f918f8363602aa8760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167744
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-15 14:50:46 +00:00
Johnni Winther db98b69aea [cfe] Handle duplicate late fields
Flow analysis was failing on our encoding of duplicate late variables.
We add an invalid expression as the initializer on duplicate variables
and flow analysis was seeing this as if the late variable had (declared)
initializer. Changed to use the `hasDeclaredInitializer` flag on
VariableDeclarationImpl to bypass flow analysis in the synthesized
initializer.

Closes #43689

Change-Id: I483caa3bbc3347eb547826e9615a40fe62b586d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167741
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-15 13:16:06 +00:00
Johnni Winther 16f7ce8e57 [cfe] Warn on null aware access on this and static members
Closes #43703
Closes #43461

Change-Id: I861462b5fcf31d5459c17cbe1604ce285c359dec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167563
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-15 08:48:33 +00:00
Johnni Winther aa329dc0d0 [cfe] Handle named parameters correctly in TypeBuilderComputer
Fixes https://github.com/flutter/flutter/issues/68092

Change-Id: I6420b6cd9285a6c1b048c8ce8b067bf2ee99c73b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167568
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-15 07:48:53 +00:00
Johnni Winther b5fd660dd3 [cfe] Remove old_dills
A .dill file was accidentally committed by a previous CL.

Change-Id: I64f5e25f157bef58c71e18b3593bc0e463bc2537
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167566
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-14 12:27:48 +00:00
Johnni Winther 73bbb6e008 [cfe] Handle scope patch-up for getter/setter/fields
Fields might be lowered to getter/setter pairs from source to
AST. This CL makes members able to show this for correct computation
of exports and handles scope patch-up when the relation isn't 1-to-1
between source and dill builders.

Change-Id: I5e4a711cd985730d320e582c3bd9d36602030992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-14 08:23:57 +00:00
Johnni Winther d8e4cdd621 [cfe] Handle bounded type variables in extension inference
Handle #43177 for the CFE.

Change-Id: I89f475a6c5dca060b75688fd4c121ab09aed9c4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160524
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-10-13 14:32:28 +00:00
Jens Johansen b3ae203907 [CFE] Add hash-code to UnevaluatedConstants and add extra canonicalization for them
This gets rid of some of the weirdness about `UnevaluatedConstant`s.

Change-Id: I5e34dedd7ad4ad5ef57b3f27e17b456f5619e14d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167281
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-13 12:27:37 +00:00
Jens Johansen d60fd61614 [CFE] Add strong-test for weird behavior of unevaluated constants
Change-Id: I10029ec87904ea989c527ad0c0edc6ddac990bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166857
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-13 10:34:43 +00:00
Jens Johansen 4e0d5feca6 [CFE] Skip re-evaluating unevaluated constants if there's still no environment
This CL stops trying to evaluate unevaluated constants if there's
(still) no environment, something that would happen before, e.g. if
there was something like this:
```
const original = String.fromEnvironment("original");
const copy1 = original;
const copy2 = copy1;
const copy3 = copy2;
const copy4 = copy3;
const copy5 = copy4;
```

Note that unevaluated constants only comes into play when there is
no environment.
Compiling a big internal app with dart2js takes the actual contant
evaluation part down from 8 point something seconds to 3 point
something seconds (-4662.67 ms +/- 537.29 ms, -54.4428% +/- 6.27357%)
and wall clock time (as reported by `/usr/bin/time -v`) down with
~9 seconds on the 8+ minutes run (-9.23 s +/- 6.70067 s,
-1.77065% +/- 1.28543%).
Maximum ram usage (`Maximum resident set size (kbytes)` reported by
`/usr/bin/time -v`) is down 700+ MB (-792367 +/- 364776,
-4.86424% +/- 2.23931%)

Change-Id: I1e1940a9e53de34cff2bcbd8eb938fdb23a22c83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166851
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-12 14:57:52 +00:00
Johnni Winther 1d6eac5ebf [cfe] Only use experimental release version when flag is not on by default
Change-Id: I06267c6d3f0e5abb289e25fde8098aa0e3bead34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166844
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-12 12:57:41 +00:00
Johnni Winther 7964e40429 [cfe] Ensure that source/dill export scopes match during incremental compilation
This fix the breakage found in https://dart-review.googlesource.com/c/sdk/+/166603/4 trying to update to the most recent package:collection

Change-Id: Ie71e97cc92d39dd121825447edf8460858c5156e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166846
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-12 07:55:41 +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
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
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
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
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
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
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 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
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
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