Commit Graph

886 Commits

Author SHA1 Message Date
Aske Simon Christensen 05fb37a808 Add SetLiteral node to kernel.
Change-Id: I2f12662efc8ae3f064674bba03c333e0c23ffa0d
Reviewed-on: https://dart-review.googlesource.com/c/85681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-06 14:46:58 +00:00
Alexander Markov 9f49b47823 [vm/bytecode] Revise representation of objects and strings in bytecode
This is a major revamp of bytecode metadata format. Now bytecode has
its own serialization mechanisms.

This CL adds 'bytecode component' metadata, which contains bytecode
object table and string table. All references from bytecode (constant
pools) to libraries, classes, members, types and strings now have a new
format. References to frequently used objects are represented as indices
in object table, while rarely used objects are written inline.
This allows VM to cache frequently used objects while reading bytecode.

Representation of strings is aligned with VM - string characters are
stored in separate pools of one-byte and two-byte strings. This allows
VM to avoid UTF-8 decoding and extra copying.

Closure declarations are now explicit. Type parameters no longer require
enslosing scopes when reading/writing them.

Benchmarks:
GenKernelKernelReadAllBytecode (Intel Core i5) +29.84%
GenKernelKernelReadAllBytecode (Intel Xeon) +28.74%
Change-Id: I4b80009733a8f8c038264af74f97c4e094b9e311
Reviewed-on: https://dart-review.googlesource.com/c/85469
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-12-03 19:08:42 +00:00
Jens Johansen 7f8e6f8bb6 Be more verbose in loops etc in kernel
Benchmarks have shown that old-style for-loops are faster than for-in
for instance.

Golem says

ia32

whole stack (i.e. including utf8 and change to VariableIndexer)

AstToBinaryP90 (Intel Core i5)	6.617% (0.4 noise)
AstToBinary (Intel Xeon)	5.158% (0.4 noise)
AstToBinaryP90 (Intel Xeon)	5.104% (0.4 noise)
AstToBinaryP50 (Intel Xeon)	5.148% (0.4 noise)
AstToBinary (Intel Core i5)	6.579% (0.4 noise)
AstToBinaryP50 (Intel Core i5)	6.741% (0.4 noise)

by itself (i.e. compared to a build with utf8 and change to VariableIndexer)

AstToBinaryP90 (Intel Core i5)	0.7724% (0.0 noise)
AstToBinaryP50 (Intel Core i5)	0.7848% (0.0 noise)
AstToBinary (Intel Core i5)	0.8559% (0.0 noise)
AstToBinaryP90 (Intel Xeon)	0.7730% (0.1 noise)
AstToBinaryP50 (Intel Xeon)	0.8195% (0.1 noise)
AstToBinary (Intel Xeon)	0.9319% (0.1 noise)



x64

whole stack (i.e. including utf8 and change to VariableIndexer)

AstToBinaryP90 (Intel Core i5)	5.555% (0.2 noise)
AstToBinaryP50 (Intel Xeon)	6.352% (0.4 noise)
AstToBinaryP50 (Intel Core i5)	5.395% (0.5 noise)
AstToBinary (Intel Xeon)	6.928% (0.5 noise)
AstToBinaryP90 (Intel Xeon)	7.180% (0.5 noise)
AstToBinary (Intel Core i5)	5.824% (0.5 noise)

by itself  (i.e. compared to a build with utf8 and change to VariableIndexer)

AstToBinaryP90 (Intel Core i5)	0.1039% (0.0 noise)
AstToBinaryP50 (Intel Core i5)	0.6154% (0.0 noise)
AstToBinary (Intel Core i5)	0.7640% (0.1 noise)
AstToBinaryP50 (Intel Xeon)	1.268% (0.1 noise)
AstToBinary (Intel Xeon)	1.457% (0.1 noise)
AstToBinaryP90 (Intel Xeon)	1.512% (0.1 noise)



Change-Id: If091a3a01f2fe6574712946a01644413033739b6
Reviewed-on: https://dart-review.googlesource.com/c/85341
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-30 13:15:47 +00:00
Jens Johansen 8db293ed70 Lazy VariableIndexer in ast_to_binary.dart
Often a VariableIndexer was initialized with no use.
This CL eliminates that by creating it as needed.

Golem says:

ia32

whole stack (i.e. together with the utf8 stuff)

AstToBinary (Intel Xeon)	4.265% (0.3 noise)
AstToBinaryP50 (Intel Xeon)	4.364% (0.3 noise)
AstToBinaryP90 (Intel Xeon)	4.365% (0.3 noise)
AstToBinaryP90 (Intel Core i5)	5.890% (0.3 noise)
AstToBinary (Intel Core i5)	5.772% (0.3 noise)
AstToBinaryP50 (Intel Core i5)	6.004% (0.4 noise)

by itself (i.e. compared to the one with hte utf8 stuff)

AstToBinary (Intel Xeon)	0.4910% (0.0 noise)
AstToBinaryP50 (Intel Xeon)	0.6186% (0.0 noise)
AstToBinaryP90 (Intel Xeon)	0.6415% (0.0 noise)
AstToBinaryP90 (Intel Core i5)	1.974% (0.1 noise)
AstToBinary (Intel Core i5)	1.854% (0.1 noise)
AstToBinaryP50 (Intel Core i5)	2.072% (0.1 noise)


whole stack (i.e. together with the utf8 stuff)

whole stack

AstToBinaryP90 (Intel Core i5)	5.457% (0.2 noise)
AstToBinaryP50 (Intel Xeon)	5.150% (0.4 noise)
AstToBinary (Intel Xeon)	5.552% (0.4 noise)
AstToBinaryP90 (Intel Xeon)	5.756% (0.4 noise)
AstToBinaryP50 (Intel Core i5)	4.809% (0.4 noise)
AstToBinary (Intel Core i5)	5.099% (0.5 noise)

by itself (i.e. compared to the one with hte utf8 stuff)

AstToBinaryP50 (Intel Core i5)	-0.6758% (-0.1 noise)
AstToBinary (Intel Core i5)	-0.0593% (-0.0 noise)
AstToBinaryP90 (Intel Core i5)	1.292% (0.0 noise)
AstToBinaryP50 (Intel Xeon)	0.6355% (0.0 noise)
AstToBinaryP90 (Intel Xeon)	0.9089% (0.1 noise)
AstToBinary (Intel Xeon)	0.9836% (0.1 noise)

Change-Id: Ia9a86958f9a9280c6ee40695fe3020debb8312a5
Reviewed-on: https://dart-review.googlesource.com/c/85340
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-30 12:39:27 +00:00
Jens Johansen e520f2480a Do UTF8 encoding slightly differently when serializing kernel
Instead of creating two small-ish utf8lists for every string we encode,
do fewer bigger allocations and convert to utf8 via a (new) method that
will hopefully eventually be moved into String.

Golem says:

ia32

AstToBinaryP90 (Intel Core i5)	3.995% (0.2 noise)
AstToBinary (Intel Core i5)	3.992% (0.2 noise)
AstToBinaryP50 (Intel Core i5)	4.015% (0.2 noise)
AstToBinary (Intel Xeon)	3.793% (0.3 noise)
AstToBinaryP90 (Intel Xeon)	3.748% (0.3 noise)
AstToBinaryP50 (Intel Xeon)	3.769% (0.3 noise)


x64


AstToBinaryP90 (Intel Core i5)	4.220% (0.1 noise)
AstToBinaryP50 (Intel Xeon)	4.543% (0.3 noise)
AstToBinary (Intel Xeon)	4.614% (0.3 noise)
AstToBinaryP90 (Intel Xeon)	4.891% (0.3 noise)
AstToBinaryP50 (Intel Core i5)	5.448% (0.5 noise)
AstToBinary (Intel Core i5)	5.155% (0.5 noise)

Change-Id: I0532778d69205a7a187342d3bdfe503c660b1004
Reviewed-on: https://dart-review.googlesource.com/c/84413
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-30 11:27:03 +00:00
Jens Johansen 56bccac775 Remove unused kernel/lib/application_root.dart
Change-Id: If02becd542935c9e9db6cbfdf8a40b47a712cd7c
Reviewed-on: https://dart-review.googlesource.com/c/85481
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-11-29 08:08:33 +00:00
Jens Johansen 9c7bdf4aae Remove unused dependencies on logging and package_config
package_config was not used at all.
logging was only used by kernel/lib/log.dart which in turn was not used
at all.

Change-Id: If57f084661c5cc1c361fb38555e903ec3f724904
Reviewed-on: https://dart-review.googlesource.com/c/85480
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-11-29 08:08:23 +00:00
Jens Johansen 498994487b Cleanup of ast_to_binary
Change-Id: Ib065dd32c23c88f64b668a6b9bcefbdb4a8e038d
Reviewed-on: https://dart-review.googlesource.com/c/85241
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-11-28 10:57:01 +00:00
Jens Johansen 1ec63ec7d5 Only one source of truth for uriToSource
Previously we had several places where different uriToSource was used.
This was both weird and led to errors when something refering to
some state was used to look up in another state.
This CL makes it so we only have one source of truth.

To not include sdk sources when serializing a component that only mixes
something from the sdk in, (or extends it or...), the serialization is
changed slightly to keep track of which uris come from actual
implementation. Before the sdk sources was explicitly removed in the
incremental compiler, but we want to limit those kinds of things,
which is why we're doing it differently here.

Fixes #35215.

Bug: 35215
Change-Id: Iaa5618fcb0ea42b13aba7720f34a87a85144e047
Reviewed-on: https://dart-review.googlesource.com/c/85175
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-11-28 10:57:01 +00:00
Dmitry Stefantsov dcc9f74a3c [kernel] Make instantiate-to-bound implementation in Kernel private
Change-Id: I04983b1d99a75054dd93ec6e7131eb7f0492540b
Reviewed-on: https://dart-review.googlesource.com/c/84638
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com>
2018-11-22 11:50:27 +00:00
Jens Johansen 4646e804dc Wrap last debugPath.add in assert
For all other "debugPath.add"s we've wrapped it in assert to avoid
doing it in the general case.
One apparently have slipped through.

Change-Id: Ib0dfc4a671428993e393d57a75db6612785e37b4
Reviewed-on: https://dart-review.googlesource.com/c/85161
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-11-22 09:32:49 +00:00
Alexander Markov a4dc8cd22e [vm/kernel/bytecode] Make sure bytecode instructions are aligned in kernel
Change-Id: I109123e88b8352b198d5ef9aad9eedc1df7141c8
Reviewed-on: https://dart-review.googlesource.com/c/83543
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-11-09 17:08:46 +00:00
Martin Kustermann 8953788993 [VM] Convert const Symbol("..") to SymbolConstants in kernel2kernel transformation
Issue https://github.com/dart-lang/sdk/issues/34911

Change-Id: Ib504d57b5a529a04f511f737af4cec0ff0590250
Reviewed-on: https://dart-review.googlesource.com/c/82069
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-02 09:28:15 +00:00
Dmitry Stefantsov c560ee9399 [fasta] Remove temporary map typedefInstantiations
Change-Id: Ife72d3b9a2b4f150e5d4e3548409fadec1dc3146
Reviewed-on: https://dart-review.googlesource.com/c/82226
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-01 18:55:04 +00:00
Alexander Markov 056fdb8734 [vm/kernel] Fix kernel tree shaker after FunctionType.typedefType change
Fixes https://github.com/dart-lang/sdk/issues/34995

Change-Id: Ieef2696ea9cfe689a661dc7d1ebd86b257b49bbb
Reviewed-on: https://dart-review.googlesource.com/c/82261
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-11-01 15:41:12 +00:00
Peter von der Ahé 690c3be02e Make FunctionType.typedefType final
Change-Id: I52ec7cdd20d431a324634a6caf0e6f1e9178c8c8
Reviewed-on: https://dart-review.googlesource.com/c/82203
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-10-31 09:01:49 +00:00
Peter von der Ahé a8291f767d Update package:kernel to use FunctionType.typedefType
Change-Id: I1d427e4fe98eb54749f3a16027badcff945ef962
Reviewed-on: https://dart-review.googlesource.com/c/82200
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-31 06:49:09 +00:00
Peter von der Ahé f10c3b9e95 Remove workaround for missing typedef information.
Fixes https://github.com/dart-lang/sdk/issues/34655
Fixes https://github.com/dart-lang/sdk/issues/34979
Change-Id: I14552a491f24b5c64cceeeb7d0273685352f7118
Reviewed-on: https://dart-review.googlesource.com/c/81408
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-30 11:15:54 +00:00
Jens Johansen 4a7f3d575c Fix loading dill with null LibraryReference
Before this CL we could get a dill file out of compiling
tests/language_2/import_nonexisting_dart_uri_test.dart
but we couldn't load it back in again.

Change-Id: I05b6b8d6368c7ed03dbb798535ea03e0493df780
Reviewed-on: https://dart-review.googlesource.com/c/79220
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-10-29 11:09:38 +00:00
Dmitry Stefantsov aba7969e27 [kernel] Add DartTypeVisitor1
Change-Id: I4eba2c4f9366096cc42f00004014680500d983ac
Reviewed-on: https://dart-review.googlesource.com/c/81406
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-10-25 13:08:18 +00:00
Peter von der Ahé 45e7ff28e1 Kernel Binary Format: Reify originating TypedefType on FunctionType
Previously, we only stored a reference to the originating Typedef declaration
and is thus loosing the originating type arguments. We need these type arguments
in various places, including diagnostics and bounds checks.

Note: this CL maintains backwards compatibility wrt to the Dart API of
FunctionType. I'll update the API in a follow-up CL.
Change-Id: I896ce3c3b4522d542a82c5036f8a17ee098143dc
Reviewed-on: https://dart-review.googlesource.com/c/81367
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-25 11:40:37 +00:00
Martin Kustermann dec268cfae [VM] Catch non-instantiated type arguments for constant partial instantiation expression
This makes us report the following error

  * in JIT:

  Unhandled exception:
  'test.dart': error: Type arguments must be instantiated in partial instantiation.
  #0      main (...)
  ...

  * in AOT:

  test.dart:7:28: Error: The type '#lib1::C::T' is not a constant, only instantiated types are ...
    const C({this.callback = _defaultCallback});
                           ^
  test.dart:7:17: Context: While analyzing:
    const C({this.callback = _defaultCallback});
                ^
  test.dart:5:37: Error: The type '#lib1::C::T' is not a constant, only instantiated types are ...
    void foo([dynamic Function(T) f = _defaultCallback]) {}
                                    ^
  test.dart:5:33: Context: While analyzing:
    void foo([dynamic Function(T) f = _defaultCallback]) {}
                                ^
  test.dart:11:38: Error: The type '#lib1::bar::T' is not a constant, only instantiated types are ...
  void bar<T>([dynamic Function(T) f = _defaultCallback]) {}
                                     ^
  test.dart:11:34: Context: While analyzing:
  void bar<T>([dynamic Function(T) f = _defaultCallback]) {}



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

Change-Id: I05c7019119a50a9cc38939d9cb41aeaa06c853bc
Reviewed-on: https://dart-review.googlesource.com/c/81278
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-25 09:23:18 +00:00
Peter von der Ahé 1546ff6752 Add class TypeArgumentIssue
Change-Id: Ie46fa496c10e8c78182bb3aeeab1836464259f42
Reviewed-on: https://dart-review.googlesource.com/c/81269
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-25 09:07:26 +00:00
Peter von der Ahé 724573e332 Rename findBoundViolations to findTypeArgumentIssues
Change-Id: I10bf8afa4a7e7656725bdb5bb05aff9a1252bff3
Reviewed-on: https://dart-review.googlesource.com/c/81265
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-25 09:07:26 +00:00
Peter von der Ahé 94b9d05349 Move bounds checks to own file.
Change-Id: I0954bdb2633c0fae8d760bff05e5be8bbba59c57
Reviewed-on: https://dart-review.googlesource.com/c/81262
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-25 09:07:26 +00:00
Kevin Millikin cfecec5eec Fix yet another cloning bug
All for-in loops became synchronous ones when mixed in.  This is obviously
wrong.  Fixes https://github.com/dart-lang/sdk/issues/34877

Change-Id: I26f71724ea68f37ce4813790ae003b51479874fc
Reviewed-on: https://dart-review.googlesource.com/c/81277
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-24 16:16:59 +00:00
Paul Berry 11adb81a77 Remove the last references to the analyzer package from kernel.
Change-Id: I326a29fc3d458d9df98e326484432be5438f7191
Reviewed-on: https://dart-review.googlesource.com/c/80984
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-22 08:21:59 +00:00
Martin Kustermann 349adc5b1f Reland "[VM] Use c++/kernel2kernel constant evaluator for const StaticInvocation in the kernel IR"
Fixes https://github.com/dart-lang/sdk/issues/34770

Change-Id: I55b02e6ce327f4a08d96612fea44f7b03bddcbb5
Reviewed-on: https://dart-review.googlesource.com/c/79680
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-16 11:22:56 +00:00
Dmitry Stefantsov bf270577cc [fasta] Report errors on generic function types in type arguments
Fixes #30931

Bug: http://dartbug.com/30931
Change-Id: Ia44f8ff95e85547997912c7dd1403ae1f77aec33
Reviewed-on: https://dart-review.googlesource.com/c/79720
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-10-15 13:48:03 +00:00
Dmitry Stefantsov 22b11717ac [fasta] Fix bounds checking: non-generic types are always well-bounded
Change-Id: I745450f0d4c9a41f9df3e1dc97dd42cf25d69edc
Reviewed-on: https://dart-review.googlesource.com/c/79681
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-10-15 12:50:23 +00:00
Siva Annamalai aabc26bafe Revert "[VM] Use c++/kernel2kernel constant evaluator for const StaticInvocation in the kernel IR"
This reverts commit 29ff9e4a6a.

Reason for revert: We seem to be seeing a number of dartkp failures after this commit.

Original change's description:
> [VM] Use c++/kernel2kernel constant evaluator for const StaticInvocation in the kernel IR
> 
> Fixes https://github.com/dart-lang/sdk/issues/34770
> 
> Change-Id: Ie0a3ea82992d70bfce04dcd8986b62f3e1dd5962
> Reviewed-on: https://dart-review.googlesource.com/c/79581
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,kustermann@google.com

Change-Id: Ib3f67e869e6bfa87161f7c580b0142d676e5a631
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/79467
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-10-12 19:34:27 +00:00
Peter von der Ahé 0b1b09116a Simplify handling of non-shadow nodes in type inference
Change-Id: Ia2fd532267d30d4b9d5f62221485e747be8d7def
Reviewed-on: https://dart-review.googlesource.com/c/78760
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-12 16:47:55 +00:00
Martin Kustermann 29ff9e4a6a [VM] Use c++/kernel2kernel constant evaluator for const StaticInvocation in the kernel IR
Fixes https://github.com/dart-lang/sdk/issues/34770

Change-Id: Ie0a3ea82992d70bfce04dcd8986b62f3e1dd5962
Reviewed-on: https://dart-review.googlesource.com/c/79581
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-12 16:08:46 +00:00
Peter von der Ahé af7cead848 Clone default values of mixin application constructors
Fixes https://github.com/dart-lang/sdk/issues/31767

Change-Id: Ief8d620dff49967a165a93fbf8d8916d7389e80a
Reviewed-on: https://dart-review.googlesource.com/c/79261
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-12 15:02:41 +00:00
Aske Simon Christensen 6177615d71 [kernel] Fix subtype relationship for generic function types
Fixes #34623

Change-Id: I707502e74c5d867785a80b64bb1d19e09412659f
Reviewed-on: https://dart-review.googlesource.com/c/79212
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-10-12 11:58:37 +00:00
Kevin Millikin 2fa1143600 Check classes at mixin applications
When a declared mixin is applied to a class, the class must implement
the superclass constraint interfaces named in the mixin declaration.

Change-Id: I6ace9fe244c1c87860b69c2c5e68f2c31ae73d7c
Reviewed-on: https://dart-review.googlesource.com/c/79206
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-10-12 08:34:07 +00:00
Samir Jindel 3e7ce992cf [vm/tfa] Implementation of type arguments tracking in TFA.
Change-Id: I9398186e27ae7a040e249df010ae16fb6ab6da89
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/74962
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-11 19:09:42 +00:00
Dmitry Stefantsov 8648d782ae Reland "[fasta] Report errors for bounds violations"
The original commit:
https://github.com/dart-lang/sdk/commit/aa6fb2d3a4298e60b5635f26507d5b39f4e531cb

Change-Id: I34287ec856fde16d56e9369ef2620311ba9bb722
Reviewed-on: https://dart-review.googlesource.com/c/79200
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-10-11 10:20:01 +00:00
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
Dmitry Stefantsov a539d2ef5f Revert "[fasta] Report errors for bounds violations"
The CL is reverted because it didn't account for the case when a check
of a user-specified type argument against the bound depends on another
type that is only known after type inference is done.

Change-Id: I1fd140af95ed37b9191a5b161a281d4639e3453f
Reviewed-on: https://dart-review.googlesource.com/c/79048
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-10-10 15:31:27 +00:00
Peter von der Ahé f1b6d81404 Remove Target.strongMode
Change-Id: I60f72904f4a9ae3427b2a2633a22f70a6b6f8ea9
Reviewed-on: https://dart-review.googlesource.com/c/79020
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-10 12:49:18 +00:00
Peter von der Ahé 8c872e0e3a Remove TargetFlags.strongMode
Change-Id: Ibf8661e5444d16666c54f1d81c626893b000521a
Reviewed-on: https://dart-review.googlesource.com/c/78986
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-10 12:11:41 +00:00
Dmitry Stefantsov aa6fb2d3a4 [fasta] Report errors for bounds violations
Fixes #33308.

Bug: http://dartbug.com/33308
Change-Id: Iae087928468ed6883c438db95644135dc7ef0a6a
Reviewed-on: https://dart-review.googlesource.com/c/57621
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-10-10 12:03:36 +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
Martin Kustermann 6c0b854477 [VM] Fix canonicalization of doubles: Two doubles are canonicalized to the same value if they are idencial()
Fixes https://github.com/dart-lang/sdk/issues/34730

Change-Id: I9f60c5f81ceb9bd31794efe20012a343dab748bb
Reviewed-on: https://dart-review.googlesource.com/c/78747
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-10-09 12:33:57 +00:00
Kevin Millikin 796d628ab6 Improve error reporting from Kernel scripts
* Ensure that we have a .dill file and it has the correct version before
  we start decoding it in dump.dart.

* Throw errors, not strings.  Ensure that they have a useful
  toString().

* Do not print usage except when the command is invoked
  incorrectly (wrong number of arguments).  Once we get into the
  command it's less likely that it's been invoked incorrectly and more
  likely that something else has gone wrong.

  Because these utilities are invoked from other scripts (like the
  fasta command), printing their usage for problems other than
  invoking them correctly doesn't match the way that they were invoked
  and it's confusing.

Change-Id: I7832383594d2b3719a0a7a7392ba4685717a79d2
Reviewed-on: https://dart-review.googlesource.com/c/78206
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-05 12:19:01 +00:00
Alexander Markov 270fd8e4a8 [vm/aot] Handle annotations on parameters in tree shaker and constant evaluator
Fixes https://github.com/dart-lang/sdk/issues/34644
Issue https://github.com/flutter/flutter/issues/22355

Change-Id: Iaf1e5da9a2d33cf4cd8ea2510cf1faff1a20c886
Reviewed-on: https://dart-review.googlesource.com/c/77673
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-03 16:16:46 +00:00
Aske Simon Christensen eacf720d2b Functions to demangle mixin application class names
Demangle all names in messages to avoid printing mangled names in
user-facing output.

Point messages about implicit mixin application classes at the subclass
name for consistency with named mixin application classes.

Change-Id: I90973986c422f271af99e18b3deb5847adf4d430
Reviewed-on: https://dart-review.googlesource.com/c/77380
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-03 14:56:43 +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