Commit Graph

18413 Commits

Author SHA1 Message Date
Alexander Aprelev 312fad1916 [vm/io] Ensure ports in SSLFilters are intitialized.
This is follow-up to a6dafabb88 where these fields were introduced

Change-Id: I50552092f369b9da4c278bad762129ec19994438
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165781
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-10-02 01:58:56 +00:00
Alexander Aprelev 48e5cba6b9 Reland "Enable long path on Windows"
This reverts commit f8fbefd951 in patchset 1 with fixes to the way how temporary strings are allocated and the way how prefixed string is returned in successive patchsets.

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

Change-Id: Idb801cb117fc2d84fad4c533f5239d8499afc943
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164741
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-10-02 00:54:46 +00:00
Alexander Aprelev a6dafabb88 [vm/io/mac] On macos/ios run trust evaluation part of ssl certification validation on separate worker thread.
Running trust evaluation system api call on worker thread effectively unblocks main isolate when it attempts to establish https connection.

Execution of the worker thread is implemented via dart native port infrastructure which allows to run C++ code as a dart message handler.
TrustEvaluateHandlerFunc (if provided by platform-dependent SSLCertContext) is that handler, only mac(ios) implementation provides it.

Asynchrony of CertificateVerificationCallback (for mac/ios) is implemented via [ssl_verify_retry] return code which allows to suspend ssl handshake until certificate trust is confirmed.
When dart's _RawSecureSocket.secureHandshake() method that initiated ssl's handshake received this return code it knows it has to wait for a future that is completed by another callback([rpEvaluteResponse]) that waits for trust evaluation handler response.
rpEvaluateResponse purpose is to listen for response from TrustEvaluateHandler and also invoke user-provided [badCertficateCallback] that can override trust decision for a given connection request, for a given certificate.
Once that future is completed and CertificateVerificationCallback knows whether to trust a certificate or not, _secureHandshake retries ssl handshake.


Bug: https://github.com/dart-lang/sdk/issues/41519
Change-Id: Ifee18639c78099ec77cad50000444bc6c7b9369b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165520
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-10-01 23:40:16 +00:00
Ben Konyi 45159b12e0 [ VM / Service ] Add isolateFlags property to Isolate JSON response
Flags that can be set in `Dart_IsolateFlags` are now surfaced via the
Isolate JSON object returned from the service protocol. Currently only
returns boolean flags.

Related: https://github.com/dart-lang/sdk/issues/43588
Change-Id: I54a30155778de8612105eb4a5f60f8a222a086b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165403
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-01 19:18:30 +00:00
Ben Konyi 9c1adbd8c5 [ dart:io / package:vm_service ] Change parameter name for httpEnableTimelineLogging enable -> enabled
This is a backward compatible change that will continue to accept the
old parameter name.

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

Change-Id: I4e7a9d8d14921784e9d1c8693ae2252cf5f023e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165623
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-10-01 17:17:58 +00:00
Adam Lesinski 919f68d8ac [process][fuchsia] Clone UTC clock when launching processes
Fuchsia is transitioning from UTC time being tracked in the kernel,
to userspace UTC clock handles.

This preserves the existing behavior that each dart process
has access to the global UTC clock.

Bug: 43629
Change-Id: I23005bccd8bec09ed6db7c6f475b6f5d6e84613c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165500
Auto-Submit: Adam Lesinski <adamlesinski@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2020-10-01 15:25:58 +00:00
Martin Kustermann 9c59897fc4 [vm/compiler] Use CompileType of Values instead of Definitions in TypedDataOptimizer
Sometimes our compiler loses type information on [Definition]s but
retains the more precise [CompileType] on the [Value]s, so use
the [Value]s [CompileType].

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

Change-Id: Ibb3610f389ec55025655a8f0ac78a33a6269063d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165360
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-10-01 11:36:32 +00:00
Martin Kustermann 014552370a [vm/nnbd] Mark FFI struct field as external in NNBD test suite
Issue https://github.com/dart-lang/sdk/issues/43630

Change-Id: I986186182a1ef184bb1920f9ac48215a7be92fd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165601
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-10-01 11:32:27 +00:00
Martin Kustermann e34f6e4405 [vm/compiler] Ensure parameters for multiple entrypoints get Phi nodes with AssertAssignable/Redefinition as inputs
Our compiler uses data dependencies to represent certain control
dependencies. In particular code that uses a SSA definition after an
AssertAssignable should use the AssertAssignable instead of it's input.

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

Change-Id: I495b793a68a99385483c62e3cbc6a7e12b2527ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165562
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-10-01 11:24:22 +00:00
Clement Skau b4f49dc255 Revert "Flow analysis: promote to non-nullable on initialization"
This reverts commit 6a1c54ec30.

Reason for revert: Triggers test failure:
https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-linux-debug-x64/8247

Original change's description:
> Flow analysis: promote to non-nullable on initialization
>
> When flow analysis encounters a variable declaration of the form `T? x
> = expr;`, if the type of `expr` is `T`, then the variable is
> immediately promoted to type `T`.
>
> Fixes #43099.
>
> Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
> Bug: https://github.com/dart-lang/sdk/issues/43099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

TBR=paulberry@google.com,scheglov@google.com,rnystrom@google.com,johnniwinther@google.com

Change-Id: I8549b48a734f527194ce11d82235b9d5c6e58185
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/43099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165564
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-10-01 08:41:15 +00:00
Paul Berry 6a1c54ec30 Flow analysis: promote to non-nullable on initialization
When flow analysis encounters a variable declaration of the form `T? x
= expr;`, if the type of `expr` is `T`, then the variable is
immediately promoted to type `T`.

Fixes #43099.

Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
Bug: https://github.com/dart-lang/sdk/issues/43099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-01 01:15:31 +00:00
Ryan Macnak f54c0a3b9b [vm] Prepare for canonicalizing general constants on load.
- Use null instead of empty array for the initial constants set, as fields dropped during snapshot are populated with null.
 - Remove assumption that canonicalization will always be bottom-up. Deserialization clusters will cause canonicalization to be ordered by class instead of by depth.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Ia3ab68281c783299e682f6c60a744c320c19e981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165160
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-09-30 22:29:05 +00:00
Alexander Thomas c3d37c1ad6 [infra] Add additional nnbd VM builders
See also Luci configuration here:
https://dart-review.googlesource.com/c/sdk/+/164084

https://github.com/dart-lang/sdk/issues/43463

Change-Id: I071c8c6055004574cbe35f14a28e0cd8c468988f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164164
Reviewed-by: William Hesse <whesse@google.com>
2020-09-29 09:57:44 +00:00
Clement Skau 379e208849 [Test] Fix lazy-async nested stepping consistency, tests.
The debugger async function handling has been moved to allow handling
of stepping_fp_ and async_stepping_fp_.
Previously the presence of an async function would take precedence over
the *stepping_fp while stepping, resulting in nested asyncs to
incorrectly re-trigger the insertion of synthetic breakpoints.

This fix revealed three tests that were still testing for unintentional
inconsistencies between causal and lazy async.
Note that there are still tests that branch on `useCausalAsyncStacks`
though these all test for known differences - namely that lazy async
cannot traverse unawaited future calls.

Cq-Include-Trybots: luci.dart.try:app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64-try
Change-Id: I5f74db18086a90828024dbb461759869531d478f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164781
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-09-28 08:18:07 +00:00
Daco Harkes 7c5df91579 [flutter] Fix GN typo
Typo from https://dart-review.googlesource.com/c/sdk/+/164320 was not
caught on the Dart CQ.

dart_native_api.c (does not exist) should have been dart_api_dl.c.

Fix verified with Flutter build locally.

Change-Id: I7e37e4da27c02a2800ff36fd67e1be1575714c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164560
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-09-25 15:16:14 +00:00
Daco Harkes 11f15f5125 [sdk] Recover folder structure in include folder
Such that include/internal/dart_api_dl_impl.h ends up in
include/internal/dart_api_dl_impl.h in the sdk release.

Also, adds missing C file: include/dart_native_api.c.

Change-Id: Ibe8dd6a6a5eed171b4bfc1f1a3013f5cf2a13547
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164320
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-09-25 11:09:44 +00:00
Daco Harkes 4a0782918e [vm] Change import paths inside runtime/include
Such that the files can be included more easily.

Change-Id: I3129b35393eaf41f90e59a530b752846085bf93e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164163
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-09-25 11:09:44 +00:00
Lasse R.H. Nielsen 02923c6f83 Make Future.wait not return a const <Never>[] when given no futures.
Fixes #43445.

Bug: https://github.com/dart-lang/sdk/issues/43445
Change-Id: I70f722f6bee1d4cfe4d53a5f37bc29f0751edd78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164162
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-09-25 10:37:00 +00:00
Paul Berry def50905c2 Make flow analysis handling of is/==/??=/?. consistent with mixed mode semantics
Bug: https://github.com/dart-lang/language/issues/1143
Change-Id: Id177f8b19c15ef246f21ddd840410cddfee2e5cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163600
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-25 08:35:03 +00:00
Ryan Macnak 39719118a4 [vm] Split canonical and non-canonical objects across clusters instead of within clusters.
Ensure canonical clusters come first; prep for canonical objects in snapshot accounting for the possibility an existing canonical object may substitute for them.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I8083f4130c359f0f86f73c25fa2869af672700e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164250
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-09-24 21:24:28 +00:00
Ryan Macnak c77eec3bab [vm] Remove assumption from Instance cluster than the Class cluster comes earlier.
Clusters should not read information produced by any other cluster until PostLoad.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I39ec580d9011604f7041615cefaa907aa99a3ff8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164280
Reviewed-by: Régis Crelier <regis@google.com>
2020-09-24 21:24:28 +00:00
Tess Strickland a36d17730a Reland "[vm] Allow BaseWriteStream::WriteFixed to be used at unaligned positions."
Fixes errors introduced by adding PRINTF_ATTRIBUTE to
BaseWriteStream::Printf due to attempting to print a
compiler::target::uword using the format for uword.

Original description:

For snapshot writing, we generally only have aligned writes so the old
methods worked well, but in some formats (like DWARF) we're not
guaranteed to have aligned writes and so had to use WriteBytes.
Instead, have WriteFixed call WriteBytes and replace any other uses of
WriteBytes(&value, sizeof(value)) with WriteFixed(value) instead.

Also makes the following additional changes:

* Expose WriteByte(value), instead of forcing use of
  WriteFixed<uint8_t> or Raw<1,T>::Write to get the same behavior.

* Rename Print/VPrint to Printf/VPrintf, so methods taking format
  strings are named consistently with others in the codebase.

* Add format string checking to Printf when supported.

* Add AddString() for non-formatted string writing.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-mac-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: Ib70ccaa752dbf9ead5ea57e386a67725723bac84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164324
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-24 16:58:30 +00:00
Alexander Aprelev 08c3276712 [io/watcher] Fix crash in file event watcher functionality on Windows.
It is possible to get '-1' bytes reported as available. This change ensures that only positive number of available bytes are being read.

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

Change-Id: I9f76bd7ca725c9e48ae5a9c44a25d3c12a487194
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164340
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-24 16:26:00 +00:00
Tess Strickland 074d6e1309 Revert "[vm] Allow BaseWriteStream::WriteFixed to be used at unaligned positions."
This reverts commit 4e2556215a.

Reason for revert: Adding PRINTF_ATTRIBUTE broke more than expected on Mac bots.

Original change's description:
> [vm] Allow BaseWriteStream::WriteFixed to be used at unaligned positions.
>
> For snapshot writing, we generally only have aligned writes so the old
> methods worked well, but in some formats (like DWARF) we're not
> guaranteed to have aligned writes and so had to use WriteBytes.
> Instead, have WriteFixed call WriteBytes and replace any other uses of
> WriteBytes(&value, sizeof(value)) with WriteFixed(value) instead.
>
> Also makes the following additional changes:
>
> * Expose WriteByte(value), instead of forcing use of
>   WriteFixed<uint8_t> or Raw<1,T>::Write to get the same behavior.
>
> * Rename Print/VPrint to Printf/VPrintf, so methods taking format
>   strings are named consistently with others in the codebase.
>
> * Add format string checking to Printf when supported.
>
> * Add AddString() for non-formatted string writing.
>
> Change-Id: I5a2e91380bc41b0502e1a576acec786dfe66abbf
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164161
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

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

Change-Id: Ie90ac4477f4c581692b37429536ce8dd66788540
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164323
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-09-24 13:57:52 +00:00
Tess Strickland 4e2556215a [vm] Allow BaseWriteStream::WriteFixed to be used at unaligned positions.
For snapshot writing, we generally only have aligned writes so the old
methods worked well, but in some formats (like DWARF) we're not
guaranteed to have aligned writes and so had to use WriteBytes.
Instead, have WriteFixed call WriteBytes and replace any other uses of
WriteBytes(&value, sizeof(value)) with WriteFixed(value) instead.

Also makes the following additional changes:

* Expose WriteByte(value), instead of forcing use of
  WriteFixed<uint8_t> or Raw<1,T>::Write to get the same behavior.

* Rename Print/VPrint to Printf/VPrintf, so methods taking format
  strings are named consistently with others in the codebase.

* Add format string checking to Printf when supported.

* Add AddString() for non-formatted string writing.

Change-Id: I5a2e91380bc41b0502e1a576acec786dfe66abbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164161
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-24 12:45:00 +00:00
Daco Harkes a7fa63493f [cfe] Give external field generated setters parameter names
The setters generated from external fields used not have a name.
This broke the assumptions in the VM when making stack traces.

Separated out from https://dart-review.googlesource.com/c/sdk/+/140290.

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

Change-Id: I1816557eff891eaa7c531db1f4239159c66c325c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164093
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-09-23 22:42:09 +00:00
Tess Strickland a4a714ebf9 [vm] Consolidate the *WriteStream hierarchy.
All *WriteStream classes are now part of the same hierarchy:

class BaseWriteStream : ValueObject;

  Base class for all *WriteStreams. Provides all the methods from
  the old WriteStream except for buffer() and SetPosition()
  (relegated to NonStreamingWriteStreams). Has one pure virtual
  method Realloc that must be overridden by concrete subclasses.

class NonStreamingWriteStream : BaseWriteStream;

  Base class for all *WriteStreams where the entire stream is available
  at all times (i.e., no flushing to an external sink). Extends the
  public BaseWriteStream API with buffer() (for accessing the stream
  contents) and SetPosition() (for changing the current stream pointer
  to the given absolute position in the stream).

class MallocWriteStream : NonStreamingWriteStream;

  Uses realloc to reallocate the internal buffer.  Almost the same as
  the old WriteStream, except that it only takes an initial size.  Adds
  one public method Steal() for taking ownership of the current buffer
  contents (after which the buffer is reset to an empty state). Instead
  of passing a pointer to a buffer, the internal buffer must be accessed
  via either Steal() or buffer(), which allows access to the current
  stream contents without changing ownership or resetting the stream.
  The internal buffer is freed on stream destruction.

class ZoneWriteStream: NonStreamingWriteStream;

  Takes a zone and reallocates the internal buffer in that zone. No
  additional public methods beyond those available from
  NonStreamingWriteStream.

class StreamingWriteStream : BaseWriteStream;

  Uses realloc to reallocate the internal buffer.  Generally same as
  before, where the contents of the stream are periodically flushed
  using Dart_StreamingWriteCallback. Since it extends BaseWriteStream,
  there are now more methods available for writing data to the stream
  than just Print/VPrint/WriteBytes. Since portions of the stream may be
  flushed and thus no longer in the internal buffer, does not provide
  access to the contents of the stream or a way to reposition the
  current stream pointer. Flushes any unflushed data and frees the
  internal buffer on stream destruction.

Also refactor things so that write streams are passed to appropriate
recipients, instead of the recipients taking arguments they only used to
create a WriteStream internally. Thus, recipients now can just specify
the appropriate base class for the public API used:

* BaseWriteStream for just writing to the stream, or
* NonStreamingWriteStream if re-positioning or the stream contents are
  needed.

Change-Id: I419096ecd9331483d168b079fca55b69ef397f15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164080
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-09-23 21:05:59 +00:00
Ryan Macnak a4637cd81d [vm] Build canonical string and type tables after reading snapshots.
Prevents snapshots from including canonical strings and types with no real uses and only referenced from the canonical tables.

Prep for constants not all being in the root snapshot during snapshot splitting, which is why we fill the table during load instead of rebuilding tables during snapshot writing.

Removes the size of the tables from the snapshot.
flutter_gallery_app_so_size (Pixel 2)        -1.618% 7967664 8098736
flutter_gallery_app_so_gzip_size (Pixel 2)   -2.724% 2980344 3063788
flutter_gallery_app_so_brotli_size (Pixel 2) -3.530% 2561824 2655566

Bug: https://github.com/dart-lang/sdk/issues/41974
Bug: https://github.com/dart-lang/sdk/issues/43319
Change-Id: I4f3b62da1cea9ee17caa965e809f16856518c9a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164102
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-09-23 19:13:29 +00:00
Tess Strickland 1d603120c5 [vm] Add std:: prefix to nullptr_t.
Change-Id: Idb111beef3a4f14ba6aaac6c9e894e92526d822b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164140
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-09-23 17:05:09 +00:00
Tess Strickland d5649fc9f6 [vm] Add build ID to non-symbolic stack traces.
Since we've run out of room for more fields in the Image object header
on 64-bit architectures, the serializer instead creates an ImageHeader
object for precompiled snapshots that is placed at the start of text
segments. The new ImageHeader object contains the following information:

* The offset of the BSS segment from the text segment, previously
  stored in the Image object header.

* The relocated address of the text segment in the dynamic shared
  object. Due to restrictions when generating assembly snapshots, this
  field is only set for ELF snapshots, and so it can also be used to
  detect whether a snapshot was compiled to assembly or ELF.

* The offset of the build ID description field from the text segment.

* The length of the build ID description field.

We replace the BSS offset in the Image object header with the offset of
the ImageHeader object within the text segment, so that we can detect
when a given Image has an ImageHeader object available.

There are no methods available on ImageHeader objects, but instead the
Image itself controls access to the information. In particular, the
relocated address method either returns the relocated address
information from the ImageHeader object or from the initialized BSS
depending on the type of snapshot, so the caller need not do this work.
Also, instead of returning the raw offset to the BSS section and having
the caller turn that into an appropriate pointer, the method for
accessing the BSS segment now returns a pointer to the segment.

Bug: https://github.com/dart-lang/sdk/issues/43274
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try
Change-Id: I15eae4ad0a088260b127f3d07da79374215b7f56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163207
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-09-22 17:14:44 +00:00
Ben Konyi e85e5b6264 [ dart:io / package:vm_service ] Add httpEnableTimelineLogging extension and service events
- Added httpEnableTimelineLogging to the dart:io service extensions
- Deprecated setHttpEnableTimelineLogging and getHttpEnableTimelineLogging
- Send service event when HTTP timeline logging state has changed

Change-Id: I56df249fcfb11d7041a40a7749d47f6ef8f97c10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163724
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-22 16:06:23 +00:00
Tess Strickland 37cfae173c [pkg/native_stack_traces] Make package NNBD compatible.
Bug: https://github.com/dart-lang/sdk/issues/43304
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Iaf451047ce74add6520bd514bafae8b0e3c5fa59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161704
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-09-22 11:33:13 +00:00
Alexander Markov f59ffd910b [vm] Fix AllocateTypedData stub for ia32
Fixes bug in register usage in ia32 stub for typed data allocation.
The bug was introduced in https://dart-review.googlesource.com/c/sdk/+/161840
when asm intrinsics for typed data allocation were converted to stubs.
This change fixes performance regressions on ia32 caused by that bug.

Change-Id: I4f05e157a56a3bd561895ec435b1e1f80d0c3880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163728
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-09-21 23:52:02 +00:00
Ryan Macnak 30897929fc [vm] Fix warnings in GCC 9.3.0 and XCode 12.0.
Bug: https://github.com/flutter/flutter/issues/66203
Change-Id: Ifff0c211e2ecdcb56d62c273a471fc05bbae9c37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161602
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-09-21 22:02:32 +00:00
Alexander Markov aa936d4294 [vm/compiler] Fix crash in ConstantPropagator::VisitInstanceOf when value is sentinel/unreachable
Result of an inlined method call is represented with sentinel if method
does not return. This change adjusts ConstantPropagator::VisitInstanceOf
to handle sentinel value and avoid calling IsInstanceOf on it.

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

Change-Id: Ibf9e4a4b30474ae3813148d23c764518f8edeb8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155580
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-09-21 21:37:52 +00:00
Alexander Markov e558373b90 [tests] Unskip vm/dart tests on NNBD bots
Those test were inadvertently skipped in
https://dart-review.googlesource.com/c/sdk/+/162501

Also fix recently added vm/dart/send_instantiated_fun_test.

Change-Id: I196e16079020693799762a11424d0ccbedfe315f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163703
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-09-21 20:56:42 +00:00
Alexander Aprelev 8ce78ca107 [vm/msan] Fix msan error triggered when building debug gen_snapshot.
Fixes https://github.com/dart-lang/sdk/issues/43433.

Change-Id: Ia7558251ab7a6115c3e0092ad57011e7e1f42340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163722
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-21 19:42:42 +00:00
Ryan Macnak e7dc37c516 [vm, gc] Don't start or finalize concurrent marking during a force growth scope.
Adjust tests to exit force growth scopes before forcing a GC.

Change-Id: I6d84c83e75ab8da4e0d623256d1997efd61341d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163140
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-18 21:32:56 +00:00
Ben Konyi a44409615f [ Service / dart:io ] Rework previously unused dart:io service extensions
This CL is mostly modernizing existing Process and File profiling code
that was never made public. Updated the service extension responses to
be more consistent with the rest of the service protocol.

Related to https://github.com/dart-lang/sdk/issues/41455.

Change-Id: I116b3cd1424980e4ec8133672901990776c1d9c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157160
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-18 20:15:56 +00:00
Ben Konyi fe85812e27 [ VM / DartDev ] Fix --disable-service-auth-codes not being recognized by DDS
The VM and dartdev were not forwarding --disable-service-auth-codes to
the DDS instance, resulting in auth codes always being enabled.

Change-Id: Ib23bfeb7c64a51fb1229f049a4b61cb1ce5018de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163261
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-18 17:23:31 +00:00
Clement Skau 96e84b8494 [Test] Removes tests for StringInterp. in bytecode.
This fixes the current breakage of vm-dartkb-linux-release-simarm64 and vm-dartkb-linux-release-x64.

Cq-Include-Trybots: luci.dart.try:vm-dartkb-linux-release-simarm64-try,vm-dartkb-linux-release-x64-try
Bug: https://github.com/dart-lang/sdk/issues/43229
Change-Id: I2b1316a2242d0276075b23ccc77e3002856db520
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163346
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-09-18 14:45:06 +00:00
Martin Kustermann eac07c1770 [vm] Fix incorrect of re-use of a handle in recursive context
The recursive call can assign the TypeArguments handle a new value. Once
the recursive call returns it's no longer safe to continue iterating
over the type arguments array.

Instead we make a custom handle.

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

Change-Id: Ifff652f3f3cece64fb8b39a328918ba46dc8d21b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162724
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-09-18 12:01:11 +00:00
Clement Skau 639de610e8 [Compiler] Adds const fold for StringIterpolate.
Bug: https://github.com/dart-lang/sdk/issues/43229
Change-Id: Ied6b59fdc91d9148b6c54a4a6a15f89e6d7e5a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162500
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-09-18 09:35:22 +00:00
Daco Harkes a80f9d7da8 [vm/ffi] Stop using R8 in FFI calls, callbacks and stubs on arm64
R8 is used for passing the address when returning structs by value
in the native ABI.

Separated out from https://dart-review.googlesource.com/c/sdk/+/140290

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

Change-Id: I35187d35b8cd1b9fe6852faf0cd02a5f51e9f358
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163204
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2020-09-17 21:08:13 +00:00
Alexander Aprelev 26e503612a [vm/sendport] Ensure that partially instantiated static closures keep types when sent over SendPort.
Fixes https://github.com/dart-lang/sdk/issues/43343.

Change-Id: If2a741ba9b13f7817ff765d83f3f5a920860cb9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163133
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-17 19:17:53 +00:00
Ryan Macnak ac6095a7cc [vm] Hash strings by UTF16 code unit instead of by rune.
The VM hasn't had UTF32 strings for many years, and it is cheaper to hash by code unit. In particular, it is convenient for hashing two-byte strings while they are being deserialized.

Change-Id: Icad3b4e7a5292bd45b0ae4f12861cd1ed20bf9ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160180
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-09-17 18:56:33 +00:00
Clement Skau 3a5c166647 [VM] Makes the GCEventCallback VM-wide.
Bug: https://github.com/dart-lang/sdk/issues/43106
Change-Id: I35ba6875deb5239a8e0154fe3cc20c321392bcbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162756
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-09-17 06:07:50 +00:00
Ben Konyi c3da025eaa Revert "[VM] Temporarily disable DDS for 2.10 branch"
This reverts commit e498ca00dc.

Reason for revert: 2.10 has been branched.

Original change's description:
> [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>

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

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

Change-Id: If895b635fc2f66c08d8b1aa28af92c250de3e95a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162942
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-09-16 18:38:28 +00:00
Alexander Markov 13aaaae1b2 [vm/compiler] Introduce AllocateTypedData IL instruction
This is the first step towards optimizing typed data array allocations,
which is useful for e.g. package:vector_math.

Opaque call to a typed data factory constructor is replaced with IL
instruction which doesn't have side-effects and doesn't prevent
other optimizations (e.g. load forwarding) from happening.

Asm intrinsics for typed data factories are replaced with stubs.

Issue: https://github.com/dart-lang/sdk/issues/43228
Change-Id: Icc7d4863f2f94ea5d8bb4620d041f7b6fe664098
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161840
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-16 03:16:42 +00:00
Alexander Markov a53a66b7db [bots] Add pkg/vm_snapshot_analysis to vm-kernel fileset
pkg/vm_snapshot_analysis is used in
runtime/tests/vm/dart/v8_snapshot_profile_writer_test.dart
which can run on sharded bot configurations such as
dartkp-weak-asserts-linux-release-x64.

Change-Id: Ie843a38069394f42be79b432d8a71bbf6d472073
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159322
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-09-16 03:08:51 +00:00