Commit Graph

2004 Commits

Author SHA1 Message Date
Sigmund Cherem 6bb7c5529a Remove multiroot option from CompilerOptions.
Closes #31163

Bug:  https://github.com/dart-lang/sdk/issues/31163
Change-Id: I38e9c0d6a1edd151077a82f77f92b36a23c70b14
Reviewed-on: https://dart-review.googlesource.com/25504
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-04 22:04:14 +00:00
Brian Wilkerson 7f720c266d Prepare to convert replaceToken
Change-Id: I1d2f9f16f49dd9edae179463eba068c34e365e5e
Reviewed-on: https://dart-review.googlesource.com/26020
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-04 17:50:26 +00:00
Peter von der Ahé f53fe4db53 Speed up testing of incremental compiles by reusing platform.dill
Change-Id: Id98488448d2f3b4589b49c37a52eb0175bed2e32
Reviewed-on: https://dart-review.googlesource.com/25960
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-04 15:01:14 +00:00
Paul Berry c800a1cc29 Fix error recovery for invalid assignment.
Previously, the front end recovered from an invalid assignment by
producing an "as" expression, e.g.:

    int x;
    String y;
    x = y;

Would produce an "invalid assignment" error, as well as this kernel
code:

    int x;
    String y;
    x = y as{TypeError} int;

The rationale was that the "as" check was guaranteed to fail, so this
code would produce a runtime error at the correct location.  However,
there were two problems:

1. (Minor problem) the "as" doesn't actually fail if the RHS is null.

2. (Major problem) for type inference, the type of an assignment
expression is defined to be the type of the RHS.  This means that if
the invalid assignment gets used for type inference, we generate
mal-typed kernel code, e.g.:

    int x;
    String y;
    var z = (x = y);

Gets compiled to:

    int x;
    String y;
    String z = (x = y as{TypeError} int);

This CL addresses both problems by changing the kernel representation
so that it evaluates the RHS and then throws an exception.  Since a
"throw" expression has type Bottom, the kernel representation is
guaranteed to be properly typed.  This also ensures that an exception
gets thrown if the RHS is null.  Finally, as a side bonus, it makes
the error-recovered kernel code more similar to the kernel code we
generate in other error recovery scenarios.

Change-Id: Iac74e0c726ce029ac0560d271413e85c15bfec5c
Reviewed-on: https://dart-review.googlesource.com/24140
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-04 14:38:04 +00:00
Jens Johansen 9bc232be12 [CFE/DDC] Create initial DDC-specific CFE entry point
This CL creates the initial DDC-specific CFE entry point.
It is currently mostly a matter of copying the DDC code for running the
front-end into the front-end, although it also applies a workaround for
making batch-mode faster.

Local timings of running
tools/test.py -mrelease -cdartdevk -rnone --strong --checked language_2
before and after change:

* Before: [05:49 | 100% | + 5136 | -    0]
* After: [00:20 | 100% | + 5136 | -    0]

Change-Id: I799b54b406970c4aa8653b71aaffa2ba476ee9d9
Reviewed-on: https://dart-review.googlesource.com/24921
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-04 14:35:02 +00:00
Peter von der Ahé f8380b0124 Test full compile using minimal IKG
Change-Id: I2e754113ab64a60d3ee1740fcb86adaf92f247d9
Reviewed-on: https://dart-review.googlesource.com/24421
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2017-12-04 14:30:34 +00:00
Peter von der Ahé e14726a3f4 Use absolute URIs instead of relative paths
We change the type of FileUriNode.fileUri from String to Uri, which in principle
doesn't change the binary format. However, we did notice that LibraryParts
weren't serialized as specified in binary.md, so we also fixed that.

Since fileUris are stored as strings in a separate table, Uri.parse is only called
once per unique URI.

Fasta only uses relativizeUri when printing diagnostics, and URIs stored in
expectation files (golden files) are relativized using String.replaceAll.

Change-Id: Ib2dc1b80c03a0cdaf84e48b8b3ba73b16bdf8a40
Reviewed-on: https://dart-review.googlesource.com/25421
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-04 11:34:24 +00:00
Konstantin Shcheglov 21277a4df8 Apply resolution to 'this' and 'super'.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I905ea53aa1c39d789824e8c7061135a41b8f8cac
Reviewed-on: https://dart-review.googlesource.com/25663
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-03 00:13:42 +00:00
Konstantin Shcheglov e16df981c9 When applying types, treat UndefinedType as having required number of UndefinedType arguments.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Id2428967928a823cb55dcc4348b994af5c6674bf
Reviewed-on: https://dart-review.googlesource.com/25502
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-01 19:10:17 +00:00
Konstantin Shcheglov 22f5ce415d Translate types during ResolutionApplier.
This allows us update enclosing ExecutableElement as we enter/exit
local functions, and successfully translate references to type
parameters.

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I184123212b816740a586beee98796c28beadf6b2
Reviewed-on: https://dart-review.googlesource.com/25220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-01 16:58:47 +00:00
Peter von der Ahé 632bba54b9 Start building incremental test suite
Change-Id: I38e969e494c671982ec2cba96d2657a836dd0d49
Reviewed-on: https://dart-review.googlesource.com/24122
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-01 13:03:16 +00:00
Jens Johansen 22d0696d91 [CFE] Move front-end API under src/
This CL deprecates the front-end API and moves it into src/api_prototype.

For now all usages have been updated to point to the new location,
but they should be updated to use custom-client invocations instead (e.g.
one specific way for DDC, another for dart2js etc.)

Bug:
Change-Id: I9b4f41f6ebf55d42510fd35240d942d1dc7292d6
Reviewed-on: https://dart-review.googlesource.com/24822
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-01 08:42:16 +00:00
Brian Wilkerson 20c9565b3d Recover from a missing function body
Change-Id: Ie9091f856fdff2e2fceaa34cd29ce787f092b6e0
Reviewed-on: https://dart-review.googlesource.com/24160
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-11-28 19:11:44 +00:00
Konstantin Shcheglov ad7bc62921 Store and apply elements for SimpleIdentifier.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ie5f7a5b963dab8a731b9c60ae3a9440ef09b68f0
Reviewed-on: https://dart-review.googlesource.com/22902
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-22 17:36:39 +00:00
Brian Wilkerson 96ba131d30 Enhance ResolutionApplier to allow elements to be applied
Change-Id: I7006000bb72592866edd641b8b614fe73c8f18c2
Reviewed-on: https://dart-review.googlesource.com/22820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-11-22 00:02:57 +00:00
Peter von der Ahé a689397a36 Revert "Implement support for generic comment syntax in Fasta."
This reverts commit f1959d6cd4.

Reason for revert: insufficient approval.

Original change's description:
> Implement support for generic comment syntax in Fasta.
> 
> Change-Id: I4c15a4adf2dbb50efd799b801dcb75a538bbe7d6
> Reviewed-on: https://dart-review.googlesource.com/21223
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Dan Rubel <danrubel@google.com>

TBR=paulberry@google.com,danrubel@google.com,sigmund@google.com

Change-Id: I047e4e87913002c6bd77e455599189349c123146
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/22460
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-11-21 10:08:39 +00:00
Paul Berry f1959d6cd4 Implement support for generic comment syntax in Fasta.
Change-Id: I4c15a4adf2dbb50efd799b801dcb75a538bbe7d6
Reviewed-on: https://dart-review.googlesource.com/21223
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-11-20 22:01:27 +00:00
Konstantin Shcheglov 64d9c683b0 Create DillTarget once and keep for body changes.
This brings IKG recompilation time from 20-30 ms range to 5-10 ms range,
i.e. 3-4 times faster.

Of course performance of the system in general starts depending now
on how how many libraries we need to send to VM, and how fast the client
of IKG can serialize the returned libraries.

1. Leaf library.
   Compilation: 10 ms
   Returned libraries: 8
   Serialization time: 1 ms.

2. A deep library.
   Compilation: 10 ms
   Returned libraries: 222
   Serialization time: 60 ms.


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

Bug:
Change-Id: I5eab99c0bd7916d605696696d5e570c5fa6f1978
Reviewed-on: https://dart-review.googlesource.com/21900
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-20 21:03:30 +00:00
Konstantin Shcheglov 079d41b519 Compute canonical names only for the new library.
This makes changes to method bodies cheaper, now in 20-30 ms range
when I change flutter/lib/src/widgets/text.dart code.

R=sigmund@google.com

Bug:
Change-Id: I9009d12330ab64969630dc92aa0404cfc581e5e3
Reviewed-on: https://dart-review.googlesource.com/21524
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-17 08:58:55 +00:00
Brian Wilkerson 8556269166 Convert some of the methods used to parse function bodies
Change-Id: Ia8addbbc057768dac83695d7c8e2a7de98c86ebb
Reviewed-on: https://dart-review.googlesource.com/21482
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-11-16 20:37:12 +00:00
Konstantin Shcheglov 7d16cec034 Rewrite IKG to be much faster on incremental changes.
This version does not store any compiled kernels into ByteStore.
We might get back to it, if we have time, and if it can be done without
slowing down returning results.

Here are numbers for the flutter_gallery sample.

Minimal KG.
1. Initial start: 3600 ms.
2. Change a leaf library (logic.dart): 30-40 ms.
3. Change a method body in a deep library (widgets/text.dart): 600-800 ms.


This IKG.
1. Initial start: 4300 ms.
2. Change a leaf library (logic.dart): 30-40 ms.
3. Change a method body in a deep library (widgets/text.dart): 30-40 ms.
4. Change API of a deep library: 600-800 ms.


  So, this new version is very fast when you change a method body.
  This is the most often and useful case.
  We might want to create a new benchmark for it.

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

Bug:
Change-Id: I134050c5bafec195d8a1eceb2ee9ea1468c819fc
Reviewed-on: https://dart-review.googlesource.com/21282
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-16 19:38:51 +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
Konstantin Shcheglov 0b80b0e028 Add MinimalIncrementalKernelGenerator with in-memory only caching and simplified dependency tracking.
R=paulberry@google.com, sigmund@google.com

Bug:
Change-Id: I828ff64afcdb735dc06cb4b200a97b51bc651e8f
Reviewed-on: https://dart-review.googlesource.com/20323
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-15 23:06:22 +00:00
Brian Wilkerson 9f730ecbc8 Return the last consumed token from seven methods
Change-Id: I53ad977e3c68ea9ed583fd89cc798ab75b9d0b0f
Reviewed-on: https://dart-review.googlesource.com/20120
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-11-10 16:55: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
Konstantin Shcheglov 6a11149ef1 Rewrite KernelDriver to use outlines of direct dependencies.
For now only getKernel() uses the new compilation method.

There are several new failing tests because redirection factories
are not serialized/deserialized correctly yet (but I saw kernel
support comming for it), and outlines don't include private fields (
which we want to work around by storing just names).


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

Bug:
Change-Id: I0d964862066ac0ee9e7b5c7b1d3802171a874aef
Reviewed-on: https://dart-review.googlesource.com/19440
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-09 02:36:42 +00:00
Brian Wilkerson cebb86e3ce Convert some methods used to parse formal parameters
Change-Id: I1d6542f069a2818ea7253997a4d5c0944e12ce6f
Reviewed-on: https://dart-review.googlesource.com/19420
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-11-08 23:21:41 +00:00
Konstantin Shcheglov 4dd4fd745e Make 'protectionDuration' in ProtectedFileByteStore optional.
Bug: https://github.com/dart-lang/sdk/issues/31323
Change-Id: Ie8de75ba16c156a69ec37fc4177ef187af3a4825
Reviewed-on: https://dart-review.googlesource.com/19442
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-08 22:09:40 +00:00
Brian Wilkerson 0a66494841 Convert parseTopLevelMember and parseClassMember
Change-Id: Iab8109a48866e12c2a3a11c62fc7e340b0b8862e
Reviewed-on: https://dart-review.googlesource.com/19022
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-11-07 21:29:41 +00:00
Konstantin Shcheglov 031cfcf993 Fix for combining outlines when we first see the external version of a library (so, without exports).
Bug:
Change-Id: I4aeef7f2ae85ce4e5ac8b997aa43d120304aee6b
Reviewed-on: https://dart-review.googlesource.com/19061
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-07 19:30:10 +00:00
Dan Rubel cf3ced607e Update scanner to gracefully degrade given invalid UTF-8
Fix https://github.com/dart-lang/sdk/issues/31193

Change-Id: I8ede0268ebff9c7e3dab003eff93a263a5d0b6ef
Reviewed-on: https://dart-review.googlesource.com/18740
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-11-07 18:19:29 +00:00
Brian Wilkerson 723f8bca05 Convert parseMetadataStar and partially convert parseMetadata
Change-Id: I546206f1b7de042827a519f4ac9c721b98a3038e
Reviewed-on: https://dart-review.googlesource.com/19020
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-11-07 16:14:50 +00:00
Konstantin Shcheglov 11543a9540 Update Library.additionalExports during combining.
Bug:
Change-Id: Ia99a9f64834acb62ee6ffb95836b957b85f90731
Reviewed-on: https://dart-review.googlesource.com/18960
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-07 04:08:29 +00:00
Dan Rubel 599bbd4269 Cleanup AnalyzerDietListener buildFields
Change-Id: Ifb29a2ca1fa2ee6eb0adffbcd2896ffeea7083ba
Reviewed-on: https://dart-review.googlesource.com/18901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-11-07 02:42:59 +00:00
Konstantin Shcheglov 9755cf6de8 Include public static members of classes in included libraries.
Bug:
Change-Id: I03dc21402b5298621086891f82d93fb37f1c0ed4
Reviewed-on: https://dart-review.googlesource.com/18903
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-07 01:45:29 +00:00
Konstantin Shcheglov 00d9c180c3 Fix for combining private members.
Bug:
Change-Id: If623420777c13a2d6e56dfcc33be4f2d4ae69f34
Reviewed-on: https://dart-review.googlesource.com/18686
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-06 18:25:44 +00:00
Konstantin Shcheglov 5ea30b4e3d Rename performace_logger.dart to performance_logger.dart
R=paulberry@google.com, sigmund@google.com

Bug:
Change-Id: Ib7b6d122dff3ddabde3db2270daa777a269e04ed
Reviewed-on: https://dart-review.googlesource.com/18512
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-03 20:24:00 +00:00
Konstantin Shcheglov 611475aaaa Separate KernelDriver.getKernel() and getKernelSequence().
The reason to have both is that IKG needs kernels for all libraries,
potentially not even deserialized from bytes, if we eventually get this
optimization.

OTOH, Analyzer always needs just one library, with enough outlines
to make sense of the dependencies. For now, getKernel() is implemented
using getKernelSequence(), this will change with switching to
outline based compilation.

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

Bug:
Change-Id: Iba02bc3a4cdb67a896c4faa2f809c7cb8069aa9e
Reviewed-on: https://dart-review.googlesource.com/18509
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-11-03 20:00:01 +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
Paul Berry 9ac19f0122 Pass --strong to vm when running front_end testcases in strong mode.
Also, stop passing "Hello, World!" as a command line argument when
executing front_end testcases.

Change-Id: I7c3ec6a301537a84bd14e232b5a0d6b8a7bd1914
Reviewed-on: https://dart-review.googlesource.com/18503
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-03 18:28:51 +00:00
Konstantin Shcheglov b2b813a37a Update ProtectedFileByteStore in IKG on acceptLastDelta().
So, we don't leak result keys to IKG clients.

Bug:
Change-Id: Ib3002aad690bf98884816a3978f759acd88b12ec
Reviewed-on: https://dart-review.googlesource.com/17342
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2017-11-03 17:31:23 +00:00
Dan Rubel 15a0abf956 Fix OutlineBuilder native class and AnalyzerDietListener tests
Update the OutlineBuilder and AstBuilder to fix native handling,
and in the process, fix several AnalyzerDietListener tests.

Fix https://github.com/dart-lang/sdk/issues/30836

Change-Id: I7e3b6c4c7d241f1325a5fce1e117e277c6166e49
Reviewed-on: https://dart-review.googlesource.com/18500
Reviewed-by: Paul Berry <paulberry@google.com>
2017-11-03 17:16:51 +00:00
Peter von der Ahé b4dcb76518 Read patch files directly when building legacy platform files.
Change-Id: Ib2e614b676021660c6a053dfc59f639c004279b9
Reviewed-on: https://dart-review.googlesource.com/18520
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-11-03 12:43:50 +00:00
Dan Rubel e781b33c83 move Analyzer test classes out of lib
This moves several classes used only for testing purposes
out of the analyzer/lib directory tree and
into front_end/test/fasta/testing where they are used.

Change-Id: I294b20710de4b16e27fbea5d13be316a6ecda112
Reviewed-on: https://dart-review.googlesource.com/18200
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-11-02 16:02:58 +00:00
Paul Berry 08b0120186 Begin reporting "invalid assignment" errors.
Change-Id: I1e47acd662032c63e56cb2349b2f349e9825b990
Reviewed-on: https://dart-review.googlesource.com/17680
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-01 16:28:35 +00:00
Paul Berry f382f3980c Run kernel type checker during front end strong mode unit tests.
This should help make sure that the front end is inserting all of the
necessary implicit downcasts.

The type checker is run after comparing to golden files, and before
running the test in the VM.  So if a test case fails to match its
golden file, the test's status will be "Fail" regardless of whether it
type checks.  If the test case matches its golden file but fails to
type chek, the test's status will be "TypeCheckError".  Rationale: the
type checker is still under development; if it has bugs leading to
false failures, we don't want that to get in the way of comparing
against golden files.

Change-Id: I6764aa5c7f2aab92a10edfa41afcdb056946530b
Reviewed-on: https://dart-review.googlesource.com/17522
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-31 21:25:45 +00:00
Dan Rubel 2b681b2149 Disable scanning of &&= and ||= assignment operators
Fix https://github.com/dart-lang/sdk/issues/30340

Change-Id: Id27f37af9805ca09deaa3c6252817e3d9a926216
Reviewed-on: https://dart-review.googlesource.com/17361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-31 18:51:24 +00:00
Konstantin Shcheglov 9b8e8c2344 Add memory cache directly into ProtectedFileByteStore.
So, it can be used standalone, without wrapping into
MemoryCachingByteStore, and IKG can check for it to protect keys.

Bug:
Change-Id: I50635c773b73ad7e57d0dfe1fd9e3c4574f1a1aa
Reviewed-on: https://dart-review.googlesource.com/17560
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-10-31 18:10:05 +00:00
Konstantin Shcheglov 16d4e9606f Use text presentation for expections and initial libraries state.
R=ahe@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: Ia74e6012e02156a8ee30eb72c07a2415ed2dcba0
Reviewed-on: https://dart-review.googlesource.com/16880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-27 14:43:08 +00:00
Konstantin Shcheglov ffadd1ed3d When running analyzer_cli with --preview-dart-2, load SDK from vm_outline.dill.
We need this to be able to access classes that are required by Fasta,
but come from VM patches.

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I4d29e1dca42e016446516a2dab0fae138cb74548
Reviewed-on: https://dart-review.googlesource.com/16863
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-26 23:34:18 +00:00