Commit graph

16387 commits

Author SHA1 Message Date
Jacob MacDonald 41fd862217 Call StringToken.canonicalizer.clear() in AnalysisEngine#clearCaches() (#30325) 2017-08-04 14:48:12 -07:00
Jennifer Messerly dcc5f0a873 fix ddc travis bot
Review-Url: https://codereview.chromium.org/2998483002 .
2017-08-04 14:08:27 -07:00
Sigmund Cherem 352dc54191 Update status files to make bots green, minor changes to the script
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2990303002 .
2017-08-04 14:04:37 -07:00
Sigmund Cherem 0e2a6bdef3 Add batch flag to update script
I don't believe it helps with --use-sdk, but why not.

Review-Url: https://codereview.chromium.org/2993733002 .
2017-08-04 13:41:36 -07:00
Emily Fortuna 15fdc7ceb0 Handful of closure issues.
Implement forEachParameter in closures, deal with not all closures being localFunctions, and point to the constructor head instead of body when calling "getConstructorBody"

This reverts commit b74f53aa74.

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2999453002 .
2017-08-04 13:31:14 -07:00
Sigmund Cherem 06a929434e add error message as a comment on the logs
BUG=

Review-Url: https://codereview.chromium.org/2996543002 .
2017-08-04 13:21:37 -07:00
Sigmund Cherem 78dc28606c Add utility tool to update .status files automatically
Usage: from the Dart repo run:

  ./pkg/compiler/tool/status_files/update_all.sh

Caveat: the bash script has only been tested in linux.

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2996533002 .
2017-08-04 12:26:52 -07:00
Konstantin Shcheglov 4ef7fd14c1 Record Typedef reference into Kernel FunctionType and resynthesyze typedefs in Analyzer.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2986393002 .
2017-08-04 12:02:26 -07:00
Konstantin Shcheglov 41bcfaa4a4 Add createDirectory() to MemoryFileSystemEntity.
We need this API to create a mock SDK in a way that makes
ProcessedOptions.validateOptions() to accept it - the SDK root
must exist.

Alternatively (or in addition to) we could make writeXYZ create parent
directories implicitly. So, to "create" a directory, you would need
to create a file in this directory.

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

Review-Url: https://codereview.chromium.org/2994643002 .
2017-08-04 11:46:02 -07:00
Brian Wilkerson 2041871f34 Add missed files from previous CL
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2990273002 .
2017-08-04 09:20:15 -07:00
Brian Wilkerson 07e45530d7 Fix hints by removing deprecation from used methods
R=pquitslund@google.com

Review-Url: https://codereview.chromium.org/2997463002 .
2017-08-04 08:51:59 -07:00
Brian Wilkerson defb2990d2 Add a test to ensure that error codes are not being missed and add missed error codes
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2992243002 .
2017-08-04 07:45:46 -07:00
Johnni Winther 5fe6282ec0 Reformat untouched files.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2990223002 .
2017-08-04 14:52:58 +02:00
Johnni Winther 93d0a55534 Split ast based parts from InferrerEngineImpl
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2991313002 .
2017-08-04 09:57:33 +02:00
Paul Berry 1b03375d62 Implement type inference for super initializers.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2992263002 .
2017-08-03 19:39:13 -07:00
Emily Fortuna 4929f282b3 Make minification Entity-friendly.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2996463002 .
2017-08-03 19:19:21 -07:00
Vijay Menon 4ead726a8c Check for cross-frame violation
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2991353003 .
2017-08-03 16:53:40 -07:00
Stephen Adams 9442c1cf44 Revert "Work-around for missing mixin-application charOffset"
This reverts commit 2007487cf0.

Needs status file changes.

TBR=sigmund@google.com

BUG=

Review-Url: https://codereview.chromium.org/2992993002 .
2017-08-03 16:43:35 -07:00
Stephen Adams 2007487cf0 Work-around for missing mixin-application charOffset
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2994553002 .
2017-08-03 14:47:31 -07:00
Jennifer Messerly 62303b6711 enable batch mode for dartdevc tests, also fix status so ddc bots pass
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2987393002 .
2017-08-03 14:39:45 -07:00
Paul Berry 867d682ff5 Test type inference for field initializers using "this." syntax.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2986403002 .
2017-08-03 14:32:06 -07:00
Paul Berry 57d71479e1 Perform type inference on constructor field initializer expressions.
Fixes #30251

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2994533002 .
2017-08-03 13:54:36 -07:00
Bob Nystrom b9795ffabb A minimal status file formatter and canonicalizer.
For the migration script, I need a (less hacky) way of programmatically
modifying a status file. As a step along that path, I need the ability
to write a status file to disc given a StatusFile object.

With that, it was a small step to write a little "formatter" that turns
a status file into its canonical representation.

It removes unneeded parentheses in expressions, normalizes expectation
case, and normalizes whitespace. Seems useful.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2988383002 .
2017-08-03 13:37:30 -07:00
Emily Fortuna b74f53aa74 Revert "Updated test status after fixing closure call generation."
This reverts commit 6839f6f79f.

BUG=

Review-Url: https://codereview.chromium.org/2986383003 .
2017-08-03 12:06:01 -07:00
pq 1c5101e4a6 Deprecate unintended APIs.
R=brianwilkerson@google.com

See: https://github.com/dart-lang/linter/issues/769
Review-Url: https://codereview.chromium.org/2989363002 .
2017-08-03 10:53:43 -07:00
Emily Fortuna 6839f6f79f Updated test status after fixing closure call generation.
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2993603002 .
2017-08-03 10:45:17 -07:00
Konstantin Shcheglov 60a576108c Store parts in Kernel Library, resynthesize parts in Analyzer.
R=ahe@google.com, brianwilkerson@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2988373002 .
2017-08-03 10:36:29 -07:00
Samir Jindel e80b42a235 Fix parsing of ClosureCreation kernel nodes in VM.
Summary:

Previously, the VM would crash when it encountered a ClosureCreation node
because it was not aware of the new type arguments field.

Now, it skips the type arguemnts field, which allows many tests to pass again,
even though it doesn't correct forward the type arguments at runtime.

Test Plan:

Removed expected failure lines for all the tests added in my prior
CL (introducing the new field).

BUG=
R=dmitryas@google.com, jensj@google.com

Reviewers: dmitryas@google.com
Review-Url: https://codereview.chromium.org/2987143002 .
2017-08-03 16:42:57 +02:00
Zhivka Gucevska 115232ada2 Add support for finalizer of TryFinally in labeled statements
When a break is encountered in the body of a TryFinally statement to an
enclosing label, the finalizer statement of the TryFinally is executed.

BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2991113002 .
2017-08-03 16:17:17 +02:00
Zhivka Gucevska 72ba4f6c1c Add partial support for TryFinally and TryCatch statements
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2985383002 .
2017-08-03 12:51:39 +02:00
Zhivka Gucevska 5e241d86b2 Add support for 'throw' expression
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2987153002 .
2017-08-03 12:36:03 +02:00
Zhivka Gucevska dde7ce2ab0 Add components for handling of exceptions
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2988153002 .
2017-08-03 11:35:49 +02:00
Samir Jindel 454ab91576 Fix duplicate context creation when closures appear in initializers.
Summary:

Previously, when a function parameter was captured both in an initializer and in
the body of a constructor, we would create two contexts: one created in a local
initializer and used by other initializers, and another in the body of the
function. This is incorrect, as it means that changes to the parameter in the
initializer's closure won't be visible in the body.

Now, to work around this problem we re-use the context created for the
initializers in the body of the constructor by moving the body into a new
constructor, and redirecting the original constructor to that one, passing the
context as an additional argument. This dance is necessary because local
initializers aren't visible in the body of a constructor.

Test Plan:

A few of the existing closure conversion tests were changed or fixed by this
revision. We also modify the 'closure_in_initializer.dart' test to hit this case
directly.

R=dmitryas@google.com

Reviewers: dmitryas@google.com
Review-Url: https://codereview.chromium.org/2991853002 .
2017-08-03 11:33:40 +02:00
Zhivka Gucevska a04c14da7d Add support for redirecting constructors
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2984423002 .
2017-08-03 11:12:16 +02:00
Johnni Winther 476b1cdd44 Support forEachClassMember on closure classes
+ split MemberData into MemberData interface and MemberDataImpl node based implementation and add ClosureMemberData objects
+ use SourceSpan instead of ir.Location for Class/MemberDefinition.location
+ register StaticUse.callMethod instead of StaticUse.closure
+ use DartType instead of ResolutionDartType in metadata_collector

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2992863002 .
2017-08-03 10:58:55 +02:00
Zhivka Gucevska 4aab6a4a49 Add support for super initializers in constructor initializer list
BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2990943002 .
2017-08-03 09:00:16 +02:00
Jennifer Messerly 676cf46c44 Fix DDC buildbot so it is green
This is an attempt to get DDC's bot (https://travis-ci.org/dart-lang/sdk) green and restore test coverage, without affecting the Analyzer --strong buildbot. DDC and Analyzer can generally use the same status entries, as they are running nearly identical strong mode analysis. This fixes DDC's test builder to understand status codes in the same way analyzer does, as that was causing mismatch in statuses.

This does not fix the problem that we're skipping tests instead of recording the status. So there is a bit of test coverage lost, but it restores most of DDC's coverage. We can tackle the skips either in a follow up, or as we migrate tests from *_strong to *_2.

This is a partial revert of  "Revert status file changes from 58a6227198d2aa927df19f1b4862f8d0017d6da4" in commit 7be946cf3d.

Review-Url: https://codereview.chromium.org/2990213002 .
2017-08-02 19:57:56 -07:00
Stephen Adams 4f7cfa9a97 closure fields must set isStatic
BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2994503002 .
2017-08-02 14:46:23 -07:00
Bob Nystrom 9d4be00986 Migrate block 44.
R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/2985243002 .
2017-08-02 13:45:45 -07:00
Brian Wilkerson 4c635b7b85 Initial support for an explicit plugin list
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2988343002 .
2017-08-02 11:30:57 -07:00
Devon Carew e164b2a820 ignore errors deleting the analysis driver cache.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2992203002 .
2017-08-02 10:33:00 -07:00
Konstantin Shcheglov 4ea75e9f8e Resynthesize values of final fields of classes with const constructors.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2989243003 .
2017-08-02 10:26:32 -07:00
Devon Carew f383c17bc2 Redo our benchmarks; add a benchmark/benchmarks.dart tool.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2986293002 .
2017-08-02 08:07:38 -07:00
Brian Wilkerson 4e1644f12a Add more documentation for plugins
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2992843002 .
2017-08-02 07:45:45 -07:00
Zhivka Gucevska 66426a2b1c Add support for initializers in constructor invocation
This adds support for field and local initialziers
for constructor invocation.

BUG=
R=dmitryas@google.com

Review-Url: https://codereview.chromium.org/2986973002 .
2017-08-02 12:57:23 +02:00
Johnni Winther 39cc1ab5ef Implement hasConcreteMatch
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2987233002 .
2017-08-02 09:44:30 +02:00
Jennifer Messerly 58a6227198 Use status files for DDC's presubmit script/travis bot
This only handles compile time errors & compiler crashes. It does not yet support status files at runtime, that is still hard coded in language_tests.js. Some preliminary support for runtime status is there, but it's not enabled yet.

This also updates *_strong.status to reflect current test behavior. It looks like those files have not been triaged in a while.

R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2987093002 .
2017-08-01 16:36:17 -07:00
Konstantin Shcheglov 58df70b83b Get logger / fileSystem / byteStore from ProcessedOptions.
R=ahe@google.com, brianwilkerson@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2992173002 .
2017-08-01 16:19:59 -07:00
Konstantin Shcheglov 1ab12931e4 A couple of tweaks.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2988253002 .
2017-08-01 15:24:08 -07:00
Sigmund Cherem d66294cfe2 Pass additional options in incremental setup
With this, we can infer the .packages file on disk.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2989223002 .
2017-08-01 15:00:38 -07:00