Commit graph

19354 commits

Author SHA1 Message Date
Samir Jindel 43382ded6d [vm/ffi] Regression test for dartbug.com/37133
Also removed some redundant test code.

Change-Id: Idbb343d35592816814d473de2317324029481c6f
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-mac-debug-x64-try,vm-kernel-reload-mac-debug-simdbc64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105590
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-17 10:47:00 +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
Mike Fairhurst c246fa1f2b Fix #36956, report undefined getter for uses on Null.
Bug: 36956
Change-Id: I5b8f40f5c1f7fd9304b02054e3d8d7d607c12af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106021
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-14 21:29:29 +00:00
Samir Jindel d0447ee0da [vm/ffi] Fix ADR usage in FfiCallInstr::EmitNativeCode.
Props to Daco for identifying the stackmap issue!

Change-Id: I9a54b9db864c86e069e2fcf84b6ba71719d76a09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106086
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-06-14 16:54:23 +00:00
Daco Harkes 04c1a2886f [vm/ffi] SimDBC64 align stack frame
And regression test for dartbug.com/37069

Fixes: https://github.com/dart-lang/sdk/issues/37176
Follow up of: https://dart-review.googlesource.com/c/sdk/+/103814
Bug: https://github.com/dart-lang/sdk/issues/37069
Change-Id: I066561b487c691952496e2ca6878ac82cee0e02e
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105941
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-06-13 16:26:40 +00:00
Zichang Guo ce9a582b05 [vm] RFC6874 support zoneID in uri parser
An implementation of https://tools.ietf.org/html/rfc6874.

IP-literal = "[" ( IPv6address / IPvFuture  ) "]"

will be updated to:

IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture  ) "]"
ZoneID = 1*( unreserved / pct-encoded )
IPv6addrz = IPv6address "%25" ZoneID

Bug: https://github.com/dart-lang/sdk/issues/29456
Change-Id: Ieac7b00e97d3ceff794f3b56ed4b6e4d9d6bbb47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103544
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-13 16:19:35 +00:00
Johnni Winther f889bd7067 Delete JavaScriptBackend
* move names to Identifiers
* move resolution parts to front end strategy
* move codegen parts to backend strategy
* remove now unneeded methods from FrontendStrategy and BackendStrategy

Change-Id: I0675d56045dd212ad195177ecd23b27b0d849a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105742
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-13 10:09:46 +00:00
Stephen Adams 68dadda21c Add other terminal Rtis
Change-Id: If70dc283a5fb06fa0d037fb0d30e4ba19352f8d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105736
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-13 00:22:28 +00:00
Samir Jindel 68b2d53da5 Revert "[vm/ffi] SimDBC64 align stack frame"
This reverts commit f1038ee771.

Reason for revert: breaks function_gc_test on ARM64

Original change's description:
> [vm/ffi] SimDBC64 align stack frame
> 
> And regression test for dartbug.com/37069
> 
> Fixes: https://github.com/dart-lang/sdk/issues/37176
> Follow up of: https://dart-review.googlesource.com/c/sdk/+/103814
> Bug: https://github.com/dart-lang/sdk/issues/37069
> Change-Id: I2c791271f936580d66a48485a60ab6cddb1ba4f8
> Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104824
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

TBR=sjindel@google.com,dacoharkes@google.com

Change-Id: Ibefa2e854f4a58b41384aca73a3bbbe86d75bf80
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37069
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105840
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-06-12 22:31:11 +00:00
Alexander Markov fa28d5b912 [tests] Update failing standalone_2/io/http_* tests for Dart 2
Change-Id: I80cff0d2f864828386f1b8711810e960bbe00f3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105729
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-12 21:17:12 +00:00
Stephen Adams b981798e3a Add environment.bind operation.
Change-Id: I2fd5d4b87e7fdd1fe75f064ec82c43a8334c2138
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105722
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-06-12 21:15:22 +00:00
Mike Fairhurst 2f65830aeb Add null checks for spread operator
Change-Id: Ib3b0f46643a24e22e0344a4505743518f885e9e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-12 20:58:03 +00:00
Aart Bik fa6fce61fa [dart/vm] Improved inlining methods and heuristics
Rationale:
Previous method cached graph information (instruction and call site
counts) on a per-function level, not accounting for potential
specializations. The improved method runs an extra constant folding
pass, and only caches per-function information for non-specialized
cases. As a result, we inling much better, see for example, the
added test as illustration.

Since we no longer cache for constants, compile-time may be increased
a bit due to the extra scan. In the long run we should consider
for common constant "situations" as the call site.

https://github.com/dart-lang/sdk/issues/36880

Change-Id: I19f007c7f1860ad0ea88fafb38695dc154189ad5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105460
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-06-12 19:39:10 +00:00
Daco Harkes f1038ee771 [vm/ffi] SimDBC64 align stack frame
And regression test for dartbug.com/37069

Fixes: https://github.com/dart-lang/sdk/issues/37176
Follow up of: https://dart-review.googlesource.com/c/sdk/+/103814
Bug: https://github.com/dart-lang/sdk/issues/37069
Change-Id: I2c791271f936580d66a48485a60ab6cddb1ba4f8
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104824
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-06-12 16:25:34 +00:00
Stephen Adams 701a2fed01 Parse binding recipes
Indexing scheme changed.

Change-Id: I44f7592b65d615827ea3b78f46117c71f3e50b31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105660
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-11 23:52:59 +00:00
Sigmund Cherem 7c7160f022 Move isRedirectingFactory to CFE and add unit test for it.
Eventually it should be handled by Procedure.isRedirectingFactoryConstructor, but that is
currently broken for patch files.

It appears the VM has no patches of that kind, but dart2js does.

Change-Id: I0b64379f16089ad0d98ecd4df1ed9282ed6bc0e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98523
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-11 22:00:10 +00:00
Stephen Adams 7ecd81b0b8 Start on parser
Change-Id: Ibcc1dcb04735bcefd43f4239dcac28329f519c95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105470
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-11 03:17:35 +00:00
Sigmund Cherem f6d67a549b Turn ddc and dart2js modular tests into suites and share their test cases
For this to work properly, we first need the test infrastructure to have support
for the `--output-directory` flag (see base CL)

Change-Id: I75f788d19ad3b4e9523830250c4a1c9de8418cda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-07 21:54:56 +00:00
Nate Bosch 8614f86c9b Remove remaining support for dart:isolate on web
Closes #37153

Isolate.resolvePackageUri was the only API which had an implementation
across DDC and dart2js. The implementation in dart2js has been broken by
default since Dart 2.0.0 without a user implemented hook that is not
used on any public repo on github. Our current supported path for
invoking the compilers on projects disallows the import altogether on
the web and it is only usable with an older version of the
`build_web_compilers` package, or by invoking the compiler manually
outside of the build system. This CL does not break the ability to have
the import when invoking outside of the build system.

- Drop implementation for `Isolate.resolvePackageUri` from the dart2js
  and DDC patch files.
- Drop all references to `defaultPackagesBase` since it is not used.
- Drop all tests under `isolate/browser` since we do not expect any
  support on the web. Most of these tests would have already been
  failing. Remove status file entries that refer to the deleted tests.

Change-Id: I4a19213b0946d835c00e9c107a714f3bc5672f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-07 21:13:06 +00:00
Stephen Adams d10dffbfbf Add simple test to create dynamic
- Add testing entry points to create Universe
- Add creation of 'dynamic'

Change-Id: I54dd27b9a2f6c93a382c4927e6a306b11bcea96c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105345
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-07 19:40:12 +00:00
Daco Harkes 9f2f5adb64 Reland [vm/ffi] Regression test for dartbug.com/36993
Fixes: https://github.com/dart-lang/sdk/issues/37175

Know issue: https://github.com/dart-lang/sdk/issues/37180

Follow up of: https://dart-review.googlesource.com/c/sdk/+/103136
Bug: https://github.com/dart-lang/sdk/issues/36993
Change-Id: I13fc69fd84362f207e9e66c4d1ef6c2ef2aba368
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105303
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-06-07 13:52:09 +00:00
Alexander Aprelev 4ccae238ea [vm/isolate] Add TransferableTypedData class that allows low-cost passing of Uint8List between isolates.
TransferableTypedData instances are one-use kind of thing: once receiver materializes it, it can't be used
again, once sender sends it out to an isolate, sender can't send it to different isolate.

Example of use:

sender isolate:

```
Future<TransferableTypedData> consolidateHttpClientResponseBytes(HttpClientResponse response) {
  final completer = Completer<TransferableTypedData>();
  final chunks = <Uint8List>[];
  response.listen((List<int> chunk) {
    chunks.add(chunk);
  }, onDone: () {
    completer.complete(TransferableTypedData.fromList(chunks));
  });
  return completer.future;
}
...
sendPort.send(await consolidateHttpClientResponseBytes(response));
```

receiver isolate:
```
    RawReceivePort port = RawReceivePort((TransferableTypedData transferable) {
      Uint8List content = transferable.materialize().asUint8List();
      ...
    });
```

31959[tr] and 31960[tr] tests were inspired by dartbug.com/31959, dartbug.com/31960 that this CL attempts to address:
```
╰─➤  out/ReleaseX64/dart 31960.dart
sending...
163ms for round-trip
sending...
81ms for round-trip
sending...
20ms for round-trip
sending...
14ms for round-trip
sending...
20ms for round-trip
sending...
14ms for round-trip
```

(notice no "since last checking" pauses") vs

```
╰─➤  out/ReleaseX64/dart 31960.dart
sending...
154ms since last checkin
174ms for round-trip
sending...
68ms since last checkin
9ms since last checkin
171ms for round-trip
sending...
13ms since last checkin
108ms for round-trip
sending...
14ms since last checkin
108ms for round-trip
sending...
14ms since last checkin
107ms for round-trip
```

Change-Id: I0fcb5ce285394f498c3f1db4414204531f98199d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99623
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-06 19:49:07 +00:00
Samir Jindel 6b7013224c Revert "[vm/ffi] Regression test for dartbug.com/36993"
This reverts commit e1a7ef52af.

Reason for revert:
Caused crash on cross-vm-linux-release-arm64: https://ci.chromium.org/p/dart/builders/ci.sandbox/cross-vm-linux-release-arm64/2036

Original change's description:
> [vm/ffi] Regression test for dartbug.com/36993
> 
> Follow up of: https://dart-review.googlesource.com/c/sdk/+/103136
> Bug: https://github.com/dart-lang/sdk/issues/36993
> Change-Id: Ib5e8308b91b9b5ce5b95362dd79d12e79499a75c
> Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104820
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Auto-Submit: Daco Harkes <dacoharkes@google.com>

TBR=sjindel@google.com,dacoharkes@google.com

Change-Id: I51cb94dc4a6046bedb6be0580d0092010992c684
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/36993
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105301
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-06-06 17:12:59 +00:00
Samir Jindel dd306dd36f [vm/ffi] Remove hacks and instability from FFI GC tests.
This is based on https://dart-review.googlesource.com/c/sdk/+/100583/2,
but instead of relying on private symbols, we expose an API function which
is a no-op outside specific tests.

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

Change-Id: Ieb78caa2d14956a2b5f985533b9b73e941d2d9c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103801
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-06-06 15:52:12 +00:00
Daco Harkes e1a7ef52af [vm/ffi] Regression test for dartbug.com/36993
Follow up of: https://dart-review.googlesource.com/c/sdk/+/103136
Bug: https://github.com/dart-lang/sdk/issues/36993
Change-Id: Ib5e8308b91b9b5ce5b95362dd79d12e79499a75c
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104820
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2019-06-06 15:12:02 +00:00
Kevin Millikin 64b0ce5b58 Remove UI as code experimental flags from our tests
The features control-flow-collections and spread-collections have been
shipped and it is no longer necessary for tests to explicitly opt into
them.

Change-Id: I074b91d12e4e485ee4a64147947bb1113899ecdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104780
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-06-06 13:17:49 +00:00
Erik Ernst 56793b3d47 Dart.g fixes, not including nnbd updates.
Change-Id: Ibbc6f5f811ed0cc042340254dce10616c0600fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105220
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-06-06 12:07:40 +00:00
Dmitry Stefantsov e9acd9033e [fasta] Add test for runtime checks in mixins with implicit covariance
Change-Id: I7e9d7cd6d3a8e27570dd6b7a882e3ad7a63acb60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104783
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-06-06 11:53:14 +00:00
Stephen Adams 237d3ca398 dart2js: Add skeleton dart:_rti libary
- Skeleton Rti type
- Skeleton test
- Add dependency on command-line flag to get dart:_rti into platform dill

Change-Id: Idf383269c66c9951e23fd70a45ce65c54a973586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104921
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-06 01:02:20 +00:00
Johnni Winther 682ffb6e7a Handle unevaluated constants in annotations
Change-Id: Icbcdac10ea5aabedbeebd7953134d297ab6c1d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104561
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-05 13:05:00 +00:00
Mike Fairhurst c388c263b0 Fix potentially-nullable test case
Change-Id: Ieb3d192d273b89666b8d00affe1279ada07dc384
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104945
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-05 07:04:21 +00:00
Brian Wilkerson 2e5cc24b8f Fix bugs in a couple of language tests
Change-Id: I601f1dafa10b9553ad4e08bad3232a896bf52aa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104843
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-04 17:06:05 +00:00
Mike Fairhurst 55d3bbf13f Promote parameter of == to nullable when invoked.
This is required because otherwise

Object() == null

requires the type signature of Object.operator==(Object o) to be
changed to Object.operator==(Object? o). Which I don't think is the
behavior we want.

Confirmation that this CL is correct has been sent to the language
team. I recommend we land, which will unblock my subtyping CL, and
roll back/readdress later if need be.

Change-Id: I498f9870e7128b2cac3012fff0cb1ab50fcc8df7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104344
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-04 00:36:24 +00:00
Sigmund Cherem 1045ef1ceb Use generic test runner to log data using the test infrastructure jsonl format
Mostly this is adding an abstraction so we can produce the jsonl files that will
allow us to track the status of each test individually.

On a separate CL I'll be moving the tests out of the current unit tests into
their own step in the test matrix.

Change-Id: Id4537db1458949370195124164b120b49a7a526c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104384
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-03 19:16:49 +00:00
Samir Jindel 8cbb11cc55 [vm/ffi] FFI callbacks on ARM32.
Please see go/dart-ffi-callbacks for design context and motivation.

Change-Id: Ie5edcb8837157c679954a670fb19d545e22fec69
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-ia32-try, vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101828
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-06-03 14:36:04 +00:00
Zach Anderson d4d9f0afaa [vm,dart:io] Check for socket connection success
Prior to this change, connection errors such as "Connection refused"
etc, are caught either by some error condition being detected by
the eventhandler thread and that error condition being propagated
to the Dart thread, or by the first read or write after a
"successful" connection failing with an error.

However, posix documentation for non-blocking sockets recommends
either checking getsockopt(SO_ERROR), or calling connect() a
second time following the first write event on a socket after
the first connect call returns EINPROGRESS.

On Fuchsia, this check is mandatory because errors like
"Connection refused" are neither signaled on the socket's
underlying OS handle, nor indicated by error returns from
read() and write().

This change adds the check, which is optional on other platforms,
but mandatory on Fuchsia, to the Dart socket connection loop
after the first write signal is asserted.

Change-Id: I8aeea4665913f79e8138bdd830676ae43066a959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104263
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-06-01 01:52:47 +00:00
Johnni Winther 30d118d429 Handle deferred expressions and names in model_test
Change-Id: I262532c2c0e58e5066376c18d7bd1478502fe539
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104301
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-31 17:06:44 +00:00
Johnni Winther 5fcff2f581 Use modular code generation in modular_test
Change-Id: I03fc9adba1999410e10ded89cec9b6e0a8b2b369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103811
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-31 15:25:34 +00:00
Johnni Winther a620c56e8d Ensure output unit data for late members
+ assert classes and members have an output unit

Change-Id: I69749d54d79a66fea4947034458295010f83c0cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103805
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-31 14:20:24 +00:00
Stephen Adams a25f927ba9 Split HTypeConversion
Introduce HPrimitiveCheck for checking the receiver or argument of
primitive operations. These will eventually go away with NNBD since it
will be a call-site type error to invoke `+` with a null receiver or
operand.

Change-Id: I54bf64f8231a234341c1ddf5ad4dba26909d613d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104185
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-30 23:38:25 +00:00
Dan Rubel 445a23a9bc first cut extension methods test
Change-Id: I0fa36916a5cf7f55dc5223c05d7d37211da035f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-30 16:01:22 +00:00
Vijay Menon dd5530a73e [dartdevc] make ImmutableSet private
Patch files should not add public members to the underlying library.

Siggi was hitting this when wiring up modular testing for DDC:
https://dart-review.googlesource.com/c/sdk/+/103680/3/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart#544

The ddk builder appears to have be swallowing this error - not yet sure why.

Change-Id: I86098b25a344b2bb8b69fe3dc386d01f6f7cb309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103740
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 20:04:24 +00:00
Sigmund Cherem 4c9bf5479f Extract generic runner logic, now dart2js modular test is mostly dart2js specific
Change-Id: I73f1a5590681871a54c5bc8dc1ad0d7d0f71024e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-05-29 19:23:33 +00:00
Vijay Menon 47e63b0eee [dartdevc] encode part file metadata
Fixes https://github.com/dart-lang/sdk/issues/37074

Hand-tested on flutter gallery.  E.g.,:
> dart.getParts('package:flutter_web_ui/ui.dart')
(15) ["src/ui/canvas.dart", "src/ui/compositing.dart", "src/ui/debug_canvas_reuse_overlay.dart", "src/ui/geometry.dart", "src/ui/hash_codes.dart", "src/ui/initialization.dart", "src/ui/lerp.dart", "src/ui/natives.dart", "src/ui/painting.dart", "src/ui/pointer.dart", "src/ui/semantics.dart", "src/ui/browser_location.dart", "src/ui/text.dart", "src/ui/tile_mode.dart", "src/ui/window.dart"]

Change-Id: Ied734d9f3739886d6679a9a9bbeae854e432bc52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103602
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 14:48:40 +00:00
Aske Simon Christensen d5405d06f4 [cfe] Allow local const variables as annotations.
Fixes https://github.com/dart-lang/sdk/issues/37065

Change-Id: If902bd22fc6e0925c361a31e22b32d046ea4754e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103628
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-05-29 09:21:39 +00:00
Alexander Thomas 182d55dfda [dart2js] Add support for BabelJS to test.py
This adds support for BabelJS to test.py's dart2js compiler
configuration. When --babel is specified directly or through a named
configuration, test.py will run an additional step after dart2js that
post-processes the javascript output by running it through BabelJS with
the specified Babel configuration. BabelJS is added to the DEPS in its
standalone form. d8 is used to run BabelJS standalone to avoid adding
a dependency on NodeJS. d8 can only write to stdout but not to files or
stderr, which makes it necessary to change the test_runner to handle
commands that expect their output to be piped to a file.

Changes:
* Add --babel option to test.py.
* Add babel option to pkg/smith.
* Switch IE11 builder to use babel transformation.
* Fix option list comparison bugs in pkg/smith.
* Change dart2js compiler configuration to generate files using the
  test name rather than just "out.js" (update test that relied on this).
* Remove runtime_configuration dependency on test_suite.
* Remove obsolete blocks adding --preview-dart-2 dart2js arguments.
* Make dart2js' compiler configuration more like DDC's.
* Remove createCommand method that is no longer used.
* Remove support for "OtherResources" which was only used for
  dart:isolate tests on dart2js and DDC.
* Skip co19_2 tests that are slow to transform with babel.
* Simplify the timeout handling in the test runner with Future.timeout.

Change-Id: I32e4917b2a57ecbe684538e40d744f0101c552a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/90402
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-29 08:39:44 +00:00
Vijay Menon 96c2d3c303 [dartdevc] enable testing of ddc internals
Change-Id: I8f4753a9a1f2f9f61df0d045adf07ff75fe32907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103820
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 19:33:05 +00:00
Daco Harkes 4c32cddef8 [vm/ffi] Fix ffi trampoline class finalization - fix test on android
Change-Id: I4389667701de45827e093305bdda8443520abe54
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103844
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-28 17:11:36 +00:00
Daco Harkes 2878bfde6c [vm/ffi] Fix ffi trampoline class finalization
Fixes: https://github.com/dart-lang/sdk/issues/37100

Change-Id: I5b1ab44da2ead7edb347fcf5ceee3cad7f396ed7
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103841
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-05-28 14:53:06 +00:00
Dmitry Stefantsov 39dbaecfc1 Remove tests relying on contravariant uses of varaibles in supertypes
Change-Id: Ie614d8f96bbe534117f83528b41fe63fdfa9c9c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103525
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2019-05-28 09:56:43 +00:00
Jonas Termansen b3a06c1933 [dart:_http] Fix http_cookie_date_test.dart compile errors.
Fixes https://github.com/dart-lang/sdk/issues/28843
Change-Id: I544f9d13e68a41412b0a7dd00b7a6d20ce3ef99e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/91222
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-05-27 12:46:39 +00:00
Samir Jindel afc54e23e3 [vm/ffi] FFI callbacks on ARM64.
For design context and motivation, see go/dart-ffi-callbacks

Change-Id: Ie463a462c8676c4a1973f377acee067253aca9f0
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101825
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-27 11:05:18 +00:00
Samir Jindel 0a5e5995e8 [vm/ffi] FFI callbacks on IA32.
Second part of implementing FFI callbacks, see go/dart-ffi-callbacks for design context.

Change-Id: Ibe8195e8cb40e0c1932b179fbc6df2b9668e2fa2
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100582
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-27 10:49:48 +00:00
Johnni Winther 0e5ebcaa96 Add InlineData and InlineDataCache
Merges InlineWeeder and InlineReductive into one visitor and computes
an InlineData object from which all decisions can be made.

Next step is to compute InlineData in the scope visitor (the first visitor
of the first modular phase).

Change-Id: I0c435ae1b3d7afdff1cee7abac657c9362995a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103632
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-27 09:01:25 +00:00
Régis Crelier 21b74fdf79 [dart2js] Update expectation file after BigInt fix in core lib.
Change-Id: I3a68b24357104b75f85a6a5c46852e2924437727
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103722
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Auto-Submit: Régis Crelier <regis@google.com>
2019-05-26 01:01:33 +00:00
Régis Crelier 735669190e [corelib BigInt] Fix implementation of BigInt.modInverse (fixes issue #37008).
A negative result was wrongly returned as a positive value.
Since positive values are preferred, the implementation now adds the modulus
enough times to make the result positive.

Change-Id: I87a2ceb359345846740a749ab6b46b1d45e7ba21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103664
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-05-25 22:05:51 +00:00
Sigmund Cherem baa721ba23 Add an sdk module to the modular_test pipeline
+ and use it in the dart2js modular tests

Change-Id: I66cf29dcea7fb705135049e7a6ea4eb17052f3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103575
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-24 19:09:12 +00:00
Paul Berry 0e5d18f281 Ensure that nullability promotion of the Null type yields Never.
Change-Id: I2232f80bbf5c8a9e51f305a603c06ca2b3ad8aea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103573
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 14:57:15 +00:00
Lasse R.H. Nielsen eca6c8953f Allow async as an identifier everywhere.
Fixes #37063

Bug: http://dartbug.com/37063
Change-Id: I2253c3088fbe33eca1072f2480cf0cf3cc363362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-05-24 08:21:14 +00:00
Johnni Winther 7580e77ef2 Support modular code generation
Change-Id: Id5511296eb0b6acf812bc464d71efa4019f211d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103523
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-24 07:38:13 +00:00
Samir Jindel 225a301637 [vm/ffi] Re-land "[vm/ffi] FFI callbacks on X64."
There are minor fixes for dartkb and windows.
The original revision is in patchset 1.

Change-Id: I9ab6e5fdb33fb4e84ea520c283fe94323616a8ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103129
Commit-Queue: Samir Jindel <sjindel@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-24 02:39:13 +00:00
Sigmund Cherem edadc9c881 Add support for caching results of shared modules.
This is important as we will soon add support for compiling the sdk as a
module and we would like to only compile it once when running a suite of
tests.

+ also enable caching in the dart2js pipeline test.

Change-Id: Ic9043f868123164f3ab425ba73f7428416b05fc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103485
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-24 01:27:13 +00:00
Mike Fairhurst 704446d159 Disable implicit casts but keep dynamic casts when NNBD enabled
Change-Id: Ia0a3271c9137bc8c7fa4cdbd469cf93d9453b69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-23 23:41:52 +00:00
Jonas Termansen df95340f0c [dart:_http] Fix parsing of empty cookies and double quotes.
Commit a9ad427 introduced a bug that assumed the cookie value was at least
one character, but the cookie value can also be empty.

RFC 6265 5.2 does not specify any special behavior for double quotes and as
such they should be considered part of the value. This change stops
stripping those double quotes and instead preserves them.

The io/http_cookie_test test was skipped because it was considered flaky.
This change dusts it off and tests the new behavior.

This change adds the exact offsets and source to the FormatExceptions to
help the caller understand why a malformed cookie was rejected.

Fixes https://github.com/dart-lang/sdk/issues/33327
Fixes https://github.com/dart-lang/sdk/issues/35804
Change-Id: I3479ba48be5763c485bd3ca5b5d2d86d283df971
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/91221
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-05-23 10:05:36 +00:00
Sam Rawlins b22cd05c51 Reland fix for #28233: add hint for missing returns to function expressions
The bulk of this change is actually correcting missing returns in the Dart SDK.

Bug: https://github.com/dart-lang/sdk/issues/28233
Change-Id: I52bcbc6c6f4a129d3fc22003f4448a7c3d4487ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100301
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-22 18:12:30 +00:00
Mike Fairhurst 6457ac1d4b Test potentially-nullable access errors
Change-Id: Ia166dbb6fb353120e30555f60b7bea186537b05b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-22 03:17:00 +00:00
Aske Simon Christensen f051cd5b4d [CFE] Transform spread and if in const collections early.
This makes sure that the AST before constant evaluation only contains
official kernel nodes.

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

Change-Id: Ic4e8e15adeaea8ad4700d6feb67e31f5f0a54f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103123
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-21 11:07:26 +00:00
Sigmund Cherem 2a85d595ba Split global analysis and backend in dart2js pipeline tests
Change-Id: I99c1464f7fb58f5edd9f726c86f29832cce2e6f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103001
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 23:25:22 +00:00
Sigmund Cherem 0c2738f616 Allow steps to declare more than one result
Change-Id: Ifd2a19f8ff771d464737bb27e22cf05a43cc2a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103020
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 23:25:22 +00:00
Sigmund Cherem 84fd1254ec Add tests for only-main behavior
+ move computeTransitiveDependencies to a shared location

Change-Id: I9bfad3d1799df2be36f28fac1a6ea9a8b4c4b023
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102225
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 23:25:22 +00:00
Lasse R.H. Nielsen 82c8c78739 Make StreamTransformer(..) transformed stream mimic original's isBroadcast.
BUG= http://dartbug.com/36965

Change-Id: I5dd156a635c1750d136206b030ee71a78b0e2ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102369
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 12:44:05 +00:00
Johnni Winther 09b46aa084 Support in-memory CodegenResult serialization/deserialization
The serialization/deserialization is performed in test-mode.

Change-Id: I90f31a6a88dbdf2c38beb9b5409ce3c52557e227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102740
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther c69d0c6e30 Flatten DynamicUse and StaticUse class hierarchies
Change-Id: Ib325425dfab7d7001a1a6133df1d50dddfadcbab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther 6757d0c6d9 Use ModularNamer/ModularEmitter to generate code separate from codegen enqueuing
Change-Id: I35dc4c0370622c63f2100e22517149cb0629423e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102367
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther c0b967d7da Refactor Namer and ConstantEmitter to prepare for modular compilation
Change-Id: I2fa8928d7c7d845df2507c9ad034107ec4bc21de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102364
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Samir Jindel ed169c4bb0 Revert "[vm/ffi] FFI callbacks on X64."
This reverts commit be209f7846.

Reason for revert: failures on dartkb and windows bots

Original change's description:
> [vm/ffi] FFI callbacks on X64.
> 
> For context on the design, see go/dart-ffi-callbacks
> 
> Change-Id: I2482e3c932e73f9a4c00fa7e218ff85f9328fc51
> Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100240
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Daco Harkes <dacoharkes@google.com>

TBR=sjindel@google.com,ajcbik@google.com,dacoharkes@google.com

Change-Id: I4cb3d93675d68a51ac9e125ad1d572c47e8b5903
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102983
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-05-18 15:29:19 +00:00
Samir Jindel be209f7846 [vm/ffi] FFI callbacks on X64.
For context on the design, see go/dart-ffi-callbacks

Change-Id: I2482e3c932e73f9a4c00fa7e218ff85f9328fc51
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100240
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-18 06:15:46 +00:00
Sigmund Cherem 475f55d46b Add dart2js modular test suite under a unit test.
At this time this only compiles to .dill and then compiles from multiple modular
dill files.

Next steps: add the global split and add the modular data bits

Change-Id: I3399776dbd5187ddb0a3e2fdd307622a736570c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102126
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-17 22:21:05 +00:00
Nicholas Shahan 86c7165969 [tests] Avoid use of $strong because it is always true now
* Remove all `&&  $strong` clauses.
* Delete all sections that include a `&& !$strong` clause.

Change-Id: Idd32cf5623793e3f98e3e998025bac079d88e2f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102223
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-05-16 17:41:27 +00:00
Mike Fairhurst a3073fc581 check null condition in assert
Change-Id: I4de11a7de3e5106ce9d5fbaf89d0b0965d637b08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102221
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-14 22:24:34 +00:00
Mike Fairhurst b91a4f5423 [analyzer] Resolve methodName staticType when Function to check Function?
Change-Id: I85d43821d4b792c269f386616dcc21d144772c5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-10 21:45:29 +00:00
Sigmund Cherem fb29d0e96d Move async_minitest to package:async_helper.
This allows to break a circular dependency between package:expect and

package:async_helper, which will simplify the support for modular tests using
package:modular_test.
Change-Id: Ie48723d3f35d51a8fbe622e0158450e8104fe3f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-10 19:43:58 +00:00
Mike Fairhurst 1a9d38be41 Fix improper unchecked_nullable test cases
Change-Id: I31aa8f1f53b8960550b9ab8d8cc63f670a20558b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-10 19:30:38 +00:00
Johnni Winther 0db620a2a5 Decouple Namer from RuntimeTypesEncoder and Tracer
Change-Id: I1c52b6740b590b1089201c3d0d8286d8e0912c48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101824
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-10 08:58:29 +00:00
Alexander Markov 477ad3c0ea [vm/bytecode] Eliminate asserts from bytecode unless --enable-asserts
Total size of a large app:
Before: 23681504
After: 23207344 (-463K/-2%)

Size of bytecode instructions:

Before: 6282376
After: 5981716 (-4.8%)
Change-Id: I57703616ecc91301c928672c83571482500dc365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101883
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-05-09 20:41:21 +00:00
Mike Fairhurst 536ecbac7b Add language 2 tests for null access errors
Change-Id: Icde35448c183a3b9311811aab388909d17e36ceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101461
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-09 18:59:11 +00:00
Daco Harkes a8b93d9e78 [vm/ffi] DBC support on x64 Linux/MacOS hosts
Issue: https://github.com/dart-lang/sdk/issues/35773

Change-Id: Ib58fb8df6c5c18e604fbf2a156ab69025e5f57d7
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97221
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-05-09 11:46:03 +00:00
Johnni Winther 9203ad5e89 Include receiver method invocation receiver type in static type test
Change-Id: I61227e694ca2a19d268705e7a79ae0e696e3a79b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101524
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-08 12:12:40 +00:00
Johnni Winther 5ce8402b0d Handle let variable like normal variables in static type computation
Change-Id: Ie6eb1eafd5677207163e22c2f428487b4e55b090
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101522
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-08 12:12:40 +00:00
Johnni Winther 27d806b5a2 Add CodegenResult as the result of FunctionCompiler.compile
+ delete CodegenWorkItem
+ remove use of WorkItem in the compilation pipeline

Change-Id: I035fb8428b7bbdea9411c087e80c81e3d46d00c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101662
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-08 08:15:59 +00:00
Mike Fairhurst a8b6e18b62 Resolve x ?? y as LUB(X!, Y) instead of LUB(X, Y).
Change-Id: I081d8ec153916fb37e2a949d9fa85a6ea778438e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/92390
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
2019-05-07 16:34:17 +00:00
Aske Simon Christensen dd6da838f1 [CFE] Avoid cloning bodies of lazy if elements.
Fixes https://github.com/dart-lang/sdk/issues/36812

Analyzer/DDC failures: https://github.com/dart-lang/sdk/issues/36873

Change-Id: I36d61d3035c9275078b368637d53f6385cf8c487
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101262
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-07 13:48:48 +00:00
Johnni Winther 3d7405f198 Separate CodegenImpl from JavaScriptBackend
Change-Id: I9644ca0cd6cb60bf20142d7fa74a559dc516a22d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101292
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-07 07:57:06 +00:00
Johnni Winther 1c1af2808f Introduce Codegen interface to decouple JavaScriptBackend from the codegen phase
Change-Id: I7effc20d34fa5d5da799c690182eb6f09948c6ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101288
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-07 07:57:06 +00:00
Sigmund Cherem 9ac7bd7855 Ensure we have a scope for variables when visiting fields
Fixes https://github.com/dart-lang/sdk/issues/36864

Change-Id: I66d70cc30b26bd069d4ab5e2b98f0f5954f3ef59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101460
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-06 21:43:42 +00:00
Brian Wilkerson 821c75c584 Update a test comment
Change-Id: I6bb053a128a689d35ae1c21b29c6a7e8bb869fad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101321
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-06 21:19:20 +00:00
Mike Fairhurst 36c315eacc [analyzer] resolve x?.y to return T?
Change-Id: I3ef319621753364b8d70e79b2ab32d7ec9c1e8d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/92383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-06 21:09:39 +00:00
Stevie Strickland 9486e99114 [vm/compiler] Forward typed data view constructor arguments.
Also adds tests for load optimizer fixes in 836c04f.

Bug: https://github.com/dart-lang/sdk/issues/36570
Change-Id: Ie8ea7f944bc789b4c0894f9d96010113fb3ec4b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99466
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-05-06 10:12:48 +00:00
Johnni Winther 28faf8c7ca Merge GraphBuilder into KernelSsaGraphBuilder
+ avoid use of `compiler` and `backend`
+ make members of KernelSsaGraphBuilder private when possible

Change-Id: Ia069a8c3b4167c1ae55554baadb857975aeff67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101287
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-06 08:53:24 +00:00
Jens Johansen 7ea75ab0e0 Const fields doesn't introduce setters; look for setter
Fixes #28268.

Change-Id: I43ccc4072be2fba3ee9273d451fc767876191e16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100964
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-06 07:09:24 +00:00
Mark Zhou 86d47dc5b4 Fixing some tests that are failing in all/most backends.
Change-Id: I91bac2a5597b654082c734decdb948c21d1f5e59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100927
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-05-03 23:36:30 +00:00
Brian Wilkerson dbe80f3397 Add tests for late and final variables without an initializer
Change-Id: I65c40b9e994e602f6133e100d0e8896cb9dce75c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101071
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-03 14:51:54 +00:00
Vijay Menon 8866165950 [dartdevc] Reify bottom as Null
Fixes https://github.com/dart-lang/sdk/issues/36832

Change-Id: Ie0869ca350d1951e0736a9d6c92da4a7984117ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101180
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-05-03 13:39:43 +00:00
Johnni Winther 102f4addda Include the static type in the receiver type of dynamic invoke
- and preserve the original receiver type information during type propagation updates.

Change-Id: I20087b282a3d018947043d7a3ab7c45f003eaee6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100966
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-03 07:52:22 +00:00
Brian Wilkerson b8fb787994 Add a test for uses of the default List constructor
Change-Id: I3b1452186e00f930d5da7c64f3a64f08cd6f4589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101066
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-02 20:46:55 +00:00
Nicholas Shahan 9df061524f [tests] Update expected error NoSuchMethodError --> Error
Most (all?) implementations now throw ArgumentError since the
StreamIterator constructor no longer accepts null but the actual
type is not specified.
https://dart-review.googlesource.com/c/sdk/+/98001.

Change-Id: I10a24a67aa7353552c56d435ef206a2bc4f842fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100987
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-05-02 19:26:55 +00:00
Brian Wilkerson 36b2520ca9 Add a test of creating a subtype of Never
Change-Id: I9d28868667667cca5eb122e33226b21850b062bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101067
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 17:53:59 +00:00
Johnni Winther 1577b95c93 [CFE] Substitute types in unevaluated as-expressions and instantiations
As expressions and instantiations lose the connection to the current type environment when put into an unevaluated constant expression. This leaves type variables unsubstituted when the expressions are lazily evaluated leading to invalid compile-time errors. This is avoided by substituting the type variable when creating the unevaluated constant. If the type variables are not substituted by concrete types, this is flagged as a valid compile-time error during the lazy evaluation.

Change-Id: I46264da4332ea1d5b783531d89a5e6f85b8f90e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100963
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-02 13:14:21 +00:00
Sergey G. Grekhov 8c2390089e [co19] DEPS updated
Change-Id: I4c7e62401f9ca3e40f9320772602ca8a247b4eff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100642
Reviewed-by: Sergey Grekhov <sgrekhov@unipro.ru>
2019-05-02 09:08:33 +00:00
Lasse R.H. Nielsen dd19353abb Update test of operator >>>.
Change-Id: Idd8c6dfcf875a53c536aa3535561f259cf7bcd1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98005
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 09:04:18 +00:00
Johnni Winther 8053c43dde Compute static types for for-in loops
Change-Id: I47e98eaf6df7d04286cb737bfdff135e6c0d34d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100843
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-01 14:06:39 +00:00
Johnni Winther 8d4816b7ff Reimplement member usage tracking
We now track member usage in terms of static, dynamic and super access
for reads, writes and invocations. The information collected during
closed world computation is now the basis for the potential member usage
in codegen, thus ensuring that we cannot conclude in codegen that for
instance a field is read dynamically when the closed world knows that
it is never read dynamically.

Closes #36516

Change-Id: I3a1cb87c71268c34bcd67e14a035d9d1be324ab0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100840
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-01 08:58:34 +00:00
Aart Bik a32fee5d8e [dart/vm] GenericCheckBound (AOT) may throw
Rationale:
Previous CL inadvertently removed the may-throw tag
from the AOT version of check bound. But, unlike its
speculative counterpart, this non-speculative check
will throw when out of bounds. Optimizations like LICM
rely on this property for correctness. Found with fuzzing!

https://github.com/dart-lang/sdk/issues/36803

Change-Id: I05952f423ffa1917a08dbb6191d0d1533450bc9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100921
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-30 22:32:07 +00:00
Ryan Macnak ac4fd50446 [vm, compiler] Check for length overflow when eliminating write barriers for variable-length objects.
Bug: https://github.com/dart-lang/sdk/issues/36778
Change-Id: I03bd00dd5a035309807e16911dcd7602b4de5e44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100900
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-04-30 21:36:07 +00:00
Ryan Macnak e178b0726a [test] Speed up unicode-regexp-zero-length_test.
After 347b72c260, this test began timing out on dartk-mac-debug-simdbc64.

Change-Id: I84fc6457c7e10068f761d25cbb1241e2c2f8ab49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100902
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-30 20:45:42 +00:00
Ryan Macnak 347b72c260 [vm] Bypass malloc for large Zone allocations to avoid jemalloc leaks.
Revert 9a07ad88f4.

Bug: https://github.com/flutter/flutter/issues/29007
Change-Id: I6a5f51f0c3a54d354ec5f8495677d46f94d8a1d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100568
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-30 16:17:18 +00:00
Alexander Markov 0b9060ec1d [vm] Fixes for flaky crashes when querying source or source location
There were no checks for missing source or source position, which
caused flaky crashes while running test mirrors/mirrors_reader_test.

Change-Id: I73497414ebe7b030ba308851038e0ef9e133aa48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100781
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-29 22:10:38 +00:00
Brian Wilkerson b83902d51b Add a language_2 test for missing arguments related to required named parameters
Change-Id: I4d08c5a7d7bd7950fab001281f26f2e838335339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100724
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 21:19:08 +00:00
Stevie Strickland 4028fec3b5 Reland "[vm] Finish adding support for ECMAScript 2018 features."
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-29 09:11:48 +00:00
Johnni Winther a1dd732ec6 Extract WorldBuilder results into an immutable BuiltWorld object
For resolution this is the KClosedWorld and for codegen this is the new
CodegenWorld object. This change removes the use of the world builders
after the world building has ended. It prepares for computing more of the
result data from the collected member usages.

Change-Id: I80032e3fc0e29179137b8c0380f09f68ab6fa03b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100540
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-26 07:52:58 +00:00
Keerti Parthasarathy 9238e25305 Revert "[vm] Finish adding support for ECMAScript 2018 features."
This reverts commit 5ebb640a67.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm] Finish adding support for ECMAScript 2018 features.
> 
> This work pulls in v8 support for these features with
> appropriate changes for Dart and closes
> https://github.com/dart-lang/sdk/issues/34935.
> 
> This adds support for the following features:
> 
> * Interpreting patterns as Unicode patterns instead of
>   BMP patterns
> * the dotAll flag (`/s`) for changing the behavior
>   of '.' to also match line terminators
> * Escapes for character classes described by Unicode
>   property groups (e.g., \p{Greek} to match all Greek
>   characters, or \P{Greek} for all non-Greek characters).
> 
> The following TC39 proposals describe some of the added features:
> 
> * https://github.com/tc39/proposal-regexp-dotall-flag
> * https://github.com/tc39/proposal-regexp-unicode-property-escapes
> 
> These additional changes are included:
> 
> * Extends named capture group names to include the full
>   range of identifier characters supported by ECMAScript,
>   not just ASCII.
> * Changing the RegExp interface to return RegExpMatch
>   objects, not Match objects, so that downcasting is
>   not necessary to use named capture groups from Dart
> 
> **Note**: The changes to the RegExp interface are a
> breaking change for implementers of the RegExp interface.
> Current users of the RegExp interface (i.e., code using Dart
> RegExp objects) will not be affected.
> 
> Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
> Commit-Queue: Stevie Strickland <sstrickl@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=lrn@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sstrickl@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I1eda0fee4fd9e94df095944049833a67b07277e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100560
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-04-25 14:29:51 +00:00
Johnni Winther 5fc8029587 Remove StaticMemberUsage and cleanup codegen world builder
Change-Id: I4fdc6148af671010d1aca55c05d08e55e9c1e9fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100245
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-25 08:45:20 +00:00
Alan Knight f3bd910e10 Only use MapFormatter for SDK maps (HashMap and LinkedHashMap)
For classes that implement Map, using MapFormatter can result in many,
many custom format operations. Also, the presentation is not that
useful. We get e.g. a list of indices that then have a name and value
beside them, so it just duplicates the Object view, but with extra
non-useful data.

Change-Id: I74ed34521778bddae9cdad975339925d7c181bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100282
Commit-Queue: Alan Knight <alanknight@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-04-24 22:08:45 +00:00
Dan Rubel f82000dfb1 pre-nnbd modifier as identifier tests
Change-Id: If44d1b0ac3279124e81e9c34e20f7bd9d399d1ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-24 21:29:13 +00:00
Stevie Strickland 650cd2ed1d [gardening] Fix multitest comments on this file.
Change-Id: I56560943c536d5f2a3358745f4b73e0660b3bd90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100361
Auto-Submit: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-24 12:02:56 +00:00
Stevie Strickland 5ebb640a67 [vm] Finish adding support for ECMAScript 2018 features.
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-24 09:24:16 +00:00
Aart Bik 2eb36e8879 [dart/vm] What's in a (register) name?
Rationale:
Under heavy register pressure, a Q register was
selected for which the corresponding D register
had no proper overlap with S registers, which
was required by integer division.

Test:
Real reproducer when use_integer_division=false.

Bug:
https://github.com/dart-lang/sdk/issues/36681
https://github.com/dart-lang/sdk/issues/34472

Change-Id: I54162f4d6aee6ef9827907d9e97f2a476e9cbe4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100272
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-04-24 00:21:55 +00:00
Dan Rubel 174395a49e NNBD "late" modifier language_2 tests
Change-Id: Iffcd2ef8042576bcfc195ab72f2743f2c3e7be07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100261
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-23 20:58:31 +00:00
Régis Crelier 7c18fc0c3d Revert "[gardening] Mark ffi/function_stress_test/1 test as slow."
This reverts commit 7388c3e3db.

Reason for revert: Marking as Slow is not sufficient. Filed issue instead.

Original change's description:
> [gardening] Mark ffi/function_stress_test/1 test as slow.
> 
> Change-Id: Ic5130781a75250165f92d86729c2d83c436db30e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100280
> Reviewed-by: Régis Crelier <regis@google.com>
> Commit-Queue: Régis Crelier <regis@google.com>

TBR=sjindel@google.com,regis@google.com

Change-Id: I35afabb3207f094f37a9d4b32e027060070f2f91
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100284
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-04-23 20:14:56 +00:00
Régis Crelier 7388c3e3db [gardening] Mark ffi/function_stress_test/1 test as slow.
Change-Id: Ic5130781a75250165f92d86729c2d83c436db30e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100280
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-04-23 17:40:31 +00:00
Brian Wilkerson b4d17f2eee Add diagnostics related to default values
Change-Id: I4b30580e34fbf302a53778010fada54a2e100409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99887
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-23 17:16:50 +00:00
Aart Bik dbfcb97fa5 [dart/vm]: sometimes a smi is just a smi
Rationale:
The IA32 codegen has the concept of "safe smis", which
can actually be larger "mints" that can be constructed
in a safe way (e.g. shifting). However, at a few places,
this caused confusion, since following code assumed
that such values can be casted to "smis" always.
This CL fixes that. Found with DartFuzz.

https://github.com/dart-lang/sdk/issues/36589

Change-Id: I6bf308897abfb0aad965c7fbaf8f374a1ba30d41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100089
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-23 16:39:02 +00:00
Dan Rubel 293c0f42f7 NNBD "required" modifier language_2 tests
Change-Id: I2c0d53fd321dea7ed74cf9fac422ec32f9dea641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-23 15:28:12 +00:00
Alexander Markov 5ee20c99ac [vm/aot/tfa] Workaround for crash in getStaticType
Issues: b/131091988, https://github.com/dart-lang/sdk/issues/34496
Change-Id: I9ef8edfff39848e6f240402682d119fe35f7f776
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99972
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-22 22:49:24 +00:00
Jenny Messerly 2c304d997f [dartdevc] fix #36372, make JS Array constructor property usable from JS
The `new array.constructor()` pattern is occasionally used in JS
(presumably, to get the array subtype if one is available). GopherJS in
particular does this. This fixes DDC's generic `JSArray<T>` to support
this pattern, for all values of T. This also makes JSArray work like
all other "native" types in DDC, where the "constructor" property
is the JS constructor for that native type.

Change-Id: I5270bd648d3d60cf07b8548fcd8c9b9d1a3018d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99940
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-22 22:43:14 +00:00
Paul Berry 17db9f986a Simplify type tests in nullable_type_ambiguous_test.dart
Change-Id: I6612a83550acf5f1920bb0467425cfb2977ea2e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99882
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-22 18:50:11 +00:00
Ryan Macnak 9d376de55a [vm] Remove code collection.
Code collection interacts badly with
 - warming up compiled code
 - retaining pre-compiled code
 - code coverage
 - hot reload (deopting to an old version of a function)

Change-Id: Id269a6c3281e577d4f600f0c158af9e62f6b49ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99722
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-18 20:12:09 +00:00
Aart Bik 3cf3e4edde [dart/vm] Reduce trip count of osr test
Rationale:
Test was borderline timeout. The reduced tripcount
still triggers OSR consistently, but runs a lot faster.

https://github.com/dart-lang/sdk/issues/36421
https://github.com/dart-lang/sdk/issues/36218
https://github.com/dart-lang/sdk/issues/36214

Change-Id: I60917bb6bdd51dee6bd11d1fe5beede4753c2147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99783
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-18 19:52:20 +00:00
Brian Wilkerson 836efd6520 Add a language_2 test for having an invalid type in an on clause
Change-Id: Ia073e6a85f6f5cc54ecb45ab5d4e11e7976c3134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99701
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-17 18:35:20 +00:00
Paul Berry 37285467db Improvements to null_assertion_ambiguous_test
Change-Id: I164d0815262d9c861c3b4ad3532808409004ea0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99660
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-17 15:36:26 +00:00
Paul Berry bc99f1ca28 Test a few more uses of the nullable type decorator
Change-Id: I902caac00961514637b77f70200103618662b325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-17 12:15:35 +00:00
Nicholas Shahan 9d15138c91 [tests] Revert the previous deletion of UI-as-Code const tests
Returning since they should be valid with the `constant-update-2018` experiment
flag:
* control_flow_collections/if_const_test.dart
* control_flow_collections/if_const_error_test.dart
* spread_collections/const_test.dart
* spread_collections/const_error_test.dart

Should be deleted when UI-as-Code is supported in constant collections:
* control_flow_collections/if_const_syntax_error_test.dart
* spread_collections/const_syntax_error_test.dart

Change-Id: I595333782630122ae4f3d021841b062b27e1cccb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99600
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-16 23:04:37 +00:00
Sigmund Cherem 8e73b3c006 Enable ui-as-code features.
Change-Id: I97781ffe5144c4b959cb3cb720e9cd06c22928ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99283
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-04-16 21:29:55 +00:00
Sigmund Cherem 4b7d256a06 Revert "Enable constant-update-2018 by default." and "Update .expect files in pkg/front_end after e9ca6a53"
This reverts commit e9ca6a5335 and d3e00fd35e.

Change-Id: I346d6156be19c4fceffa202a7ce9bfa931c7c14b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-04-16 20:20:12 +00:00
Nicholas Shahan 6dc209e858 [tests] UI-as-Code in const collections is a compile time error
* Update tests to expect compilation errors when `if` `for` or `...` are used in
  const collections.
* Remove constant-update-2018 flag from tests.

Change-Id: I477c30f07c7e3da6139f263e1855c3908c1bce2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99485
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-16 20:02:29 +00:00
Aart Bik 9070d6ae61 [dart/vm] Inspect shift constant in absence of range analysis
Rationale:
Queries the constant of a shift operation to determine if it
is in range when range analysis has not run. This seems in general
a good idea, since some optimizations occur *after* range analysis,
and we were missing those cases. In this particular case, it also
avoids an assert fail on a shift by one without env() that was
introduced by a pass that has no subsequent range analysis. In
this case, it is unclear whether not having an env() was an
accident, or on purpose since the shift factor is known to
be well-behaved. Please have a careful look!

https://github.com/dart-lang/sdk/issues/36587

Change-Id: I12b4cb773f31899e17bfce8506bce599ccbef8ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99382
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-16 19:07:15 +00:00
Johnni Winther 5af34ea93d [CFE] Handle invalid constant string interpolation in unevaluated constant expressions
Non-primitive constants were incorrectly stringified in an unevaluated
context. These are now, as with unevaluated constants, checked when the
string concatenation is fully evaluated.

Closes #36609

Change-Id: Ia3266ebcb9d497b277690244569812f7cd3e30c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99461
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2019-04-16 16:05:05 +00:00
Paul Berry 4b19ca1489 Add language_2 tests for NNBD null-assertion operator (!)
Change-Id: I06ffbfae376210ca0428181f567be3702defbe5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99185
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-16 15:16:44 +00:00
Johnni Winther 58ff41ad33 Add test for static tear-off
- to document the change (for the better) with CFE constant

Change-Id: I9b6673497fe07ccd4f92fc4c22df0ae3205f72a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99152
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-04-16 07:06:12 +00:00
Brian Wilkerson 0314d86af4 Add errors when a nullable type is used as a supertype
Change-Id: I82471ba67dd74db6425bb2081bd761eb2b490333
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99284
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-12 21:13:21 +00:00