Closures can be shared if they have no state they capture (i.e. a null
context). Otherwise we copy them by also transitively copying the
parent context chain.
Issue https://github.com/dart-lang/sdk/issues/36097
TEST=Added tests to vm/dart{,_2}/isolates/fast_object_copy{,2}_test
Change-Id: Ie641b97806edd0c21f0a8d5c514f8e850823e165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209110
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This particular test was not run in both modes (--enable-isolate-groups
and --no-enable-isolate-groups). So enabling the flag made this test
fail.
It fails because it shutdown the isolate before destroying the
[IsolateSpawnState] - which in return destroys persistant handles which
needs the isolate to be still alive.
TEST=Fixes vm/dart{,_2}/spawn_shutdown_test
Change-Id: Ib06e1149c4066fa993e899bbd3bfdba8a2533b48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212292
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Per breaking change #45451 we are removing support for dart-ext:
style native extensions from the Dart VM.
This CL removes the associated VM code, tests and samples. It also ports
a single test which used dart-ext: import to use FFI instead.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/45451
Change-Id: Iae984bce32baf29a950b5de1323939006a217b94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212050
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Various VM embedders have already explicitly opted into it
AOT mode for a long time.
Now we turn it on by default, also because we'd like to collect
feedback from the field on this - in good time before the next
stable branch will be released.
All of our isolate related tests have already
// VMOptions=--enable-isolate-groups ...
// VMOptions=--no-enable-isolate-groups ...
So they will continue to exercise the tests in both modes.
Issue https://github.com/dart-lang/sdk/issues/36097
TEST=Existing test suite.
Change-Id: I1d031e8a5f2173b48eb32c53b08daccda75dc51d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208649
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Change-Id: Iff6760863c1902c4e6432ff2ef6343cfd15da40e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212021
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Converting an expression function body to a block should not include
return if the function has a return type of void.
Change-Id: I456e0b01ac83d6d42502eab18642ae66ca42111f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212038
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Elf::GenerateBuildId() doesn't have a code to ensure that generated
build ID doesn't start with zero byte, so valid build ID may start with
zero.
In precompiled runtime Image::build_id() should never see "non-final"
build ID and it should not skip build ID if it starts with zero byte.
TEST=ci
Change-Id: I5b993ae3b9ae75eaedc4e84b652b489befca34e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212024
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Previously the tear off lowering procedure used the typedef uri and
offset, but the parameters and body used the target constructor offsets.
This meant that file offset were looked up in the wrong file.
Change-Id: Ie754d09a1475d1b67231676f7d4f24bff7056ff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212004
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This allows local variables and other expressions, as long as the
static type is a generic function type, to be explicitly type
instantiated.
* Expressions with a non-generic function type cannot be type
instantiated.
* Expressions with a type of `Function` cannot be type instantiated.
* Expressions with other non-function types cannot be type instantiated.
This results in doubling-up of errors in a few situations. I think these
are generally rare occurrences, and tricky to prevent double reporting,
so I've left them for now.
Bug: https://github.com/dart-lang/sdk/issues/46020,
Change-Id: Iad212fd95773f39f3202480b3fa71f6a28c7698f
https://github.com/dart-lang/language/issues/1812
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211941
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
`--mark-main-isolate-as-system-isolate` option affects all isolates in the main isolate group. The test had to be adjusted so it verifies that isolates in new isolate groups remain non-system in presence of this option.
This is follow-up to https://dart-review.googlesource.com/c/sdk/+/207203
TEST=mark_main_isolate_as_system_isolate_test
Change-Id: I74d94accab2094311a1067ca3853fd4e19d9c67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212030
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
As a followup to 'dart format', replace Map and Set constructor calls
with literals and remove inferred type arguments.
Change-Id: Ie337bccb12848c51b3a2ab2202ebed7726f35d86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211682
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
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>