Commit graph

461 commits

Author SHA1 Message Date
Ryan Macnak daf91f56b9 [vm] Fix some further mirror breaks with frontend NNBD checks enabled.
Change-Id: I3c52dac2244c1f7eae59d85bc637cce2cbb3faa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139302
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-12 20:58:56 +00:00
Ryan Macnak f82e5fcbb1 [vm] Update some return types of mirror natives to be explicitly nullable.
Bug: https://github.com/dart-lang/sdk/issues/40997
Change-Id: I18e4bc4637f68ba5080c11d0a2c3c7bb43eb54bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139061
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-03-11 22:47:30 +00:00
Nate Bosch 9d76737487 Remove support for --emit-metadata in DDC
This flag is unused and the behavior it enables was only useful along with
`dart:mirrors`.

- Remove the flag and the field on the options object.
- Prune code branches that are no longer reachable.
- Remove or inline some functions that became either empty or trivially small.
- Remove the manual check for a `dart:mirrors` import since this is handled by
  the CFE now.
- Remove references to the flag in tests.
- Remove test files which only existed to enable the flag for other tests.

Change-Id: I21bf594271fb4eeb5b73fcbf07da736e9e8d1f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138018
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2020-03-05 23:26:13 +00:00
Robert Nystrom 0d34bf5571 Remove another one of the unittest-like libraries.
This one was literally only used for a single test. :-/

Change-Id: I316e17ecaf9a839b3c6f27ec86971a67ab52bbfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135782
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-02-13 23:36:13 +00:00
Ryan Macnak 0fde59b21d [vm] Further mirrors and test fixes.
Bug: https://github.com/dart-lang/sdk/issues/40497
Change-Id: Ieed8a51600f92fa4dc9137bf1f4ed58bb4cfa598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134900
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-10 20:58:05 +00:00
Ryan Macnak 081e2acf29 [test] Update copied mirrors tests for Dart 3.
Bug: https://github.com/dart-lang/sdk/issues/40045
Change-Id: Ic0f62843d61b613e61f434b72b9553dd1e6897af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132441
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-23 18:09:37 +00:00
Ryan Macnak 00b2e580a3 [test] Fork mirrors tests.
Bug: https://github.com/dart-lang/sdk/issues/40045
Change-Id: I597259b38684de87016f1e136723d24f4ac05420
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132440
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-22 18:46:23 +00:00
Bob Nystrom f6ca2c1d8f Remove the Dart 1 tests.
This deletes:

tests/co19
tests/corelib
tests/html
tests/isolate
tests/language
tests/lib

It does not delete tests/standalone because apparently there are tests
in there that are not in standalone_2. (I assume they were added after
the test migration. I don't know why they were added there.)

I have tried to remove references to the old tests from various scripts
and tools but may have missed some. (As you can imagine, grepping for
"lib" does not have the best signal-to-noise ratio.)

"It was a pleasure to burn. It was a special pleasure to see things
eaten, to see things blackened and changed. With the brass nozzle in his
fists, with this great python spitting its venomous kerosene upon the
world, the blood pounded in his head, and his hands were the hands of
some amazing conductor playing all the symphonies of blazing and burning
to bring down the tatters and charcoal ruins of history."

- Ray Bradbury, Fahrenheit 451

Change-Id: If3db4a50e7a5ee25aff8058b1483e2ce8e68424e
Reviewed-on: https://dart-review.googlesource.com/c/75420
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-11 23:45:18 +00:00
Ryan Macnak e0c09211fc Revert "[vm] Add a simple compactor."
This reverts commit 5bdffcd32e.

Reason for revert: Failures on DBC, timeouts on hot reload and opt counter stress bots.

Original change's description:
> [vm] Add a simple compactor.
> 
> The compactor copies all live objects in old space to fresh pages, places forwarding pointers in the old objects, forwards all the pointers, then frees the old pages. This has a high space overhead. It is not meant for use in production, but meant to test that the VM is properly set up to handle old-space objects moving.
> 
> Large page objects and instruction objects are not moved.
> 
> Bug: https://github.com/dart-lang/sdk/issues/30978
> Change-Id: Ia42683fd5e27a33702aa5e83bece803a8b005a4b
> Reviewed-on: https://dart-review.googlesource.com/13624
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>
> Reviewed-by: Erik Corry <erikcorry@google.com>

TBR=rmacnak@google.com,zra@google.com,asiva@google.com,erikcorry@google.com

Change-Id: I4fda673561532b604d97b9b02189c030844d969d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/30978
Reviewed-on: https://dart-review.googlesource.com/14680
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-10-17 21:57:19 +00:00
Vyacheslav Egorov 826b48ee8a [VM] Clean up typing violations in the numerics implementation.
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: I93d7bca2ff627431f1a316bb01a5dada1b5f2354
Reviewed-on: https://dart-review.googlesource.com/14522
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-10-17 21:00:24 +00:00
Ryan Macnak 5bdffcd32e [vm] Add a simple compactor.
The compactor copies all live objects in old space to fresh pages, places forwarding pointers in the old objects, forwards all the pointers, then frees the old pages. This has a high space overhead. It is not meant for use in production, but meant to test that the VM is properly set up to handle old-space objects moving.

Large page objects and instruction objects are not moved.

Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: Ia42683fd5e27a33702aa5e83bece803a8b005a4b
Reviewed-on: https://dart-review.googlesource.com/13624
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Erik Corry <erikcorry@google.com>
2017-10-17 20:44:02 +00:00
Vyacheslav Egorov 5b14ee115a [VM] Make _StringBase implement String
_StringBase is used everywhere as if it was assignable to String,
however it itself does not implement String, its subclasses do.

This change addresses this.

Also removes unused native runtime method from one of subclasses.

Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: Iea2389d1b48a3689fb11c99c0e230747ab1c5962
Reviewed-on: https://dart-review.googlesource.com/12444
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-10-10 10:33:31 +00:00
Zachary Anderson 2948f8c1b7 Reland: [dart:io] Moves Http code into a separate library.
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.

This CL was reverted due to a failure in the Flutter engine build
which happened due to an incomplete change in gen_snapshot.cc, and to
update sdk/lib/libraries.yaml and sdk/lib/libraries.json

Change-Id: Ie90c77ef631aea7a163774b58e8ccbaf71a24d3c
Reviewed-on: https://dart-review.googlesource.com/7588
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-21 19:21:25 +00:00
Zach Anderson 64bf1b49b0 Revert "[dart:io] Moves Http code into a separate library."
Reverting for broken Flutter build and kernel platform compilation test. It looks like the new _http library is missing from various snapshots. Not sure why this didn't fail locally.

This reverts commit ac9ff3f3af.

Change-Id: I7fbc2f842cf1380793e7af9fb869cacd14682885
Reviewed-on: https://dart-review.googlesource.com/7600
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-21 15:57:59 +00:00
Zachary Anderson ac9ff3f3af [dart:io] Moves Http code into a separate library.
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.

Change-Id: Icd33232a97b3d75511ef7ec88b01fd47cdcf5a23
Reviewed-on: https://dart-review.googlesource.com/6420
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-09-21 15:10:22 +00:00
Florian Loitsch 38bf70d7ac Use generic functions in zones.
Migrated from https://chromiumcodereview.appspot.com/2893893002/

Change-Id: I0bd6dc1438eb1e6762e7760a08b5a760b07d4b10
Reviewed-on: https://dart-review.googlesource.com/4942
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-09-20 15:46:06 +00:00
Florian Loitsch 051f0f1267 Added new entries to the .gitattributes file.
Also updated the tests so that we don't forget in the future.

Change-Id: I0a998af306a0b6fa54b3c86cf164fdfe1f76340d
Reviewed-on: https://dart-review.googlesource.com/3624
Reviewed-by: William Hesse <whesse@google.com>
2017-09-06 18:05:57 +00:00
Ben Konyi adfc7a6b72 Migrated test lock 217 to Dart 2.0.
Fairly simple block, with only minor changes made to lib_2/mirrors tests
needed for strong mode compliance.

BUG=

Review-Url: https://codereview.chromium.org/2997283003 .
2017-08-31 07:47:36 -07:00
Ben Konyi 143ea83cf3 Migrated test block 220 to Dart 2.0.
No changes to tests.

BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/3001373002 .
2017-08-31 07:16:58 -07:00
Ben Konyi 0312bb6c35 Removed another test from lib/mirrors that has already been migrated to lib_2/mirrors.
TBR=jcollins@google.com,rnystrom@google.com
BUG=

Review-Url: https://codereview.chromium.org/3007863002 .
2017-08-30 12:40:36 -07:00
Ben Konyi ac7c0ecf5c Removed test from lib/mirrors that has already been migrated to lib_2/mirrors.
TBR=jcollins@google.com,rnystrom@google.com
BUG=

Review-Url: https://codereview.chromium.org/3009853002 .
2017-08-30 10:42:33 -07:00
Ben Konyi e3d14e2945 Remove test from lib/mirrors that has already been merged into lib_2/mirrors.
TBR=rnystrom@google.com,jcollins@google.com
BUG=

Review-Url: https://codereview.chromium.org/3008933002 .
2017-08-30 10:07:25 -07:00
Ben Konyi 07d16559f2 Made helpers strong-mode clean for Dart 2.0 migration.
BUG=

Review-Url: https://codereview.chromium.org/3006863002 .
2017-08-30 09:51:39 -07:00
Ben Konyi 8723989404 Added back declarations_model_easier.dart to lib and lib_strong mirrors tests to fix buildbot failures caused by landing test block 219.
TBR=dmitryas@google.com
BUG=

Review-Url: https://codereview.chromium.org/3010753002 .
2017-08-30 08:18:47 -07:00
Ben Konyi 36ddbead91 Added back helper file accidentally deleted during test block 219 migration.
TBR=dmitryas@google.com

Review-Url: https://codereview.chromium.org/3011633002 .
2017-08-30 07:59:09 -07:00
Ben Konyi 64105ee014 Migrated test block 219 to Dart 2.0.
No major changes. Some tests that rely on noSuchMethod needed to have
some 'var's changed to 'dynamic's.

BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/3003123002 .
2017-08-30 07:51:59 -07:00
Ben Konyi a7a97e41ed Migrated test block 218 to Dart 2.0.
Fairly simple block, with changes made to some mirrors tests to make
them strong-mode clean. Modified test script to also accept
*_app_jit.status files.

BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2999373002 .
2017-08-30 07:29:11 -07:00
Florian Loitsch 978213d427 Revert "Make Zone API strong mode clean."
This reverts commit 0b35711d48.

BUG=

Review-Url: https://codereview.chromium.org/2963743002 .
2017-06-28 13:31:32 +02:00
Florian Loitsch 0b35711d48 Make Zone API strong mode clean.
Review-Url: https://codereview.chromium.org/2959163002 .
2017-06-28 13:16:39 +02:00
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Erik Corry 2fb5d08102 Spelling a
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2841543002 .
2017-04-24 14:53:51 +02:00
Jacob Richman 2dcd56ef43 Format all tests.
There are far too many files here to review everyone carefully.
Spot checking most of the diffs look good as test code is generally written
with less care than application code so lots of ugly formatting get through.
If people notice files where the automated formatting bothers them feel free
to comment indicating file names and I'll move spaces within comments to make
the formatting cleaner and use comments to force block formatting as I have
done for other case where formatting looked bad.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2771453003 .
2017-04-17 14:53:02 -07:00
Florian Loitsch 46ba54e315 Add @MirrorsUsed annotations to speed up tests.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2727323002 .
2017-03-31 12:46:31 +02:00
Jacob Richman 14531fa62d Re-land "Format all multitests"
Only delta from the original is a bad merge of tests/corelib/list_test.dart

This reverts commit 44d8be0ed3.

BUG=

Review-Url: https://codereview.chromium.org/2774783002 .
2017-03-23 12:40:21 -07:00
Jacob Richman 44d8be0ed3 Revert "Format all multitests"
This reverts commit 312b66dd5f.

BUG=

Review-Url: https://codereview.chromium.org/2770063002 .
2017-03-23 10:49:40 -07:00
Jacob Richman 312b66dd5f Format all multitests
BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2768073002 .
2017-03-23 10:26:44 -07:00
Jacob Richman 88eb557b65 Fix warnings_checker.dart handling of multitests
Update all tests

Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com
BUG=

Review-Url: https://codereview.chromium.org/2765693002 .
Review-Url: https://codereview.chromium.org/2765893003 .
2017-03-21 17:29:56 -07:00
Jacob Richman bf2b545150 Revert "Update all tests"
This reverts commit ce76e9c30beaf9a193d3677b88c20a1ebb3fae8c.
2017-03-21 16:33:18 -07:00
Jacob Richman 3c7353d987 Update all tests
Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2765693002 .
2017-03-21 12:39:28 -07:00
Jacob Richman 6a7d6c385e Add comments
Add spaces to make sure dartfmt doesn't destroy bespoke indentation

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2763823002 .
2017-03-20 21:03:12 -07:00
Siva Annamalai 4bc53826f7 Add test case to regress case where fields of a closure are accessed (reproduces the problem we encountered in b/36131545)
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2752803003 .
2017-03-15 13:41:47 -07:00
Stephen Adams fc56b59a88 Type of InstanceMirror on class should still be a ClassMirror when class has call method
BUG= https://github.com/dart-lang/sdk/issues/28864
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2735983003 .
2017-03-07 17:08:44 -08:00
Kevin Millikin 508793071a Do not invoke fatal in dart:_internal when fuzzing mirrors
Add fatal from dart:_internal to the blacklist of functions we should
not invoke while fuzzing mirrors.  Invoking it will not succeed.

Arguably, mirrors should not be able to see any of the members of
dart:_internal but that's a bigger implementation change and possibly
a breaking change.

BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2687883002 .
2017-02-09 14:08:29 +01:00
Peter von der Ahé f5d9f29cae Use factory syntax in circular_factory_redirection_test.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2669233002 .
2017-02-06 11:03:01 +01:00
Zachary Anderson 63c4b6b1cb Revert "Remove package:unittest from some tests"
This reverts commit dde47b2aad.

Revert "Update Dartium status for passing test"

This reverts commit d71c70d56d.

Tests failing on dart2js and async_star_pause_test is
passing on Dartium. Need to think about how to update the
status files.

Review-Url: https://codereview.chromium.org/2656503004 .
2017-01-25 11:06:58 -08:00
Zachary Anderson dde47b2aad Remove package:unittest from some tests
package:unittest is deprecated in favor of package:test.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2656743002 .
2017-01-25 08:50:02 -08:00
Regis Crelier 97c42acc30 Support FutureOr<T> in the VM (fixes #28010).
R=asiva@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/2642443002 .
2017-01-17 10:27:21 -08:00
Florian Loitsch 2547caab25 Reapply "reflectType() dynamic type arguments support (#26012)"
This was a pull request: 8a8033a417

MirrorsUsed doesn't transitively include reflective information. However, it must still be able to create TypeMirrors for types that are used as return- or parameter types.

Initially, the patch checked that TypeMirrors had the correct number of arguments for generic types. This is now disabled.

A better approach would be to know if a class has full reflective information, or not. But this would require much bigger changes to the system.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2615943004 .
2017-01-10 15:53:21 +01:00
Asger Feldthaus 6bae3151e2 Revert "reflectType() dynamic type arguments support (#26012)"
This reverts commit 8a8033a417.

There are a bunch of dart2js mirror tests that fail.

Issue https://github.com/dart-lang/sdk/pull/26012

BUG=

Review-Url: https://codereview.chromium.org/2617163002 .
2017-01-06 19:12:27 +01:00
Anatoly Pulyaevskiy 8a8033a417 reflectType() dynamic type arguments support (#26012)
* Basic implementation of reflecting generic types using dynamic list of type arguments

* Removed redundant expectation in test

* Added basic support for dynamic type arguments in reflectType of js_mirrors

* Fixes according to code review comments: major cleanup, added more test cases and updated docs

* Updated JS mirrors reflectType() to match behavior of VM implementation

* Terminate exception messages with a dot; Improved error handling for empty argument list and type checks;

* Use NumTypeParameters when checking provided argument list size

* Check if type arguments are malbounded; added test cases for typedefs and mixins

* Uncommented a test case

* Updated lib.status to mark some tests as failing in dart2js due to limitations in JS mirrors

* Fixed mixin test mock definition; updated configuration for tests requiring checked mode

* Handle nested generic types in type argument parsing (JS)
2017-01-06 06:05:14 -08:00