Commit Graph

4770 Commits

Author SHA1 Message Date
Johnni Winther d68b482f26 [cfe] Handle constructor from external libraries
Closes #37532

Change-Id: I8b07addeb1da6bc4fe165ff535944fab8c6698b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109261
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-07-17 06:26:34 +00:00
Siva Annamalai 83d2aaa072 Revert "[dart] Enable constant-update-2018"
This reverts commit 9bbd3192f4.

Reason for revert: Reverting enabling of constant-update-2018 by default as some blocking issues were found that are breaking Flutter and preventing rolls of Dart into Flutter. Once the blocking issues are addressed and fixed this CL will be relanded.

Original change's description:
> [dart] Enable constant-update-2018
> 
> Change-Id: Ib3942b4f6e336a02826305d9f81839333a5464a0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106943
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>

TBR=paulberry@google.com,vegorov@google.com,athom@google.com,vsm@google.com,aadilmaan@google.com

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

Change-Id: I5796881412cec464f450ff3894ca253c58edc4a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109308
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-07-16 22:30:36 +00:00
Johnni Winther dfa12c7456 [cfe+dart2js] Support library and error ids in annotated tests
Change-Id: Ife808a7d4aa1d4cf459ac3c04ee6ff02042442d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108810
Reviewed-by: Stephen Adams <sra@google.com>
2019-07-16 14:32:37 +00:00
Johnni Winther d5af4ed8c2 [cfe] Remove KernelTypeBuilder and KernelFunctionTypeBuilder
TypeBuilder and FunctionTypeBuilder are only subclassed by
KernelTypeBuilder and KernelFunctionTypeBuilder, respectively, so the
distinction can be removed.

Change-Id: I2cccd0d6b08f695ecb6ccb543f858edd4919cfda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108819
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-16 05:40:41 +00:00
Johnni Winther db7ab14167 [cfe] Handle invariance in non-covariant checks
To insert covariant checks, CFE was searching for covariance in
contravariant positions and _not_ for non-covariant
(=contravariant+invariant) positions of type parameters. This
let to the omission of needed checks when type parameteres were
used in invariant positions (in function type parameter bounds).

Closes #37476

Change-Id: Icb4a827e75aee1a679ef7175d36904bbfbf6aa0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108815
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-15 07:34:15 +00:00
Alexander Markov 78a8f670eb [vm/bytecode] Initial support for bytecode generation in incremental compiler
This change adds support for bytecode generation in incremental compiler in
kernel service. Bytecode generation is performed as a post-processing step,
after delta components are merged.

Bytecode generation requires CoreTypes and ClassHierarchy, which cannot be
constructed using delta component from incremental compilation (as it doesn't
contain platform or previously compiled libraries). The solution is to obtain
CoreTypes and ClassHierarchy directly from incremental compiler.

Now the following tests work:
vm/cc/IsolateReload_KernelIncrementalCompile
vm/cc/IsolateReload_KernelIncrementalCompileAppAndLib

Change-Id: I34c5870b01850c057ace71a63f8effa5b010cfcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108682
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-07-12 20:45:26 +00:00
Vyacheslav Egorov e82ca2f366 [fasta] Unconditionally enable asserts in const constructors
Based on feedback from the language team (https://github.com/dart-lang/language/issues/447).

Removal of CompilerOptions.enableAsserts is pending cleanup in DDK.

Change-Id: Id515e91da3e31647941ce893b2cffc58894a1b1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108813
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-12 15:42:43 +00:00
Vyacheslav Egorov 9bbd3192f4 [dart] Enable constant-update-2018
Change-Id: Ib3942b4f6e336a02826305d9f81839333a5464a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106943
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-07-12 12:32:34 +00:00
Jens Johansen 28f95fcd24 [cfe] Track dependencies in the incremental compiler
The objective of this CL is to allow the incremental compiler to track
which dill input libraries it actually used (in order to - in a modular
context - be able to ignore changes to dependencies we didn't really
use).

This is done by:
* Making the dill library builder lazy (and mark if it has been used).
* Making kernels class hierarchy record which classes it has been
  asked questions about.
* Add special handling to redirecting factory constructors as they
  bypass the fasta-builders and directly use the kernel ast.

Please note that:
* This has to be enabled, but kernels class hierarchy always records
  which classes it was asked about (even if disabled,
  or not running though the incremental compiler).
  There might potentially be some overhead to this (though setting
  a bool to true is probably comparably cheap - we did just do a
  map lookup).
* This was designed to be used together with modules
  (e.g. setModulesToLoadOnNextComputeDelta) - as used via for instance
  api_unstable/bazel_worker.dart. It might not function the way you'd
  expect in other circumstances.
* The incremental compiler (potentially) gives you the full kernel tree
  despite not having marked all of those libraries as 'used'. If a
  client use such libraries it is the clients responsibility to take
  that into account when answering any questions about this
  libraries/dill files was used.
* This feature works on the library level. In practice it is most likely
  needed at the dill-filename level. A translation from library to
  dill-filename is up to the client.
* This is a new feature, and we cannot promise that 100% of actually
  used libraries are marked. If you find used but un-marked libraries
  please report a bug.

Change-Id: I01d7ff95b9baac9550b77d8e09ea772d43173641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107280
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-12 10:40:55 +00:00
Vyacheslav Egorov 09b93b7ea0 [fasta] Tweak fasta unit tests setup in anticipation of constant update 2018
- Pass empty environment defines into CompilerOptions - to ensure that
there are no unevaluated constants in the output. VM does not expect
those.
- Include constant table when comparing expectations

Change-Id: I276e8bf8ce1f4f39c63265e4ae2650953649e41f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108800
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-11 19:59:59 +00:00
Alexander Markov 3dcaea5a25 [vm/aot/tfa] Update TFA unit tests to work with constants-update-2018
Normally, TFA runs after constant evaluation and it expects @pragma
annotations in the evaluated form. In unit tests TFA runs after
front-end and it was expecting @pragma annotations in the expression
form. With constants-update-2018 front-end starts evaluating constants,
so TFA unit tests should switch from ExpressionPragmaAnnotationParser
to ConstantPragmaAnnotationParser.

This CL does not update test expectations as flag is not flipped yet.
Test expectations should be updated when flipping a flag using

  tools/test.py -m release --vm-options -DupdateExpectations=true pkg/vm

Change-Id: I94ee2de9f70328ce3ed3ffd9902a92eeb26d3a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108840
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-11 18:16:28 +00:00
Samir Jindel 24725a8559 [cfe] Fix handling of private names in expression evaluation.
Issue: dartbug.com/35505

Change-Id: Ia1d211247852ef116139f8b509c21410fc8629d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108606
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-07-11 11:40:03 +00:00
Johnni Winther bae176b073 [cfe+dart2js] Add shared constant evaluation test.
Change-Id: I11fa0f576c5d177d85d3c17cfa075b7dd91326b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108604
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-07-11 10:49:23 +00:00
Johnni Winther fdd3822e3c [cfe+dart2js] Move annotation testing logic to front_end
Change-Id: Ic53c3d34d5c56232ac011e99972ef8f145aac6da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108602
Reviewed-by: Jens Johansen <jensj@google.com>
2019-07-11 10:49:23 +00:00
Johnni Winther 910064b416 [cfe] Prepare compiler_common for use in annotated code tests
Change-Id: I99b52ad25fdbde7b2211f29795cfaad32b90c09f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108405
Reviewed-by: Jens Johansen <jensj@google.com>
2019-07-11 10:49:23 +00:00
Vijay Menon 11da803fe9 [dartdevc] build the ddk sdk with dartdevc
This:
(1) Uses dartdevc and kernel_worker directly to build ddk artifacts.

(2) Generates an outline file instead of a full dill file for ddc_sdk.dill.

(3) Fixes source maps in the shipped sdk so that urls from dart_sdk.js.map
have correct relative paths to dart files in the sdk.  This won't work with
webdev/build as that copies and serves dart_sdk.js, but it will now be
able to build the sdk directly.

Change-Id: I7b9470fe18cac9b4343c7c520fe6ffd7bd9246b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104842
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-11 02:05:37 +00:00
Vyacheslav Egorov c00d5ceb33 [fasta] Include initializers for parameters of instance methods into outline
Fixes https://github.com/dart-lang/sdk/issues/37416

Change-Id: I4a9ebc3a18c2f7afcb77df1c4a19626429caf57b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108603
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-10 21:03:15 +00:00
Mark Zhou 9a07c4a817 [dartdevc] Properly encode Windows-style paths and paths with spaces for source maps
Change-Id: I32a28d7327a35c245a67343c91fdc74d6026d810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108503
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-07-10 16:49:22 +00:00
Daco Harkes 52858391e6 [frontend/ffi] Remove const Pointer()
Fixes: https://github.com/dart-lang/sdk/issues/37396

Change-Id: I6f53360297a3e1c9cc505c6f781cd5c55a041c6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108415
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-07-10 07:52:41 +00:00
Vyacheslav Egorov a86db84e0a [fasta] Preserve information about const constructors in outline.
- for classes with const constructors parse field initializers;
- for const constructions parse initializer lists and default parameter
values;

Fixes issue https://github.com/dart-lang/sdk/issues/37357
Fixes issue https://github.com/dart-lang/sdk/issues/36635

Change-Id: Iff0e47f8bd2925cee9f42a2b309de4de84e99cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108279
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-09 14:02:01 +00:00
Vyacheslav Egorov fce43ebc4e [ddk] Pass environmentDefines to CFE through CompilerOptions
CFE needs to have access to them to be able to perform constant
evaluation.

Bug: https://github.com/dart-lang/sdk/issues/37357
Change-Id: I15705e6fda330a05765ec2e8354051276cb88b07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108278
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-07-09 07:48:32 +00:00
Dmitry Stefantsov b14f3accbb [fasta] Thread nullability through the subtyping methods in fasta
Change-Id: I5ecf07bad41941c5e39af7c9eff61614d5b5f3e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107745
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-07-05 12:09:35 +00:00
Paul Berry c0932a8af6 Move annotated_code_helper.dart into front_end.
This avoids the need for the analyzer to depend on the unpublished
package sourcemap_testing.

Change-Id: I7632df2028d4f3557d2c5c4a3a75510cda968efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108268
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-05 11:40:25 +00:00
Paul Berry cea3d85ade Rename statment -> stmt in testing annotations.
We are probably going to want to use this often enough that giving it
a short name will save a lot of typing.

Change-Id: Id95297183afa9d8e87002b93900d5c279401c74d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108267
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-07-05 10:24:10 +00:00
Paul Berry ee696f2c35 In flow analysis tests, annotate doesNotComplete on functions rather than bodies.
Change-Id: I40476db016fd153ea4a013bcaa452775bcd960d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108266
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-05 09:08:40 +00:00
Paul Berry c1ca599353 Adapt flow and promotion tests to make use of CFE testing framework.
This CL reworks the tests flow_analysis_test.dart and
type_promotion_test.dart to make use of the framework recently
introduced into pkg/front_end/lib/src/testing/id.dart.  The long term
goal is to move these tests into a common location so that they can
exercise both the front end and the analyzer.

Change-Id: Iad95065e995b0fe3c6e4990d2ea015215895743a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108265
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-05 09:08:40 +00:00
Johnni Winther 4ceefdbe4c Rename ElementId to MemberId and use member: prefix instead of element:
Change-Id: I71c82318357881230edcaeefe1d86ceb50473c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108261
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-04 12:53:55 +00:00
Johnni Winther aeee6139f5 [cfe] Extract Id, DataRegistry and DataExtractor from dart2js
This is a step towards sharing tests based on annotated code between
the CFE and the analyzer.

Change-Id: Ia0f4b78717042af5544d92b0a259d6693547e722
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108260
Reviewed-by: Paul Berry <paulberry@google.com>
2019-07-04 12:53:55 +00:00
danrubel a4f34f4a51 expired experimental flag command line message
Change-Id: I02a977f36969aec7fa67593739330fd785fcf02c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107661
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-04 08:32:05 +00:00
Johnni Winther b8a8cfdcda [cfe] Use InvalidExpression for await on non-async context.
CFE failed to replace an invalid AwaitExpression in a non-async context
with an InvalidExpression. The lead to untransformed (and thus unexpected)
await expressions crashing the hot reload.

Closes #37108

Change-Id: I4457925b20749d231cbf9dac80203ee9b381a312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107501
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-04 08:30:45 +00:00
Vyacheslav Egorov 9f32f9b87e [cfe] Store the initializer tokens in constructor builders
For const constructors, we need to compile the initializer expressions
and write them into the outline so that we can perform modular
constant evaluation.  As a first step, preserve the tokens for the
initializer expressions in const constructor builders when building
the outline.

Currently they are discarded later during outline building at the
point when we should compile them instead.

Change-Id: Ief8d94ceb752b2315982d720836496b7d597e55c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107509
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-03 10:52:35 +00:00
Samir Jindel fc6cb0ac21 [vm/ffi] Revamp struct representation in FFI.
See dartbug.com/37229 for details.

Change-Id: I63490e41c512ffc9312803985a6f6d4be1586c0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101291
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-07-02 23:12:13 +00:00
Dmitry Stefantsov 613b645a44 [cfe] Don't return null when substituting UnknownType
Closes #37381.

Bug: http://dartbug.com/37381
Change-Id: I924bf38c1b16f8dc31c6b574c90f100acf3a6fdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107505
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-06-28 09:03:42 +00:00
Samir Jindel 496345e2e1 [vm/ffi] Update exception behavior of FFI callbacks and fix callbacks returning void
Issues dartbug.com/36856 and dartbug.com/37301

Change-Id: I96595b0781a3a6ddf73bba5595ed5c1aa08be257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106352
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-06-27 18:26:27 +00:00
danrubel 8d705089ba remove retired experimental flags from kernel
Change-Id: Id0f5e64ad7431e42a10c09fdaf1fae70b73a6d68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104900
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-27 18:19:55 +00:00
Todd Volkert ddfde57069 Update File.openRead to return Stream<Uint8List>
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: Ib2e417f4baa0048e2d4c2156c250d0cf454fdf87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104523
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-27 00:22:17 +00:00
Kevin Millikin c9c614db6a [CFE] Simplify outline expression parsing
Outline expressions (const field initializers, annotations) are never
in a formal parameter scope so it's not necessary to consider it.

Change-Id: Ifacdc28d7d565f29ae9e47b09ed32dd4947d284a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107284
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-06-25 14:45:32 +00:00
Dmitry Stefantsov de72f2f1bd [fasta] Fix checks of abstract methods when noSuchMethod is defined
If an abstract method overrides a concrete method, and the abstract one
is more specific, it's an error, unless there's a user-defined
noSuchMethod, effectively making the abstract method concrete.

Change-Id: I06ebe2de257ef6627529e6e97ca11b768c9647b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106084
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov a8f8f1d1a1 [fasta] Fix erroneous dependence of inference on named parameters order
Change-Id: I7013b4c4340a7d6fd543a21f14ac318ff0ecb4d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106080
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov cd709c263a [fasta] Fix an issue with override inference and type parameters
The CL fixes how override-based inference works in the cases when the
type of a parameter in the overriding method is omitted, and the type
of this parameter in the overridden method contains a type parameter
of the class.  Basically, the type should be substituted in this case.

Change-Id: I36d6c614d47e5cd68dc14eae1a2bbe4cd19d842b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104784
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov 10a04a4309 [fasta] Fix crash when override inference depends on field inference
Change-Id: I34a273185ba09f2740783cf8a25ac6d5f754c621
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104762
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov 1aa7f52972 [fasta] Make forwarding stubs operators if their source are operators
Change-Id: I516c0ac9ccf93770cc331b1c7569df1a1c16659c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102160
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov 53dde321fd [fasta] Fix override-based type inference for setters
If both the getter and the setter are present in the superclass, the type should
be taken from the setter.

Change-Id: Ie0d84e45d15341151af4a688c508da0f1d7b522d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101988
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov e92bd978ad Fix 'covariant' bit propagation in mixin applications
In the upstream CL https://dart-review.googlesource.com/c/sdk/+/100580 the
'covariant' bit on parameters of class methods isn't propagated correctly in the
case of mixins.  Effectively, if it's used in a member of the superclass of the
mixin application, it won't be propagated to the mixin application or its
subclasses.  Consider the following:

```
class A {
  void foo(covariant num x) {}
}

class B {
  void foo(num x) {}
}

class C {
  void foo(num x) {}
}

class D extends A with B implements C {
  void foo(int x) {}
}
```

The program above doesn't have any errors, and overriding foo in D using int as
the type of the parameter is allowed, because D's superclass A declares the
parameter as 'covariant'.  Without the changes from this CL, the code will
result in a compile-time error.  With the change, the 'covariant' bit is
propagated correctly, and the program compiles.

An existing test already covers the described behavior: see class Mixed in
tests/language_2/covariant_override/tear_off_type_test.dart.

Change-Id: Ia508a224527c95f5ef04c1f1fb02614f8ff43714
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101284
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov f2b3126984 Fix propagation of GenericCovariantImpl bit for type parameters
Change-Id: I81be85c0870a8a4fda4fb472aacadd915158ff6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100961
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Dmitry Stefantsov bce89db6a5 Reland "Combine override checks and override-based inference in one phase"
Original CL description:

> Combine override checks and override-based inference in one phase
>
> Change-Id: I2760f72f4eaa44bd192747179e843f017db30874
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97301
> Commit-Queue: Peter von der Ahé <ahe@google.com>
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>

Change-Id: I8408b35819a89336d10bb11e36c7b1bee707994d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100580
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Jacob MacDonald 006fd0cfab Actually set experiment flags to fix invalidation
Previously we were just getting the default experiment flags (regardless of the arg),
which never matched any experiments passed in, so we always threw away the world.

I also added invalidation based on experiment flags for DDC.

This gives overall ~20% initial build time reduction for flutter gallery, and ~30% for angular_components_example.

Change-Id: I578d9611b89d3776e45ae8d309cfe8f70c7b7edd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107188
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2019-06-24 22:52:51 +00:00
Jacob MacDonald 0fa8986a07 Use worker input digests for ddk instead of reading the full file bytes.
Also actually compare the SDK summary digest instead of assuming it doesn't change.

Most of this logic is mirroring logic in the bazel_worker.dart file that kernel uses, which eventually we should unify.

Change-Id: If33af0d8de0b0a6a17081dcd852dd036c4b34a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107184
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-24 21:17:20 +00:00
Alexander Markov 37a25d9100 [vm/bytecode] Add a compile-time error if there are too many arguments.
Issue: https://github.com/dart-lang/sdk/issues/37305
Change-Id: I9dac7c1b7b49fca8531ca2bf83b1c309d8217969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106984
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-24 16:02:05 +00:00
Johnni Winther 77668f4e58 [CFE] Preserve errors in unevaluated and unused arguments and locals
Change-Id: If8c23ac2f374ee863fd8df4c241195c0a115e69d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104980
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-21 13:53:17 +00:00