Commit Graph

5921 Commits

Author SHA1 Message Date
Jens Johansen 8270944c5d [CFE] Extend weekly test - fuzz tests and advanced invalidation leak test
We currently run our leak tests weekly.
This extends it so we also run leak tests with advanced invalidation,
as well as our strong and weak tests with fuzzing enabled.

Change-Id: I2c941f58594791d1981c6b6612db2205b68f5e19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192682
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-24 14:44:51 +00:00
Jens Johansen 9d5f3187ad [CFE] Crash reproductions
Change-Id: Iddf58c3af16fd56aa7cc9bd1a988ec45a4a042a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175243
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-24 13:45:31 +00:00
Sam Rawlins 3efcdb3ff0 front_end: Remove unnecessary import
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I631483a90d89268c0ffd75ee2e1c27ba19f084cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192609
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-24 13:30:49 +00:00
Johnni Winther 92e237c835 [cfe,dartdevc,dart2js] Use InstanceGetterInvocation for getter/field invocation
The web compilers don't support getter/field invocation encoded as a
FunctionInvocation on an InstanceGet because it doesn't work for
getter/field invocation of js-interop properties, since the InstanceGet
wouldn't result in a Dart function but just JavaScript function.

To support this in the new method invocation encoding, a special
expression, InstanceGetterInvocation, is used to encode getter/field
invocations in dart2js and ddc.

Change-Id: I21da8e8686f66ae4ce4d44245073b9e424f975b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192181
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-23 09:49:06 +00:00
Jens Johansen 22551d35c2 [CFE/dart2js] Don't set exit code to 1 in unit tests running analyzer
The testing system - sometimes (see http://dartbug.com/45408) - exits
and turns the bot purple when the exit-code from a test is (e.g.) 1.

This CL removes some instances of having an exit code of 1.

Change-Id: Ic831d151346a28dabe9180e80a8e462af227bf41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192381
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-23 08:36:56 +00:00
Johnni Winther 0de315c146 [cfe] Compute variance for type parameters on duplicate typedefs
Change-Id: I6e4a05911c77d26f1fb440ec8e90c13e783926e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192147
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-23 07:32:26 +00:00
Kallen Tu 9e5a6c1568 [cfe] Do-while statements for const functions.
Change-Id: I881fb535ef76e564ab76c5fc661d3adbbe5aed0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192401
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-22 22:19:45 +00:00
Jens Johansen 86e296f3ce [CFE] Make fuzz testing work also when not skipping VM
Also "roll up" fuzz errors/craches to pass if not fuzzing.

Change-Id: Ie044f0c014504f11939d4ce50971bf31930f1193
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192144
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-22 10:12:52 +00:00
Kallen Tu 45c9d8a25e [cfe] Enable recursive function calls for const functions.
Change-Id: Ia164adaf5da313cae4db2b3b326a909e57d8c07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192200
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-19 17:56:17 +00:00
Johnni Winther 5c65c68669 [cfe] Handle cyclic bounds on generic function types as type arguments
This also handles reporting of cyclic bounds in parts and sets the
bound of a cyclic type parameter to InvalidType to avoid looping on
the bound later, as for instance in computation of NORM.

Closes #45330

Change-Id: Ida20dc5b44b08a6f8674a402d801314a9172fa8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192142
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-19 17:54:37 +00:00
Daco Harkes 77dc74bcd5 [vm/ffi] Support packed Structs
Closes: https://github.com/dart-lang/sdk/issues/38158

This CL implements unaligned access for float/double on arm32, but does
not expose it in an API. Rather it only uses these loads/stores inside
the getters and setters of packed structs.
Bug: https://github.com/dart-lang/sdk/issues/45009

Besides unaligned access for float/double, this CL is mostly a CFE
change. The only VM change is reading the packing in the
`_FfiStructLayout` annotation.

The implementation of using the packing in the VM, and analyzer changes
have landed separately in earlier CLs.

tools/test.py ffi ffi_2
TEST=tests/ffi(_2)/(.*)by_value_(*.)_test.dart

Change-Id: Ic3106ecc626d2e30674a49bf03f65ae12d2b3502
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186143
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-03-19 15:34:42 +00:00
Jens Johansen 20cfdeffe5 [CFE] Include .crash_dart in weak tests; better handling of erroneous -D parameters and expectationFileMismatchSerialized on -DupdateExpectations=true
Change-Id: I00da3e4cf8859c65a8d93600804c7dbc56ec0bca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192180
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-19 13:34:17 +00:00
Johnni Winther 9ad76fe7bd [cfe] Support annotations on function type parameters
The fix includes processing of type parameters elsewhere and also
adding support for annotations on extensions.

Closes #28981

TEST=existing

Change-Id: I71ab5640bd3a16f4a024b6edd047a525eed1c399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191404
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-19 11:52:57 +00:00
Paul Berry 681d3e2a43 Allow the expensive parts of "why not promoted" computation to be deferred.
This is necessary because `whyNotPromoted` needs to be called right
after visiting a subexpression, but it's not always possible to tell
that the type of that subexpression will result in an error until more
code has been visited.

Change-Id: If44e2bb55612c1ba7996b523c3ec078d7b80c865
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 19:52:13 +00:00
Kallen Tu 3c5c1cd3f4 [cfe] Break, continues and labels for const functions.
Change-Id: Id8fce4088042b4acf9eadebe7aa99abd5565a471
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191680
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-18 17:06:13 +00:00
Johnni Winther d59c8bc4fd [cfe,dart2js] Handle LocalFunctionInvocation in ListFactorySpecializer
The CloneVisitorNotMembers contains a mapping from variables to their
corresponding clones. The ListFactorySpecializer special cased access
to this mapping to support conditional cloning. When dart2js switchted
to used the new method invocation encoding, this left the
LocalFunctionInvocation unhandled, leading to null check error when
local functions where invoked in the closure passed to List.generate.

This CL makes this mapping private and adds getter/setter methods for
lookup and registration. The ListFactorySpecializer now instead overrides
the getter to support conditional cloning instead of handling each use
case.

Bug: b/183083319
Change-Id: I2fd3b79137c51a424f17127b502e6a945c6796a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191901
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-18 14:34:33 +00:00
Daco Harkes 55082199e7 [vm/ffi] Fix Array<Pointer> loads and stores
Closes: https://github.com/dart-lang/sdk/issues/45198

TEST=tests/ffi(_2)/regress_45198_test.dart

Change-Id: I15cf5a4d48b1bfb33de039cc8b17be8e01fba752
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191881
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-18 12:26:38 +00:00
Johnni Winther 12f510fbd1 [dart2js] Use new method invocation encoding
Change-Id: Iab73f25a19fe8718cb68327fef5878d25b735030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188523
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-03-17 17:26:25 +00:00
Sam Rawlins 7465b17ad7 front_end: Remove unnecessary imports
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I0dd5d176a95289333cd42f87f49d7820c54bbe38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191470
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-17 16:48:40 +00:00
Kallen Tu 7ff1aebc2d [cfe] While loops for const functions.
Change-Id: I7979fa8b50a74f9e423f19805a793a0c25609abd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-17 16:11:43 +00:00
Kallen Tu 54f8b6fb54 [cfe] Basic for loops for const functions.
Basic for loops with tests, breaks/continues coming in a later CL.

Change-Id: I28f832ef80689a562da99f60d682bf8e4c630697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191340
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-17 14:53:22 +00:00
Dmitry Stefantsov e64daf805f [cfe] Handle boudness type variables in results from i2b
Closes #45317.

Bug: https://github.com/dart-lang/sdk/issues/45317
Change-Id: Ib6144778a11dc837c74b4b7992c41dbe2d654946
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191260
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-03-17 10:48:31 +00:00
Kallen Tu 00b6a815d9 [cfe] AbortStatus in statement executor for constants.
Change-Id: I96d5a7bc7aed69898e2c8bf048aeadf3b02387c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191100
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-16 15:56:51 +00:00
Jacob MacDonald 3f5384bd08 Roll dart_style 2.0.0 into the repo.
There are no formatting changes aside from adding support for generic
metadata annotations, which are not yet used. Changes are:

- Migrated to null safety.
- Return exit code from FormatCommand.run().

Change-Id: I8892f6551541f673b8e49045665e2371ba40b026
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191182
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-03-16 15:22:21 +00:00
Jens Johansen fd89f1176b [parser] Test for (already fixed) issue 45327
The crash reported in #45327 was already fixed, but for good measure
we'll add the provided examples as tests.

Change-Id: I74f3b78b8644712322d0fb582bbbbde291a8994e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191366
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-16 14:45:00 +00:00
Kallen Tu c906133967 [cfe] Multi-call const function tests to existing behavior.
Change-Id: Id03250e5eeb38d9c69b629c239e573a1d838820f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190980
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-15 18:09:13 +00:00
Dmitry Stefantsov d6b79dab6c [cfe] Correct argument count in extension member errors
Closes #45204.

Bug: https://github.com/dart-lang/sdk/issues/45204
Change-Id: I5295704a8d470e639fe346dbbbf80ad28ff614a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190520
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-15 10:46:00 +00:00
Jens Johansen b5da327ed9 [parser] Parse and skip metadata according to spec
Make the parser handle metadata properly according to the spec.

There has been some confusion in regards to metadata because
https://github.com/dart-lang/language/blob/master/accepted/future-releases/small-features-21Q1/feature-specification.md
(used to) say we needed a spec update.

That was done in the parser in
https://dart-review.googlesource.com/c/sdk/+/182668
but really that made the parser adhere to the spec as it was which is
also correct (as the spec change wasn't needed at all).

The parser also needs to be able to skip metadata, though, and that
wasn't done it that CL which caused the issues in
https://github.com/dart-lang/sdk/issues/45120

The work directly in this CL is:
* Add lots of comments to parseMetadata to make them more up-to-date with
  the spec.
* Fix skipMetadata to correspond to parseMetadata.
* Tests verifying that 45120 is fixed in the parser and that metadata in
  general works as expected in the parser.

(In working on this, the future specification was corrected to say that the
spec did not need updating. Thanks to Erik for the quick turn-around
there).

Bug: #45120
Change-Id: Id1e4912cac7e5d9113efe083b3ecd06e6834a16e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190880
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-15 08:40:40 +00:00
Kallen Tu a7e5965495 [cfe] If statements for const functions.
Change-Id: If4449eb6613c7a2b53119ed2e8d3f3042624ccd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190800
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-12 21:09:08 +00:00
Dmitry Stefantsov 8ddc7465a8 [cfe] Move ExtensionType into pkg/kernel/lib/ast.dart
Change-Id: I2e8231dad00accafb09d1ec88416242d3d5815a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190483
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-12 19:02:27 +00:00
Kallen Tu ef01825d44 [cfe] Const function tests removed SharedOptions.
Change-Id: I51ceedf4b140f6aef2af407058c5e7c23860c850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190801
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-12 16:20:17 +00:00
Jens Johansen 31acdc9d92 [parser] Recovery of of new/const/Map/Set/List with said literals
E.g. recover `Map<int, int>{}` by ignoring the map (i.e. it's
just a literal map), recover `new {}` as just `{}` etc.

Fixes #45251.

Change-Id: I44e67ca6d3b9b068014b8e28822a61063c794d57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190022
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-12 10:41:06 +00:00
Kallen Tu 494aaaab39 [cfe] Variable assignments (VariableSet) for const functions.
Change-Id: Iab23493fc09b8fdad78968d905ac8f28e1236aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190620
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-03-11 23:14:41 +00:00
Johnni Winther 1aa6f00107 [kernel] Refactor CanonicalName/Reference integration
The CL is a step towards have a more restricted and wellstructured
handled of references and canonical names.

The CL moves Reference to canonical_name.dart and makes
CanonicalName.reference private, and replaces CanonicalName.getReference
with a 'reference' getter.

It also removes NamedNode.canonicalName, Field.getterCanonicalName and
Field.setterCanonicalName so that these can only be accessed through the
corresponding reference. This is to reduce the reliance on the
canonical names which, ideally, should only be part of serialization and
deserialization.

TEST=existing

Change-Id: I955fb7d52d4e112d8741f7c12dcf38b74ae0c91a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190442
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-03-10 15:39:28 +00:00
Paul Berry c509ad1e41 Change "could not" to "couldn't" in error messages
See comments at
https://dart-review.googlesource.com/c/sdk/+/186320/4/pkg/analyzer/lib/src/generated/resolver.dart#3423.
On the recommendation of the documentation team, we use a more
informal tone in messages.

Change-Id: I0c243669ebd91b8f4a745530582e0f829769a754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-10 15:26:38 +00:00
Kallen Tu 3210fb4306 [cfe] Environment parents and block tests for const functions.
Fixed up block environment and added tests for them.

Change-Id: I97375c90c9244f6dcf8294dc11b0d4e70697d114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190320
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-10 15:23:18 +00:00
Paul Berry b661bf12c5 Front end: Additional "why not promoted" functionality.
This CL implements "why not promoted" functionality in the front end
for the following scenarios:
- null iterable in for-loop
- null iterable in yield* statement
- null iterable or map after spread (`...`) operator

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I471b8bf558341514207fad527dde009f1372182c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188160
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-10 14:52:19 +00:00
Jens Johansen 3794264427 [CFE] Forgotten test for external fields and advanced invalidation fix
This CL is a test I forgot to include in
https://dart-review.googlesource.com/c/sdk/+/188461
even though I wrote it and used it to verify the fix.
Better late than never.

Change-Id: I6371719ce0d447f6ef9aeb6ebed2b7615c911b6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190480
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-10 14:13:59 +00:00
Johnni Winther 03ac05b146 [kernel] Migrate package:kernel/text_serializer.dart
Change-Id: I0b084911fa4ba35593a70ba8c214e818dbf7c219
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190440
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-10 13:26:58 +00:00
Paul Berry 73f9d0cd26 Flow analysis: Remove unnecessary argument from tryFinallyStatement_end.
Flow analysis stopped using this argument (the AST node for the
finally block) some time ago, but I kept it around so I could assert
that clients didn't unnecessarily store assigned variables info for
it.  It's been long enough now that we can eliminate this code
entirely.

Change-Id: I8c64e2b4fc5b154f441ec2d057637f3dc9ced277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-10 13:14:08 +00:00
Kallen Tu d1fd3c6cb6 [cfe] Local functions for const functions.
Change-Id: I9ad3c36c4d515afe1def3f32244dc15b291d4011
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189980
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-10 01:07:32 +00:00
Dmitry Stefantsov a65f9357f8 [cfe] Add resolution for other member kinds for extension types
Change-Id: Ief5b7da1e06d0b37327fb62d29c967bcfb2cbdf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189208
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-09 12:49:40 +00:00
Daco Harkes ffa5d16ae7 [vm/ffi] Support multi-dimensional inline arrays
This CL only changes dart:ffi API, CFE, and analyzer. No VM changes
were needed because the dimensions of inline arrays can be flattened
before passing them to the VM. The multi-dimensionality does not
impact the ABI.

Closes: https://github.com/dart-lang/sdk/issues/45023

TEST=pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart
TEST=pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart
TEST=tests/ffi/function_structs_by_value_generated_test.dart
TEST=tests/ffi/inline_array_multi_dimensional_test.dart

Change-Id: Ica2c01fccbea7e513879365b34086d8968b54c5b
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188286
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-03-09 10:50:17 +00:00
Johnni Winther 67a810c758 [cfe] Make constant evaluator implement ExpressionVisitor
Change-Id: Id0aa5e808857798d7403a2733f69c2fe7bb3842e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189207
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-09 08:05:56 +00:00
Johnni Winther 2d63f26ef5 Reland "[cfe] Encode field references as @getters and @setters"
This removes the @fields and @=fields canonical name
encodings that allowed for encoding of conflicting members
and didn't support field<->getter/setter conversion
between dills or between outline and full dill.

TEST=existing tests+add aot expectation tests

Change-Id: I119b0c95f90e456356146cdc2d9241de4c1b4fff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186680
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-03-09 05:47:16 +00:00
Kallen Tu 0ac716d098 [cfe] Variable declarations for const functions.
Change-Id: I085d789125e80dd2b45df9a55f4eaea28c98fd66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189400
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-03-08 23:34:23 +00:00
Johnni Winther 01b0947a6d [kernel] Update kernel encodings
* Add InstanceGetterInvocation for getter/field invocation in web
  backends
* Add localFunction getter to LocalFunctionInvocation
* Remove isNot from EqualsCall and EqualsNull - the encoding didn't
  carry its weight.
* Remove uses of Name.name
* Remove BottomType code from VM

TEST=existing

Change-Id: I99d05d35b9ef193d092cc151c99ad472dbd60834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188725
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-08 11:29:51 +00:00
Kallen Tu b683098fde [cfe] Execute statements with StatementConstantEvaluator.
Altered the structure of the statement visitors now that ConstantEvaluator is an expression visitor. Currently uses the environment from the prior exprEvaluator, but will change in the future when needed.

No new const functionality, just set up for future ones.

Tests renamed so they actually run now.

Change-Id: Ic5914b0fc700aadeb0dcb28c08593f88e38582a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189220
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-06 01:16:26 +00:00
Dmitry Stefantsov 0be5ac538b [cfe] Add a test with nested generic arguments and bounds
Change-Id: I65ab1bab6624bb63bf36a6f09c582384fa89a73a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189203
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-03-05 12:21:37 +00:00
Kallen Tu e28a53a781 Added IntermediateValue constant results, EvaluationReferences to store values.
Pre-work for variable declarations and method invocation. Storing values in locations (refs) and having the ability to update the values.

Change-Id: I682c139dfebbc4ef6f5032d4f53f29f08b8ceeb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188500
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-04 18:27:59 +00:00