See b/157883819: Custom embedder doesn't correctly join threads that
interacted with Dart API, which causes us to hit the newly added
RELEASE_ASSERT.
This reverts commit ea4b17533c.
Change-Id: I9fec45196646f67ae46efccc2f83a43e8941a626
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149592
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This reverts commit d806959461.
Reason for revert: multiple failures on service and other tests on various buildbots
Original change's description:
> [vm, service, observatory] Bang Bang (My Type System Shot Me Down).
>
> Port the service tests and Observatory to Dart 3.
>
> Change-Id: Ia43b169a110e5209a9770aeda1b9a4007427f064
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143381
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>
TBR=bkonyi@google.com,rmacnak@google.com
Change-Id: Id22f40dafa8c0fc3fb8c3052321629a48cb7dbc3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149684
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Port the service tests and Observatory to Dart 3.
Change-Id: Ia43b169a110e5209a9770aeda1b9a4007427f064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143381
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This addresses an issue that AOT snapshot, disassembly and flowgraph are different when generated on Windows vs Linux.
Difference is caused by different order of targets in CallTargets, caused by the fact that qsort doesn't have to preserve the order of equal elements in the original list.
While qsort on Linux preserves original (by id) order, on Windows it does not.
See https://github.com/flutter/flutter/issues/44425 for context.
Change-Id: I74c17fd83e5ae21f9733712a87de8f55a1ba94fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149496
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
At present calling convention code is guarded by _WIN64 macro, which indicates that compiler is running on Windows, doesn't take into account target os. This causes problems when one attempts to generate aot snapshot for Android os.
Fixes https://github.com/flutter/flutter/issues/44425.
Change-Id: I8b21d9e9c357071f29632826dd7bbedc19be00a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149497
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Load*Field and Init*Field IL instructions are fused into load
instructions with 'calls_initializer' flag.
A new, more powerful elimination of lazy initializer calls uses
data flow analysis and load forwarding (place numbering).
In addition to improved elimination of initializer calls,
fusing instructions avoids extra load after field is already
loaded for lazy initialization check.
Fixes https://github.com/dart-lang/sdk/issues/41417
Change-Id: Ibb2a63f84b9b0c970db67b3d6684ec15384a64e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148283
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This change mechanically copies
runtime/tests/vm/dart -> runtime/tests/vm/dart_2
in preparation for the migration of runtime/tests/vm/dart to NNBD.
Corresponding statuses in vm.status are duplicated.
Added vm_nnbd builder tag for NNBD bots.
vm/dart/* tests are allowed to run only on vm_nnbd builders.
vm/dart_2/* tests are allowed to run only on non-vm_nnbd builders.
Issue: https://github.com/dart-lang/sdk/issues/41314
Change-Id: I079da92da17960605f37c1c0e28e48362b236739
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149485
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Parts of the GC now run without a current isolate, so THR_Prints there were all silenced.
Change-Id: Icd4be68eca8a2edfa43b4f140f69babd798f17af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149371
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Remove Dart_CompileSourcesToKernel from the Dart C API as it is not used
anywhere except in unit tests (unit_test.cc)
Change-Id: I314dafbe4cddbe20a81890505bc07c8bf2100eaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149380
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
The FIDL library fuchsia.deprecatedtimezone is going away. There are
different and better ways to obtain the same functionality. This change
removes the dependency on fuchsia.deprecatedtimezone from the Dart SDK.
Adds inspect metrics that allow whitebox testing of the runners. Here's
a sample `fx iquery` excerpt from a running device, showing both a dart
and a flutter runner exposing the same OS diagnostic metrics.
```
/hub/c/dart_jit_runner.cmx/70981/out/diagnostics:
/hub/c/dart_jit_runner.cmx/70981/out/diagnostics#os:
dst_status = 0
get_profile_status = 0
timezone_content_status = 0
tz_data_close_status = 0
tz_data_status = 0
/hub/c/flutter_jit_runner.cmx/29567/out/diagnostics:
/hub/c/flutter_jit_runner.cmx/29567/out/diagnostics#os:
dst_status = 0
get_profile_status = 0
timezone_content_status = 0
tz_data_close_status = 0
tz_data_status = 0
```
Under nominal operation, all of the above values should be equal to 0.
Nonzero values indicate an error.
This functionality is guarded by Fuchsia integration tests at
//src/tests/intl.
Tested:
(compile locally for Fuchsia and deploy)
fx test //src/tests/intl
Fixes#39650
Change-Id: I5fc3ed305301abe1b183948a7cf478e014f351e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149206
Commit-Queue: Filip Filmar <fmil@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Introduce an internal StreamingWriteStream wrapper and use that instead.
Also add more ELF-defined constants and use those appropriately.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: I2bd34ebac60e789aea82c8f064c59351e2c55dd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149291
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
To avoid stopping all mutators when updating subtype test caches, we
ensure that any updates to the subtype test cache will be visible in a
consistent way to mutators by adding a store-release barrier when
updating the backing array of the STC.
Since STCs are always grown by allocating a new array with size+1, there
is no need to actually add barriers when accessing the individual
entries of the backing store.
To prevent multiple writers creating STCs and patching the pool or
updating a STC we add a mutex.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: Ic705619fe16772565ac11438fd15d3977cbb49c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149164
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The mutator thread pool can, when it becomes idle, cause idle
notifaction, which can cause GC.
So we should turn down the mutator thread pool before waiting for
outstanding GC tasks.
See b/157612890
Fixes https://github.com/dart-lang/sdk/issues/42098
Change-Id: I1645252377ff07763eef1a00f9c1edff95e34f72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149296
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Recognized factories have known result type and its type arguments
and length are automatically forwarded (length is forwarded only for
fixed-size lists).
List.filled factory is recognized only if optional 'growable' parameter
is not passed.
Fixes https://github.com/dart-lang/sdk/issues/42019
Change-Id: I0d63428f1c4667f3981447a939dbef67170e542e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149385
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Before this change we would replace unboxed definitions (those with
representation not equal to kTagged) which is too loose and causes issues
in subsequent passes, which assume that replacements have normalised
representation.
After this change we make sure that replacement has a matching
representation.
Closes https://github.com/dart-lang/sdk/issues/35371
Fixes https://github.com/dart-lang/sdk/issues/41971
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I48543893562acf4f8516651196eba7c0c0769a22
Fixed: 35371,41971
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103139
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
In the past, negative text offsets were used for instructions shared
by multiple code objects. This is no longer the case.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I85085a06b8c955abb21573caea5554e839154979
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149281
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
In --enable-isolate group is
* turned off, then we have 1<->1 mapping between isolate and isolate
group, so moving the locks should have no impact
* turned on, then we have N<->1 mapping between isolates and isolate
group, mutators need to use the same locks to guarantee exclusive
access (e.g. to symbol table, type canonicalization, type arguments
canonicalization, ...)
This is a follow-up to share the program structure in AOT mode across
multiple isoltes.
In order to move the existing `Isolate::type_canonicalization_mutex_` to
`IsolateGroup` (and thereby make all mutators use the same lock), we need
to remove the `RunWithMutatorsStopped()` usage in the runtime entry.
=> Without this it can lead to deadlocks.
In order to remove usage of `RunWithMutatorsStopped()` we will change
access to the cached type arguments array to use load-acquire barriers
in generated code and store-release barriers in runtime code.
A nice side effect is that it reduces `sizeof(dart::Isolate)`.
Closes https://github.com/dart-lang/sdk/issues/41912
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: Ifd42691524fe41ffe8bb4e2623c5b8c1151de973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148539
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The old RangeError.range message was confusing:
RangeError (index): Invalid value: Not in range 0..2, inclusive: 9
The comma makes the message hard to parse. I've seen a number of
people misinterpret "inclusive" as describing the invalid value (9)
instead of acting as a modifier on the range.
https://github.com/dart-lang/sdk/issues/29586 has a lot of
bikeshedding about this, but in the interest of mitigating confusion
sooner, I propose changing it to:
RangeError (index): Invalid value: Not in inclusive range 0..2: 9
I'm intentionally trying to improve the message with minimal
disruption to the structure of the error message. Although I'd much
prefer that "Invalid value" and the actual value be adjacent instead
of being interrupted by the explanation, such restructuring is rather
non-trivial. RangeError allows the "Invalid value" message to be
customized, and rearranging terms could produce even worse
constructions.
I also considered:
RangeError (index): Invalid value: Not in range [0, 2]: 9
And while I like that that is brief and clear, I chose not to use it
for people who are unfamiliar with interval notation and who might
mistake it as a Dart List.
Bug: https://github.com/dart-lang/sdk/issues/29586
Change-Id: I0f23b195437e4053ae5f76b5d303123979a8c9fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146024
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Test Profiler_ArrayAllocation used the non-existing List.empty()
constuctor.
This fix replaces it with the semantic equivalent List.filled(..).
TBR:bkonyi
Change-Id: I70913803a4d3585cb19a39375b14c1184f047644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149160
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Instead of maintaining separate list of static fields which
needs to be flushed into list of retained fields in Iterate()
keep track of which precompilation phase we are in - and add static
fields into the retained set only if we are in the fixpoint
code generation (aka Iterate()) phase.
Apply the same treatment to selectors as well.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I2c7c7bdf268eaee9623ab1be5cf3eb022991a7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148403
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Previous variant of the code did not handle FutureOr<T> and Comparable<U>
correctly - variables of these types can contain a smi value if T can be a
subclass of num or if U can be num.
Rename HasNonSmiAssignableInterface to CanReceiverBeSmiBasedOnInterfaceTarget
to better conway its meaning.
Fixes https://github.com/flutter/flutter/issues/57398
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I67b29908e057632e62c46fb327a5c805fcc78d74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149063
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Trampolines which are generated in use_bare_instructions mode should be
taken into account when dumping sizes in --print_instructions_sizes_to.
This change fixes failing pkg/vm/test/snapshot/instruction_sizes_test on
Windows after https://dart-review.googlesource.com/c/sdk/+/148543.
Change-Id: I343f82699407ba54d9ccb9a9800875c61a6e8df3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149043
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
It might be too late to remove redundant phis in EliminateDeadPhis
because EliminateDeadPhis runs after OptimizeBranches, and
OptimizeBranches may be able to eliminate more branches if redundant
phis are cleaned up.
This change moves elimination of redundant phis into canonicalization
pass which is repeated more frequently.
Fixes recent regressions on several micro-benchmarks after
https://dart-review.googlesource.com/c/sdk/+/139314
Change-Id: Ib0148564615dbd0adb88e93b938ca9f3f59cabfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148792
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Attribute bytes written outside of any particular object to the
artificial root node.
https://github.com/dart-lang/sdk/issues/41249
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I6d4be9b9a6a42cd0996330bb14552d12d6430ff9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148526
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
The relocated addresses are populated during BSS::Initialize() for
natively loaded ELF snapshots, and during the non-native loader when it
is used. Putting this information in the BSS segment avoids having to
change the embedder interface, since we only need this information for
AOT snapshots. This also avoids depending on our ELF snapshot layout
to reverse-engineer the DSO base for ELF-compiled snapshots.
We now always print the DSO base for both the VM and isolate in
non-symbolic stack traces, not just for ELF-compiled snapshots. However,
we still only print the relocated addresses in individual stack frames
if we're guaranteed they match those in separately saved debugging
information.
Bug: https://github.com/dart-lang/sdk/issues/41880
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-mac-release-simarm64-try
Change-Id: I4837262f78e6e73a32eb7e24ef7a68ccb8ec2669
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148441
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The dill file has an index at the end. The last 4 bytes of that index is
a size that indicates how big the file is. This is done to support
concatenated dill files. If the dill is invalid and the size is read as 0
both the VM and the dart kernel reader will go into an infinite loop where
it allocates another list entry on every loop iteration (making the whole
loop not infinate because we will run out of ram soon enough).
This CL fixes the issue by checking the size to be possitive.
Change-Id: I42da0557c6d4a274fdbe1a729fdaf5b8f149b187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148538
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This reverts commit af5ad5f1b0.
Reason for revert: Failing Windows bots.
Original change's description:
> [ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path
>
> This was causing the DartDev snapshot discovery to fail for brew
> installs as the last symlink resolved to '../libexec/bin/dart' which
> meant that we were looking for the snapshot at
> '../libexec/bin/snapshots/dartdev.dart.snapshot'.
> `
>
> Change-Id: Ic68bfa13ba060f7a059d07e25c04076583b0b118
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148542
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
TBR=bkonyi@google.com,asiva@google.com,zichangguo@google.com
Change-Id: I55d3102e87c4cc522bac3a55421ed85f22f97035
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148745
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This was causing the DartDev snapshot discovery to fail for brew
installs as the last symlink resolved to '../libexec/bin/dart' which
meant that we were looking for the snapshot at
'../libexec/bin/snapshots/dartdev.dart.snapshot'.
`
Change-Id: Ic68bfa13ba060f7a059d07e25c04076583b0b118
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148542
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This saves one instruction for every BoxInt64 overflow check, reducing
the instructions size for Flutter benchmarks by between 0.26% and 1.03%
(0.26% for Flutter Gallery).
Also add OVERFLOW and NO_OVERFLOW condition aliases to arm and arm64.
Change-Id: I82990419b448f21a22ea2cc7a15a9497d3275943
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145860
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Snapshots don't necessarily retain original program structure because we
attempt to drop objects representing elements of the program structure
when it is not observable. However not having this information makes it
harder to understand how various parts of the snapshot graph relate to
the original program.
This CL introduces support for writing artificial nodes into snapshot profile
for the cases when we want to preserve some structure for later analysis.
To make mapping between actual heap objects and their artificial profile
counterparts simple we use currently unutilized part of the object-id space:
negative ids below kUnallocatedReference.
https://github.com/dart-lang/sdk/issues/41249
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: Idb46491b0e2b21aebf946b0da55eaf67e73aadd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148530
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Previously, we were crashing when trying to report a compile-time
error via H.ReportError when loading a bootstrap library from kernel.
That happened because we didn't have LongJumpScope set up.
This change sets up LongJumpScope and makes sure compile-time
errors during kernel loading can be reported and propagated up.
This also removes the need to use FATAL error when detecting
a dill file which is incompatible to the current runtime mode,
so we can use less severe compile-time error for that.
Fixes https://github.com/dart-lang/sdk/issues/41870
Change-Id: Ib3690f7812c20e5529f3066ed37fdb9052dd559b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148683
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Abstract unix domain socket(UDS) is not supported on platforms other
than Linux/Android. So it has not been supported in the initial design.
This cl will enable users to use abstract UDS.
As long as InternetAddress has a path starting with '@', it will be
interpreted as abstract UDS on Linux/Android.
For abstract UDS, checkout unix man page for more information.
Bug: https://b.corp.google.com/issues/156871566
Change-Id: I393d798b2fc65304677a60639223f90e20aabaa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148380
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This is a partial fix for https://github.com/dart-lang/sdk/issues/41939
Let's take one step at a time, but later, we should be able to leave the bound as dynamic, since mutual subtyping of bounds is now implemented.
Change-Id: I57f725ba5b02237a64ae77593f340438f7159ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148515
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
The most common case is to access the symbol table in read-only mode
outside a safepoint. This CL ensures that this use case is fast.
Furthermore it fixes a potential issue where one thread accesses the
symbol table using exclusive access via RW lock and is half-way-through
updating the symbol table while another thread requests a safepoint
operation, and updates the symbol table.
There is a remaining TODO item to not hold a safepoint while allocating
a symbol.
It increases performance by 10x for e.g. vm/dart/isolates/fibonacci_call_test
(26 seconds to 2.6 seconds).
Issue https://github.com/dart-lang/sdk/issues/36097
Issue https://github.com/dart-lang/sdk/issues/41943
Change-Id: I0b4e26aaffc613bed336a8845d12b7c7ee84b146
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148323
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Fix visiting roots to wait for visiting new-space pages to finish, not merely start.
Change-Id: I0c6688701f4563bf5c3b8ae02f215e709d5cac6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148230
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
The GC was sometimes incorrectly calculating the "is-unboxed" bit due to
shifter >= 64. The change in [0] fixed that issue and this CL is adding a
regresion test.
Our tests in `runtime/tests/vm/dart/*` have access to `dart:_internal`.
To make the newly added test reliable we add a `collectAllGarbage()` native
and use it in the test.
[0] https://dart-review.googlesource.com/c/sdk/+/143000
Change-Id: Ifb3f16469a9dc58623acdb029b78807ed7fcc857
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148402
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Two growable arrays needed for possibly re-hashing objects when sending
messages using the snappshotter are often unused. Only create them when
needed.
When looking up message handler and calling it avoid repeated
allocations of small arrays (they can be cached savely because right
the transition stubs will copy the arguments out of those arrays).
This improves performance of high-frequency messages but small message
handlers.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I623aba5b29064f3a75ea294557ee153067a63d08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148263
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Change-Id: I5218e5f0858279589ac3b3b71fb27daccb3095c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146697
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Final cleanup work before first full version of package:dds is
published:
- Added `getSupportedProtocols` RPC to the VM service protocol, which returns a
list of supported service protocols and extensions along with their version
information.
- Added `getDartDevelopmentServiceVersion` RPC to the DDS protocol.
- Misc code and dependency cleanup recommended by pub
Change-Id: If1bdf46852778adf31242122665c36b63106ad44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148224
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This removes the only stub code with a function owner.
Change-Id: I629eb3a1b231430afaf0a2777032bba8eaddd2aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148124
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
If a custom embedder does not use the VM's thread pool implementation
(1) but instead installs a custom message handler and invokes that
message handler on possibly unlimted number of threads, those mutator
threads will be constantly fighting to obtain TLABs.
To avoid this, the VM will ensure that only a limited number of mutators
can execute at the same time. The limit is the same as we use for
determining the VM's mutator thread pool.
In order to test this, we simulate such an embedder by disabling the
mutator pool limit, thereby allowing unlimited number of thread pool
workers.
=> The added test would timeout without without the new limit imposed
by this CL.
(1) Which has a maximum size adjusted based on TLAB size and new space size.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I6d459f85fbeb3e4b1d756b752853157e40097271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148121
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Previously, AssertSubtype instructions could only be created with a
compile-time AbstractType value for sub_type and super_type. Relax this
so that AssertSubtype instructions can be created with possibly
non-constant Values instead.
Currently, all AssertSubtype uses still have constant sub- and
supertypes, so for now we check at code generation that we indeed
have constants for these values and only handle the constant case. Thus,
there should be no impact on size or speed of the generated code from
these changes. Follow-up work will add code generation for non-constant
sub- and supertypes and add uses the generalized form.
Bug: https://github.com/dart-lang/sdk/issues/40813
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-linux-release-simarm64-try
Change-Id: Ib1512b3e07a016d68a8e0c670ce857b8ac1b2777
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147520
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
To avoid deadlock scenarios where an application runs N isolates on a
thread pool with T threads (T < N) where all scheduled T isolates will
do FFI call and block. That prevents any other isolates from executing.
To avoid such a scenario we add support for the isolate-group specific
thread pool to dynamically increase the maximum size if a worker is
running a isolate mutator thread, which calls to C which exits the
isolate.
=> While such an isolate is descheduled but still occupies a thread
pool worker we temporarily incrase the maximum size of the thread pool.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: Id61c39b06766da11f76d607ac7cbe8a8e623f250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148120
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Instance hash calculation on host and on target should produce same
results(like when you use simarm_x64/gen_snapshot to produce arm snapshot).
It was not producing same results because of how unboxed fields could be
taking more than one word(on 32-bit arm they are taking two words).
Hash calculation was done in terms of words so simarm_x64/gen_snapshot
saw one word unboxed field, but same calculation saw two words.
The fix is to pay special attention when iterating over unboxed field
during hash calculation and accommodate host and target word size
difference.
Fixes https://github.com/dart-lang/sdk/issues/41824.
Change-Id: Ib280736fa458a3954ca1f9994734ad04ee8db80a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148040
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Allow work stealing of new-space page when marking roots.
Change-Id: I18fc22934bea26a37341216e88b13d1fb6f83b36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125767
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This is a reland of fd19c8cc25
No changes were made to the original CL.
The following fixes landed separately:
* Flutter tests which use --enable-experiment=non-nullable are
disabled in https://github.com/flutter/flutter/pull/57235.
* Auto-detection of null-safety mode from dill file in gen_snapshot is
implemented in https://dart-review.googlesource.com/c/sdk/+/148152.
Original change's description:
> [vm/nnbd] Auto-detect null-safety from entry point in kernel compilers
>
> If --null-safety flag is not specified, tools should infer null safety
> mode from a legacy status of an entry point script.
> This change adds such auto-detection to kernel compilers (front-end
> server and gen_kernel).
>
> Issue: https://github.com/dart-lang/sdk/issues/41206
> Change-Id: If78491d08390c28b98e86857ec7d61520433dee9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148024
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
Change-Id: Ibc185caa6975087a35c89ff69faf3f6c11fcf14c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148201
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Prior to this change, if the VM was run with:
`dart --observe=8282 --disable-dart-dev foo.dart`
The custom VM service port would be ignored whereas with:
`dart --disable-dart-dev --observe=8282 foo.dart`
The custom VM service port would be used. This was due to
the value of `--disable-dart-dev` being used during argument parsing
even though the value may not have been parsed yet.
Change-Id: I221fb4c0ad6fdc0ae1855bd60b58c115de00e34b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148153
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This reverts commit fd19c8cc25.
Reason for revert: Flutter has tests with --enable-experiment=non-nullable, but dart:ui is not migrated yet and gen_snapshot doesn't detect null-safety from kernel file. This change causes failures in those tests as dill file is now compiled with null-safety enabled due to the auto-detection.
Original change's description:
> [vm/nnbd] Auto-detect null-safety from entry point in kernel compilers
>
> If --null-safety flag is not specified, tools should infer null safety
> mode from a legacy status of an entry point script.
> This change adds such auto-detection to kernel compilers (front-end
> server and gen_kernel).
>
> Issue: https://github.com/dart-lang/sdk/issues/41206
> Change-Id: If78491d08390c28b98e86857ec7d61520433dee9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148024
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
TBR=aam@google.com,rmacnak@google.com,alexmarkov@google.com,asiva@google.com
Change-Id: Ie6105552c9d88101a3188f5daec4ee9a9c24a530
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/41206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148141
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Also fixed issue where not all VM flags were being forwarded to the child
of an implicit DartDev instance.
Change-Id: I4c7bacb1b93ae336b6ed1f80eb621fbeabd8ced9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148021
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
If --null-safety flag is not specified, tools should infer null safety
mode from a legacy status of an entry point script.
This change adds such auto-detection to kernel compilers (front-end
server and gen_kernel).
Issue: https://github.com/dart-lang/sdk/issues/41206
Change-Id: If78491d08390c28b98e86857ec7d61520433dee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148024
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This is broken in Dart 3.
Change-Id: I809830c8d8657ce3ef44ed08da207c50d376b793
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148010
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This is a reland of 604a366065
Original change's description:
> [ VM / DartDev ] Run all debugging sessions via 'dart run'
>
> Prior to this change, running `dart --observe foo.dart` would result in
> the DartDev flow being bypassed. While `dart foo.dart` will continue to
> bypass DartDev and be run directly, running either `dart --observe
> <vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
> will result in the command being implicitly converted to `dart run
> --observe <vm-flags> foo.dart`. This is required for all standalone VM
> instances to run against DDS instead of the VM service directly.
>
> As usual, the DartDev flow can always be bypassed by providing the
> --disable-dart-dev flag.
>
> Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
Change-Id: I917d3056322d74766bdf376a3e28871ad5b66cfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147980
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
The DWARF standard specifically states that line number information is
unsigned (with 0 denoting no line number information). However, we
currently use special (negative) token positions in our DWARF
information directly as line numbers. Instead, convert any special token
positions to a line number of 0.
Fixes: https://github.com/dart-lang/sdk/issues/41860
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: Ic26e553d6a6d642b456fe45760650de9c8478d16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147902
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
These were supposed to be included into d959f4290e
but were accidentally left behind.
Readding these tests revealed a bug in the main commit - where
async/async*/sync* bodies were not properly disambiguated. There is a
change included here which fixes that.
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I1fff57c8d7b16ee72dd670f1a309dd756a2b2653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147580
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
We used Align on the assembly_stream_ directly, which
calls StreamingWriteStream::Align and introduces null
bytes into the stream. When running with -Werror, this
will stop builds.
```
.../ios__app_ios_aot.S:2510:1: error: null character ignored [-Werror,-Wnull-character]
<U+0000><U+0000><U+0000><U+0000><U+0000>_kDartVmSnapshotBss:
```
Instead, we should have used AssemblyImageWriter::Align,
which introduces a .balign instruction instead.
Fixes b/156346855.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-mac-release-simarm64-try
Change-Id: If99f66ccd7eee67f86d654e17a639fad7096dc53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147720
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This change only affects dart SDK when built from source in the
Fuchsia OS tree, without using the Fuchsia SDK.
The BUILD.gn rules are slightly different for a SDK and a non-SDK build.
My last change (see link below) omitted the non-SDK build flavor, which
led to dart roller break when rolling into Fuchsia. This change should
make the non-SDK build in Fuchsia work.
Tested:
(locally on Fuchsia, tried with and without the change to
third_party/dart):
fx set workstation.x64 --release --with=//topaz
fx build -k
See the problem here:
https://dart-review.googlesource.com/c/sdk/+/144480/3/runtime/vm/BUILD.gn
Bug: https://github.com/dart-lang/sdk/issues/41884
Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=52080
Change-Id: I1bcfff1576be33717ce49d1b714bc4867ba2c736
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147816
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
This reverts commit 604a366065.
Reason for revert: Breaks google3, see b/156414355
Original change's description:
> [ VM / DartDev ] Run all debugging sessions via 'dart run'
>
> Prior to this change, running `dart --observe foo.dart` would result in
> the DartDev flow being bypassed. While `dart foo.dart` will continue to
> bypass DartDev and be run directly, running either `dart --observe
> <vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
> will result in the command being implicitly converted to `dart run
> --observe <vm-flags> foo.dart`. This is required for all standalone VM
> instances to run against DDS instead of the VM service directly.
>
> As usual, the DartDev flow can always be bypassed by providing the
> --disable-dart-dev flag.
>
> Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
Change-Id: I688a3779e7ccaf85a28dc4d6f5ccf23596109519
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147900
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
At present there is difference in assembly output from SIMARM/gen_snapshot and SIMARM_X64/gen_snapshot around classes that extend native wrappers(for example, dart:io NativeSocket).
See dartbug.com/41824.
Change-Id: I944901ff4cccde972623c490d1d67d894fb03595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147808
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Prior to this change, running `dart --observe foo.dart` would result in
the DartDev flow being bypassed. While `dart foo.dart` will continue to
bypass DartDev and be run directly, running either `dart --observe
<vm-flags> foo.dart` or `dart --enable-vm-service <vm-flags> foo.dart`
will result in the command being implicitly converted to `dart run
--observe <vm-flags> foo.dart`. This is required for all standalone VM
instances to run against DDS instead of the VM service directly.
As usual, the DartDev flow can always be bypassed by providing the
--disable-dart-dev flag.
Change-Id: I211cd1ec4b1ec0e75ae0a568a66f1a0fc7b3852f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147342
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
The `TimelineStreamSubscriptionsChanged` event is sent when
`setVMTimelineFlags` is invoked, notifying `Timeline` subscribers that
the set of recorded timeline streams has changed.
Fixes https://github.com/dart-lang/sdk/issues/41822
Change-Id: Ic1545eefea8cf3deeefba97bd1ea2695d1c35016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147681
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Also base these and the corresponding methods in _OneByteString on
functions in dart:_internal, so they can be used in other patches.
Change-Id: Ibced31758db2959c111a01cdaa46df2971ae4a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146784
Reviewed-by: Martin Kustermann <kustermann@google.com>
Previously, AssertAssignable instructions could only be created with a
compile-time AbstractType value for dst_type. Relax this so that
AssertAssignable instructions can be created with a possibly
non-constant Value instead.
This is only an IL-level change for the instruction. Code generation for
AssertAssignable still requires the dst_type Value to be bound to a
constant and is otherwise unchanged from before, thus this should have
no impact on size or speed of generated code. (Generating the
non-constant case will be done in follow-up work.)
Bug: https://github.com/dart-lang/sdk/issues/40813
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-linux-release-simarm64-try,vm-dartkb-linux-release-simarm64-try,vm-dartkb-linux-release-x64-try
Bug: https://github.com/dart-lang/sdk/issues/40813
Change-Id: I1f984039d8c2695c66161a69a3d80cfbe7110f19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146801
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Only the case for unstripped snapshots and debugging information.
Stripped snapshots still have no static symbol table, only the
dynamic one.
Fixes: https://github.com/dart-lang/sdk/issues/41783
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: Ibd82334597d34267a3b9e45a673d23c3f9e3fcb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147182
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
There was a code in the register allocator that recognized whether
destination is a spill slot or not by checking if it is one of
different location types. By accident QuadSpillSlot was missing
from that list - and as a result we were emitting redundant moves
when connecting split siblings after register allocation.
Change the code to just ask parent live which spill slot it was assigned
and use that to drive decisions.
https://github.com/dart-lang/sdk/issues/41805
Change-Id: I73e208acd0bf86dceeaad970b8e5cbcb9c3f8eaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147550
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Additionally make it possible to filter the output of this tracing
using --print-flow-graph-filter=...
Expose should_filter() setting through CompilerState - to avoid
plumbing FlowGraph or Function through various methods that don't
already have access to either of these two.
Change-Id: Ia1b8bcff5702e869db23ea4407191741662b2417
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147544
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Originally, the assert here required the location be a machine register,
invalid, or a pair location if always_calls() was true, which meant
that SameAsFirstInput() could not be used.
Extend the assert to allow SameAsFirstInput(), but only if the location
of the first input is a machine register, invalid, or a pair location.
Also make sure any further changes to the first input remain consistent
with this expectation.
Fixes: https://github.com/dart-lang/sdk/issues/32787
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try
Change-Id: If43eb5399283d23f62a502edb0a9ce9c82813b3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147101
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Since the virtual addresses in ELF snapshots are the same as in
separately saved debugging information, print the virtual address in
non-symbolic frames again when running from a snapshot compiled directly
to ELF."
Storing the relocated address as an extra field in the Image header,
which requires increasing the Image header size on 64-bit platforms,
means Image pages cannot be used reliably as HeapPages as objects no
longer start after kMaxObjectAlignment bytes.
Instead, we return to an older design that just uses the lowest bit
in the BSS offset to store whether the instructions in an Image were
compiled directly to ELF.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Change-Id: I3819b0dc2719d69f5e8764ca8be8c6ae7171a7bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146560
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
When generating DWARF for assembly snapshots, we use a lower bound
of the start of the isolate instructions section. Use the same bound
when generating DWARF for ELF snapshots as well.
Also avoid generating rows in the line number program for address 0.
Fixes https://github.com/dart-lang/sdk/issues/41756.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I3d17e09ff8af3ba6fc70dcd6859d9b298e941ecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146584
Reviewed-by: Ryan Macnak <rmacnak@google.com>
See b/152430908
Change-Id: I89524489ec9868bf5fa40559292e4f82b352cfe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147362
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Opened dartbug.com/41825 to track it being too slow.
Change-Id: I37b76de494fbbf309ec0e6106bd7ebb2771f7cb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147401
Reviewed-by: Alexander Aprelev <aam@google.com>
Raised dartbug.com/41824 to track test failure.
Change-Id: Ie5596a7d66adc4e6b55b7dd6fe0009da396740e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147400
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Added the following RPCs to the DDS protocol:
- getLogHistoryLength
- setLogHistoryLength
Historical logs will be sent to clients when they connect and subscribe
to the Logging stream for the first time. Current default log history
length is 10,000 messages to support applications with chatty logging at
startup.
Change-Id: Ic6cd9c58673fbb7179b6ac0f1f6581cb8ada03fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146444
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
* AssertAssignable should not be generated for top types according to
IsTopTypeForSubtyping().
* Arguments descriptor should be passed when calling field initializer
from InitLateInstanceField/InitLateFinalInstanceField stubs.
If interpreter is enabled, InterpretCall stub expects to find
arguments descriptor in a register. Also, lazy compilation stub
may save arguments descriptor in a slot visited by GC, so arguments
descriptor register should contain a GC-safe value.
Fixes https://github.com/dart-lang/sdk/issues/41807
Change-Id: Ia33ed1bc57007d674799fb4453c8ab4841037211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147383
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
With element-by-element comparison the test seems to be too slow for reload, kb bots.
Change-Id: I68d923f78ea40bd13a10582c7cc6e456a1e9b13d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147384
Reviewed-by: Alexander Aprelev <aam@google.com>
Makes some conversions no-ops.
Originally reverted along with other changes for a g3 roll; re-landing with no changes.
Change-Id: Ia267d1f0104a77866432d7172611b91dae9075ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147320
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
In order to reduce confusion, if a VM instance detects that it will be
running a dartdev snapshot it will ignore all VM flags and print a
warning message to stderr informing users that the flags are being
ignored and that they should be passed immediately after the 'dart run'
command. This will prevent the dartdev snapshot from being run with
incompatible flags in addition to preventing users from accidentally
setting flags for the dartdev VM when they meant to set those flags for
the target process.
As usual, passing --disable-dart-dev will allow for the user to bypass
this behavior and run their dart program directly.
Fixes https://github.com/dart-lang/sdk/issues/41590
Change-Id: I7d5dc3d4ddae8be99994620b5b2c2e4cc492ae5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146984
Reviewed-by: Siva Annamalai <asiva@google.com>
Attempts to expect runtime performances lead to flakiness.
Fixes dartbug.com/37520
Change-Id: I6bc548f523b2c2453c7fa90498ebaf4f91ec9f71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147380
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Some isolate might get Run message and start sending data(Tree) to a receiver before that receiver got Run message.
Fixes dartbug.com/41813
Change-Id: Ifdf1a44d3a2f955f5919d3fd63bf97e9b3317388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147329
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The bad arity maybe detected after an isolate reload or when using strong mode with a mix of opted in and opted out libraries.
The thrown NoSuchMethodError contains enough information to be useful, but does not mirror the complete invocation (e.g. arguments).
This CL does not fix https://github.com/dart-lang/sdk/issues/37517 where the target is missing after a reload (not just bad arity).
The VM implementation of NoSuchMethodError is cleaned up, but the deprecated constructor 'NoSuchMethodError(...)' is not yet removed, since it is still documented.
Change-Id: I0306971c59cb510d21cb1b1acc3545c8817dfea7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146986
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Windows paths are limited to 260 characters including the null
terminator in most cases. This makes characters in paths
a precious commodity.
Currently creating a temporary directory in Dart will append
a UUID to the user-provided prefix. UUIDs consume 36
characters of a path. If a temporary directory is created
inside of another temporary directory, this adds up to 72
characters or about 28% of the available real estate.
This change first attempts to use a shorter suffix generated
from a random uint32_t using Crypto::GetRandomBytes. If
that fails, then it falls back on using the UUID.
Change-Id: I15a413746316028b39b6ff915b1b2b19cbf62a5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147341
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
The following options are removed:
--use_strong_mode_types
--experimental_unsafe_mode_use_at_your_own_risk
The following flags and predicates are removed:
Dart_IsolateFlags::unsafe_trust_strong_mode_types
Isolate::argument_type_checks()
Isolate::can_use_strong_mode_types()
Isolate::should_emit_strong_mode_checks()
Also, everything depending on these flags is cleaned up.
Change-Id: I9328009ad5a42ea2173842386d612c465e3ebec1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147325
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This tests takes too long on these configurations, timesout most of the
time and causes infra issues.
Change-Id: Iddcb61997df3dea5add0da716dca6bfc930f075e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147340
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Opened dartbug.com/41813 to track the fix.
Change-Id: Ic026ffeee47ad9a283ae6314572a15a42b80a249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147343
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
- Flips the flag from --nnbd to --no-nnbd so that by default it builds
the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
directory which has the 'Legacy' suffix added to it
(e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
in during execution so that CFE runs in that mode. This is different
from the 'null_safety' flag
Change-Id: I729630a7bd36ea7ae38134f9285b44e93c283c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138902
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
This improves performance of spawn isolate since it drops a need to lock isolate group when spawning new isolate.
Change-Id: I867c13c808a3eb356f3d53323bb8aef06541019e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147046
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Previously the output used scrubbed qualified names which hides some
of the information and causes names of various synthetic functions
collide. We change it to use internal qualified names instead and add
additional information for disambiguation:
- For functions this means adding a prefix for various synthetic
methods;
- For anonymous closures we add their token position;
- For types we prefix type parameters with their owner's name.
We also add a unit test covering parsing of
--print-instructions-sizes-to output.
As part of adding a test dart2native was changed to support passing
extra arguments to gen_snapshot binary.
Fixes https://github.com/dart-lang/sdk/issues/41137
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I299ab0fb5993c8af9b51246483608d1e65970d67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146581
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Avoids GC overhead when the VM service is not in use.
Change-Id: Ic2e752c17fdd01045e30dd62e16f20896a9fc64e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146440
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
To enable our tests to spawn a new isolate in a new group, this CL
adds a `{bool newIsolateGroup}` parameter to the internal
`Isolate._spawnFunction` native and moves that native to
`dart:_internal`, thereby allowing runtime/tests/vm/dart/* to access it.
It also adds various tests for lightweight AOT isolates, exercising
GC, communication, spawning, ...
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I3940c30fb43d2475c58e6be78507da74ce64b60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145941
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Snapshots which contain code are compiled with a particular null-safety
mode and it is not possible to change their mode at run time.
When running from such snapshot, VM now reads null-safety mode from
the snapshot if it is not specified at the command line.
This avoids the need for embedders to pass null-safety flag
used during snapshot generation also to the runtime, similarly to
other VM flags listed in VM_GLOBAL_FLAG_LIST (such as use_bare_instructions).
In addition, error for incompatibility of kernel libraries with
current null-safety mode is changed from ReportError (which attempts
to throw an exception) to a FATAL, because throwing an exception
crashes when bootstrapping from a kernel file.
Change-Id: I93a791825c25c2da4e33634f1c71736c17928fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146460
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Our TLAB sizes and maximum new space size constrain the number of
parallel mutator threads we can have. Having too many mutator threads
would cause constant races between threads to acquire TLABs.
In reality we should constrain the number of threads to be at most the
number of cores, since at most that many threads can run in parallel
(i.e. at the same time).
This CL extends the TreadPool implementation to be constrained by a
maximum size. Furthermore it makes each isolate group's have it's own
pool with constrained size and schedule all group member
mutator / message handler tasks on that pool.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I095c749adad827ab892f33713a32be594d7606d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145382
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Change-Id: I6634dc10fdc8d7523562c0fcc20e3561eb580acf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146023
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Prior to this CL, the signal handler finalizer passes a file descriptor
where a signal number is expected.
This went uncaught for awhile since it is innocuous in most cases.
Clearing a signal handler just involves setting it back to the
default. It is not innocuous where the VM chose to override the
default, for example in the case of SIGPIPE. When setting signal
handlers with the dart:io API, if the finalizer for a _NativeSocket
for a signal handler runs, some time later the VM may be killed by
SIGPIPE instead of getting EPIPE from an IO call.
This CL replaces the call in the finalizer with a new call that
expects a file descriptor, and uses the file descriptor to look
up the signal handler that needs to be cleaned up.
Change-Id: I54caa14a556e434872d12fd9acf8c2fcf767b91e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146080
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Fuchsia OS is making a change in the serving sequence for component
startup, to avoid a race condition in which clients attempt to connect
to services that are not yet exposed but will be.
This change is needed for a smooth transition to that new API. The
Fuchsia SDK change has already rolled to Dart.
See: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=50758
Change-Id: Ib1249dcf771e99f542343328918ae55497ddaf71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
Avoids failing on Linux from exhausting Page Table Entries before exhausting physical memory or address space.
Change-Id: Idffbd0a2eb8b030f2afabb4c31135fb75deca59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144669
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>