Commit Graph

744 Commits

Author SHA1 Message Date
Jens Johansen 3692c0285a [kernel] Allow ast_to_text to print 'partial' dills
Currently we produce 'partial dills' for the VM when compiling through
kernel, i.e. we only include the user-code and whatever canonical names
the user refers to. That's perfectly fine for the VM as it always loads
the platform.dill file too.

We cannot currently print it though.
(Technically we should be able to concatenate it with platform.dill and
print that).

This CL allows us to print these partial dills without concatenating
anything first.

Bug:
Change-Id: I7d5f12332e16623d02531ad46e2dc103222f59e9
Reviewed-on: https://dart-review.googlesource.com/19002
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-11-17 11:02:33 +00:00
Martin Kustermann d354a28cb2 [kernel] Add kernel2kernel constant evaluation, binary format as well as vm support
The introduced "constants" transformation can evaluate constant expressions.  The
original use-sites of constant expressions are replaced by a new [ConstantExpression]
node, which points to a subclass of a new [Constant] class hierarchy.  Constant
[Field]s and [VariableDeclarations]s will be removed, since all use-sites are
re-written.

The [Constant] class hierarchy is, similarly to the [DartType] class hierarchy, not
part of the AST tree (also has no parent pointer).  The constants form a
DAG (directed acyclic graph).

There is no canonicalization requirement of the [Constant] objects referenced by the
AST (via [ConstantExpression]).  Although it is beneficial to canonicalize them during
construction, since it reduces time spent in operator==/hashCode.

This CL furthermore adds support for a constant table in the binary format.  Similarly
to [String]s, we canonicalize the constants before writing the table to the binary.
The constant table entries in the binary are written in a post-order way, to ensure
easy construction on the backend side.

The text format will be augmented with a "constants { ... }" section at the end,
which lists the constants in the same order as in the binary format.

The transformation can be used by those backends who choose to do so.  It is not
enabled by default atm.  It should therefore not affect analyzer, fasta or other
components.

Change-Id: I57cd9624fedcf537ab6870db76246149647bed21
Reviewed-on: https://dart-review.googlesource.com/14382
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-11-16 11:08:02 +00:00
Kevin Millikin 02511ceeb4 Fix the precedence of FunctionExpression
FunctionExpression should have a low precedence to ensure that it is
properly parenthesized.

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

Bug:
Change-Id: I2ca2bb728973c5b374411dc07fdadc4dda8c707b
Reviewed-on: https://dart-review.googlesource.com/21343
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2017-11-16 10:38:12 +00:00
Vyacheslav Egorov c847cbd5e4 [VM, Kernel] Use T as a Completer type argument in async transformation.
Previously we used FutureOr<T> by mistake.

This causes the code construct a much more meaningful type Future<T> not

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

Bug:
Change-Id: I38d4e4101b81bb33d53a87385ebcf60302f6764f
Reviewed-on: https://dart-review.googlesource.com/21081
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-11-15 14:05:32 +00:00
Zachary Anderson 1113d6adb1 Fix missed vmservice_sky -> vmservice_io rename
Change-Id: I9a8fb047ea361a99949e80394733e30a70851de7
Reviewed-on: https://dart-review.googlesource.com/20904
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-14 22:13:06 +00:00
Aske Simon Christensen 4b3bb06c4f Put no bound on substituted type when substitution has no bound.
Closes https://github.com/dart-lang/sdk/issues/31181

Change-Id: Iace1771f1adcf029049ee8e7f8903017f512ed46
Reviewed-on: https://dart-review.googlesource.com/20022
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2017-11-10 13:15:08 +00:00
Siva Annamalai c29b19fb34 - Do not generate a separate vmservice kernel file, include it in vm_platform file
- Load vmservice_io library only in the service isolate or when an AOT snapshot is being generated

This should account for the following issues:
- https://github.com/dart-lang/sdk/issues/31203 - there should be a vmservice_io_strong.dill file
- https://github.com/dart-lang/sdk/issues/30158 - Consider extracting flutter vmservice_sky into
                                                  separate .dill from platform.dill
- https://github.com/dart-lang/sdk/issues/30111 - support compiling vmservice with an external
                                                  outline of the sdk

Bug:
Change-Id: If945ec05afe8127e288e8d3b55172c0f7c3d6e7a
Reviewed-on: https://dart-review.googlesource.com/18147
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Chandra <sivachandra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2017-11-09 19:05:15 +00:00
Jens Johansen c72b19a012 [kernel] Optimize BinaryPrinter slightly more
This CL basically:
 - Manually inlines writeAnnotationList.
 - Writes 2 and 4 byte uint30s and uint32 more effeciently in the general
   case (idea stolen from Slava).

Benchmarking 10 times with binary_bench gives the following:
 - vm_platform.dill: -10.02% +/- 0.93%
 - vm_outline.dill: -12.45% +/- 1.66%



Bug:
Change-Id: I79354b260e37cbbced0557069ae63817fac0f333
Reviewed-on: https://dart-review.googlesource.com/19188
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-11-09 10:28:20 +00:00
Alexander Aprelev 1a45ad96ca Move super resolution from kernel transformation to VM flow graph construction.
Super resolution kernel transformation updates kernel graph with
resolved static calls in place, which breaks incremental modular nature
of transformations.

Bug: dartbug.com/31043
Change-Id: I7ec52d29ea03652cae1403dd89552b30686a5749
Reviewed-on: https://dart-review.googlesource.com/18320
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2017-11-08 20:17:51 +00:00
Konstantin Shcheglov 6541c720e5 Update mock SDK and shaker to include required declarations.
Bug:
Change-Id: I585daea4bb4315d01333a6515c809e3a862b44e5
Reviewed-on: https://dart-review.googlesource.com/19064
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-08 01:19:50 +00:00
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
Vyacheslav Egorov 9ccc2877eb [kernel] Update binary_bench to use a single name for each benchmark.
Previously we used one name for command line argument and one name for
output.

Bug:
Change-Id: Idc422f077e77cd932a27380d49e2c0b061a6b716
Reviewed-on: https://dart-review.googlesource.com/19001
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-11-07 09:21:49 +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
Vyacheslav Egorov 8306f07fb6 [kernel] Add pkg/kernel/test/binary_bench.dart.
This file implements a simple benchmark for kernel serialization and
deserialization routines.

Change-Id: Ib67745a4176c2bcf5717395af86d724ffbb164fd
Reviewed-on: https://dart-review.googlesource.com/18185
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-11-02 15:09:48 +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 b46375ef7b Fix reporting of source lines
R=vegorov@google.com

Change-Id: I3efa2d8be318a6dc58dce6924bcca7ac0d97609f
Reviewed-on: https://dart-review.googlesource.com/16484
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2017-10-26 12:08:21 +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
P.Y. Laligand ce79a77331 Remove Fuchsia-specific build files.
Also fix Fuchsia tools to account for new project location (//third_party/dart).

Change-Id: If89a934729c4fa44229eaca83219dbdf8bb700a8
Bug:
Reviewed-on: https://dart-review.googlesource.com/14800
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-10-19 17:52:37 +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