Commit Graph

218 Commits

Author SHA1 Message Date
Peter von der Ahé 5b32ab3be6 Remove the word "strongMode" from some package:kernel libraries.
Temporarily using "legacyMode" instead, but I plan to rid these soon.

Change-Id: Iff8bcde03b6ebe4ad95f963f456c855e73e58926
Reviewed-on: https://dart-review.googlesource.com/c/79042
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-11 08:50:43 +00:00
G?nter Z?chbauer 2da0b9f4f1 fix some typos
Closes #34738
https://github.com/dart-lang/sdk/pull/34738

GitOrigin-RevId: d211bbacfe65355cf7304c990ffb6c79d7a229cf
Change-Id: If690e6d378e543b300e1f6a353ceae73e39c29db
Reviewed-on: https://dart-review.googlesource.com/c/78900
Reviewed-by: Alexander Thomas <athom@google.com>
2018-10-10 19:15:30 +00:00
Peter von der Ahé f942af451b Remove kernel interpreter
The test isn't normally run, and all 12 testcases caused a crash.

Change-Id: Ie1576e32b70f01aa775c3305bff2bc992eebf86f
Reviewed-on: https://dart-review.googlesource.com/c/78940
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-10 08:42:21 +00:00
Aske Simon Christensen bb2775b16a Only perform override check on declared members.
The code in class_hierarchy.dart that looped over override pairs
included implementations inherited from its superclass as potential
overriders, presumably in a broken attempt to include some interface
checks into the mix.

With this problem fixed, the special case in kernel_class_builder.dart
that excluded overriders not declared in the current class (i.e.
declared in a mixin) could be removed without incurring false
positives.

These override checks performed on members from a mixin produce an
extra context message indicating the class where the two members meet,
giving rise to the override relation (similarly to interface checks).

Since the same member can now override more than one member (or even
the same member more than once), the diagnostics message duplication
check has been extended to also include the context in the comparison.

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

Change-Id: I990e5719ae1749fd1aad1ad478aaa6e173cb170b
Reviewed-on: https://dart-review.googlesource.com/c/76900
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-10-03 14:56:43 +00:00
Aske Simon Christensen d3bd06d4e8 Check class interface requirements using override check code.
When a member in the interface of a non-abstract class is found to
have an implementation with the correct name which does not override
the representative declaration of the member in the interface (and thus
has not been checked against that member for override validity), call
the override check to check interface validity.

Override relations thus checked produce an extra context message
explaining that the override relation must hold because both members
are inherited by a non-abstract class.

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

Change-Id: I955f057e35fa30f33c19da37c9cea1262042431c
Reviewed-on: https://dart-review.googlesource.com/c/74642
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-03 14:56:43 +00:00
Peter von der Ahé 29d57107dd Move dependency_walker to package:analyzer
Change-Id: I9882c2be31366cc85a1623a2b324ce4ec200aa20
Reviewed-on: https://dart-review.googlesource.com/c/77804
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-03 12:25:06 +00:00
Kevin Millikin d8931dafa7 Use the Dart 2 platform in a pair of package tests
Change a pair of package tests that relied on the existence of the
VM's Dart 1 platform Kernel binary.  Use the Dart 2 platform instead,
becuase the VM will stop supporting Dart 1 in the future.

Change-Id: Ic93488974d9ed53cd205dcc24e0455a26b5f71b2
Reviewed-on: https://dart-review.googlesource.com/71246
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-08-29 22:11:58 +00:00
Jens Johansen 57d48dcc9f Fix bug in incremental compiler, only later using initialized type
Before this CL, if initializing from a dill file containing a class,
say A, but it wasn't used, and then later using it as a type, say
'A a = new A()', the class hierarchy would complain about not knowing A.

This was caused by the class hierarchy initially being constructed using
the full component of the first compile (i.e. in the example above
without any usage of A and thus without including A), and subsequent
compiles telling the class hierarchy about new classes created in that
compile. The problem was, that if the class was loaded from a dill file
(in the example above 'A' was such a class) it would never be included
if not a part of the first full component.

This CL fixes it by changing the interface to the class hierarchys
`applyTreeChanges` function and letting the class hierarchy know about
libraries too: It will now basically just be given the full component
when asked to update, and just update with the libraries it doesn't
already know about. In the example above that would - once using 'A' -
include 'A'.

Change-Id: I895100b51659938636da0bca6c80516d87b57a24
Reviewed-on: https://dart-review.googlesource.com/69302
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-16 13:26:08 +00:00
Sam Rawlins 57918dad37 Fix some new 'missing_return' errors in kernel
Change-Id: I561ca47e698f51c01d998c7b347436f2993a6cae
Reviewed-on: https://dart-review.googlesource.com/69540
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-14 16:14:15 +00:00
Leaf Petersen b5fe750007 Strong mode fixes to kernel and dart2js
Change-Id: Ic51e0bbc31cf993ffb7d2ec6909b96c7ace964ed
Reviewed-on: https://dart-review.googlesource.com/63342
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2018-07-10 19:19:24 +00:00
Kevin Millikin 6213303e65 Fix some runtime check failures in tests
Fix some Dart 2 runtime check failures due to inferred List<dynamic>.

Change-Id: I09215629d4d6c70cd56930b0d19de2a092a7facd
Reviewed-on: https://dart-review.googlesource.com/58208
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-06-06 08:09:58 +00:00
Jens Johansen 9d05ada522 Renamings and updated comments in class hierarchy #2
Follow-up to https://dart-review.googlesource.com/c/sdk/+/53804.

Change-Id: I8359985f60207ef92c365c9a6e3833be181b49be
Reviewed-on: https://dart-review.googlesource.com/55162
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-15 10:12:32 +00:00
Jens Johansen f08f61e84d Incremental ClassHierarchy
This CL turns the ClassHierarchy incremental and use that in two places:

* When compiling incrementally
* When performing the second ClassHierarchy computation after adding
  forwarding stubs.

Change-Id: I7046d6be9d7673dc0783a98789b5a25183b44799
Reviewed-on: https://dart-review.googlesource.com/53804
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-15 07:37:09 +00:00
Alexander Markov 344c68e54c [kernel, vm] Revise how metadata is written in kernel binaries
Metadata is no longer written ahead of all nodes. Instead, metadata for
each node is written in the same context as the node itself (into a separate
buffer). This allows metadata to contain (serialize) arbitrary nodes
(for example, arbitrary DartTypes) and use serialization context of parent
nodes (such as declared type parameters).

However, with this change metadata looses the ability to reference
arbitrary AST nodes. This ability was overly restricted and had no
practical uses. (It was not possible to reference nodes which are not
reachable from root Component. As a consequence, it was not possible to
write references to arbitrary DartTypes.)

This change aligns the serialization capabilities of metadata with
how kernel AST nodes are serialized.

Change-Id: I027299a33b599b62572eccd4aa7083ad1dd2b3b3
Reviewed-on: https://dart-review.googlesource.com/54481
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-05-15 00:41:08 +00:00
Peter von der Ahé 02cd63eefd Remove unused closure conversion
Change-Id: I0edbbd29a4cc603e7479023bc0e8869c78ca7bcc
Reviewed-on: https://dart-review.googlesource.com/54225
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-05-14 14:58:17 +00:00
Peter von der Ahé bc86dc1dd6 Remove unused reify transformation
Change-Id: I4d29e3372b9aaf6bc7f1849e9fc0fb27f63e5c5f
Reviewed-on: https://dart-review.googlesource.com/54223
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Karl Klose <karlklose@google.com>
2018-05-14 14:48:57 +00:00
Jens Johansen 7b3ba3f41f ClassHierarchy refactorings
This CL:
* Removes unused functions in the ClassHierarchy
* Turns the data structures used in the ClassHierarchy upside down
  (nodes have a lists of supers instead of lists of subs)
* Factors some things that needs the original list-of-subs into another
  class that the user can ask the ClassHierarchy to compute if needed.
  It appears that it isn't generally.

This is step #1 in turning the ClassHierarchy into an incremental
ClassHierarchy.

Change-Id: I48c5731c01c1b0e8bf1fcd4ddba7f2bf7ce3b9c9
Reviewed-on: https://dart-review.googlesource.com/53662
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-14 11:33:20 +00:00
Peter von der Ahé b4206bb92c Remove dartk
Change-Id: Iac6cea06fd5ec6b37ded21943f59013c94d0d16f
Reviewed-on: https://dart-review.googlesource.com/47440
Reviewed-by: Jens Johansen <jensj@google.com>
2018-03-22 08:58:59 +00:00
Peter von der Ahé 4f2bdff90b Rename Program to Component
Change-Id: I1a3cc03fba9783807fa637a9d42fdbad68ee7686
Reviewed-on: https://dart-review.googlesource.com/31040
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-03-15 12:22:23 +00:00
Kevin Millikin 1abf929476 Fix some uses of deprecated API
Fix all deprecation warnings in the kernel and vm packages.

Change-Id: I44e5b128cc8fbc1360ad4c49ecdf2aa7cfd269d8
Reviewed-on: https://dart-review.googlesource.com/46720
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-03-15 10:09:23 +00:00
Dmitry Stefantsov cdd228510b Move computeStrongComponents utility to pkg/kernel
Change-Id: I5f8f87875b8d65859dcbb21c74586c842389d9d1
Reviewed-on: https://dart-review.googlesource.com/42440
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-21 12:02:04 +00:00
Jens Johansen bd94ab5068 [kernel] Test bootstapping from dill with deferred library
This CL adds a test that bootstraps from a dill with a deferred library
in it. Before this CL it crashed, see bug #32245.

This CL "double fixes" the problem:
a) When lazy loading a dill file the _currentLibrary variable wasn't set
   properly. This has been fixed.
b) When bootstrapping from a dill file, (almost) everything in the dill
   will be included in the output so lazy loading it doesn't make sense.

Bug: 32245.
Change-Id: I94980608e19633fd31b522651a4a05b9cf7beabd
Reviewed-on: https://dart-review.googlesource.com/42600
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-02-21 09:39:24 +00:00
Siva Chandra 6ff0951bdf Remove the use of redundant flags --dfe and --kernel-binaries.
This change helps in confining flag manipulation to just the embedder.
When we are ready to turn all dart 2 flags to true by default, the
change can be confined to just the VM.

Change-Id: I4ac550c331b1f236a2bd9d0453b7c567eb0c05d3
Reviewed-on: https://dart-review.googlesource.com/38881
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-08 20:56:22 +00:00
Alexander Markov 32396138ff [CFE, VM] Improve efficiency of CHA-based devirtualization
Implemented more efficient way to iterate ClassSet in class_hierarchy.dart,
ClassSet becomes Iterable<Class>. This considerably improves speed of
ClosedWorldClassHierarchy.getSingleTargetForInterfaceInvocation() and
CHA-based devirtualization.

Time of CHA-based devirtualization on Flutter Gallery reduced
from ~13.4s to ~1.2s.

Also, ClassHierarchy used in devirtualization is configured to ignore
ambiguous supertypes to avoid crashes on Flutter Gallery.

Change-Id: Iaca251ca268aad3d8bb652247650096f19c25839
Reviewed-on: https://dart-review.googlesource.com/38960
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-07 18:32:39 +00:00
Peter von der Ahé 6e4e931309 Ensure duplicated members also have a default supertype
Change-Id: I33b6fa0fef116f20d382dd77644476d05f1378c5
Reviewed-on: https://dart-review.googlesource.com/35661
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-01-18 16:50:14 +00:00
Peter von der Ahé 4d1adf42d3 Deprecate IncrementalClassHierarchy
See https://github.com/dart-lang/sdk/issues/31842

Change-Id: I019909831a91a4e06138dc3a6bf32f766bca1ae6
Reviewed-on: https://dart-review.googlesource.com/34880
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-17 13:30:17 +00:00
Peter von der Ahé 1bca76d012 Convert Platform.resolvedExecutable to URI correctly
Change-Id: I583b98277b1c62328885c775fcb712823c9ff405
Reviewed-on: https://dart-review.googlesource.com/34860
Reviewed-by: Alexander Thomas <athom@google.com>
2018-01-16 14:24:52 +00:00
Jens Johansen dab5ac348b [kernel] Remove unused file
Bug:
Change-Id: I6a14d9f70d90bb59c26370b3aa62c8b30722cb58
Reviewed-on: https://dart-review.googlesource.com/32041
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-04 10:20:56 +00:00
Aske Simon Christensen de2ce48e17 Finish type variables earlier so their bounds are available when building the program.
Check bounds in verifier.
Fixed an inconsistency in the printing of parent nodes in the verifier.

Closes https://github.com/dart-lang/sdk/issues/30838
Closes https://github.com/dart-lang/sdk/issues/31213
Closes https://github.com/dart-lang/sdk/issues/31700

Change-Id: I328ca2c5bfa01a6753a806abd2510c98fa2b7cfe
Reviewed-on: https://dart-review.googlesource.com/22500
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-22 11:06:52 +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
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 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
Peter von der Ahé b96ac4520a Update most clients to use computePlatformBinariesLocation.
Change-Id: I6e6960c471b2fab3f0cd8a672da05d7699217410
Reviewed-on: https://dart-review.googlesource.com/12291
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-17 10:48:40 +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
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
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
Peter von der Ahé 16aa720d27 Remove compiling platform.dill from patch_sdk.dart
This separates compiling platform.dill files from the patch_sdk.dart
script. The motivation for that is that I'm working on reading patch
files directly from Fasta, so we can completely remove the build step
for generating patched_sdk and dart2js_patched_sdk.

Short-term this should allow Paul to add a strong-mode version of
platform.dill without causing to many conflicts with my work on
patches.

Change-Id: I1150845b2986348d4fffe27092701d8a9b57ea54
Reviewed-on: https://dart-review.googlesource.com/11506
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-06 15:34:37 +00:00
Vyacheslav Egorov 8ee26d8a19 [kernel] Make TypeEnvironment.strongMode into a field instead of getter.
This allows creating strong mode TypeEnvironments without actually subclassing
it.

Make SubtypeTester.isBottom treat Null as Bottom in strong mode.

Bug:
Change-Id: Icdd1a4b736ce0fe839a6ef30cf24487111f32d25
Reviewed-on: https://dart-review.googlesource.com/11882
Reviewed-by: Paul Berry <paulberry@google.com>
2017-10-06 15:14:36 +00:00
Vyacheslav Egorov a52d4b0f75 [kernel] Extend Kernel with backend specific metadata section
This section contains a linear mapping between offsets of serialized nodes
and associated opaque binary metadata.

Note: this CL does not yet update C++ reader and only implements metadata in Kernel package. 

C++ implementation will be updated if we agree that format seems flexible enough.

Bug:
Change-Id: Id433458afc6c2ea76c72f6a1901b9dc55b8f1696
Reviewed-on: https://dart-review.googlesource.com/9340
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-10-04 15:14:02 +00:00
Samir Jindel 195c62ff0c [kernel] Begin reducing type erasure.
1. We no longer remove type parameters on functions.
2. We no longer remove type arguments at call sites.
3. We allow non-captured function type parameters to be used outside closures. 

Bug:
Change-Id: I116ec54c90b04be90e1157042c22797e57a7c51c
Reviewed-on: https://dart-review.googlesource.com/9342
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-03 14:33:30 +00:00
Paul Berry 240fd56709 Change main function in erasure_test to take optional args.
This will allow the test to be run inside google3, where the test
framework calls main with no arguments.

Change-Id: Ia3135b634b4752be816b53209c39d24d72edb6b3
Reviewed-on: https://dart-review.googlesource.com/8960
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-09-27 16:24:44 +00:00
Paul Berry d9ca760992 Start writing the infrastructure for creating forwarding stubs.
This CL adds the ability to create a list of "forwarding nodes" for a
source class.  A forwarding node is a data structure that will later
be resolved to either an explicitly declared member in the class or a
superclass, or to a forwarding stub.  The idea is that we will create
the forwarding nodes at the time of outline building, and later,
during type inference, we will resolve each forwarding node as it is
encountered.

The reason we need to defer resolution of the forwarding nodes until
inference is because we may need to use the results of type inference
to determine which member a given forwarding node resolves to.  For
example:

num f() => 1;
class A {
  final x = 1; // Inferred type: int
}
class B {
  final x = f(); // Inferred type: num
}
abstract class C implements A, B {}

We cannot determine at the time of building the outline for C whether
it inherits its x from A or B, because we need the results of type
inference to determine which of the two x's has a more specific type.

Note that some refactoring of ClassHierarchy was necessary in order to
allow the front end to maintain member lists in the same order used
internally by ClassHierarchy.  This will let us avoid unnecessary
redundant sorting of methods.

Change-Id: Iee754957e0ad3b16c4b60608e17a4a7b0006dfb4
Reviewed-on: https://dart-review.googlesource.com/7851
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-25 20:59:49 +00:00
Paul Berry f1665714a5 Move batch_util.dart into pkg/kernel/lib/.
This will allow tests that use batch_util.dart to be run inside
google3, where package layout conventions are more strictly enforced
(files in test/ cannot import files in bin/ or vice versa).

Change-Id: I046b864bc3b1c4e78b984b0047b7567873146c52
Reviewed-on: https://dart-review.googlesource.com/7340
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-09-22 16:52:07 +00:00
Paul Berry 5dd63f9fdc Implement proper subtype check for promoted bounds in kernel.
Note that the parser used for unit tests in kernel didn't have a
notation for promoted bounds.  I chose `T & A` to mean "type parameter
T with promoted bound A", following Leaf's convention (the rationale
is that semantically, a promoted bound functions like an intersection
type).

It was also necessary to change the test infrastructure so that we
could specify the (non-promoted) bounds of type parameters when
running a subtype test.

Fixes #30833.

Change-Id: Ic62722df63c5ed5288b23560745a1cd0869b63fb
Reviewed-on: https://dart-review.googlesource.com/7628
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-09-22 15:37:19 +00:00
Paul Berry a8afd3ab16 Remove reified_dart.dart, batch_consistency.dart, and dartk.dart.
These files all have to do with the old "dartk" front end, which is no
longer used.

Change-Id: I67041bf0a3a8a9213153123d9f79ac1632cc4d24
Reviewed-on: https://dart-review.googlesource.com/7101
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-09-20 15:33:16 +00:00
Alexander Markov 0d77b0b61d [kernel] Clean up warnings to fix fasta/analyze_test
This is the follow-up to 1989edb06e.

Change-Id: I1e3118475f2cef68b5d7e1ddd624b5b8163d7633
Reviewed-on: https://dart-review.googlesource.com/4100
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-07 18:22:44 +00:00