Commit Graph

17595 Commits

Author SHA1 Message Date
Clement Skau c273f9ae15 [API] Changes Dart_GCEvent to mirror Service Protocol closer.
Turns out, even thought Heap constructs an elaborate event
object, and attaches it to the ServiceEvent, the service
does its own event construction (again).
As a result the ServiceEvent has quite a different layout
and no concept of before/after.

This CL changes Dart_GCEvent to more closely follow the
JSON event emitted by Service.

Bug: https://github.com/dart-lang/sdk/issues/43106
Change-Id: I34f33f23065ea7a92142ee7df23ab05ca91f161e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161176
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-09-09 07:25:44 +00:00
Zichang Guo f8fbefd951 Revert "Enable long path on Windows"
This reverts commit 08662f0575.

Reason for revert: failure on pkg-win-release, https://dart-ci.appspot.com/log/pkg-win-release/unittest-asserts-release-win/12878/pkg/dartdev/test/commands/test_test

Original change's description:
> Enable long path on Windows
> 
> File APIs on Windows can now handle files and directories identified by
> long paths (greater than 260 characters). For directory, the limit is
> 248.
> 
> Some restrictions from Windows:
> 1. The size limit for long path is 32,767 characters.
> 2. Each component separated by backslashes should not be more than 255
> characters.
> 
> Reference: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation.
> 
> Note that `Directory.current` does not work with long path.
> 
> Bug: https://github.com/dart-lang/sdk/issues/42416
> Change-Id: Ia1b4608d393fb36f1d843858c6f076f3c825dc83
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152736
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

TBR=aam@google.com,zra@google.com,zichangguo@google.com

Change-Id: If6701c887e616cd62f20faac43f601cfb53ed349
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/42416
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162104
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-09-08 22:34:50 +00:00
Zichang Guo 08662f0575 Enable long path on Windows
File APIs on Windows can now handle files and directories identified by
long paths (greater than 260 characters). For directory, the limit is
248.

Some restrictions from Windows:
1. The size limit for long path is 32,767 characters.
2. Each component separated by backslashes should not be more than 255
characters.

Reference: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation.

Note that `Directory.current` does not work with long path.

Bug: https://github.com/dart-lang/sdk/issues/42416
Change-Id: Ia1b4608d393fb36f1d843858c6f076f3c825dc83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152736
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-09-08 20:12:05 +00:00
Michal Terepeta 4237fda6a5 Check for IN_MODIFY in file_system_watcher_linux.cc
This allows to detect changes to a file due to `write` or `truncate`
syscalls.

Change-Id: I095d842367a56121cd87c2176dde0a4feb5e3d7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161177
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Michal Terepeta <michalt@google.com>
2020-09-08 17:57:45 +00:00
Alexander Aprelev 3e0243fb16 [vm/locks] Allow SafepointRwLocks reentrance, nesting read lock in write lock.
Change-Id: I9ab7b0b16c814116d15892c23f594d520f8a0e71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161823
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-08 16:26:43 +00:00
Tess Strickland 6349882b7a [vm/compiler] Add missing truncate calls for parameter names.
Also replace any null flag entries left in the parameter names array to
zero Smi values, so that after truncation, no null checks are needed for
retrieved flag entries.

Now that all appropriate places truncate the parameter names array after
setting any required bits, dynamic closure call dispatchers can simply
check for any post-name flag entries to detect missing required named
parameters if no named arguments were passed.

Without the added truncate calls, then
vm/dart/minimal_kernel_bytecode_test fails when dynamic closure call
dispatchers use that shortcut as seen on patchset 1 of CL 160725.

Bug: https://github.com/dart-lang/sdk/issues/40813
Change-Id: I25abd23ad3ce42b03ec5ca29b4e067c162826066
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160860
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-09-08 13:16:24 +00:00
Vyacheslav Egorov 4d182203ca [vm] Include static call references into V8 profile
Code objects might be connected by static calls and these references
were not included into the profile. This lead to some objects being
unreachable from the root.

This CL also adds a test which computes dominators for all nodes
in the snapshot (this in turn verifies that there are no
unreachable nodes).

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I2af4107fdb7f875624192e892ce1cec78cbf0dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161709
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-08 12:11:34 +00:00
Tess Strickland ee8690563d [vm/compiler] Fix early return value from SerializeGraph.
The bodies provided to COMPILER_PASS macro uses are put into
a DoBody method of a generated class that has the following signature:

virtual bool DoBody(CompilerPassState* state);

CompilerState::Run uses this return value to decide whether to repeat a
given pass.

Previously, if no precompiler was provided in the compiler state, the
SerializeGraph compiler pass returned the compiler state. Since the
compiler state itself was not nullptr, it would implicitly convert to
true, meaning that CompilerState::Run would always run SerializeGraph
twice in this case. Since SerializeGraph was marked as an AOT pass,
though, this case never happened as the precompiler is always provided
for AOT passes.

In the meantime, others have used it as a basis for new compiler passes
with early returns that _could_ happen and then were confused by seeing
the pass happen twice in those cases. Fix the return value so it avoids
such confusion in the future.

Change-Id: I3a91e84abe2fbcc8437c64ce1b5b91f3d4808c65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161784
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-09-07 11:44:13 +00:00
Tess Strickland e969fd995a [vm/compiler] Optimize prologue IL for invocation dispatchers.
Arguments descriptors for invocation dispatchers are loaded as
constants.  However, we only optimize type argument length field loads
from constant argument descriptors, so the prologue code is less
efficient than it could be in these cases.

Add the appropriate cases for pulling out the count, positional count,
and size as constants from constant argument descriptors in
LoadFieldInstr::TryEvaluateLoad, which is enough to let the optimizing
compiler tune this code appropriately.

Also remove the code for handling dynamic closure call dispatchers
specially within the prologue builder and instead explicitly generate
any checks that use the runtime closure value in the dynamic closure
call fragment builders after the prologue.

Bug: https://github.com/dart-lang/sdk/issues/40813
Change-Id: Ie9bd4c01c3b604f282e9b2a72327b7fc81dc4eaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159905
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-09-07 11:35:47 +00:00
Ben Konyi e498ca00dc [VM] Temporarily disable DDS for 2.10 branch
Change-Id: I32916b8e816e109d4e659e9b05326cd0fffb85d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161764
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2020-09-04 02:25:35 +00:00
Ben Konyi 9de8be2792 [ VM ] Fix failing assert when requesting system isolates immediately
after startup

It's possible for VM service clients to request information about
isolates before they've been marked as runnable. Updated the assert to
allow for the kNone service event to handle this case.

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

Change-Id: If03d9f6659714408381d5d2e9f9b1d75a83e82a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161761
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-09-03 21:40:35 +00:00
Ben Konyi f0d88cc96d Reland "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit ed120c3c80.

Change-Id: I445f4bb2dafaad3ce2daa3ae42efe1723f9b1abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160660
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-03 15:20:14 +00:00
Vyacheslav Egorov 80504c8ffe [vm_snapshot_analysis] Fix issues with artificial nodes
This CL addresses two problems, which only reveal themselves when
analysing snapshots produced when function dropping is enabled.
When tests for snapshot analysis were written functions were dropped
in PRODUCT build by default - by currently this functionality needs
to be enabled separately or is automatically enabled when DWARF stack
traces are enabled. This CL changes test suite to enable DWARF stack
traces.

* When constructing ProgramInfo from V8 snapshot profile we should
not assume that Function nodes have any fields outside of owner_,
because Function node might be artificial and thus have no real
fields except for owner link.
* When writing V8 snapshot profile we should take care not to call
CreateArtificalNodeIfNeeded inside TraceStartWritingObject scope,
because CreateArtificalNodeIfNeeded might itself call
TraceStartWritingObject and these calls don't nest, the second one
overwrites the first one.

R=sstrickl@google.com

Bug: b/167601345
Change-Id: I40879ee087c38992388776af58b81bbefd147631
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161703
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-09-03 13:31:14 +00:00
Vyacheslav Egorov 566fd8af36 [vm] Tweak version.cc generation
Actuallly generate null SDK hash in version.cc when verify_sdk_hash
is set to false. Previously it also required setting dart_version_git_info
to false.

R=cskau@google.com

Change-Id: Ib81757c898507029c499c7c3fa17a86b3375d25b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161701
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-09-03 10:00:24 +00:00
Zichang Guo 0c5f2a3532 [vm/file] Ensure that appropriate type is reported for links to files vs directories
Bug: https://github.com/dart-lang/sdk/issues/30410
Change-Id: I96c9ca8a5aff4a4337022047ea0b844335efdfcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161260
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-09-03 01:17:52 +00:00
Alexander Aprelev 8793e5aa01 Reland "[vm/io] Fix FileSystemWatcher enum name typo."
This reverts commit 34f636ce1d with the fix for the typo in patchset 2.

Change-Id: I419528f866f6edb707ca586f21a2a8c7f09323d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161620
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-02 20:41:32 +00:00
Alexander Markov 34f636ce1d Revert "[vm/io] Fix FileSystemWatcher enum name typo."
This reverts commit 0a036db596.

Reason for revert: build fails on android.

Original change's description:
> [vm/io] Fix FileSystemWatcher enum name typo.
> 
> Change-Id: Ie9f2e10847caf794ddc79229ce7bd35a3909896d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161600
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Alexander Aprelev <aam@google.com>

TBR=aam@google.com,rmacnak@google.com

Change-Id: Ibffe96077dacd6f7f9c8b383703d77b416a0cf20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161605
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-09-02 19:05:35 +00:00
Liam Appelbe 7a02118a41 [vm/fuchsia]: Safely shutdown the async message loop.
Shut down the message loop before destroying it, and also clear the
default dispatcher.

Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=59293
Change-Id: I77ba07f4139309e70f812cd4f921e6af4bdc4957
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161462
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-09-02 18:36:02 +00:00
Alexander Aprelev 0a036db596 [vm/io] Fix FileSystemWatcher enum name typo.
Change-Id: Ie9f2e10847caf794ddc79229ce7bd35a3909896d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-02 17:21:47 +00:00
Tess Strickland 33e4a6bc2a Revert "[vm] Have Read/WriteStream use (S)LEB128 for variable-length encoding."
This reverts commit cfc8e6de3f.

Reason for revert: b/167520550

Original change's description:
> [vm] Have Read/WriteStream use (S)LEB128 for variable-length encoding.
>
> Previously, the non-fixed read and write methods of ReadStream and
> WriteStream used a similar but slightly different encoding to LEB128 for
> unsigned values and SLEB128 for signed values. The only difference was
> the high continuation marker bit, which was unset in non-final parts and
> set in final parts in the previous encoding, but is set for non-final
> parts and unset in final parts in (S)LEB128.
>
> This CL changes it so that they instead use the standard LEB128 and
> SLEB128 encodings. Among other things, this means that one-byte
> encodings of values in snapshots will be the value itself, not the value
> with the high bit set. This also means that when outputting specific
> formats that use (S)LEB128, like DWARF, the format writers can just use
> WriteStream::Write(Unsigned) directly instead of needing to write a
> separate encoder.
>
> Cq-Include-Trybots: luci.dart.try:vm-kernel-ubsan-linux-release-x64-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_x64-try
> Change-Id: I409a22e7da9e4672011dfaccd3790c122ec3e522
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150526
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=kustermann@google.com,rmacnak@google.com,sstrickl@google.com

Change-Id: Ie5b9e595e4dbe9bbed5f0dd5bdc6f78bd1233f5d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161540
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-09-02 14:17:53 +00:00
Tess Strickland cfc8e6de3f [vm] Have Read/WriteStream use (S)LEB128 for variable-length encoding.
Previously, the non-fixed read and write methods of ReadStream and
WriteStream used a similar but slightly different encoding to LEB128 for
unsigned values and SLEB128 for signed values. The only difference was
the high continuation marker bit, which was unset in non-final parts and
set in final parts in the previous encoding, but is set for non-final
parts and unset in final parts in (S)LEB128.

This CL changes it so that they instead use the standard LEB128 and
SLEB128 encodings. Among other things, this means that one-byte
encodings of values in snapshots will be the value itself, not the value
with the high bit set. This also means that when outputting specific
formats that use (S)LEB128, like DWARF, the format writers can just use
WriteStream::Write(Unsigned) directly instead of needing to write a
separate encoder.

Cq-Include-Trybots: luci.dart.try:vm-kernel-ubsan-linux-release-x64-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_x64-try
Change-Id: I409a22e7da9e4672011dfaccd3790c122ec3e522
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150526
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-09-02 01:16:21 +00:00
Zichang Guo d27556656f Fix Directory.list from aborting on Linux
Directory.list will throw fatal error if a symbolic link points to an
unexpected file type with follow_link being set. This cl will make
list() issuing the link itself regardless of whether follow_link is set.

Closes: https://github.com/dart-lang/sdk/issues/43176
Change-Id: I16f0e9a0ec68c9d48e60f1fbe58820ebe4b066eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160705
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-09-01 22:44:01 +00:00
Ryan Macnak d511a85126 [vm] Fix missing initialization in --print_instructions_sizes_to.
Bug: https://github.com/dart-lang/sdk/issues/43246
Change-Id: Ib477e0289974d9de9f3c66952184bcf5fe69756e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161240
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-09-01 16:50:29 +00:00
Ryan Macnak c1bb9a520c [vm] Don't write LibraryPrefix::importer_ in AOT snapshots.
This field won't be used at runtime and is not accounted for during tree-shaking.

Bug: https://github.com/dart-lang/sdk/issues/41974
Bug: https://github.com/dart-lang/sdk/issues/43245
Change-Id: Ie5a669608e896aa8cee74a3a4249ba99ec6f980a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161220
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-09-01 16:49:49 +00:00
Clement Skau 7a978c3a35 [API] Adds Dart_SetGCEventCallback for GC events in PRODUCT
Bug: https://github.com/dart-lang/sdk/issues/43106
Change-Id: Ied2201464eca387e0bc58ab54404041f7649e870
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160063
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-08-31 12:14:38 +00:00
Vyacheslav Egorov 50736d2bd9 [vm/compiler] Avoid redundant moves in linearscan
When resolving control flow check detect a case when all
predecessors would contain the same move and try to
emit this move at the entry to the block if possible
(i.e. when the source of the move is not destroyed by other
moves at predecessors).

Optimization discovered as part of go/dart-llvm-assessment

flutter_gallery_total_size (sizeopt) -0.7127%

R=alexmarkov@google.com

Cq-Include-Trybots:dart/try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: Ic8ead8ec3974a896ac58dfe97d652ffe497dfcce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160100
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-08-28 11:47:19 +00:00
Vyacheslav Egorov f91b6d9ad5 [vm/compiler] Fix divide by zero in inliner
Sometimes we might decide to inline a function which
was never executed itself - which causes us to divide
by zero when computing scaled edge weights.

Instead use 1.0 scaling factor when function was
never executed.

Minor cleanup in SetEdgeWeight helper function.

Bug: b/166297352
Change-Id: Ibe6922d2986ba42ec1b81b2f82263c7609782ce5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160282
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-08-28 11:07:38 +00:00
Clement Skau cc148b35d6 [Nit] Remove incorrect lint for dart_tools_api.h
Change-Id: If941238d0c87f58bcbac877a049b0f11cd1e5e39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160223
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-08-27 13:39:47 +00:00
Aske Simon Christensen e0c9b5e45f [vm/aot/tfa] Group unboxing info via dispatch table selector IDs.
Also fix a copy/paste error in the unboxing metadata handling which
prevented setter parameters from being unboxed.

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

Change-Id: I0a37b432f15b34e50b4f60cefea774bacca174a5
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156915
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-08-27 11:00:27 +00:00
Bruno Garcia 655675a7db decode tool from native_stack_trace
I'm going through the docs to ramp up with the split debug-info/DWARF stuff.

In [this doc, I noticed a reference to `pkg/vm/bin/convert_stack_traces.dart`](https://github.com/dart-lang/sdk/blob/52f1502191e8668e3ec216eb52cedc47e574c334/runtime/docs/dwarf_stack_traces.md#using-the-stack-trace-converter-tool) but [this code was deleted (moved) in this commit](https://github.com/dart-lang/sdk/commit/a003d5e69ac860263895f0d4f1438cb2b5ae5053#diff-23252e156bc12255fd263fe5f59b6d42).

The new file is in `pkg/native_stack_traces/bin/decode.dart` which is part of the [native_stack_traces package](https://pub.dev/packages/native_stack_traces).

Closes https://github.com/dart-lang/sdk/pull/43201
https://github.com/dart-lang/sdk/pull/43201

GitOrigin-RevId: fbe926f8d1e3c0fa8cc9abcb045c9d8d750cc921
Change-Id: I5570a23af28cb66853bdc5c2835dcaf1390dd74f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160400
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-08-27 10:00:37 +00:00
Adam Lesinski 6bfc5fdecf Reland "[fuchsia][time] Use C11 timespec APIs for UTC time"
This is a reland of 0e1d32f10c

Original change's description:
> [fuchsia][time] Use C11 timespec APIs for UTC time
> 
> UTC time is being removed from the zircon kernel. Using timespec_get
> ensures that the correct userspace UTC clock handle (supplied to the
> process through proc_args) is used for UTC time queries.
> 
> See https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=57506
> 
> Change-Id: Id22f0c7c7b0dd785ace4b7aa47e3080addf40e61
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159589
> Commit-Queue: Zach Anderson <zra@google.com>
> Auto-Submit: Adam Lesinski <adamlesinski@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

Change-Id: I95acd36978491b468a5dfdafdd0e3319d894938b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160420
Auto-Submit: Adam Lesinski <adamlesinski@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2020-08-26 22:28:45 +00:00
Ryan Macnak d373ff5557 Revert "[vm, service] Gather used and capacity from various mallocs."
This reverts commit 84f9eee652.

Reason for revert: Weak linking does not work on iOS

Original change's description:
> [vm, service] Gather used and capacity from various mallocs.
> 
> Change-Id: I9d397b3b865a804252d1adc90c03a369bf88aff3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159186
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I6c9e17783ee5a3296296677cad11d036aa8fa060
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160401
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-08-26 21:32:36 +00:00
Ryan Macnak 569fc70a91 [vm] Factor out common structure from the three kinds of snapshot.
Reduces Serializer::WriteVM/Program/UnitSnapshot to Serializer::Serialize, and likewise for deserialization.

Change-Id: Idd641ccbbfea410b128e50fe37fca171a0662a95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160000
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-08-26 21:07:55 +00:00
Ryan Macnak 84f9eee652 [vm, service] Gather used and capacity from various mallocs.
Change-Id: I9d397b3b865a804252d1adc90c03a369bf88aff3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159186
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-08-26 20:13:05 +00:00
Ryan Macnak ae37f48796 [vm] Fix Dart_GetNativeFieldsOfArgument when passed an object with no native fields.
Bug: https://github.com/flutter/flutter/issues/64598
Change-Id: I90325e5eecc7a7fca2cb76894ce1830c93c05388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160185
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-08-26 18:03:05 +00:00
Ben Konyi ed120c3c80 Revert "[ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0"
This reverts commit 0ea18ffb36.

Reason for revert: Tree is on fire

Original change's description:
> [ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0
> 
> This change does the following:
>   - The DDS URI will be reported by the VM as the VM service URI. If DDS
>     disconnects, the VM service URI will be reported instead. This only
>     impacts the standalone VM.
>   - Updated the service protocol to 4.0 and removed the following
>     deprecated functionality:
>       - Client synchronization RPCs (these now live in DDS)
>       - getWebSocketTarget (no longer needed as the VM service no longer
>         tries to redirect web socket clients to DDS)
>   - Regenerates package:vm_service based on the new spec, prepare for
>     5.0 release
> 
> Change-Id: I8a2b401062342eb99b81ef10ef6926baa88f946e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160141
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: I6a16e9fa7ceb18555d6424a169cfa811d3833419
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160340
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-26 16:08:27 +00:00
Ben Konyi 0ea18ffb36 [ Service / DDS ] Advertise DDS as the VM service, bump version to 4.0
This change does the following:
  - The DDS URI will be reported by the VM as the VM service URI. If DDS
    disconnects, the VM service URI will be reported instead. This only
    impacts the standalone VM.
  - Updated the service protocol to 4.0 and removed the following
    deprecated functionality:
      - Client synchronization RPCs (these now live in DDS)
      - getWebSocketTarget (no longer needed as the VM service no longer
        tries to redirect web socket clients to DDS)
  - Regenerates package:vm_service based on the new spec, prepare for
    5.0 release

Change-Id: I8a2b401062342eb99b81ef10ef6926baa88f946e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160141
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-08-26 14:55:15 +00:00
Martin Kustermann 7797e0b311 Revert "[Nit] Fixes include lint in dart_tools_api.h"
This reverts commit 091e66ceb0.

Reason for revert: Broke flutter build.

Original change's description:
> [Nit] Fixes include lint in dart_tools_api.h
> 
> Fixes:
> "dart_tools_api.h:8:  Include the directory when naming .h files .."
> 
> Change-Id: Ie22fb13a031328c02b01a0708674761d27659d10
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160064
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

TBR=askesc@google.com,cskau@google.com

Change-Id: Ie33502a66780326386645466c7c0fc6c1bd9e29a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160222
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-08-26 08:53:15 +00:00
Clement Skau 091e66ceb0 [Nit] Fixes include lint in dart_tools_api.h
Fixes:
"dart_tools_api.h:8:  Include the directory when naming .h files .."

Change-Id: Ie22fb13a031328c02b01a0708674761d27659d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160064
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2020-08-26 06:56:33 +00:00
Siva Annamalai 35ec37752c Revert "[fuchsia][time] Use C11 timespec APIs for UTC time"
This reverts commit 0e1d32f10c.

Reason for revert: Appears to cause flaky failures in the Fuchsia timezone tests, see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket.appspot.com/8870947860833887232/+/steps/FEMU_Test/0/steps/Run_FEMU_Test_shell_tests/0/stdout

Original change's description:
> [fuchsia][time] Use C11 timespec APIs for UTC time
> 
> UTC time is being removed from the zircon kernel. Using timespec_get
> ensures that the correct userspace UTC clock handle (supplied to the
> process through proc_args) is used for UTC time queries.
> 
> See https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=57506
> 
> Change-Id: Id22f0c7c7b0dd785ace4b7aa47e3080addf40e61
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159589
> Commit-Queue: Zach Anderson <zra@google.com>
> Auto-Submit: Adam Lesinski <adamlesinski@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=zra@google.com,chaselatta@google.com,adamlesinski@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I9dc6b81f2837acb674815f30d2531c6496a5e7bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160240
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-08-26 05:45:13 +00:00
asiva 930e50964d [SDK] - Remove support for option '--custom-for-pub' in make_version.py
Bug:42820
Change-Id: I773c09790cdb97edbd4b5ebc75c1746d50d80d2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155681
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-08-26 03:46:33 +00:00
Clement Skau 4db081545e Revert "[VM] Fixes yield* exception handling in sync*."
This reverts commit 358aee331b.

Reason for revert: Appears to break service/async_generator_breakpoint_test

Original change's description:
> [VM] Fixes yield* exception handling in sync*.
> 
> This adds a mechanism similar to that used in async functions where
> exceptions are caught in the synthetic code and passed into the
> generated body to be rethrow'n.
> This ensures the exception is throw'n from the same place as the
> original yield*, as per the spec.
> 
> Bug: https://github.com/dart-lang/sdk/issues/42466
> Change-Id: I553dd89141985f6f30751913a1c8a62b1229af04
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158543
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,cskau@google.com

Change-Id: I9df83543d41d4260e91e4a7fb8df7c2762b92429
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/42466
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160101
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-08-25 14:08:42 +00:00
Clement Skau 358aee331b [VM] Fixes yield* exception handling in sync*.
This adds a mechanism similar to that used in async functions where
exceptions are caught in the synthetic code and passed into the
generated body to be rethrow'n.
This ensures the exception is throw'n from the same place as the
original yield*, as per the spec.

Bug: https://github.com/dart-lang/sdk/issues/42466
Change-Id: I553dd89141985f6f30751913a1c8a62b1229af04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158543
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-08-25 12:40:49 +00:00
Vyacheslav Egorov ab591454c5 [vm/arm64] Fix optional parameters overflow
Functions with too many optional positional parameters were causing
an assertion failure in ARM64 backend because LoadIndexedUnsafe
we not taking large offsets into account.

ARM64 only gives 9 bits for encoding a negative offset while
ARM32 gave 12+1 bits for these offsets.

Closes https://github.com/flutter/flutter/issues/64526

R=kustermann@google.com

Change-Id: Ia49fd237f3fa8465b01f6dc4aabceef40c2fc256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160066
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-08-25 11:34:40 +00:00
Tess Strickland 1914b0d7c0 [vm/compiler] Unify slot rep != kTagged handling across architectures.
Unify the order of checks in both LoadFieldInstr::MakeLocationSummary()
and LoadFieldInstr::EmitNativeCode() so that all architectures first
check the slot representation, then for unboxed fields when optimizing,
then for potential unboxed fields.

Add kUnboxedInt64 handling to IA32, so that all architectures support
the same set of unboxed slot representations.

For 32-bit architectures, use RepresentationUtils::ValueSize to
determine when to use single registers vs. pairs of registers for
unboxed integers.

Move (and dedup) any asserts in LoadFieldInstr::EmitNativeCode() into
LoadFieldInstr::MakeLocationSummary(), since the latter is always called
first, making the ASSERTs fail as soon as possible, and there's no need
to re-check the duplicated ASSERTS.

Change-Id: Ia0f8fddd5a3cda036f9e4c51e3e9a374be121e7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159667
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-08-25 09:40:49 +00:00
Alexander Aprelev c105b89652 [vm/locks] Add helper methods to SafepointRwLock to assert the lock is held.
This will be useful in program structure mutation operations where it is important to ensure appropriate lock is held.

Change-Id: If5bef0937ba997af84716d1f050da2d5f2a7cd8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159583
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-08-24 19:49:47 +00:00
Adam Lesinski 0e1d32f10c [fuchsia][time] Use C11 timespec APIs for UTC time
UTC time is being removed from the zircon kernel. Using timespec_get
ensures that the correct userspace UTC clock handle (supplied to the
process through proc_args) is used for UTC time queries.

See https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=57506

Change-Id: Id22f0c7c7b0dd785ace4b7aa47e3080addf40e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159589
Commit-Queue: Zach Anderson <zra@google.com>
Auto-Submit: Adam Lesinski <adamlesinski@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2020-08-24 16:08:33 +00:00
Ben Konyi e44c0b2264 [ Service ] Add 'is_system_isolate' option to Dart_IsolateFlags
Provides a general way to designate an isolate as a 'system isolate'
(formerly known as 'VM internal isolates').

Initial fix for https://github.com/dart-lang/sdk/issues/42875

Change-Id: I8798a3a1c51df1db8008d602f6303df13c958cba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158063
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-08-21 21:44:50 +00:00
Ben Konyi 7d92b3f24d [ dart:developer / Service ] Added optional 'silenceOutput' parameter to
Service.controlWebServer

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

Change-Id: I3454592bf0e30bb1a84622493889619f3799ed0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159541
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-08-21 19:32:40 +00:00
Ben Konyi 8b7594b9ee [ Observatory ] Disable 'getWebSocketTarget' connection flow while DDS
is disabled

Invoking 'getWebSocketTarget' as an HTTP request seems to cause failures
with Flutter, resulting in a 403 response. Disabling this flow while DDS
is turned off in both the standalone VM and flutter_tools to resolve https://github.com/flutter/flutter/issues/64333

Change-Id: I862e616e622efd3701f10ed0616562cbd2663109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159643
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-08-21 18:46:30 +00:00