Commit Graph

6018 Commits

Author SHA1 Message Date
Michael Thomsen ea50890370 Fix links in front_end readme
Closes https://github.com/dart-lang/sdk/pull/44412
https://github.com/dart-lang/sdk/pull/44412

GitOrigin-RevId: 145a40371fb91b8ade302b31bb6eab20e07bde43
Change-Id: I0950e524e7af0d65ce146dbac1465196f322c0aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175260
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-07 15:02:57 +00:00
Johnni Winther c7519a3f01 [cfe] Pass static target to inferInvocation
This is used to detect calls to identical which need special treatment
for flow analysis.

Change-Id: I5109ccc94cdffd8cd46843adfbe4df6b83b92122
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175240
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-07 13:21:57 +00:00
Alexander Markov f04757f6ea [vm] Specialize List.empty calls for growable and fixed-length lists
TEST=existing tests for List

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

Change-Id: I89eecb15b535cc5a3e1aeea350a306883b463b9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175003
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-12-06 23:31:55 +00:00
Paul Berry 6a097edc48 Flow analysis: allow identical to promote values to non-nullable.
This change causes `identical(x, y)` to be treated similarly to `x ==
y` for flow analysis.  For example:

    int? x = ...;
    if (!identical(x, null)) {
      print(x + 1); // Ok, x is known not to be null.
    }

Fixes https://github.com/dart-lang/language/issues/1226.

Bug: https://github.com/dart-lang/language/issues/1226
Change-Id: If2939d3d4dd0dc9d7aaf39984045e9ec3e10ce7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174760
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-12-04 14:40:15 +00:00
Johnni Winther 74be6670c9 [kernel] Remove CoreTypes from legacyErasure
Change-Id: I9692c01ed3bf9982834144dd9eb477a97db5536f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175041
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-04 10:03:40 +00:00
Johnni Winther f7ae22a4c1 Reland "[cfe] Improve encoding of set/list literals for unified collections"
Change-Id: I4f8098e110c9a5e5d6e102b8c6230e85c1575c6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175040
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-04 09:52:20 +00:00
Johnni Winther a3236f6622 [cfe] Disable verification of opt-in/opt-out types
In response to https://dart-review.googlesource.com/c/sdk/+/174860

Change-Id: I8d037bcd833990d242c0822adecbd0c4086e604f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174925
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-03 17:08:43 +00:00
Johnni Winther 87ef15787a [cfe] Handle write during late local initialization
In response to issue #44372

Change-Id: I6ad0730e662f7fcd8987a745cbab72dbb91c2045
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174923
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-03 16:41:53 +00:00
Johnni Winther 442fa7f44e [cfe] Update message for missing default value
Update in response to issue #44329 and to match the change
in https://dart-review.googlesource.com/c/sdk/+/174300

Change-Id: Ia28887f0fad54927b82b7aa29acb88231053cd6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174800
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-03 14:46:23 +00:00
Jens Johansen 923facf226 [CFE] Improve crash test minimizer
This CL adds to/changes the crash test minimizer to:
* Make use of the direct-from-parser ast to try to delete entire
  classes, procedures etc.
* Tries to inline small files into the importers/exporters of those
  files to reduce the number of files.
* Can print info by pression 'i' while it's running.
* Can stop the process without throwing away anything by pression 'q'.
* Can save and load a partial minimization to a json file so one can
  start from there again by passing '--fsJson=jsonFileHere'.
* Attempts to prints the reproduction as a "incremental yaml test file"
  so one can quickly create an incremental test reproducing the crash.

For instance, recreating a bug recently fixed, I can find it using:
```
time out/ReleaseX64/dart pkg/front_end/test/crashing_test_case_minimizer.dart --platform=/path/to/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/platform_strong.dill --invalidate=package:flutter/src/widgets/framework.dart --target=flutter --widgetTransformation --experimental-invalidation --serialize --stack-matches=5 /tmp/edited_flutter_gallery/lib/main.dart

[...]

DONE


Wrote json file system to file:///usr/local/google/home/jensj/code/dart-sdk/sdk/crash_minimizer_result_132
------ Reproduction as semi-done incremental yaml test file ------


type: newworld
trackWidgetCreation: true
target: DDC # basically needed for widget creation to be run
worlds:
  - entry: file:///tmp/edited_flutter_gallery/lib/main.dart
    experiments: alternative-invalidation-strategy
    sources:
      file:///tmp/edited_flutter_gallery/.dart_tool/package_config.json: |
        {
          "configVersion": 2,
          "packages": [
            {
              "name": "flutter",
              "rootUri": "file:///path/to/flutter/packages/flutter",
              "packageUri": "lib/",
              "languageVersion": "2.12"
            }
          ],
          "generated": "2020-11-20T08:58:21.614044Z",
          "generator": "pub",
          "generatorVersion": "2.12.0-50.0.dev"
        }
      file:///tmp/edited_flutter_gallery/lib/main.dart: |
        import "package:flutter/src/widgets/framework.dart";
      file:///path/to/flutter/packages/flutter/lib/src/widgets/framework.dart: |
        import "package:flutter/src/widgets/widget_inspector.dart";
        abstract class Widget {}
      file:///path/to/flutter/packages/flutter/lib/src/widgets/widget_inspector.dart: |
        abstract class _HasCreationLocation {}
        class _Location {}
    expectedLibraryCount: 3 # with parts this is not right

  - entry: file:///tmp/edited_flutter_gallery/lib/main.dart
    experiments: alternative-invalidation-strategy
    worldType: updated
    expectInitializeFromDill: false # or true?
    invalidate:
      - package:flutter/src/widgets/framework.dart
    expectedLibraryCount: 3 # with parts this is not right
    expectsRebuildBodiesOnly: true # or false?

------------------------------------------------------------------


[...]

real    31m16.886s
user    38m57.585s
sys     1m35.374s
```

Change-Id: I9b75a231841c13370f11879a10485ee2add8c3ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174643
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-03 07:53:57 +00:00
Devon Carew 8cba879f46 Add additional validations to the pkg/ package pubspecs.
TEST=these are additional validations that we run on the bots

Redux of https://dart-review.googlesource.com/c/sdk/+/161040

Change-Id: Ia32ced5d48fbfeafacfa9e51dc4774d2e9425091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-12-02 17:27:18 +00:00
Johnni Winther d51ab9b62a [cfe] Add ProcedureStubKind
The enum `ProcedureStubKind` together with the flag `isSynthetic`
replaces the flags `isForwardingStub`, `isForwardingSemiStub`,
`isNoSuchMethodForwarder` and `isMemberSignature`.

The semantics of the existing properties on `Procedure` is unchanged.

The new MixinStub and MixinSuperStub stub kinds are not used yet and
the stub target for NoSuchMethodForwarder is not set yet.

TEST=refactoring


Change-Id: I6e81970dbb4baf0229f43c2a0bf0d5e575e65043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174462
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-02 16:35:58 +00:00
Jens Johansen 321af0844e [CFE] Additions, changes and tests for direct from parser ast stuff
Change-Id: I7457585ddd338cdc6172fee030f93fa4f82ddf1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174642
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-02 11:39:17 +00:00
Johnni Winther 2fafa55d90 [cfe] Add predicate functions for detecting locals created for late lowering encodings
Change-Id: If9c53d4002f6e3cd85c116fb04ea93244a872a71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174123
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-02 09:15:18 +00:00
Dmitry Stefantsov 1d8d2de0a4 [cfe] Use buildInvalidInitializer to report duplicating initializers
Closes #43363.

Bug: https://github.com/dart-lang/sdk/issues/43363
Change-Id: I1de61c2be0d8a30dc184aad7cb392d0c92c5237b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174403
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-12-01 16:55:45 +00:00
Jens Johansen 27ed7912af [kernel] Constant coverage recorded in dill
This adds the recorded constant coverage to the dill file.

runtimes for constant evaluation:
dart2js: No difference proven at 95.0% confidence
flutter gallery: No difference proven at 95.0% confidence
big internal app: No difference proven at 95.0% confidence

sdk sizes:
vm: ~0.0182%
dart2js: ~0.0137%
flutter: ~0.0197%

compile sizes:
dart2js: ~0.0179%
flutter gallery: ~0.0162%
big internal app: ~0.0414%

TEST=test was fixed.

Change-Id: I347751e4d96d4d62140d26ebe37960f46a0dfbfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171948
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-01 12:30:14 +00:00
Jens Johansen deca91c86d [CFE] Record const constructor coverage when evaluating constants
This CL records which const constructors were evaluated
(i.e. contributes coverage) but doesn't actually
save the coverage into the dill file.

runtimes for constant evaluation:
dart2js: No difference proven at 95.0% confidence
flutter gallery: No difference proven at 95.0% confidence
big internal app: No difference proven at 95.0% confidence

sdk sizes:
vm: no change
dart2js: no change
flutter: no change

compile sizes:
dart2js: no change
flutter gallery: no change
big internal app: no change

Change-Id: I2567446c1b78180d73fd7613bc9e780e1a067f5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170435
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-01 09:20:14 +00:00
Jens Johansen 08f3b03361 [CFE] Constant evaluator benchmark
E.g. one can run a benchmark via something like
`out/ReleaseX64/dart pkg/front_end/test/constant_evaluator_benchmark.dart --platform=out/ReleaseX64/vm_platform_strong.dill pkg/compiler/bin/dart2js.dart --target=VM`

Change-Id: Ie9202bbd8a390a461a31625880bbb182f845261e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168485
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-01 09:00:44 +00:00
Jens Johansen 9b5764d05d [CFE] Add uri to crashing error message when finding .packages file
TEST=test was changed.

Change-Id: I68c2041e51c66a93f00a0e2be026caef25ddb223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174241
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-01 08:28:24 +00:00
Clement Skau 2d36c85ff8 [vm] Removes support for --causal-async-stacks
All existing embedders have been opted into --lazy-async-stacks, the
VM also uses it as it's default in all configurations.

After this CL, any user of --causal-async-stacks will get an error
message when trying to use it.
=> In any such case, please simply remove the flag.

TEST=Exhaustive CQ.

Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: Ia440afcf2dba464aa8b8cf381b93bbac8eb9f8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172564
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-12-01 07:27:14 +00:00
Johnni Winther 7a130ccc49 [cfe] Rename isNullableByDefault annotation to isLegacy
TEST=Existing tests

Change-Id: I0aad4deea062ba2016a8be47489ffaa970bfc03e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174260
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-11-27 13:36:29 +00:00
Johnni Winther b9541a14bb [cfe] Mark combined member signatures as legacy when needed
If synthesized members have legacy signatures, mark these as
nullable-by-default even when inserted into opt-in classes.

Change-Id: I956912402cae85f6ceb28a73477d44917780a6d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174240
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-27 11:09:09 +00:00
Jens Johansen c8105305ac [CFE] Improve direct parser ast
* Add specific classes with explicit arguments instead of storing
  everything in a map.
* Add helpers as extension methods.
* Include an (unused) example of using it.

This can most likely still be improved a lot usability-wise, but this
should be a step in the right direction.

Change-Id: I57fc6e7c1866e0647a019a9514dfe71b8e584d82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173726
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-26 11:54:25 +00:00
Lasse Reichstein Holst Nielsen b64550eaff Add a nullFuture in dart:internal.
This is the future returned by `dart:async` in some cases which used to return `null` pre null-safety.
Code inside the SDK which *needs* to not change its timing of events can recognize the future and skip waiting for it, giving the same "synchronous" behavior as before the null safety change.

Longer term, we need to wean people off depending on the specific interleaving of events.
Maybe we should randomly shuffle our microtask queue.

Change-Id: I8d52e74f0549a3068f5dfaffb28c7894b324c49d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172641
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-11-25 11:58:53 +00:00
Johnni Winther 90ec6f2531 [cfe] Ensure that shorting is stopped before expression usage
The creation of the shorting stop expression was done lazily
in NullAwareExpressionInferenceResult.expression. Since the shorting
calls flow analysis to stop null promotion doing this out of order
let to inconsistent flow analysis state.

This CL introduces an `inferNullAwareExpression` the allows to
caller to continue the shorting (if in an opt-in library). The
inferExpression method, used everywhere else, stops any shorting
currently in progress.

Closes #43275

Change-Id: I448163e29bdb0de8e493e5c62aa0474d0c9a593f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173729
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-25 11:28:13 +00:00
Daco Harkes 1245a196ce [samples] Duplicate samples prior to NNBD migration
We want to migrate the samples to NNBD. In order for the old samples
to keep running on the legacy bots, this duplicates all samples, and
changes the legacy bots to run the copies.

Note this will cause the legacy bots to report that all the samples
tests are skipped and that there are now new tests in the samples_2
suite. Existing failures may re-appear. These will be be re-approved
or alternatively Skipped.

The follow up CL migrates samples/ffi to NNBD.

Issue: https://github.com/dart-lang/sdk/issues/43600.

TEST=samples
TEST=samples_2

Change-Id: Ib40f8fb71f81c091973aa0f860b1a49bac120d6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173523
Reviewed-by: Alexander Thomas <athom@google.com>
2020-11-24 18:50:28 +00:00
Johnni Winther d75f7005a0 [cfe] Stop shorting in ??
Closes #44276

Change-Id: I60f398c413f3b40215e9049ee3292eaf7f700d7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173722
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-24 16:01:38 +00:00
Johnni Winther 48ae906dc4 Revert "[cfe] Improve encoding of set/list literals for unified collections"
This reverts commit 3380168c76.

Reason for revert: Performance regression on VM

Original change's description:
> [cfe] Improve encoding of set/list literals for unified collections
>
> Closes #44188
>
> Change-Id: Ib7d457f4beef0f7284922803d46cfe5d4b14cb1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173268
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

TBR=dmitryas@google.com,johnniwinther@google.com

Change-Id: If61882f73e59d0d61a2c23bd28179a881545d295
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173541
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-23 16:00:08 +00:00
Jens Johansen 08ecccf958 [CFE] Test for advanced invalidation, flutter and widget tracking transformation
This is the test promised in
https://dart-review.googlesource.com/c/sdk/+/173265

Change-Id: Ie3943e04c4ba756532bdf41146759715c5893297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173522
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-11-23 15:22:55 +00:00
Johnni Winther 3380168c76 [cfe] Improve encoding of set/list literals for unified collections
Closes #44188

Change-Id: Ib7d457f4beef0f7284922803d46cfe5d4b14cb1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173268
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-23 11:21:33 +00:00
Sam Rawlins bf3f7bad7a Remove unused imports with shared prefixes
The analyzer will start reporting these when
https://github.com/dart-lang/sdk/issues/38784 is fixed.

Change-Id: I5a75b305f52812f07406057b8f0f624e6171ccd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172882
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-19 14:59:24 +00:00
Johnni Winther 3a8a9fe42b [cfe] Register parameters as initializes for expression evaluation
This fixes most skipped tests in https://dart-review.googlesource.com/c/sdk/+/172689

Closes #44235

Change-Id: Iafd84b815dd1a91fd2c8a8bec2669440c2552f00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172645
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-19 10:49:03 +00:00
Johnni Winther 887ab360e5 Revert "[kernel] Ensure that visitors don't implicitly returns null"
This reverts commit 4a3f121341.

The changes broke flutter/engine

TEST=It's a revert!

Change-Id: I1e65e6cfab03795a21a64a96fe3ed72e6ba8ecd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-18 14:51:30 +00:00
Johnni Winther 4a3f121341 [kernel] Ensure that visitors don't implicitly returns null
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.

TEST=Refactoring

Change-Id: I9f9b318982148d844be9826a5f8c88374a9fc402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-18 11:54:30 +00:00
Johnni Winther 3c2a5c8976 [cfe] Add forceUseSentinel for weak mode sentinels
When in weak mode non-nullable fields/locals can hold `null` and therefore
cannot use `null` as sentinel. When the backend supports sentinels, these
are therefore always used in weak mode.

Change-Id: I8b6ac7935d928b148af1c826fcf357502a1c8a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172561
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-18 10:10:39 +00:00
Jens Johansen 0576d64a67 [CFE][kernel] Set parents on typedef children
Change-Id: Iccdd2b0c4c0062abc4e0cf50a2feadc4487941b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172563
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-11-17 17:52:18 +00:00
Nate Bosch aaf13b5247 Update to the latest package:yaml
Expand the range allowed by the dep from `package:analyzer`.

Switch dependencies to `any` for the packages which are `publish_to:
none`. The actual constraints aren't useful in these packages since they
are always pinned exactly by DEPS and so we can't trust they are kept up
to date.

Change-Id: Ibd937e8646574d49105f4dd0de2529e7ab30862a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172380
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-11-16 22:16:50 +00:00
Aske Simon Christensen b11d057572 [vm] Look for the recognized pragma in the unboxer and signature shaker.
This removes the conservative exclusion of everything below num in the
unboxer, and it allows some methods marked as entry points to not be
entry points, as they are not actually referred explicitly in VM code.

TEST=Existing test suite.
Change-Id: If465b9081ac278a105ba99c23a49f5516b7bfbc0
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169401
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-11-16 13:49:50 +00:00
Aske Simon Christensen 1ab705f60c [vm] Require all recognized methods to be marked with pragma.
Adds a @pragma("vm:recognized", <kind>) to all recognized methods, where
<kind> is one of "intrinsic", "graph" or "other", corresponding to the
kind of recognized method.

When running in debug mode, it is checked that all recognized methods
are marked with the correct kind of pragma, and that all methods marked
with the pragma are in fact recognized.

This enables kernel-level analyses and optimizations to query whether
a method is recognized by the VM.

TEST=Asserts that check the correspondence both ways, covered by test
suite, in particular the various CompileAll tests that compile all code.
Change-Id: I12f3305c72a93ecb1aefae2d66e3d9a7dae23b44
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168951
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-16 13:49:50 +00:00
Johnni Winther c4622003a2 [kernel] Remove dynamic access from text_serializer
Change-Id: Ic1012992472f8798c384af8795db8b1f42f8ccb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171945
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-16 08:16:39 +00:00
Johnni Winther a39ea25627 [cfe] Add test for dynamic access in CFE/kernel code
Change-Id: I9cd5aec2bd9b455a099503ca3c55f61659145869
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171726
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-15 12:04:47 +00:00
Anna Gringauze 9c54996510 Fix issues in expression evaluation in google3
- Define private symbols load without reloading the module
  and knowing module format
- Remove libraryName->moduleName map from ExpressionCompiler's
  compileExpressionToJs API as a result of above
- Make ddc tolerate null locations on kernel loaded from dill
  during assert insertions for nullability
- Disable asserts in expression compilation worker
  due to ddc reading source for assert statement compilation
- Remove unused test configuration for expression compiler worker
- Add and update expression compiler tests

Part of: https://github.com/dart-lang/webdev/issues/1174

Change-Id: Idf8f508308915a5487fa0e9810b5674140393fed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170028
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-11-14 01:34:16 +00:00
Liam Appelbe 504e9a32f9 Reland "[wasm] Remove dart:wasm"
This is a reland of ade333dd54

Original change's description:
> [wasm] Remove dart:wasm
>
> I'm not entirely sure why I had to modify a random set of fingerprints
> in runtime/vm/compiler/recognized_methods_list.h, but when I did a debug
> build it had some fingerprint errors.
>
> Change-Id: Ib0a0cccb37f2efba509e2b37b6eabe790fa933c4
> TEST= Deleting stuff, so not really necessary
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170620
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Liam Appelbe <liama@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Change-Id: I0d1388f6312358cc62bb32f5ac7b88a3187223c9
TEST= Deleting stuff, so not really necessary
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171940
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-11-13 20:40:24 +00:00
Siva Annamalai 54a91f26c4 Revert "[wasm] Remove dart:wasm"
This reverts commit ade333dd54.

Reason for revert: This broke both the Flutter HHH and Google3 bots. It looks like some co-ordination is required between the Google3 and Flutter engine build changes for this CL to land.

Original change's description:
> [wasm] Remove dart:wasm
>
> I'm not entirely sure why I had to modify a random set of fingerprints
> in runtime/vm/compiler/recognized_methods_list.h, but when I did a debug
> build it had some fingerprint errors.
>
> Change-Id: Ib0a0cccb37f2efba509e2b37b6eabe790fa933c4
> TEST= Deleting stuff, so not really necessary
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170620
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Liam Appelbe <liama@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,liama@google.com

Change-Id: I244d7b3549845dd71719176a62b6ec3a4c4b5f86
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171860
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-11-13 01:54:10 +00:00
Liam Appelbe ade333dd54 [wasm] Remove dart:wasm
I'm not entirely sure why I had to modify a random set of fingerprints
in runtime/vm/compiler/recognized_methods_list.h, but when I did a debug
build it had some fingerprint errors.

Change-Id: Ib0a0cccb37f2efba509e2b37b6eabe790fa933c4
TEST= Deleting stuff, so not really necessary
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170620
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-11-12 19:22:29 +00:00
Dmitry Stefantsov b4dbbe220c [cfe] Use type parser in type constraint gatherer tests
Closes #44096.

Bug: https://github.com/dart-lang/sdk/issues/44096
Change-Id: Id977e1ef70a1c17b30aedf072be7e6d2ea812d8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171587
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-12 17:25:27 +00:00
Johnni Winther 15c35c2f88 [cfe] Update message for failure to run sound null safety
Closes #44149

Change-Id: Ifcfd951ec616132332aef15058b45d4a49f250cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171594
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-12 14:33:36 +00:00
Johnni Winther f2f0c1a8a8 [cfe] Create const constructor in mixin application with only static fields
Closes #40982

Change-Id: I2fc426735ece176cc81a9da33e33fd3ad14e756a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171592
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-12 13:05:16 +00:00
Johnni Winther 7b89827956 [cfe] Support bit mask for enabling specific late lowerings
TEST=pkg/front_end/testcases/late_lowering/late_lowering_bitmasks.dart

Closes #43993

Change-Id: I47d238dd7cf0ea22983a38bed86e415330070596
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171580
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-11-11 14:06:30 +00:00
Lasse Reichstein Holst Nielsen 1003e91a35 Remove uses of, and need for, Expect.throwsNullCheckedError.
All code which was tested now throws a TypeError in both
sound and unsound null safe mode.

Change-Id: I304dfa6b8683223562f8613f3d14823fccab35bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170439
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-11-11 13:30:30 +00:00