Commit Graph

2300 Commits

Author SHA1 Message Date
Aske Simon Christensen 5121a2e831 [cfe] Read product mode directly from environment in async transform.
When we perform constant evaluation in the CFE, the async transform
runs after constant evaluation. Thus, it can no longer use const
bool.fromEnvironment("dart.vm.product") to query whether the VM is
in product mode.

Instead, it can read the product mode define directly from the
environment defines given to the CFE and generate different code
depending on the value.

Change-Id: I2aabc4a84b50a940d35d5664ff4ebdf0680ed5c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111645
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-07 08:28:25 +00:00
Konstantin Shcheglov a05ef7c0cc Store inferred type arguments for tear-off(s).
This change passes pre-submit run over google3.
https://test.corp.google.com/ui#id=OCL:260993915:BASE:261043007:1564632838252:e80ace42

Change-Id: Ibef739f241fdb60a574da971961b1abe6abde9c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111402
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-01 18:25:39 +00:00
Mark Zhou dbabe4dea6 [dartdevc] Imports/Exports are now aliased relative to the library root to disambiguate cross-module name conflicts.
Note: Changes in this CL will require some google3 changes (mostly in code related to test entrypoints).

We encountered an issue whereby cross-module programs importing files
with the same name (but separate identities/locations) were being
overridden throughout all of DDK's module builders. For example, a
module importing "x.dart" and "y/x.dart" would export {x: x, x: x$} -
the latter renamed module shadowing the first. DDC handles this by
prepending a formatted module-root-relative identifier string, so
"y/x.dart" becomes something like y__x, and the export becomes {x: x,
y__x: y__x}. However, this results in some code bloat, especially as
paths become deeply nested. More importantly, the $-renaming scheme is
not consistent across modules. Were we to export x$ instead of x, how
would the importing library know whether x or x$ referred to "y/x.dart"?

To have the best of both worlds, we're introducing the concept of a
module alias that exists at the boundary of module imports and exports.
We use this module-root-relative alias to differentiate modules with the
same name but use the shorter $-renaming scheme throughout the generated
code. Relevant points:

1) jsLibraryAlias has been introduced alongside jsLibraryName.
jsLibraryName no longer must be unique - that property having been
transferred to the alias. DDK no longer just outputs pathSegments.last,
instead adopting DDC's scheme of "creating" a special alias from the
module root. jsLibraryName's temporary IDs are renamed using the
existing DDK scheme.

2) Libraries are now associated with NameSpecifiers. The name and asName
fields represent jsName and jsAlias, respectively, for exports
(vice-versa for imports).

3) The test frameworks have been taking advantage of DDK's previous
naming scheme (throwing way the module root, keeping just the name). A
common pattern is to expect DDK's output symbol to be "someexport", then
forcing DDC's output (normally "some__path__someexport") to resemble
that with the deprecated "library-root" flag set to the path of the
output JS file. We resolve this by updating the scaffolding code to look
for the module-root-relative (long) name, which requires a bunch of
path-to-identifier subsitution logic. The "absoluteRoot" bool in the
sourcemap test runner is a way to reenable this DDC-specific deprecated
behavior. The test runner now requires this alias in the html generator.

Fixes https://github.com/dart-lang/sdk/issues/37473

Change-Id: Iaaa82f3350d424af195967b55c87cb32b30a3d85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108942
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-08-01 17:24:59 +00:00
Nicholas Shahan 08553214ad [dartdevc] Fix optional and named params being detected as not nullable
When compiling the SDK, nullable inference was marking optional and named
parameters as not nullable when they had default values that are not nullable.

This is wrong because the caller could pass null at the call site if they want.

Fixes: #37700
Change-Id: I9d2baae9e4491587b25dcacda4b3df151b9a2754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111602
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-08-01 15:24:19 +00:00
Vijay Menon 2390a25341 [dartdevc] emit base types (void/dynamic) eagerly
This is a somewhat roundabout way to prevent a hot restart from redefining these types.
This fixes the issues arising: https://github.com/dart-lang/sdk/issues/37259.
Should more cleanly separate fields reset on a hot restart from ones preserved.

Change-Id: Id0c45cbeed67b574c3259e1f87a405137ae93575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111315
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-31 16:04:34 +00:00
Dmitry Stefantsov 20e4c74f7f [fasta][nnbd] Print NNBD type modifiers in Kernel's text representation
Change-Id: I48c43858094e2b7264a15be05238bfc3dadd5ecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108264
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-31 08:26:14 +00:00
Konstantin Shcheglov 1a0fe21fb2 Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it.
This reverts commit b8614ca613.

Change-Id: Ic31ee323b21311d8a89f50bcb533316eb55f75e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110941
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-07-29 19:02:24 +00:00
Paul Berry b8614ca613 Revert InheritanceManager3 changes.
These changes were inadvertenly rolled out in a way that breaks
clients, so we need to stage them out more gradually.  See discussion
at
https://dart-review.googlesource.com/c/sdk/+/110552/2/pkg/analyzer/lib/src/generated/resolver.dart#3768

This reverts commit 5b5ddeda92.
This reverts commit e76879acc4.
This reverts commit 27bec56744.

Change-Id: Ic80a577b1cdc4a6c89ca06afceae01af6621d3e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110841
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-07-28 13:54:09 +00:00
Nicholas Shahan 42769d3391 [dartdevc] Update error messages to use new label in github url
area-dev-compiler --> web-dev-compiler

Fixes: #37615
Change-Id: Iab0bb57ed0114bf6918d16d13bc6744bbfde1cc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110345
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-07-26 21:36:56 +00:00
Nicholas Shahan dceeadae53 [dartdevc] Fix unevaluated constants when building SDK with kernel
Passing an empty map signals that the environment is empty and constants should
be evaluated.

Change-Id: I5611a2be81786aa7d42e24022198d52c60558cc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110748
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-07-26 20:51:21 +00:00
Johnni Winther 78224f9b0c [cfe+analyzer+dart2js] Support union markers in id-testing
Supports markers like `cfe|analyzer.` to annotated that the expected
result is for both `cfe` and `analyzer`.

Change-Id: Ie69809db5f63a9ee9b87ff1513b819fe85ce0bce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110500
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-26 17:18:01 +00:00
Johnni Winther bcfe26cba0 [cfe] Fail early on unsupported evaluated constants
The many different entrypoints to the CFE have repeatedly shown problems
with targets that do not support unevaluated constants being used
without providing an environment.

Making the targets opt-in to supporting unevaluated constants will
give the users of CFE early notice that CFE is used inconsistently
(as opposed to the backends failing when they happen to see an
UnevaluatedConstant node that they don't support).

Change-Id: I98c80df3a551823598e413e2895f5649f22f7c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110561
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-26 16:57:51 +00:00
Konstantin Shcheglov 27bec56744 Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it.
Initial: 5d6bab4ed2.
Reverted: 39afa4e555
Change-Id: If611f96e6b0156ec218831dd64305e6ccf02e312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110552
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-26 16:16:11 +00:00
Mark Zhou 7d6024b0ff [dartdevc] Fix for DDC overzealously expanding nested constants
Fixes https://github.com/dart-lang/sdk/issues/37523
Change-Id: I140d7d8fdce836dc0f7f2961711d70ec965e46d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109640
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-07-25 22:21:31 +00:00
Nicholas Shahan 11f5b34f07 Reland "[dartdevc] Immediately throw when encountering an unevaluated constant"
This reverts commit 62674b977d.

Reason for revert: There is no reason we should ever encounter an unevaluated
constant in DDK and doing so implies there is an error in the constant evaluation.

We hope to find all such errors with this assertion. If this causes any more test
failures, feel free to revert this again and create an issue so we can fix.

A fix for the issue seen in the flutter-hhh bot has landed:
https://github.com/flutter/engine/pull/10069

Original change's description:
> Revert "[dartdevc] Immediately throw when encountering an unevaluated constant"
>
> This reverts commit fd38424fa4.
>
> Temporarily disabling this to get Flutter roll going.  See
> https://github.com/dart-lang/sdk/issues/37605
>
> TBR=nshahan@google.com
>
> Change-Id: I44dbb1d4aaf8d5f9cc05f096d26cade93a364f4c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110120
> Reviewed-by: Vijay Menon <vsm@google.com>
> Commit-Queue: Vijay Menon <vsm@google.com>

TBR=vsm@google.com,nshahan@google.com

Change-Id: Ibcb719d3e6c0026b11a812bec853e158b338d51a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110185
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-07-23 23:18:15 +00:00
Vijay Menon 62674b977d Revert "[dartdevc] Immediately throw when encountering an unevaluated constant"
This reverts commit fd38424fa4.

Temporarily disabling this to get Flutter roll going.  See
https://github.com/dart-lang/sdk/issues/37605

TBR=nshahan@google.com

Change-Id: I44dbb1d4aaf8d5f9cc05f096d26cade93a364f4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110120
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-23 16:43:24 +00:00
Konstantin Shcheglov ccdddd2eee Parallel build-mode and DDC changes for summary2.
It does not enable summary2 yet, but makes it possible to flip
one flag AnalysisDriver.useSummary2 to switch between summary1
and summary2.

I run presubmit scripts, and it seems that it works for both.
https://test.corp.google.com/ui#id=OCL:255717824:BASE:259228828:1563746330268:5481d33a
https://test.corp.google.com/ui#id=OCL:255717824:BASE:258892260:1563515248201:2d5ce329

One thing that is not implemented yet is tracking used dependencies
for summary2. So, //dart/bazel_codegen_tests:dependencies_test_run fails.


Change-Id: Iec9f3852e9b91236ce98e87041031daa0cc71a88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107689
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-23 15:07:11 +00:00
Nicholas Shahan fd38424fa4 [dartdevc] Immediately throw when encountering an unevaluated constant
Visiting an `UnevaluatedConstant` at this point is a signal something
has gone wrong in the constant evaluation. This should help us identify
hidden issues when flipping the constants-update-2018 flag back on.

Change-Id: Idd8db4c60785f00b22c29292db53783582ed8af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109104
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-07-18 17:32:00 +00:00
Nicholas Shahan e1e3daa52d [dartdevc] Add --summarize-text flag to ddb script and pass through to DDK
Cleanup handling of paths with the aims to help the script work when run
from an arbitrary directory.

Change-Id: I1a319e7a16e5e021f06457d15807bc4c3245f677
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109521
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-07-18 16:35:35 +00:00
Vijay Menon d0cb753ebd [dartdevc] fix ddb directories and source maps
With this change, one can launch tests, e.g.,

> ddb -r chrome -d -k tests/compiler/dartdevc_native/subtype_test.dart

and step through Dart SDK code using source maps.

Change-Id: I1662a4df76d29e3ccb80a4754147839da784ebe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107480
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-15 17:09:06 +00:00
Vijay Menon 45591cd123 [dartdevc] fix sdk source map paths
Change-Id: I5d508d64b8cb9e8cc9ca764ab34f57aebcc9146a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109020
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-15 16:11:04 +00:00
Vyacheslav Egorov e82ca2f366 [fasta] Unconditionally enable asserts in const constructors
Based on feedback from the language team (https://github.com/dart-lang/language/issues/447).

Removal of CompilerOptions.enableAsserts is pending cleanup in DDK.

Change-Id: Id515e91da3e31647941ce893b2cffc58894a1b1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108813
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-12 15:42:43 +00:00
Jens Johansen 07a53a3cc9 Set onDiagnostic in DDCs incremental compiler code path
Change-Id: Iebff83658bb3b33a316de3f0719cdb44c14ca1b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108725
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-07-12 06:03:13 +00:00
Konstantin Shcheglov 464a5a640f Issue 37401. Support for const Set default values in mocks.
Bug: https://github.com/dart-lang/sdk/issues/37401
Change-Id: Ia65a0e6204f64a308dd27810759a8b7416244248
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108841
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-07-12 04:16:33 +00:00
Nicholas Shahan 55078c0d2f [dartdevc] Fix emitting double constants from the SDK
Change-Id: I38c2f1fe6deca63c3a689503862c3a620017e091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108880
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-07-11 23:44:44 +00:00
Vijay Menon 723bb0eee1 [dartdevc] make nullable_inference_test resilient to const refactor
This test now appears to pass with and without --constant-update-2018.

Change-Id: I9f2f49f6dc5187d5a09bc502f5460089448043e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108820
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-11 17:29:08 +00:00
Brian Wilkerson 97587b554f Update the element model to support extension methods
Change-Id: Ia3bd6a19514368b3e046fead2eed0a4d0bfb133d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108504
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-07-11 13:28:37 +00:00
Johnni Winther d16c0a127e [cfe] Change supportSetLiterals default value to true
This aligns the NoneTarget with the raw output of the CFE.

Change-Id: Ic3a0a3de46dac389d0ade581192e392fdaba9553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108721
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-11 08:54:19 +00:00
Vijay Menon 11da803fe9 [dartdevc] build the ddk sdk with dartdevc
This:
(1) Uses dartdevc and kernel_worker directly to build ddk artifacts.

(2) Generates an outline file instead of a full dill file for ddc_sdk.dill.

(3) Fixes source maps in the shipped sdk so that urls from dart_sdk.js.map
have correct relative paths to dart files in the sdk.  This won't work with
webdev/build as that copies and serves dart_sdk.js, but it will now be
able to build the sdk directly.

Change-Id: I7b9470fe18cac9b4343c7c520fe6ffd7bd9246b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104842
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-07-11 02:05:37 +00:00
Nate Bosch 2a2d41658f Update DDC import prefix for path package
The docs recommend `as p` and it's consistent with usage in other
dart-lang packages.

Change-Id: I242387c5583ba01b0a7ec0287462dbc289b7df01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108561
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-07-10 21:58:31 +00:00
Mark Zhou 9a07c4a817 [dartdevc] Properly encode Windows-style paths and paths with spaces for source maps
Change-Id: I32a28d7327a35c245a67343c91fdc74d6026d810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108503
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-07-10 16:49:22 +00:00
Vyacheslav Egorov fce43ebc4e [ddk] Pass environmentDefines to CFE through CompilerOptions
CFE needs to have access to them to be able to perform constant
evaluation.

Bug: https://github.com/dart-lang/sdk/issues/37357
Change-Id: I15705e6fda330a05765ec2e8354051276cb88b07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108278
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-07-09 07:48:32 +00:00
Mark Zhou ac93a3c368 [dartdevc] Fixing windows-related source map pathing issues
Bug: https://github.com/dart-lang/sdk/issues/37364
Change-Id: If06a2a2737fbc55493ec3f0f607c3d75f7dc4546
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107452
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-07-08 17:46:49 +00:00
Paul Berry c0932a8af6 Move annotated_code_helper.dart into front_end.
This avoids the need for the analyzer to depend on the unpublished
package sourcemap_testing.

Change-Id: I7632df2028d4f3557d2c5c4a3a75510cda968efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108268
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-05 11:40:25 +00:00
Nicholas Shahan ac30ab12ab [dartdevc] Bump pedantic to v1.8.0 and apply new lints
Cleanup violations of:
* `prefer_iterable_whereType`
* `unnecessary_const`
* `unnecessary_new`

Ignore violations in lib/src/js_ast to avoid additional diffs when un-forking.

Change-Id: I7333903422bbf635cd0dea82116372f305f679d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108182
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-07-03 23:51:51 +00:00
Mark Zhou 0e9957c7b1 [dartdevc] Adding support for analyzer dep pruning
Courtesy of Morgan and Emmanuel: https://critique.corp.google.com/#review/255926209

Change-Id: If9981d7b0eede150caed481d0c9f1d9027419ec6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107924
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-07-03 18:36:31 +00:00
Brian Wilkerson 480337106e Implementation of extension override AST node
Change-Id: Ia4249512c3bc14a995179328603fb847c2fe768e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107925
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-07-03 14:01:07 +00:00
Paul Berry a2e1434603 Breaking changes for analyzer version 0.37
Change-Id: I65a16ab2d2ca05de701c27f08300de85a6316b41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99880
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-02 03:59:49 +00:00
Lorenz Nickel 79e478e50e Fixed some links
**I fixed some links and some other minor flaws.**

I also found the following outdated links, which I didn't fix:

- [This link](https://github.com/dart-lang/pool/tree/zone.strong) in [this file](https://github.com/dart-lang/sdk/blob/master/docs/newsletter/20170728.md) (didn't fix because don't know new location and this is some sort of archive so the link should probably stay the original)
- [This link](https://www.dartlang.org/tools/analyzer) in [this file](https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_cli/lib/src/options.dart) (didn't fix since the link is still working, it just gets redirected and the link is part of the programm, I don't want to break anything by changing it, all other links are in comments)
- [This link](https://github.com/domokit/mojo/issues/728) in [this file](https://github.com/dart-lang/sdk/blob/master/build/config/compiler/BUILD.gn) (didn't fix since probably has no new location and is part of TODO, which I don't want to change)

While doing all this I also noticed that [these tests](https://github.com/dart-lang/sdk/tree/master/tests/compiler/dart2js_extra) contain a lot of other inconsistencies in their comments and the location of the import-statements (I only fixed one which was not link-related), could be target of another PR.

Closes #36927
https://github.com/dart-lang/sdk/pull/36927

GitOrigin-RevId: 71d05d0b52d8ec5b92d077a070e066d1fdd4bbfa
Change-Id: Ide4b2424fccad8ae2e06c788efd4443dc0de997b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102222
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2019-07-01 16:21:41 +00:00
Jacob MacDonald 279c1da42d Use absolute paths as canonical paths for inputs digest maps
Change-Id: I9a6c5efe22d4ef1f46393e2983084fe0b8a4652b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107682
Reviewed-by: David Morgan <davidmorgan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-07-01 16:02:14 +00:00
danrubel 8d705089ba remove retired experimental flags from kernel
Change-Id: Id0f5e64ad7431e42a10c09fdaf1fae70b73a6d68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104900
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-27 18:19:55 +00:00
Nate Bosch 032576b323 Make local helpers and fields private
Reduce the surface area of this library to only the fields and methods
which are used from somewhere else.

Cleanup:
- Drop `get` from method names that were changing anyway.
- Remove the `emitMetadata` getter since it's nearly as short to read it
  from the options field.
Change-Id: I8b28f5bbdde57c045c76b11f35c0b224adac89ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107462
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2019-06-26 22:45:08 +00:00
Paul Berry a80b3279a9 Add more specific deprecation notices to package:analyzer/analyzer.dart.
Also fix dev_compiler and tools/patch_sdk.dart to stop using
deprecated functions from package:analyzer/analyzer.dart.

Change-Id: I623e2e5e9cfaed6f52b6126b4eb65d8b47dd3afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107140
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-06-25 13:10:57 +00:00
Jacob MacDonald 0fa8986a07 Use worker input digests for ddk instead of reading the full file bytes.
Also actually compare the SDK summary digest instead of assuming it doesn't change.

Most of this logic is mirroring logic in the bazel_worker.dart file that kernel uses, which eventually we should unify.

Change-Id: If33af0d8de0b0a6a17081dcd852dd036c4b34a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107184
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-24 21:17:20 +00:00
Nicholas Shahan ffb044e4f0 [dartdevc] Apply all lints from pkg:pedantic
Ignore slash_for_doc_comments in lib/src/js_ast to avoid additional diffs when
potentially un-forking in the future.

Fixes: #37218
Change-Id: If5c5bacf2d77fbae432217ba6031a6a8fa5dfcd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106580
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-21 22:13:59 +00:00
Robert Nystrom ee8d2322d4 Remove support for ignoring cast failures in DDC.
Change-Id: I63aac10df5e26155f394623308a03c1977eba1e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106400
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-06-19 21:50:21 +00:00
Paul Berry 01dcec46e7 Refine type of ClassTypeAlias.declaredElement.
This is an API change, but it's non-breaking, because
ClassTypeAlias.declaredElement has always returned a ClassElement; its
return type simply didn't reflect that fact.

Change-Id: I45bcfe1b371953e86f9690b7727be89a835841a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106681
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-19 20:23:50 +00:00
Nicholas Shahan 2073a822bd [dartdevc] Add top level function names to NSM error messages
These are now represented as named functions. This will also help the
debug tools give more information.

Tested with three applications and adding the names caused a code size increases
of less than 1%.

|Total App JS size | Increase |
|------------------|----------|
|  24.7 MB         |   0.06%  |
|  242  MB         |   0.14%  |
|  327  MB         |   0.19%  |

Fixes: #37118
Change-Id: I89a259215ceb8b9e559a190dbd521c923d4c55c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105546
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-06-17 20:58:31 +00:00
Robert Nystrom 99e8a9fba5 Move the test runner (i.e. "test.dart"/"test.py") to pkg/.
This makes it an actual Pub package like most other code inside the SDK
repo. The main goal is to make it easier to write tests for the test
runner itself.

This change:

- Moves all of the code from tools/testing/dart/ over to
  pkg/test_runner. Most of it ends up under test_runner/lib/src.

- Move tools/testing/dart/main.dart to
  pkg/test_runner/bin/test_runner.dart.

- Move standalone_2/io/test_runner_test.dart to
  pkg/test_runner/test/test_runner_test.dart. I don't think it currently
  works, but it wasn't being run in its old location either.

- Add test_runner to the analysis-server bot. This ensures the
  test_runner package is static error clean.

- Remove standalone_2/io/test_runner_analyze_test.dart which used to
  attempt to do the above and is no longer needed.

- Update test.py to look for the test runner at its new location.

- Add test_runner to the repo .packages file and remove the weird
  test_dart pseudo-package. (I think this fixes #35279.)

- Remove status file entries for the removed standalone_2 tests.

There are no code changes to the test runner itself aside from fixing
up import paths.

Change-Id: I3d05d50d222b291848fa5a30de2846e803bc81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105821
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-06-14 23:35:10 +00:00
Nicholas Shahan 177f425012 [dartdevc] Fix violations of library_prefix lint
Rename the library prefix used in imports from `JS` to `js_ast`. Create more of
a distinction between:
* `JS` the library.  Now named `js_ast`.
* `js` the const instance of a JSBuilder.
* `JS` the helper to inline javascript in the SDK patches
  and runtime libraries.

Ignore the lint in the js_ast directory to avoid additional diffs for the
eventual un-forking of the package.

Cleanup a few unused imports.

Issue #37218

Change-Id: I039c1048876d9d9ad424fbec3ad555d300845a3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106160
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-14 22:48:40 +00:00