Commit graph

42918 commits

Author SHA1 Message Date
Konstantin Shcheglov 987ed0661c Dispose AnalysisContext(s) used to resynthesize CompilationUnitElement(s) for IndexResult(s).
Otherwise we end up with references from SDK cache partitions to the
context private partitions, which reference AnalysisContext(s).

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

Review URL: https://codereview.chromium.org/2532353002 .
2016-11-29 07:18:45 -08:00
Asger Feldthaus 5d26d67342 Revert "Update kernel baseline tests."
This reverts commit b771d61499.

BUG=

Review URL: https://codereview.chromium.org/2540713002 .
2016-11-29 15:01:09 +01:00
Asger Feldthaus bb540416f2 Revert "Store library paths relative to a given application root folder."
This reverts commit 60adb852ad.

BUG=

Review URL: https://codereview.chromium.org/2539783002 .
2016-11-29 14:55:57 +01:00
Martin Kustermann b5e0a0060b Remove dart:mojo.internal library in FlutterTarget
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2539773002 .
2016-11-29 14:41:40 +01:00
William Hesse e2a48dbf38 Update status for failing tests
BUG=https://github.com/dart-lang/sdk/issues/27925
R=eernst@google.com

Review URL: https://codereview.chromium.org/2536183002 .
2016-11-29 14:26:27 +01:00
Asger Feldthaus 640061d62e Add more checks to kernel verifier.
We now check that classes and type parameters are not redeclared.

The verify_test also verifies that its test harness has no errors,
as this would make all the other tests useless.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2539743002 .
2016-11-29 13:04:43 +01:00
Asger Feldthaus b771d61499 Update kernel baseline tests.
These tests are currently disabled on the buildbots, but we should
keep them up-to-date so we can re-enable them soon.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2533773004 .
2016-11-29 12:58:31 +01:00
Asger Feldthaus 60adb852ad Store library paths relative to a given application root folder.
In kernel, library import URIs now have the "app" scheme instead of
the "file" scheme, representing a path relative to the application root.

dartk takes an --app-root flag giving the application root. This
defaults to the current working directory.

The intention is that kernel binaries should not carry irrelevant
path information, such as the path to the home directory of the
user who compiled a given file.

It is not the intention that end-users should see an app URI.
Import paths are currently not shown to users at all, and if we need
to do this, they should be translated to file paths first.

In theory we could stick to file URIs with relative paths, but the Uri
class from dart:core makes this difficult, as certain operations on it
assume that file paths should be absolute.

Source mapping URIs are not yet affected by this change.

R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2532053005 .
2016-11-29 12:40:17 +01:00
Martin Kustermann 8698589dee VM: [Kernel] Update status file for precompiled (debug) builders
Review URL: https://codereview.chromium.org/2538713002 .
2016-11-29 10:32:53 +01:00
Johnni Winther 258ed14ae3 Decouple WorkItem from Compiler
- Remove Compiler and Enqueuer arguments from WorkItem.run
- Move show progress from WorkItem.run to Compiler.showXProgress methods
- Move Compiler.analyzeElement to Resolution.computeWorldImpact
- Move Compiler.analyze to ResolutionWorkItem Move Compiler.codegen to CodegenWorkItem

R=het@google.com

Review URL: https://codereview.chromium.org/2531303002 .
2016-11-29 09:31:41 +01:00
Johnni Winther fbc69f1e9e Merge QueueFilter with EnqueuerStrategy
R=het@google.com

Review URL: https://codereview.chromium.org/2529273003 .
2016-11-29 09:22:13 +01:00
Johnni Winther 417d4d7a50 Further encapsulate Enqueuer
R=het@google.com

Review URL: https://codereview.chromium.org/2527403002 .
2016-11-29 09:14:09 +01:00
Johnni Winther c102d3f72a Remove direct access to enqueuer through use of WorldImpact
R=het@google.com

Review URL: https://codereview.chromium.org/2527973002 .
2016-11-29 09:05:53 +01:00
Johnni Winther bf13fc1b28 Handle assert with message in type inference
Closes #27882

R=sra@google.com

Review URL: https://codereview.chromium.org/2528043003 .
2016-11-29 08:36:27 +01:00
Siva Annamalai 280d6ede9d Temporary workaround to isolate memory leak issue.
BUG=
R=kulakowski@google.com

Review URL: https://codereview.chromium.org/2535683003 .
2016-11-28 19:08:49 -08:00
Konstantin Shcheglov 95ae62b20b Request SearchResult(s) of multiple kinds at once.
This helps to reduce the number of times CompilationUnitElement is
created for each file when we search for more than one kind of relation.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2534833004 .
2016-11-28 18:11:43 -08:00
Ryan Macnak 0cf02040f8 Add a version of heap snapshots that use only fields and stack frames as roots and only include instances.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2502283003 .
2016-11-28 16:00:06 -08:00
Ryan Macnak e60c9d52b6 Fuchsia: Enable newly working socket tests; use MX_CLOCK_UTC.
R=kulakowski@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2536943002 .
2016-11-28 15:50:54 -08:00
Emily Fortuna 86ddd0ea18 Correct link for front page readme (!).
BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/2538563002 .
2016-11-28 14:57:50 -08:00
Matthias Hausner 6e84b56256 Fix dartium test expectations
Fallout from initializing formal access change.

BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org/2535083002 .
2016-11-28 14:04:14 -08:00
Konstantin Shcheglov d8ac1076d9 Don't search if the driver cannot reference the element.
This is just a performance optimization to avoid analyzing the element file in a driver that does not use the file yet.

We use library/unit URIs to search in index, so search in extra drivers would not produce extra results.

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

Review URL: https://codereview.chromium.org/2533853005 .
2016-11-28 13:51:34 -08:00
Konstantin Shcheglov 564be5bc3b Time box _FilesReferencingNameTask.
Relinquishing execution flow and running event loop after every piece
of work in _FilesReferencingNameTask works, but has too much overhead.
If we instead use a fixed time quantum, we can spend less time overall.

E.g. time to search in analyzer files is 400 microseconds.

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

Review URL: https://codereview.chromium.org/2535053002 .
2016-11-28 13:22:02 -08:00
Paul Berry ad68013cea Update CHANGELOG to reflect breaking change to PartOfDirective constructor.
The breaking change was made in b923dafd25.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2528353005 .
2016-11-28 13:21:35 -08:00
Matthias Hausner b48435197a Turn on initializing formal access
Change default value of --initializing_formal_access to true.

BUG=27892
R=regis@google.com

Review URL: https://codereview.chromium.org/2540453002 .
2016-11-28 13:15:15 -08:00
Paul Berry e926a84ec2 Remove support for summary "fallback mode" from analyzer.
This feature was added as a stopgap in case summaries proved
unreliable.  It is no longer needed.

Fixes #27916.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2538503002 .
2016-11-28 12:12:03 -08:00
Konstantin Shcheglov 27a3275495 Search for top-level elements and class members.
No search for imports, import prefixes, libraries and units yet.

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

Review URL: https://codereview.chromium.org/2532203002 .
2016-11-28 11:08:57 -08:00
Paul Berry f4baeb20d7 Create a new AstFactory class to be used by analyzer and its clients.
Unlike the previous AstFactory (now called AstTestFactory), this class
is not just for testing; it is intended to be able to create all
analyzer AST objects used in production.  Also, its methods are
non-static.

For now, all users of the new AstFactory access it using the final
variable `astFactory` in standard_ast_factory.dart.  In future CLs I
intend to plumb a reference to the AstFactory through various analyzer
classes so that it can be used in a dependency injection style.

Also, the classes CommentType and UriValidationCodeImpl have been
moved out of the AST implementation file
(pkg/analyzer/lib/src/dart/ast/ast.dart) and to their own files so
that the AST interface will be able to continue to use them without
depending on the AST implementation.

In follow-up CLs I will change the analyzer and its clients to use the
AstFactory rather than the redirecting constructors in the AST
interface file, and then remove those redirecting constructors.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2522143003 .
2016-11-28 10:50:20 -08:00
Konstantin Shcheglov 1fea2bb238 AnalysisErrorWithProperties cannot be reported with the new analysis driver.
Add a check for now to avoid crashes.

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

Review URL: https://codereview.chromium.org/2533043002 .
2016-11-28 10:43:49 -08:00
Konstantin Shcheglov 5ee52c415f Fixes for documentation.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2533013002 .
2016-11-28 10:30:07 -08:00
Martin Kustermann f81bcb660a VM: [Kernel] Update status file for precompiled (release) builders
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2537543002 .
2016-11-28 19:23:23 +01:00
Konstantin Shcheglov a573765c18 Status page for the new analysis driver.
Probably more info should be added with time.
But this lets us see drivers and files.

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

Review URL: https://codereview.chromium.org/2530273004 .
2016-11-28 09:15:31 -08:00
Konstantin Shcheglov 5cbd824762 Fix for search references when the element is null.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2526363002 .
2016-11-28 08:51:40 -08:00
Konstantin Shcheglov 5ff8db3a5f Filter out AnalysisErrors with null 'errorCode'.
We have an error report:

My guess is that `errorCodeByUniqueName` returned `null`.

It might be either a bug in `errorCodeByUniqueName`, or a shortcoming
or our current data version mechanism (which we know about - it should
be a hash of sources or something like this).

Either way, a missing error is better than a crash.

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

Review URL: https://codereview.chromium.org/2527423002 .
2016-11-28 08:43:18 -08:00
William Hesse 0bb0386634 Increase subprocess timeout in standalone/io/test_runner_test.
A passing subtest was sometimes taking more than 10 seconds, and
timing out.

BUG=https://github.com/dart-lang/sdk/issues/20351
R=kustermann@google.com

Review URL: https://codereview.chromium.org/2535773003 .
2016-11-28 17:42:47 +01:00
Konstantin Shcheglov f189796d68 Implement getLinkedBundle() for MockSdk in analysis_server.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2525203002 .
2016-11-28 08:32:34 -08:00
William Hesse 6f7005ee71 Update status for co19 tests on browsers.
BUG=
R=kustermann@google.com

Review URL: https://codereview.chromium.org/2538443002 .
2016-11-28 16:32:41 +01:00
Martin Kustermann e697ce94af VM: [Kernel] Remove assertion in TranslateStatement() - we use it inside let expressions
Review URL: https://codereview.chromium.org/2535823002 .
2016-11-28 16:17:04 +01:00
Vyacheslav Egorov 8eceda053f VM: [Kernel] Don't add implicit getters for top level fields into the library dictionary.
Tree shaker can't cope with this and produces incorrect snapshots that contains tree shaken classes.

R=kustermann@google.com
BUG=

Review URL: https://codereview.chromium.org/2536683002 .
2016-11-28 15:50:24 +01:00
Martin Kustermann 0c6beaca1c VM: [Kernel] Need to keep stack_ correct, fixes failures in debug JIT mode
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2535813002 .
2016-11-28 15:40:40 +01:00
Martin Kustermann aaec324001 Add more flags to the blacklist of reproduction commands
Currently failures on the buildbot will look for example like this:

Short reproduction command (experimental):
    python tools/test.py -cdartk -t120 --write-debug-log --write-test-outcome-log --copy-coredumps --exclude-suite pkg language/transitive_private_library_access_test

But developers only would like to see

    python tools/test.py -cdartk -t120 language/transitive_private_library_access_test

R=whesse@google.com

Review URL: https://codereview.chromium.org/2532123002 .
2016-11-28 14:18:27 +01:00
Asger Feldthaus 50c199c224 Skip kernel unit tests on jsshell due to #26103.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2536633002 .
2016-11-28 13:44:34 +01:00
Asger Feldthaus 0ae961f428 Document that setter expressions return their right-hand side.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2530203003 .
2016-11-28 12:27:08 +01:00
Asger Feldthaus 8f12489839 Add --verify-ir flag to dartk and test.py.
This replaces the old --sanity-check flag from dartk. Some files have
been renamed to avoid the wording "sanity check".

Compared to --sanity-check, the following checks have been added:
- variables are not referenced out of scope
- variables are not redeclared
- class type parameters are not referenced from static context

A unit test has been added to check that the verifier rejects certain
invalid ASTs.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/2531873002 .
2016-11-28 12:21:19 +01:00
Lasse R.H. Nielsen c05eb97461 Add message to assert in specification.
R=eernst@google.com

Review URL: https://codereview.chromium.org/2530083002 .
2016-11-28 09:19:28 +01:00
Lasse Reichstein Holst Nielsen 7957a1c256 Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2467113003 .

Committed: b08fb1373f
2016-11-28 08:04:04 +01:00
Stephen Adams b20b10a0af dart2js-kernel: Implement Let and PropertySet.
The Accessor builders capture some subexpressions to help map kernel
Nodes to Ast Nodes.

R=asgerf@google.com

Review URL: https://codereview.chromium.org/2526123002 .
2016-11-26 12:42:37 -08:00
Matan Lurey d92107e01d Remove scary warning from dart:convert#Codec (#27897)
Seems unnecessarily scary given that a breaking change here would now be a huge breaking change.
2016-11-25 15:42:01 -08:00
Konstantin Shcheglov a69b7f3fb0 Add AnalysisDriver.getIndex().
AnalysisResult.index is not quite enough.

While the index can be used to find where an element is used in the file,
we need to know also the enclosing Element, which we can find from the
full CompilationUnitElement.

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

Review URL: https://codereview.chromium.org/2526373002 .
2016-11-25 09:51:05 -08:00
Konstantin Shcheglov d16dfdc2c9 Store individual LinkedLibrary objects instead of PackageBundle(s).
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2531723002 .
2016-11-25 09:38:40 -08:00
Konstantin Shcheglov 483fa6de3a Prefer a driver to which the file is added.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2533533002 .
2016-11-25 09:28:07 -08:00