This makes it easier to identify the responsible program when a Dart process has high CPU or memory usage.
TEST=look at top
Change-Id: I0bf9e2f5c81aa82a4721b177b8db2bb6bf3fb002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211303
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
dart2js previously assumed that type variables could only occur
at the root of type literals. With the constructo tear offs feature
type literals like `C<T>` are allowed, requiring a check for nested
type variables to determine whether a type literal can be encoded
as a constant.
Fixes the crashes in
language/type_object/explicit_instantiated_type_literal_test
language/typedef/aliased_type_literal_instantiation_test
Change-Id: I0fbd2f9ea3a96ab6db70f98b8d8af1b24c950070
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211902
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
May fix "The process cannot access the file because it is being used by another process" on Windows bots when tests are trying to clean up while the pub process was running.
Change-Id: I1f3ed0a404d27e2769887e6d33c94cf9b3614092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: Ia4a9ffa1b4e27abcea66dca985d099f9fef75790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211400
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
It's a badly designed class, but this change makes it slightly better.
(We should consider moving it to package:collection and removing it from
the platform libraries. Eventually.)
The changes decouples the public `DoubleLinkedQueueEntry` class from
the actual queue implementation classes, avoiding the latter having
to share a generic `_Link<DoubleLinkedQueueEntry>` interface
which would force them to do otherwise unnecessary casts.
The public class should have been abstract, but isn't.
It's mainly used as the API of the entries exposed by DoubleLinkedQueue,
but it can also be used by itself to build double-linked lists that are
not part of a Queue, and the class can be extended.
If anyone does either, it should keep working, so it needs to be a concrete,
self-contained class with a generative constructor.
That class is moved to dart:_internal to avoid its private
implementation fields from interfering with the queue implementation classes,
which have similar fields, but can now have them at different types.
That's a hack, but it works.
The internal implementation of the DoubleLinkedQueue and its entries
are updated to better follow current programming idioms, and avoids
having fields on classes which don't need them.
Also fixes#27920
(`clear`ing a list now detaches each entry from the list so later `.contains`
won't give the wrong answer).
And moves queue tests from tests/corelib to tests/lib/collection,
since Queue isn't exposed by `dart:core`.
BUG= https://github.com/dart-lang/sdk/issues/27920
Change-Id: Ia3bb340a75886de160cc0e449947e8e7ee587061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211265
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
This prepares for the expiration of the extension-method, non-nullable,
and nonfunction-type-aliases experiments in
https://dart-review.googlesource.com/c/sdk/+/211443
Included in the CL is a fix to isExperimentEnabled,
isExperimentEnabledInLibrary, and isExperimentEnabledInLibraryByVersion
method, so that these don't overwrite enabled/disabled experiments
with the default value when flags are expired, which would otherwise
disallow library from opting out of features using its language version.
Change-Id: Ib9668afcecc2247dd54d885d4a551638d6e7d59d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211900
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-31 sgrekhov@unipro.ru Fixes 1177. Tests updated to expect compile errors according to the new behaviour
2021-08-31 sgrekhov@unipro.ru 1176. Roll failures fixed
2021-08-30 irina.arkhipets@gmail.com Issue 1172: --enable-experiment=constructor-tearoffs option returned back.
2021-08-30 sgrekhov@unipro.ru Fixes 1173. Resolving ambiguities tests were changed according to the new specification
2021-08-30 irina.arkhipets@gmail.com Fixes 1176: regression tests updated
2021-08-30 irina.arkhipets@gmail.com Fixes 1172: useless execution directives removed.
2021-08-30 sgrekhov@unipro.ru Fixes 1175. Use braces to get type literal
2021-08-26 sgrekhov@unipro.ru Rename some tests to follow test runner pattern
2021-08-25 sgrekhov@unipro.ru Fixes 1171. Expected CFE error messages updated
2021-08-25 irina.arkhipets@gmail.com Fixes 1170: tests re-named.
2021-08-25 sgrekhov@unipro.ru Fixes 1167. Fix checking for object's Type
2021-08-24 sgrekhov@unipro.ru 1169. Change error expectation for CFE according to the new behaviour
2021-08-23 sgrekhov@unipro.ru Fixes 1137. Add dependence "OtherResource" for the dependend library and chack AOT case
2021-08-20 irina.arkhipets@gmail.com Fixes 1166: test updated so that they check that function invocation cannot be constant. New tests added.
2021-08-19 irina.arkhipets@gmail.com Fixes 1168: test corrected to check syntax errors properly.
2021-08-19 irina.arkhipets@gmail.com Fixes 1167: existing test for abstract class updated, added new test for the custom generic class.
2021-08-17 irina.arkhipets@gmail.com Issue 1158: Language/Expressions/Numbers test splitted to web and non-web ones. Non-web ones should be excluded for dart2js in status files.
2021-08-17 irina.arkhipets@gmail.com Issue 1158: Some tests splitted to web and non-web ones. Non-web ones should be excluded for dart2js in status files.
2021-08-16 irina.arkhipets@gmail.com Fixes 1164: Got rid of toInt32, toInt16, toInt8 functions.
2021-08-13 sgrekhov@unipro.ru Fixes 1162.Wait for entryPoint is invoked before doing the test
2021-08-13 sgrekhov@unipro.ru 1138. Roll failures fixed and issue numbers added
2021-08-13 sgrekhov@unipro.ru Fixes 1161. Fix tests to be able to work without sound null safety
2021-08-13 sgrekhov@unipro.ru Fixes 1160. Fix tear-offs types in test expectations
2021-08-13 sgrekhov@unipro.ru Fixes 1159. Fix test expectations
2021-08-13 sgrekhov@unipro.ru Fixes 1155. Wrong tests deleted
2021-08-13 sgrekhov@unipro.ru Fixes 1154. Expect a compile-time error for 'C.new<int>' instead of syntax error
2021-08-13 sgrekhov@unipro.ru Fixes 1154. Expect a compile-time error for 'List.filled<int>' instead of syntax error
2021-08-13 sgrekhov@unipro.ru Fixes 1151. Use constants to tear-off constant constructors
2021-08-13 sgrekhov@unipro.ru Fixes 1153. Use (List<int>).toString() instead of List<int>.toString()
2021-08-13 sgrekhov@unipro.ru Fixes 1152. Fix typos in summary_A02_t01 test
2021-08-13 sgrekhov@unipro.ru Fixes 1150. Fix typo in parameter name
2021-08-13 sgrekhov@unipro.ru Fixes 1149. Fix named constructor tests to not to try to tear-off from Type
2021-08-13 sgrekhov@unipro.ru Fixes 1148. Expect errors for tear-off that violate bounds
2021-08-13 sgrekhov@unipro.ru Fixes 1147. Make 'call' method to be generic one
2021-08-13 sgrekhov@unipro.ru Fixes 1146. Fix expected error location for CFE
2021-08-13 sgrekhov@unipro.ru Fixes 1145. Remove excessive wrong check
Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I0ead022e41a63573e1d3a61b42fd9c4d9ca86fdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211903
Reviewed-by: William Hesse <whesse@google.com>
iOS appears not to allow any single virtual memory allocation to exceed ~700MB.
iOS appears to limit the total amount of allocated virtual memory to amount of physical memory available, even virtual memory that is reserved by not committed.
So instead of trying to allocate the full 4GB region for compressed pointer, allocate the largest power-of-two that succeeds, and speculate that further allocations to into the same 4GB region.
TEST=none
Change-Id: Ib45f7ece59e1adb96d175ae861b984c0c6737549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210640
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
- Don't stay in the monomorphic state if the corresponding ICData is no longer monomorphic, even if the call site itself encountered the same CID as before.
- Don't assume the ICData's entries array hasn't been replaced.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/47010
Change-Id: I00f59eb59ed52e21bd638fec876accda42db0e2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211464
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Sorting classes causes all generated code to be discarded because it may invalidate embedded CIDs. For the kernel-service in particular, this results in a significant slowdown. These classes were already sorted when the snapshot was generated.
TEST=ci
Change-Id: Ice443718ec43ead88e69039a7c723856f4fd448c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211882
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Can cause unexpected behavior when combined with
--mark-main-isolate-as-system-isolate
TEST=Confirmed main isolate used to pause on start and not output anything to console. Applied fix, sample ran to completion.
Change-Id: I355deaa7f30909b345f38c85ec5a7ccb358b43c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211881
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
I added commas and formatted. No other changes were made.
Change-Id: I5aacab204d2a36474ed1689a912ea61362764726
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
So, 'parameterKind' is never null.
Change-Id: Id5d17a3cfc9795d3dcec4b2f1e8bb5c372f339fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211607
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit 1016bbadde.
Reason for revert: Broken benchmarks on golem.
Original change's description:
> [vm/compiler] Add more checks in TTSes for uninstantiated types.
>
> In certain cases, optimized type testing stubs for uninstantiated types
> compare the instantiation of the type arguments for the type against the
> corresponding instance type arguments. Previously, only an identity
> check was generated, so the instantiation had to match the instance type
> argument exactly.
>
> This CL adds checks for the following cases:
> * The instantiated type argument is dynamic, void, or Object.
> * The instance type argument is Null or Never.
>
> When strong null safety is enabled, we also check that the the instance
> type argument is legacy or non-nullable when the instantiated type
> argument is non-nullable Object or that the instantiated type argument
> is nullable or legacy when the instance type argument is Null.
>
> This CL also adds handling for the case where the instantiated or
> instance type argument is not a Type, which is necessary for safely
> retrieving the type class id and nullability, and allocates some
> additional registers in TTSInternalRegs for storing type arguments. On
> ARM7, this requires pushes/pops around type argument checking, because
> we've run out of registers there.
>
> Fixes https://github.com/dart-lang/sdk/issues/40736
>
> TEST=vm/cc/TTS
>
> Bug: https://github.com/dart-lang/sdk/issues/46920
> Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
> Change-Id: Ib8498fd2b9593b4abb92111f062ed2fc95a45c16
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210681
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
TBR=kustermann@google.com,alexmarkov@google.com,sstrickl@google.com
Change-Id: I8c2368cbbb3d23aa2d0cb4788737d9b737318bb7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/46920
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211860
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
In certain cases, optimized type testing stubs for uninstantiated types
compare the instantiation of the type arguments for the type against the
corresponding instance type arguments. Previously, only an identity
check was generated, so the instantiation had to match the instance type
argument exactly.
This CL adds checks for the following cases:
* The instantiated type argument is dynamic, void, or Object.
* The instance type argument is Null or Never.
When strong null safety is enabled, we also check that the the instance
type argument is legacy or non-nullable when the instantiated type
argument is non-nullable Object or that the instantiated type argument
is nullable or legacy when the instance type argument is Null.
This CL also adds handling for the case where the instantiated or
instance type argument is not a Type, which is necessary for safely
retrieving the type class id and nullability, and allocates some
additional registers in TTSInternalRegs for storing type arguments. On
ARM7, this requires pushes/pops around type argument checking, because
we've run out of registers there.
Fixes https://github.com/dart-lang/sdk/issues/40736
TEST=vm/cc/TTS
Bug: https://github.com/dart-lang/sdk/issues/46920
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
Change-Id: Ib8498fd2b9593b4abb92111f062ed2fc95a45c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210681
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
E.g. if reporting a missing ";" after a SyntheticStringToken (e.g. a
inserted identifier) before this CL it would go to the next token and
say we expected the ";" after that, when really we expected it *before*
that token.
Change-Id: I2c358e017edb2f661e307eba03dddaee889086d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205799
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This should reduce the risk of mistakes, since there are many call
sites that create FlowAnalysisHelper objects, and we would have subtle
bugs if the call sites disagreed about when certain pieces of flow
analysis logic should be enabled.
Change-Id: I2c58eebbe05724b231107a0681c9ea668f5d968f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211502
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
communicate with the kernel isolate while accepting compilation results
during a hot reload.
TEST=reload bot tests.
Change-Id: I55f983cc8461c89e91bf1bef84f39dcda61e8142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210942
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Fixes https://github.com/dart-lang/sdk/issues/46899
Also required fixing the dangling type parameters on
ConstructorElements, FunctionTypes and the returnType (an
InterfaceType) of the FunctionTypes. In the case of the
ConstructorElements, we just refer to the declaration.
Fixes https://github.com/dart-lang/sdk/issues/46981
To remove dangling type parameters, we set
`constructorName.type.type` to null for generic ConstructorReferences.
The idea is that this code is generic and the TypeName is not a proper
type. This requires a few changes to other code that expects
TypeName.type to be non-null.
Change-Id: Ie14344c5179922318ca746cbbdab13cf67b7432a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211304
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The 'File' object created in the async file open method is leaked
if the operation is not completed when the isolate shuts down
with an unhandled exception.
This change adds a finalizable state for the 'File' object so that
the message deletion that happens when ports are closed could run
the callback to clean up the 'File' object.
TEST=new tests added
Change-Id: I64c18a7905261b0fc7bf9f220086791478232d0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211340
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This change removes duplicated implementations of dart:math intrinsics
from GraphIntrinsifier/AsmIntrinsifier and FlowGraphInliner, and adds
a single implementation in FlowGraphBuilder.
TEST=ci
Change-Id: Ifcf285aba15e1b240144215463cd6b2703a8937c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211481
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Addresses extra error in
co19/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A03_t07.
Change-Id: Ice77048de06199de9de65a0a403f0393e4300a4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211562
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Non-nullable Object is not a top type in strict null safety mode, so
we need to explicitly check for it, since we can't fall back to
Class::IsSubtypeOf for FunctionTypes.
TEST=vm/cc/FunctionType_IsSubtypeOfNonNullableObject
Change-Id: Icfa2ece9bb954a2cc8756334614eb38c0ec1443a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211580
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>