Commit graph

16414 commits

Author SHA1 Message Date
Sigmund Cherem 8d4af85333 Remove use of cwd in d8 preamble
Fixes #30279
BUG= https://github.com/dart-lang/sdk/issues/30279
R=sra@google.com

Review-Url: https://codereview.chromium.org/2993153003 .
2017-08-07 15:54:08 -07:00
Paul Berry 6855bd28f8 Remove hack from KernelTypeInferrer.inferInitializer.
Now that all constructor initializers created by BodyBuilder implement
KernelInitializer, we no longer need a hack to skip initializers that
don't.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2992423002 .
2017-08-07 14:03:44 -07:00
Paul Berry 41170b0a15 When reordering constructor initializers, use correct types for temp vars.
In strong mode, when a call to a super-initializer is reordered, we
can use the static type of the super-initializer arguments to set the
types of the temporary variables that we use to do the reordering.
This is desirable because it might help avoid unnecessary casts.

In non-strong mode, we use `dynamic` for the temporary variables, to
replicate Dart 1.0 behavior.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2993193002 .
2017-08-07 13:55:40 -07:00
Paul Berry 107335c1d0 Add type inference for invalid constructor initializers.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2998573002 .
2017-08-07 13:37:27 -07:00
Konstantin Shcheglov 5011b024df Replace fake directories with actual createDirectory().
R=paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2994683002 .
2017-08-07 13:25:16 -07:00
Stephen Adams 84b615df3d Scrub all non-identifier characters from JavaScript class names
Class names from kernel contain "&", "#", "^" etc

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2999473002 .
2017-08-07 13:12:59 -07:00
Sigmund Cherem c80402ab67 Update .status file after move of byte_store
TBR=paulberry@google.com

Review-Url: https://codereview.chromium.org/2993853002 .
2017-08-07 12:16:43 -07:00
Dan Rubel 6e4f00a27c fasta listener assert enclosing event
The fasta parser generates begin/end event pairs such as
[beginCompilationUnit] and [endCompilationUnit].
Each event should be generated "within" a "higher level" begin/end event pair,
except for [beginCompilationUnit] and [endCompilationUnit],
which should not be generated within any begin/end event pair.

This CL updates the fasta test listener and associated test code to assert that
[endTopLevelDeclaration] is generated within or is enclosed by
a begin/end "CompilationUnit" event pair, and that the [beginCompilationUnit]
and [endCompilationUnit] events are not enclosed by any begin/end event pairs.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2993833002 .
2017-08-07 14:22:01 -04:00
Sigmund Cherem 907fbcd694 Fix compile_from_dill test.
I recently changed the FE in how it loads sdk files. That internally fixed the
meaning of this flag and made it unnecessary for our script.

TBR=efortuna@google.com

Review-Url: https://codereview.chromium.org/2999553002 .
2017-08-07 11:13:51 -07:00
Paul Berry 89c910b9c1 Move byte_store.dart and file_byte_store.dart to their own subdirectory.
This allows us to use the subpackage relationships test to verify that
they don't import any other parts of front_end, which paves the way
for the possibility of moving them to their own package in the future.

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

Review-Url: https://codereview.chromium.org/2990323002 .
2017-08-07 11:04:48 -07:00
Konstantin Shcheglov c28419bce0 Add support for SDK outline in KernelDriver.
I had to weaken file system createDirectory() to avoid conflicts when
we re-create SDK, and attempt to re-recreate its directory.

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

Review-Url: https://codereview.chromium.org/2993093003 .
2017-08-07 10:46:44 -07:00
Paul Berry ae4cbb50af Use "bool" as the downward inference context for assert conditions.
This addresses the type inference part of #30326.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2997513002 .
2017-08-07 10:36:51 -07:00
Sigmund Cherem 62f4509aa0 Update status file for libraries_specification_test
The test fails in `d8` for unrelated reasons.
TBR=paulberry@google.com

Review-Url: https://codereview.chromium.org/2995593002 .
2017-08-07 10:09:12 -07:00
Paul Berry e2f77056a5 Eliminate dependencies on pkg/front_end.
The API for pkg/front_end is still in flux so we want to avoid having
any packages depend directly on it (other than analyzer and
back-ends).

This CL re-exports some of the critical pieces of front_end needed by
analyzer clients so that those clients can access them via analyzer,
without having to directly depend on front_end.  It also updates
pkg/analyzer_plugin to make use of those re-exports.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2993123002 .
2017-08-07 09:46:30 -07:00
Sigmund Cherem b48584d3d0 Switch FE to use the libraries.json format.
This CL:
  * introduces the Dart API to operate over libraries specifications and describes
    the format we intend to use (see libraries_spec.dart)

  * implements serialization/deserialization for this API

  * switches over the front_end to use these APIs
    * public options accept a URI to the JSON file and no longer
       accept a `dartLibraries` map
    * internal code uses the LibrariesSpecification API

  * switches other dependencies on these APIs (resynthesizer_test and patch_sdk.dart)

This is the first step in migrating over to use the libraries.json format and
eventually remove the patched_sdk step. In particular, some of the next steps
include:
  * add a build step to generate .json files from .yaml files
  * add a libraries.yaml file for the sdk
  * split the patched_sdk step in two:
     * patching files
     * generating .dill files
  * add any missing support for patch-files in fasta
  * finally remove the patching files step, and only have a build step for generating
   .dill files

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

Committed: abf2d23af2
Review-Url: https://codereview.chromium.org/2986303003 .
2017-08-07 08:41:28 -07:00
Peter von der Ahé dbe482caac Share code for parsing local functions.
R=danrubel@google.com, johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2999523002 .
2017-08-07 16:06:04 +02:00
Peter von der Ahé 98422979ac Parse type variables of local functions before return type.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2985673002 .
2017-08-07 13:46:47 +02:00
Zach Anderson 0394d3a0cf [infra] Begin removing gyp
This CL begins removing gyp from Dart's tree.

Removing gyp will go in three stages:
1. Remove unused .gyp and .gypi files.
2. Translate *_sources.gypi files to *_sources.gni files
3. Remove //third_party/gyp from DEPS

This CL is stage 1.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2992593002 .
2017-08-04 22:19:35 -07:00
Sigmund Cherem b6d08264a3 Revert "Switch FE to use the libraries.json format."
This reverts commit abf2d23af2.

Reason for revert:
 - win build failed in patched_sdk (likely storing paths and not uris)
 - dart2js bots failed (missing flag)

Will fix the issues and reland shortly.

Review-Url: https://codereview.chromium.org/2993113003 .
2017-08-04 19:46:17 -07:00
Jennifer Messerly 89578574d0 mark call_test failing for DDC travis bot
TBR= @munificent
2017-08-04 18:27:33 -07:00
Paul Berry 1b9ba53fb6 Implement type inference for asserts in constructor initializers.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2995553002 .
2017-08-04 17:55:11 -07:00
Jennifer Messerly 4cb87e6f1e Update language_tests.js
The test was fixed shortly after the fail marker was added
2017-08-04 17:48:31 -07:00
Sigmund Cherem abf2d23af2 Switch FE to use the libraries.json format.
This CL:
  * introduces the Dart API to operate over libraries specifications and describes
    the format we intend to use (see libraries_spec.dart)

  * implements serialization/deserialization for this API

  * switches over the front_end to use these APIs
    * public options accept a URI to the JSON file and no longer
       accept a `dartLibraries` map
    * internal code uses the LibrariesSpecification API

  * switches other dependencies on these APIs (resynthesizer_test and patch_sdk.dart)

This is the first step in migrating over to use the libraries.json format and
eventually remove the patched_sdk step. In particular, some of the next steps
include:
  * add a build step to generate .json files from .yaml files
  * add a libraries.yaml file for the sdk
  * split the patched_sdk step in two:
     * patching files
     * generating .dill files
  * add any missing support for patch-files in fasta
  * finally remove the patching files step, and only have a build step for generating
   .dill files

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

Review-Url: https://codereview.chromium.org/2986303003 .
2017-08-04 17:41:27 -07:00
Konstantin Shcheglov f5d2688206 Add documentation comments for enum and enum values. Resynthesize in analyzer.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2997473002 .
2017-08-04 16:53:52 -07:00
Jennifer Messerly fdf8c22e23 fix Travis bot runtime status
Review-Url: https://codereview.chromium.org/2995563002 .
2017-08-04 16:41:13 -07:00
Stephen Adams bb1e91b597 Redo "Work-around for missing mixin-application charOffset"
TBR=sigmund@google.com

BUG=

Review-Url: https://codereview.chromium.org/2991403002 .
2017-08-04 15:35:38 -07:00
Leaf Petersen d3344ed466 Fix incorrect nullability inference for ??
Fix bug where (a?.foo) was being incorrectly inferred to be
non-nullable if `foo` was non-nullable.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2996523003 .
2017-08-04 15:31:01 -07:00
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