Commit graph

93 commits

Author SHA1 Message Date
Ömer Sinan Ağacan a0f1bd5a4b Update test for #45060
Equal types should have the same hash, but they are not necessarily
identical.

Update the test to remove the identity check between a constant type and
a type constructed in runtime.

Change-Id: I0d6c6395c587391d3087c26b00fff36d645b33dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368340
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-05-28 07:10:39 +00:00
Chloe Stefantsova 04e8677d59 [cfe] Infer mixins by directly solving for equality
The direct algorithm for solving for equality replaces the more
general constraint solving algorithm. It reduces complexity and
removes the requirement on the constraint gathering and solving engine
to be applicable at the earlier stages of compilation.

Change-Id: I73dfa39bb1534803c6985578708ecab198c26e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343920
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-08 11:42:39 +00:00
Chloe Stefantsova d0aa049ae1 [cfe] Report cyclic dependency on declaration, not on type variable
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/339941/comment/356b962f_a73d18c8/

Change-Id: I193cee03bdfa766621d57dd4a47cc9f0da6c9c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340440
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-12-07 13:21:29 +00:00
Mayank Patke bd06128def [web-fixit] Make regress45529_test minification-agnostic
Change-Id: I93eaaf56fefa02e7f630b5711d9781cd651b1dad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339783
Auto-Submit: Mayank Patke <fishythefish@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-12-06 22:49:49 +00:00
Ryan Macnak e478de7e38 [vm, compiler] Fix incorrect canonicalization of a load to an initializing where the load's receiver is the store's value instead of the store's receiver.
TEST=ci
Change-Id: I182b511f100a36419a29d3a5ac971961824421e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326682
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-09-18 23:11:22 +00:00
Sergey G. Grekhov 82b78916fd [tests] Remove obsolete Dart 3.0 experiments from language tests
Change-Id: If31c487e3ebe2c1ae847aff7c8994580b8b6f2f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309660
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-06-15 08:26:27 +00:00
Nate Biggs 990fdea1d5 [cfe] Fix for transforming record literals to const records with unevaluated const elements.
Similar to fix for unevaluated const elements in record constants:
https://dart-review.googlesource.com/c/sdk/+/304766

Bug: https://github.com/dart-lang/sdk/issues/52468
Change-Id: I0af9012f3b6153951f957363077a2be85165aeed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306560
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-06-01 15:36:24 +00:00
Sigmund Cherem 81bf7f1254 [cfe] fix for nesting unevaluated constants within record constants
Fixes https://github.com/dart-lang/sdk/issues/52468

Change-Id: I78704ce965afa453fc46acf6f39ac59357246d4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304766
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-05-23 17:14:10 +00:00
Nicholas Shahan 5091631de1 [tests] Add regression tests for identifiers
Issue: https://github.com/dart-lang/sdk/issues/52431
Issue: https://github.com/dart-lang/sdk/issues/39595
Change-Id: Iae9c02ad632264d1eb14fb0958f714b4faee55b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304262
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-05-18 20:33:20 +00:00
Nicholas Shahan dd2fb672fd [ddc] Add regression test for type test issue
In DDC the types [num], [int], [double], [String], and [bool] used in 
bounds caused an "optimization" in type tests that was incorrect when 
passing a subtype as the type argument.

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

Change-Id: I0ae8d21c907cd923d62dbae257085545840a8cdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301140
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2023-05-05 21:13:40 +00:00
Robert Nystrom 27ef9f0762 Migrate "r" directory language tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static
error tests.

See: https://github.com/dart-lang/sdk/issues/45634
Change-Id: I5dd012381390ef2c00d674308db3fe099ecc6a4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296423
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-04-19 23:35:16 +00:00
Mayank Patke 5d859bb463 [dart2js] Add test for issue #51910.
Bug: #51910
Change-Id: I0ee968a88e67279d1ced7e1f1126357b0e1bc6b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292260
Reviewed-by: Stephen Adams <sra@google.com>
2023-03-31 02:14:46 +00:00
Lasse R.H. Nielsen 9e76983782 Reland "Add more interface and final modifiers to dart:core."
This is another reland of 4f8333e80e.
Third time is the charm.

CoreLibraryReviewExempt: Reland of accepted CL.
Change-Id: I4ea8326af91c168b044d252162571d3fe697e4b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289826
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-30 20:34:09 +00:00
Nate Biggs f9fba691ea [tests] Add language test for field accesses on constant-like record.
Change-Id: I4748f14fd77e4422823af2b7e60d61a57339e19c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291641
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-03-28 22:02:52 +00:00
Ilya Yanok 936cdeeb2f Revert "Reland "Add more interface and final modifiers to dart:core.""
This reverts commit e293eb809d.

Reason for revert: Breaks G3.

Original change's description:
> Reland "Add more `interface` and `final` modifiers to `dart:core`."
>
> This is a reland of commit 4f8333e80e
>
> Blocked on Flutter patch: https://github.com/flutter/engine/pull/40175
>
> Original change's description:
> > Add more `interface` and `final` modifiers to `dart:core`.
> >
> > Make intent explicit for classes which are intended as interfaces,
> > or which are not intended to be subclassed.
> >
> > Mainly classes which are pure interfaces are marked as such,
> > and platform-specific classes not intended for subclassing
> > are made `final`.
> >
> > The `final` classes includes `BigInt`, which is written to assume
> > that arguments inherit its private members
> > (it runs `_ensureSystemBigInt` on arguments).
> >
> > It also includes the `Expando`, `WeakReference` and `Finalizer` classes,
> > which are just intended as stand-alone implementation classes for accessing
> > platform-specific functionality.
> >
> > Change-Id: Ib770c265edff127a289a67fe72d15b9ff0499407
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287180
> > Reviewed-by: Stephen Adams <sra@google.com>
> > Commit-Queue: Lasse Nielsen <lrn@google.com>
> > Reviewed-by: Aske Simon Christensen <askesc@google.com>
> > Reviewed-by: Nate Bosch <nbosch@google.com>
> > Reviewed-by: Martin Kustermann <kustermann@google.com>
>
> CoreLibraryReviewExempt: Accepted in original CL.
> Change-Id: Id713edede4228801bb097a64734be4f2187f51a9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288206
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I05ff2fe44e5a13f20725eb122963d20243062c7a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288503
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2023-03-13 16:08:31 +00:00
Lasse R.H. Nielsen e293eb809d Reland "Add more interface and final modifiers to dart:core."
This is a reland of commit 4f8333e80e

Blocked on Flutter patch: https://github.com/flutter/engine/pull/40175

Original change's description:
> Add more `interface` and `final` modifiers to `dart:core`.
>
> Make intent explicit for classes which are intended as interfaces,
> or which are not intended to be subclassed.
>
> Mainly classes which are pure interfaces are marked as such,
> and platform-specific classes not intended for subclassing
> are made `final`.
>
> The `final` classes includes `BigInt`, which is written to assume
> that arguments inherit its private members
> (it runs `_ensureSystemBigInt` on arguments).
>
> It also includes the `Expando`, `WeakReference` and `Finalizer` classes,
> which are just intended as stand-alone implementation classes for accessing
> platform-specific functionality.
>
> Change-Id: Ib770c265edff127a289a67fe72d15b9ff0499407
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287180
> Reviewed-by: Stephen Adams <sra@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

CoreLibraryReviewExempt: Accepted in original CL.
Change-Id: Id713edede4228801bb097a64734be4f2187f51a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288206
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-03-13 15:21:30 +00:00
Oleh Prypin 732d1cc0a4 Revert "Add more interface and final modifiers to dart:core."
This reverts commit 4f8333e80e.

Reason for revert: causes breakages in google3

Original change's description:
> Add more `interface` and `final` modifiers to `dart:core`.
>
> Make intent explicit for classes which are intended as interfaces,
> or which are not intended to be subclassed.
>
> Mainly classes which are pure interfaces are marked as such,
> and platform-specific classes not intended for subclassing
> are made `final`.
>
> The `final` classes includes `BigInt`, which is written to assume
> that arguments inherit its private members
> (it runs `_ensureSystemBigInt` on arguments).
>
> It also includes the `Expando`, `WeakReference` and `Finalizer` classes,
> which are just intended as stand-alone implementation classes for accessing
> platform-specific functionality.
>
> Change-Id: Ib770c265edff127a289a67fe72d15b9ff0499407
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287180
> Reviewed-by: Stephen Adams <sra@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I94ff95f72410a4e1ae80744971c4c920fecc1493
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287760
Reviewed-by: Martin Kustermann <kustermann@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-09 13:09:57 +00:00
Lasse R.H. Nielsen 4f8333e80e Add more interface and final modifiers to dart:core.
Make intent explicit for classes which are intended as interfaces,
or which are not intended to be subclassed.

Mainly classes which are pure interfaces are marked as such,
and platform-specific classes not intended for subclassing
are made `final`.

The `final` classes includes `BigInt`, which is written to assume
that arguments inherit its private members
(it runs `_ensureSystemBigInt` on arguments).

It also includes the `Expando`, `WeakReference` and `Finalizer` classes,
which are just intended as stand-alone implementation classes for accessing
platform-specific functionality.

Change-Id: Ib770c265edff127a289a67fe72d15b9ff0499407
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287180
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-03-09 12:31:08 +00:00
Jake Macdonald af6e1bf5a4 [flip-modifiers]: prep more tests for the class modifiers flag flip
TEST=only test changes

Change-Id: I725bd897e9e749ab6010c99ee74c20ee64e61500
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286981
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-03-06 20:52:03 +00:00
Jake Macdonald bc3a4a660f pre-emptively fix some tests for class modifiers flag flip
Change-Id: Ie7bbea5faa07dcc41f551268bd730bf0416e1fef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286280
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-03-01 20:11:25 +00:00
Robert Nystrom 7ca5ad46ce Set tests that have mixin errors as 2.19.
Mark tests that contain errors about using a class as a mixin to use
language version 2.19 where that's not an error.

This may not fix all of the tests because it's the language version of
the library where the class is declared that matters, not where the
class is used as a mixin. But most tests have all of their declarations
in the same library, so this should fix most.

Change-Id: I910439ebd2f10f731418dc588b7e4619a0841c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285923
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-01 15:03:39 +00:00
Josh Soref 84e3c8b50f Spelling tests
Closes https://github.com/dart-lang/sdk/pull/50920

GitOrigin-RevId: fa87531bd0f52b69485c9d02ff9e44a4a29c6a91
Change-Id: I0ae8574a5b77087895e004079f221201bb550cf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278535
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 16:24:29 +00:00
Alexander Markov 88400bdc42 [vm] Update number of parent function type arguments
Number of parent type arguments in function types is critical
for instantiation and subtype checks when there are nested
generic function types. So it is important to update
number of parent type arguments when parent function type is updated.

This change adds mechanism for updating number of parent
type arguments and uses the new mechanism in 2 cases:

1) When a type parameter is substituted during type instantiation.
   The substituted type can have nested generic function types and
   it should be updated if substituted inside another generic
   function type.

2) When creating a constructor tear-off for a generic class.
   Parameter types of the constructor could have nested generic
   function types and they should be updated as tear-off itself is a
   generic function.

TEST=language/function_subtype/generic_function_type_substitution_test
TEST=language/regress/regress50905_test

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

Change-Id: If13baa420939f5ac002ce32f3909953fb6998bd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278525
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-01-10 03:10:14 +00:00
Josh Soref a8cb0b4f98 spelling: compliance
Closes https://github.com/dart-lang/sdk/pull/50762

GitOrigin-RevId: e85b436a4cb108176273ffeffd96cc4ba84df444
Change-Id: I391df2dfb65c69c658965d9ebfd2d2314841044c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276320
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-19 13:22:28 +00:00
Michael Thomsen b3304af17d [3.0 alpha] Remove deprecated onError API on int.parse, double.parse, and num.parse
Change-Id: I9ed24c380bf716cb893b99ba228e34f4671cc8fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259042
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-12-12 09:54:54 +00:00
Alexander Markov 24b8399086 [tests] Avoid small --optimization-counter-threshold in tests
Small --optimization-counter-threshold makes tests very slow,
especially on architectures where kernel service runs from
kernel and not from app-jit snapshot.

TEST=change in tests, *-ia32 bots
Fixes https://github.com/dart-lang/sdk/issues/48627

Change-Id: I63e7e201ef9a0e4f645016c39a5be1819b61822d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263421
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-10-10 21:04:18 +00:00
Lasse R.H. Nielsen 5642199dd0 Remove uses of : as default value separator in some tests/ directories.
Change-Id: I35bb926e53e92fd02e264fb5b14feadf063fb8db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257961
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-09-07 14:49:17 +00:00
Johnni Winther 5222bfd90c [cfe] Refactor bounds checking
This CL moves the bounds checking into the TypeBuilder instead of
performing it from the outside on the computed DartType node.
This solves several problems:

  1) Errors are now reported on the type in the code instead of the
     declaration which holds the type.
  2) Checking of type aliases (both function and nonfunction type
     aliases) is now handled correctly in all cases. This achieved by
     computed the aliased type (containing TypedefType nodes)
     internally and performing the checking on this type, and only
     convert the type into the unaliased version (without TypedefType
     nodes) after checks have been performed. Previously this handled
     through the FunctionType.typedefType property for function type
     aliases and through and incomplete work-around for nonfunction
     type aliases.
  3) With 2) FunctionType.typedefType is no longer needed and is
     removed.

TEST=general/bounds_*

Change-Id: I7653bca5ccb0ebf4b3553828a298d1ad918ef235
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243722
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-05-17 14:36:19 +00:00
Johnni Winther 1f848492b7 [dart2js] Compute the correct selector for InstanceGetterInvocation
The Selector computed for InstanceGetterInvocation used the name of
the getter eventhough the invocation is actually a .call invocation.
This lead the computation of whether type arguments need to be parsed
to fail because it queried with the wrong selector.

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

Change-Id: Ia08fb91fa24b5b04eba850f75f9b66cb89494dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234288
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-01 08:55:17 +00:00
Stephen Adams 0afb365804 [dart2js] Fix #47566 by disabling optimization
The JavaScript-to-JavaScript async transform had an inconsisent
handling of switch statements that contained an await, but only in the
expression.

For now the special handling of the expression-only case is disabled.

Change-Id: Ia79ff3951d681ba933df638da7e0e518d401ed9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-09 00:43:02 +00:00
Martin Kustermann 96d40d1caa [vm/concurrency] Remove --(no-)enable-isolate-groups flag usage in tests
This is a preparation CL to remove the --enable-isolate-groups flag in
the VM.

The following tests were only running in --no-enable-isolate-groups and
are therefore obsolete now:

  - runtime/tests/vm/dart/regress_47468_test.dart
  - runtime/tests/vm/dart_2/regress_47468_test.dart
  - tests/lib/isolate/illegal_msg_function_test.dart
  - tests/lib_2/isolate/illegal_msg_function_test.dart

TEST=Changes tests only.

Change-Id: I6257cb667eebca66a649614d3010139dd2cdd3ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219100
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-11-04 18:57:21 +00:00
Erik Ernst ace8c34996 Adjust language{,_2}/regress/regress31596_covariant_declaration_test
These tests are updated to match the behavior which was specified in
dart-lang/language#1833. The change is valid for both language_2 and
language because it isn't tied to a language version. This should not
break any existing code because it only changes programs with
compile-time errors into programs with no errors.

(If we agree on this change then I'll approve the failures.)

Change-Id: I49f41fd1b1575c237c9c619c912de3e8de53356f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217016
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-10-18 15:58:09 +00:00
Stephen Adams ff617b9505 [dart2js] Fix bug in load elimination with try-catch-finally
1. Make unwrapException pure. This allows it to be removed if the
exception is unused, and ensures that the catch does not unnecessarily
invalidate locations. This is helpful since, by itself, this change
causes some test failures due to the load elimination bug (#47166).

2. Invalidate locations on entry to catch and finally blocks. This is
a conservative fix for #47166.

Bug: 47166
Change-Id: If3b4113b538978095d59814c16bd8375bbd70696
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213414
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-15 19:34:23 +00:00
Johnni Winther b3af778a38 [cfe] Add UnresolvedKind for fine grained unresolved reporting
- including tests for issues 46719 and 46887

Change-Id: I601fcfcb956e059f502cbece29fb2a6a00f68846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-08-25 09:51:54 +00:00
Nicholas Shahan a899525bdc [tests] Add regression tests
Issue: https://github.com/dart-lang/sdk/issues/46867
Change-Id: I7e2912752ac8c48df233f27869599280e2c322fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209853
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-08-17 17:32:52 +00:00
Alexander Markov 3097b72b2b [vm] Ignore differences in generic-covariant-impl flags of type parameters when doing a subtype check
We might get different flags on lhs and rhs of a subtype check as
lhs might come from a tear-off which has generic-covariant-impl type
parameters and rhs is a standalone function type.

TEST=language/regress/regress46816_test
Fixes https://github.com/dart-lang/sdk/issues/46816

Change-Id: Ic0f1b4a9fdf0f4c9ae65c8c372d12c1e51ad8050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209265
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-08-07 21:03:46 +00:00
Alexander Markov 300a2ea952 [cfe] Create normal bodies for redirecting factories
Replace bogus body created for redirecting factories with a
normal body which calls target factory or constructor and
forwards all arguments. Such a body can be used by back-ends
if they choose to treat redirecting factories as ordinary
factories.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/41915
Issue https://github.com/dart-lang/sdk/issues/46231

Change-Id: I62c83bcc9005995e85de049d3d929ca86a75297f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208681
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-04 17:51:07 +00:00
Daco Harkes db90fd784b [test] Replace non-implemented @DontInline() annotations
Remove the `@DontInline()` annotation. None of the backends implemented
it. (Searching for "DontInline" yields nothing in our code base.)

Instead replaced the use sites with `@pragma('vm:never-inline')` and
`@pragma('dart2js:noInline')`, which are implemented in the backends.

Original suggestion:
https://dart-review.googlesource.com/c/sdk/+/208080/4..6/tests/language_2/const/map_hashcode_override_test.dart#b11

Change-Id: Ifdcfc8ef3413d0b5964edc1bc1fa47c5ce306935
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208082
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-07-26 13:22:31 +00:00
Alexander Markov 6128a39d85 [vm/compiler] Fix handling of delayed type arguments in case of inlined closure call
Previously, prologue builder omitted loading of delayed type arguments
from closure object in case of inling. This would effectively switch
from using delayed type arguments of an instantiated generic closure to
type arguments passed on the stack (null/all-dynamic if none), which is
not correct.

The fix is to load delayed type arguments from closure object even
in case of inlining.

TEST=tests/language/regress/regress46550_test.dart
Fixes https://github.com/dart-lang/sdk/issues/46550

Change-Id: Ibe50b0bc2ebda1d3638c4940fe9a26cd5ba7ce32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207704
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-07-22 17:33:39 +00:00
Martin Kustermann 627292bcc0 [vm] Remove --experimental-enable-isolate-groups-jit, only guard via --enable-isolate-groups
The JIT support has progressed and is no longer unstable. We'll
therefore remove the experimental flag and rely on the same
--enable-isolate-groups flag as in AOT mode.

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

TEST=Existing test suite.

Change-Id: Iff0dd5b64d9b6ab91ad9ffc0ae445efc802d3908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207122
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-16 09:13:28 +00:00
Daco Harkes d5a97be466 [test] Fix getValueNonOptimized in tests
Addressing https://dart-review.googlesource.com/c/sdk/+/206202/4/tests/language/const/set_hashcode_override2_test.dart#12

Change-Id: I08948507b702dd0885b98ae31b1a7d22536e9ce1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206224
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-07-12 10:23:14 +00:00
Regis Crelier 8b7870bc62 Reland "[VM/runtime] Handle generic types in intrinsics for type equality and runtimeType comparison."
This is a reland of 09d2025685

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

Intrinsics for sameRuntimeType wrongly assumed that types with unequal type arguments are unequal, which is not true:
1) nullability of individual type arguments may be different
2) one vector may be a prefix of the other vector

Note that the intrinsic for type equality did not make this assumption.

Case 2 above was not handled properly in the runtime.

TEST=added regression test

Original change's description:
> [VM/runtime] Handle generic types in intrinsics for type equality and runtimeType comparison.
>
> Generic types with equal class ids and equal type arguments are now considered equal by the intrinsics and a runtime call is avoided.
>
> Fixes https://github.com/dart-lang/sdk/issues/23746
>
> TEST=existing ones
>
> Change-Id: I668db119ac6d2525eac3a4f17a44f36c53b9dbf5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203143
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Régis Crelier <regis@google.com>

Change-Id: I53fc00d856ecd9d9b8d66b8da95285e6e0bd508e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204363
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-06-22 20:35:53 +00:00
Regis Crelier bae9560c8a [VM/runtime] Insert TypeRef when type parameter bound refers to type parameters.
Fixes https://github.com/dart-lang/sdk/issues/46276

TEST=added regression test

Change-Id: Iecdccd4af02c374d4d17d0c0d7985fdaeec5e42a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202820
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-06-16 18:25:37 +00:00
Regis Crelier 7014f03aad [VM/runtime] Fix type test: a closure is T, when T is instantiated to Object.
Fixes https://github.com/dart-lang/sdk/issues/46165

TEST=added regression test

Change-Id: I3016f60560b00f077d5ef55a0b23ccfb7dbf0836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201863
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-06-01 20:25:55 +00:00
Bob Nystrom 43260485de Revert "Rename a regression test so that the test runner runs it."
This reverts commit c362bc085c.

Reason for revert: Causes out-of-memory on CI.

Original change's description:
> Rename a regression test so that the test runner runs it.
>
> Change-Id: I5effc1641b08e4249da9945e638e3b2cb4f0024c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201226
> Auto-Submit: Bob Nystrom <rnystrom@google.com>
> Commit-Queue: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,rnystrom@google.com

Change-Id: Ic0c234a4b48cd51b500224d12acd7605928aa405
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201381
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-05-25 23:38:02 +00:00
Robert Nystrom c362bc085c Rename a regression test so that the test runner runs it.
Change-Id: I5effc1641b08e4249da9945e638e3b2cb4f0024c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201226
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-25 21:31:31 +00:00
Konstantin Shcheglov e9b1d45382 Issue 46062. Report TYPE_ALIAS_CANNOT_REFERENCE_ITSELF on the name of the alias.
Bug: https://github.com/dart-lang/sdk/issues/46062
Change-Id: Ib5dfd6fe4008bf6f1f352f5682b85866355cd756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200527
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-19 15:45:21 +00:00
Ben Konyi d7ccc3ca6a Revert "Fix orphaned files in tests/language/ and tests/language_2/."
This reverts commit 1989b7f376.

Reason for revert: Bots are sad, red, and purple

Original change's description:
> Fix orphaned files in tests/language/ and tests/language_2/.
>
> Some of these should be tests but were missing "_test". Others seemed
> to simply be dead code. Some should have been referenced but there were
> mistakes in the imports in other files.
>
> Change-Id: If6f1d9e52a4babbf9883ddd437fc3091179f2ef2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198141
> Auto-Submit: Bob Nystrom <rnystrom@google.com>
> Commit-Queue: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,leafp@google.com,rnystrom@google.com

Change-Id: I8d63af684023e99849addf9d1c3f87d6bcfbe89d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200531
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-05-18 21:28:01 +00:00
Brian Wilkerson 06638483e1 Improve the highlight range for conflicting_generic_interfaces
Change-Id: I4ec19c1ceba747f5f23f7c95462de323fe76ecf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200240
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-18 20:42:33 +00:00
Robert Nystrom 1989b7f376 Fix orphaned files in tests/language/ and tests/language_2/.
Some of these should be tests but were missing "_test". Others seemed
to simply be dead code. Some should have been referenced but there were
mistakes in the imports in other files.

Change-Id: If6f1d9e52a4babbf9883ddd437fc3091179f2ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198141
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-18 00:36:52 +00:00