Commit Graph

600 Commits

Author SHA1 Message Date
Konstantin Shcheglov f9c1b896f4 Add test that shows that we don't include additional exports for external libraries into shaken outlines.
As promised in https://dart-review.googlesource.com/c/sdk/+/18960

Bug:
Change-Id: I33970364e04a28a174aa036456ccdc1ce3fa965b
Reviewed-on: https://dart-review.googlesource.com/19060
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-07 19:23:31 +00:00
Vyacheslav Egorov d755f87781 [kernel] Improve performance of the BinaryPrinter.
In order of importance:

* manually inline putIfAbsent invocation in StringIndexer.put;
* manually inline writeList into writeNodeList;
* don't create Switch/Label indexers eagerly. Most functions don't need them.

Before this change:

  AstToBinary(RunTimeRaw): 83019.54 us.
  AstToBinaryP50(RunTimeRaw): 80010 us.
  AstToBinaryP90(RunTimeRaw): 96234 us.

After this change:

  AstToBinary(RunTimeRaw): 57031.02 us.
  AstToBinaryP50(RunTimeRaw): 56251 us.
  AstToBinaryP90(RunTimeRaw): 60861 us.

Bug:
Change-Id: Ida2365088a51a5095c2ce8aef5f1582bc0b5b99e
Reviewed-on: https://dart-review.googlesource.com/19005
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-11-07 15:04:09 +00:00
Samir Jindel bc9645509e Revert "Revert "[kernel] Fix NoSuchMethod errors for generic functions.""
This un-revert fixes the issues revealed in https://logs.chromium.org/v/?s=chromium%2Fbb%2Fclient.dart%2Fvm-kernel-mac-release-x64-be%2F2217%2F%2B%2Frecipes%2Fsteps%2Fvm_tests%2F0%2Fstdout.

Patchset 1 contains the original revision unmodified.

This reverts commit 9029ee09c5.

Bug:
Change-Id: I109c011c2688144b00293ce50b3aad53e018a2f2
Reviewed-on: https://dart-review.googlesource.com/18340
Reviewed-by: Régis Crelier <regis@google.com>
2017-11-06 17:07:38 +00:00
Konstantin Shcheglov cd2f4a1e44 Update references to Class and TypeParameter, updates for tests.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: I8a922df8c21fe2ff54c60da989f87524b0cff56c
Reviewed-on: https://dart-review.googlesource.com/17340
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-03 18:55:11 +00:00
Samir Jindel 7b6b716071 [kernel] Don't cancel completed streams in the Async transformation.
Bug:
Change-Id: I40742b13f1b47f2817c480bfc257deaf6f1028ca
Reviewed-on: https://dart-review.googlesource.com/17820
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-03 17:03:01 +00:00
Jens Johansen dfef2338eb [kernel] Reduce context creations in BinaryBuilder
The VM creates context objects even though it's only applicable in a
non-taken branch. This CL moves such a branch into its own function
and thus avoids the context object creation when loading a dill file
eagerly.

This CL further more reduces the number of context creations by not
lazy loading basically non-existing function node bodies (e.g. the body
of a FunctionNode in the outline).

The change has the following effect when loading platform/outline
100 times after 2 seconds warmup (statistics on 5 runs):

Outline, lazy loading disabled: -12.8133% +/- 2.26214%
Outline, lazy loading enabled: -40.9197% +/- 1.50042%
Platform, lazy loading disabled: No difference proven at 95.0% confidence
Platform, lazy loading enabled: -44.3347% +/- 0.613235%

Bug:
Change-Id: I9634e0a81f43efeb4e2524edb765d36072074f1e
Reviewed-on: https://dart-review.googlesource.com/18220
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-03 08:25:11 +00:00
Samir Jindel 9029ee09c5 Revert "[kernel] Fix NoSuchMethod errors for generic functions."
This reverts commit 52e1466588.

Bug:
Change-Id: Ic1b37a5df2f50ede4f6873b6d2a701663673bcbb
Reviewed-on: https://dart-review.googlesource.com/18261
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-02 16:52:32 +00:00
Samir Jindel 52e1466588 [kernel] Fix NoSuchMethod errors for generic functions.
Bug:
Change-Id: I8ad90e34a7b1f77b29f1d711f158bcb69f5928f4
Reviewed-on: https://dart-review.googlesource.com/17941
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-11-02 15:16:08 +00:00
Samir Jindel 091f12b148 [kernel] Serialize fileOffset with SuperProperty{Get,Set}
Bug:
Change-Id: I35d568b8ce98413df36bd83837fd46cb95e98ec7
Reviewed-on: https://dart-review.googlesource.com/18184
Reviewed-by: Jens Johansen <jensj@google.com>
2017-11-02 14:11:33 +00:00
Jens Johansen 57c3f0579c [kernel] Replace for in loop in BinaryBuilder
Loading vm_platform.dill 100 times after 2 seconds warmup:
		Statistics on 5 runs:
			It varies to much to tell on the runs I did.

	Loading vm_outline.dill 100 times after 2 seconds warmup:
		Statistics on 5 runs:
			-7.84428% +/- 1.21335% at 95.0% confidence

Bug:
Change-Id: I34bbdca555ec50e1d16a5994c5cb46f845b4a4a3
Reviewed-on: https://dart-review.googlesource.com/18183
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-02 11:55:58 +00:00
Jens Johansen 4ea37a8702 [Kernel] Replace List.generate in BinaryBuilder
Changes in runtime:
	Running python tools/test.py -m release -cdartk language -j6
		Statistics on 3 runs:
			real -1.21% +/- 1% at 95.0% confidence
			user -2.01% +/- 0.29% at 95.0% confidence
			sys No difference at 95%

	Loading vm_platform.dill 100 times after 2 seconds warmup:
		Statistics on 5 runs:
			-15.3209% +/- 1.26028% at 95.0% confidence

	Loading vm_outlin.dill 100 times after 2 seconds warmup:
		Statistics on 5 runs:
			-21.9672% +/- 0.48754% at 95.0% confidence

Bug:
Change-Id: I16474e32715df57922376d88baddd17a1cf73663
Reviewed-on: https://dart-review.googlesource.com/17788
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-02 09:07:08 +00:00
Jens Johansen c8e51ef922 [kernel] Add offset to this[i] and super[i]
Bug:
Change-Id: Ic65b69c4977be834c7b69638d6c030727c7210e5
Reviewed-on: https://dart-review.googlesource.com/17441
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-01 09:57:00 +00:00
Paul Berry cd1898be16 Move ErrorFormatter and HighlightingPrinter into pkg/kernel/lib.
This will allow it to be used by front_end unit tests.

Change-Id: I7eef0f2ca361a75fd98fdd7a25abd1739f1aa1f8
Reviewed-on: https://dart-review.googlesource.com/16981
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-30 11:12:52 +00:00
Samir Jindel 031a7ffe41 [kernel] Improve Enum representation.
Dart2JS and the VM prefer for Enum names to be stored inline in the Enum
object to avoid having the static array of all Enum values. A base class
for Enums is provided to avoid repeating the common fields and accessors
between Enum definitions.

Bug:
Change-Id: I783f863015b45f13317fda06e627d14844fe2ddf
Reviewed-on: https://dart-review.googlesource.com/16526
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-27 12:10:53 +00:00
Jens Johansen 07b6ec3425 [kernel] Allow VM to load concatenated dill file
The kernel format has been designed so that one can concatenate several
dill files into one file and then load it. For instance the dart
function BinaryBuilder.readProgram supports this.

Currently a dill file contains one or more programs.
In the VM each of these programs are called either program or subprogram.
Technically a dill "program" isn't necessarily a program at all (e.g. it
could be missing a library).
This naming snafu should probably be cleaned up at some point, but that's
for another CL.

When loading a dill file via BinaryBuilder.readProgram what happens is
this:
- Each program in the dill file ends in 4 bytes that indicates the size
  of the program.
- Reading the input from the end one can then read the size, skip back
  that amount of bytes, if we have more data (i.e. there's another
  program), read another size and so on, and continue until we have
  accounted for all bytes in the input.
- We then read each program from the start, and basically overwrite any
  library, class, procedure etc. we find.
  The first main reference found is the one used though.
  (Saying that we overwrite is not completely true, but when the library
  is a non-external library that's basically what happens).

This CL introduces (some) support on the C++ side for the same thing.
So far the C++ side could only handle single-program-dills, and trying
to load anything else would probably crash the VM.
The support added is this:
- Assume the SDK (i.e. vm_platform.dill) is not a concatenated file
  (error out if it is).
- For user provided input, loop over each contained program one-by-one,
  for each individual one behave as normal.
- The way LibraryLoad is implemented (i.e. it skips if the library is
  already loaded) this means that it currently would behave differently
  than the dart version (i.e. the first one is used, not the last one).
  For now it is assumed that that's not a problem.
- There is a possibly snafu if the same script is included several times.
  This could probably mostly be remedied by not creating scripts up front,
  but only as needed. By the "keep only one" (and fixing the above point,
  probably by simply loading in the opposite order, i.e. last program
  in the binary first) the (theoretical) problem would probably do away.

Note that we will have separate string tables, canonical name tables etc
per "sub program" and that there might be some duplication.

The implementation was tested as indicated below, but introduces no tests.

$ cat test_lib1.dart
import "test_lib2.dart" as lib2;

String lib1field = "lib #1 field!!";

main() {
  foo();
  lib2.foo();
  print("From lib2: ${lib2.lib2field}");
}

foo() {
  print("Hello, Foo, from test_lib1!");
  var x = 42;
  print(x);
}
$ cat test_lib2.dart
String lib2field = "Lib #2 field!!!!";

foo() {
  print("Hello, Foo, from test_lib2!");
  var y = 34;
  print(y);
}

$ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart --packages=.packages --platform=out/ReleaseX64/vm_platform.dill test_lib1.dart

$ ls -lha test_lib1.dart.dill
[...] 4.2M Oct 26 14:42 test_lib1.dart.dill

$ dart pkg/kernel/bin/split.dart test_lib1.dart.dill
Wrote test_lib1.dart.dill.part1.dill
Wrote test_lib1.dart.dill.part2.dill

$ ls -lha test_lib1.dart.dill.part{1,2}.dill
[...] 811 Oct 26 14:42 test_lib1.dart.dill.part1.dill
[...] 582 Oct 26 14:42 test_lib1.dart.dill.part2.dill

$ cat test_lib1.dart.dill.part1.dill test_lib1.dart.dill.part2.dill > test_lib1.dart.dill.concat.dill

$ ls -lha test_lib1.dart.dill.concat.dill
[...] 1.4K Oct 26 14:44 test_lib1.dart.dill.concat.dill

$ out/ReleaseX64/dart --kernel-binaries=out/ReleaseX64 --packages=.packages test_lib1.dart.dill.concat.dill
Hello, Foo, from test_lib1!
42
Hello, Foo, from test_lib2!
34
From lib2: Lib #2 field!!!!

Change-Id: I233a033aa3042b202dd4708908a5be3089474588
Reviewed-on: https://dart-review.googlesource.com/16820
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-10-27 12:01:48 +00:00
Jason Simmons 81c8e2bfc4 Remove Flutter diagnostic server
Bug:
Change-Id: I729f60ad310c3d864273687fe46b9b93d4696772
Reviewed-on: https://dart-review.googlesource.com/16882
Reviewed-by: Alexander Aprelev <aam@google.com>
2017-10-27 03:50:59 +00:00
Peter von der Ahé a18358482e Don't crash if there's no enclosing program.
Change-Id: If526d29a0fcbf9cc787127b73725088c05565efe
Reviewed-on: https://dart-review.googlesource.com/16544
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-10-26 15:38:11 +00:00
Paul Berry cc3f95b41d Check procedure kind when matching up forwarding stubs during mixin resolution.
Otherwise we might match up a getter to a setter and crash.

The test cases indirectly verify that mixin resolution does the right
thing by checking the semantics of the generated code.  These tests do
not pass yet, because covariance checks are not yet implemented in the
VM.

Change-Id: Ibe6d8b7479f86151c515c45c20ed7c880bf2ad43
Reviewed-on: https://dart-review.googlesource.com/16686
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-26 12:54:08 +00:00
Karl Klose 6a0ef10862 Move error formatting out of the type checker
Change-Id: Ib4860e15950912f8a0108886c21741bdb11b4bd3
Reviewed-on: https://dart-review.googlesource.com/16528
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-10-26 07:38:40 +00:00
Karl Klose 51089b53cd Remove strong mode type check insertion transformations
Change-Id: I7f4bb08b32b0ecf5af4d60af0a5b5b3a2e41c49a
Reviewed-on: https://dart-review.googlesource.com/16482
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2017-10-26 07:32:00 +00:00
Paul Berry 7bb6369db6 Move naive type checker into pkg/kernel/lib.
This will allow it to be used by front_end unit tests.

Also plumb through the "ignoreSdk" boolean, since we will need to use
it when invoking the naive type checker from front_end unit tests.

Change-Id: I9ae50f48e24a5c45e93f4218e6b61f193f549e7a
Reviewed-on: https://dart-review.googlesource.com/16601
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-25 18:55:37 +00:00
Alexander Markov 1d629221d1 Wrap the description of an option to fit within 80 columns
This is the follow-up for review comment

https://dart-review.googlesource.com/c/sdk/+/15644/2/pkg/kernel/lib/target/implementation_option.dart#10

to the CL 34df7f3599.

Change-Id: If0c17e36bbfb42df0aa410b04e5830ebd979d3cd
Reviewed-on: https://dart-review.googlesource.com/16301
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-10-25 17:27:49 +00:00
Karl Klose ed390e7bad Change imports in reify transformation to not use 'package:'
R=dmitryas@google.com

Change-Id: If2e1f735de9f3879fcf321af5d5fa00e291e28a8
Reviewed-on: https://dart-review.googlesource.com/16460
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2017-10-25 11:25:00 +00:00
Jens Johansen f94ffbf624 [kernel] Move procedure lazy loading to function node body
Previously lazy loading was done in Procedure by lazy loading functionNode,
now lazy loading is done (only through Procedure) in the functionNode by
lazy loading the body.

Bug:
Change-Id: I25cc86d038123ed4992162b65aa95781ea2c56e8
Reviewed-on: https://dart-review.googlesource.com/15560
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-25 08:45:59 +00:00
Kevin Millikin 034501e805 Handle forwarding stubs in mixin application classes
Before: mixin application classes could not have methods of their
own.

After: type inference will sometimes insert forwarding stubs in mixin
application classes.  In the mixin elimination transformation, these
forwarding stubs are replaced with the methods of the mixin class if
they have the same name, but the parameter flags from the forwarding
stub are retained.  The other forwarding stubs are left as methods of
the class.
Change-Id: I5ee89d6b1fc83194df82009c2800b54ce856e8c5
Reviewed-on: https://dart-review.googlesource.com/15887
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2017-10-24 08:04:18 +00:00
Alexander Aprelev b6d7ad59dc Include dart:diagnostic_server into flutter patched sdk.
Bug: https://github.com/dart-lang/sdk/issues/31145
Change-Id: Id9cd5e484d108f62d1008cd07dc3d4e0eb05d598
Reviewed-on: https://dart-review.googlesource.com/15920
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-10-23 21:29:09 +00:00
Alexander Markov 34df7f3599 Wire up strong-aot implementation option
This CL adds handling of previously introduced 'strong-aot'
implementation (target-specific) option into VM target.

After this change, it will be possible to enable strong-mode
whole-program optimizations in Flutter (in addition to standalone VM).

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I054b75ce4ba1b9bcf150e0b7f25fa7ca1bdd187e
Reviewed-on: https://dart-review.googlesource.com/15644
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-10-23 16:57:17 +00:00
Vyacheslav Egorov a7809d6f2e [kernel] SyncYielding functions created from SyncStar are expected to return bool
Change TypeCheckingVisitor._getInternalReturnType to reflect this assumption.

Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: Ib0b06b41acc6b0b7eabe9eaa9b0fe80a8b85f7ad
Reviewed-on: https://dart-review.googlesource.com/15124
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-10-23 14:40:57 +00:00
Sigmund Cherem bc1dd524ba Use custom URIs on most of front_end unit tests
This required a couple small fixes where we had made assumptions in our system
about not having anything other than dart, package, and file URIs.

Change-Id: Ie0943f609ceeaacf3fb284ceba0df5c55c315b0b
Reviewed-on: https://dart-review.googlesource.com/11650
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-21 00:26:58 +00:00
Vyacheslav Egorov 9cd7bc724d [VM, Kernel] Fix sync* implementation in checked mode
Change abefb7b432 introduced a typing issue
instead of fixing it: _SyncIterator<T>._current was actually used to return
either a value of type T (for yield) or value of type Iterable<T> (for yield*)
from the move callback.

This change refactors implementation of _SyncIterator in such a way that
_current is only used to return value for yield and a separate field
_yieldEachIterable is used to return Iterable<T> for yield*.

Change-Id: I3e3c832bbc8986d6976ddbb0856a1b5a127d845b
Reviewed-on: https://dart-review.googlesource.com/15542
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-10-20 18:15:28 +00:00
kmillikin 809a549494 Do not clone forwarding stubs in mixin applications
Forwarding stubs are added to a class for when calls target that
class's interface.  When a class is used as a mixin, these forwarding
stubs should not be copied into the mixin application class.

Fixes https://github.com/dart-lang/sdk/issues/31135

Change-Id: If516210391fed83ddeb150faca42b6df4049da12
Reviewed-on: https://dart-review.googlesource.com/15600
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2017-10-20 16:49:38 +00:00
Peter von der Ahé ae0ac23e80 Prototype BulkCompiler API for fuzz testing.
Change-Id: Icf9134dccfa02ff36167287cd63abe9886e0f2e4
Reviewed-on: https://dart-review.googlesource.com/13985
Reviewed-by: Luke Church <lukechurch@google.com>
2017-10-20 12:44:15 +00:00
Vyacheslav Egorov 587a7cfae5 [kernel] TypeCheckingVisitor.getReceiverType should respect promoted bounds
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: I6e1238e4622c5af089cbc6962b07a7eaf9aa6c32
Reviewed-on: https://dart-review.googlesource.com/15125
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-10-19 14:24:27 +00:00
Konstantin Shcheglov c3a76ed636 Move all documentation comments into metadata.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: I05382fe275e7a3a0f18128508d30fe1438adffc4
Reviewed-on: https://dart-review.googlesource.com/14623
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-10-18 14:48:56 +00:00
Paul Berry dca8a9acf5 Make it possible to distinguish "as" checks that come from generic covariance.
Change-Id: Ie230e6ca3ae28a0f4a6faaf5cb559426de0d8a0e
Reviewed-on: https://dart-review.googlesource.com/14361
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-18 09:16:05 +00:00
Samir Jindel d794eb3330 [kernel] No metadata for types.
Since 'DartType's overload equality with a structural comparison, we cannot
store metadata for them in a 'Map', as is done for 'TreeNode's. Since there is
no use-case yet for storing metadata on types, we remove this ability and the
restrict the metadata test.

Bug:
Change-Id: I825f55a5fd48da2c615b3154f909dd666baf5a33
Reviewed-on: https://dart-review.googlesource.com/14640
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-10-17 23:44:35 +00:00
Vyacheslav Egorov abefb7b432 [kernel] Assign proper types and interface targets to nodes created by async transformer.
Bug: https://github.com/dart-lang/sdk/issues/31070
Change-Id: Iaedbd425fcb6d243c0bfa93495335658553a9301
Reviewed-on: https://dart-review.googlesource.com/14481
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-10-17 17:44:00 +00:00
Paul Berry 9a0e962e67 Add a kernel flag to represent generic contravariance.
This flag indicates when a procedure's return type makes contravariant
use of a class type parameter.  The front end will have to insert "as"
checks at any call sites that refer to such a procedure as their
interface target.  Placing the flag on the procedure will allow the
front end to determine whether the check is needed once, at the same
time as it's determining the need for covariant parameter checks,
rather than when compiling individual call sites.

Once this lands I will follow up with CLs that cause the front end to
set the flag appropriately, and to generate the necessary "as" checks.

Change-Id: I989fc702bc233384eb5ea8cd630c8efd384ab248
Reviewed-on: https://dart-review.googlesource.com/14365
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-17 05:24:21 +00:00
Samir Jindel ab5afac660 [kernel] Add const constructors to visitors.
Bug: 30809
Change-Id: I46da961a2320bdb7cf8eb315777f4f8ffc641d13
Reviewed-on: https://dart-review.googlesource.com/12580
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-17 00:09:20 +00:00
Samir Jindel dd0d299dcb [kernel] Un-revert support for generic function types and removing type erasure.
Change-Id: I8032e4622a0756199528a61fdb59f3d0ec132d1f
Reviewed-on: https://dart-review.googlesource.com/14202
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-10-16 23:17:09 +00:00
Samir Jindel dcf48efa23 [kernel] Un-revert support for generic closures in VM's kernel frontend.
Change-Id: I09dbcfdb13600fe694863db628b379bcf1f56684
Reviewed-on: https://dart-review.googlesource.com/14200
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-10-16 22:27:03 +00:00
Konstantin Shcheglov 26d0486de2 Fix serializing metadata when using LimitedBinaryPrinter.
TBR

This also fixes a race condition on Windows, where we sometimes
consume not serialized/deserialized Kernel.

R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: Ie40534d2562e75c05618e9ccb4fb86fc499184ff
Reviewed-on: https://dart-review.googlesource.com/14260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-16 21:57:39 +00:00
Konstantin Shcheglov 6b5ba5351b Implement combining outlines for top-level declarations.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: Id849e68d3026457bdddb98604b92c7424961bbd9
Reviewed-on: https://dart-review.googlesource.com/11649
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-10-13 20:32:24 +00:00
Paul Berry 27f5e7f9ee Remove ClassHierarchy.forEachCrossOverridePair.
This method is no longer needed, since the front end iterates through
members directly to find cross overrides.

Change-Id: Ibc5180962a097c4d6194dbf4cbd1a0dea15050c2
Reviewed-on: https://dart-review.googlesource.com/13582
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-13 20:28:55 +00:00
Régis Crelier ae94cbf3d6 Revert "[kernel] Support generic closures in VM's kernel frontend."
This reverts commit a273ff8314.

Revert "[kernel] Support generic function types in the VM's kernel frontend."

This reverts commit 2cac57da09.

Revert "[kernel] Completely remove type erasure."

This reverts commit 3ffacb3814.

Change-Id: I8fdd40a6a8f34911028353f48249fdd4bf7dba76
Reviewed-on: https://dart-review.googlesource.com/13622
Reviewed-by: Alan Knight <alanknight@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-10-12 20:01:11 +00:00
Alexander Markov 8e5c172b43 [Kernel, VM] Add internal kernel binary format version
This CL adds internal binary format version to kernel binaries.
Kernel readers in the front-end and VM verify that the reader's format
version matches the format version in the binary file.
This improves detection and diagnostics of stale kernel binary files.

Change-Id: Ic69b16057397a84627040bdd6420ffa1852a4b3f
Reviewed-on: https://dart-review.googlesource.com/13280
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-10-12 16:50:21 +00:00
Samir Jindel 3ffacb3814 [kernel] Completely remove type erasure.
Bug:
Change-Id: I146db24f3f745d9f87560b051f3e57b784de1cb4
Reviewed-on: https://dart-review.googlesource.com/12294
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-12 15:34:21 +00:00
Samir Jindel 2cac57da09 [kernel] Support generic function types in the VM's kernel frontend.
Bug:
Change-Id: I3554562b409b35478437601f34e6263615409b38
Reviewed-on: https://dart-review.googlesource.com/12292
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-10-12 14:45:21 +00:00
Samir Jindel a273ff8314 [kernel] Support generic closures in VM's kernel frontend.
Change-Id: I0866971dc633c27df55811cba734d7cca0e849d4
Reviewed-on: https://dart-review.googlesource.com/12290
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-10-12 13:53:21 +00:00
Paul Berry b474f5e754 Process getters and setters together when creating forwarding nodes.
This will be necessary when we try to integrate type inference with
the creation of forwarding nodes, because getter types can be inferred
from inherited setters and vice versa.

We accomplish this by producing two separate lists (getters and
setters), then merging them together.  This results in a list where
correspondingly-named getters and setters are grouped together, with
getters appearing before setters.

Change-Id: I549f0b4354370753a6aa7a15285d778980fb4841
Reviewed-on: https://dart-review.googlesource.com/12900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 14:35:41 +00:00