Commit graph

14977 commits

Author SHA1 Message Date
Ben Konyi
15b4e57510 [ VM / Service ] Fixed failing isolate_lifecycle_test
Change-Id: I7cf18b36ccd55aeca368343a02e036f9a8ba2e0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98221
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-03-28 19:03:32 +00:00
Ryan Macnak
ae62f7fefe [vm, gc] Make incremental write-barrier elimination safe.
If generated code allocates an old object during concurrent marking, add this object to the deferred marking stack to be (re)scanned when marking is finalized to catch stores missed by the barrier elimination.

Bug: https://github.com/dart-lang/sdk/issues/36341
Change-Id: Ifc744fdf720446f14b68268383e1fe5c92d9b5a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97861
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-28 18:00:10 +00:00
Michael Powell
dfcc52f909 [vm/dart:io/fuchsia] Improve fdio_pipe_half signature, step 2.
The return value on fdio_pipe_half conflated two things: the error code
on failure (as a zx_status_t) or a file descriptor on success. This
technically worked, because they're both ints, the error code was always
negative, and the file descriptor always positive. However, the stated
return type of zx_status_t was misleading. This changes the signature
such that it always returns an actual zx_status_t, and the file
descriptor is returned through a pointer argument.

Also remove the last argument, since it was always given the same value.

This needs to be done as a soft transition because it's called from the
Dart runtime. The steps are as follows:
1. Add fdio_pipe_half2 with the new signature.
2. Update the Dart runtime to call fdio_pipe_half2.
3. Change fdio_pipe_half to be identical to fdio_pipe_half2.
4. Update the Dart runtime to call the updated fdio_pipe_half.
5. Delete fdio_pipe_half2.

This is step 2.

Change-Id: Ieac841c5f8055f34000851cef364a12b6c0aca2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96664
Commit-Queue: Zach Anderson <zra@google.com>
Auto-Submit: Michael Powell <mikepowell@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-03-28 17:45:55 +00:00
Ben Konyi
ac2c934563 Reland "[ VM / dart:isolate ] Added ability to set names for spawned isolates."
This reverts commit 638f13ff3d.

Change-Id: Ib5015539b1c93791c2469be6995789f8f0362806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97845
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-28 16:39:50 +00:00
Ben Konyi
380ae2ce55 [ Observatory ] Fixed links for 'part's in dart:* scripts not being created.
For example in the dart:io script, `part 'bytes_builder.dart';` would not
link to the script inset for 'bytes_builder.dart'.

Change-Id: I9252980cb2621f0bc2ea4b224209cb07dc21b896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97848
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-03-28 16:35:35 +00:00
Aart Bik
f29e100f42 [dart/fuzzer] Generate DartFuzz API tables automatically
Rationale:
Rather than manually constructing the API tables for DartFuzz,
this introduces a utility to generate API tables based on
the analyzer traversal of common libraries. The utility
recognizes DartTypes that are currently understood by DartFuzz
and constructs the tables organized by return type.

TBD:
DartFuzz's type system is rather simple; as this improves,
more and more methods will be accepted by the utility,
thereby increasing fuzzing coverage of our libraries.
Change-Id: Idcc607a4a592dbbf80bd79cdfec429cb397b7f68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98041
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-03-28 16:31:45 +00:00
Jens Johansen
3e4a1de6e9 Use dart:foo-patch import uri for patches; remove VM workaround for sdk uris
Closes #32087.

Change-Id: I93a757125bf29bc283bf6536fa5e53a4f9334891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97311
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-28 10:00:51 +00:00
Jens Johansen
ef168de000 [vm/kernel] Index all source and line starts before using them (2nd try)
By indexing all sources in a concatenated dill file and then using that
index to find the sources and line starts we can fix missing information
(leading to crashes when collecting coverage) in for instance circular
instances.

This reverts commit 57321c1590 and adds a
fix.

Change-Id: I7a91801fb318cad0218cf3101d6a15f1ec929175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98006
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-28 08:36:51 +00:00
Ryan Macnak
cf32584870 [vm] Support compiling static field initializers and dynamic invocation forwarders from a compilation trace.
Clean up creating static field initializers.

Change-Id: I914263f532be1d1a7216d3b5e35d05c4f0fdf167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97547
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-03-28 00:48:30 +00:00
Ben Konyi
e5bc8c2d39 [ VM / Service ] Remove Platform.pathSeparator from test and replace with / to fix Windows failure
Change-Id: Icddbcf46ba17d36e2832f9b86022461b6b71e074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98047
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-03-27 23:10:20 +00:00
Ben Konyi
ca2f03c5f8 [ VM / Service ] Allow for breakpoints to be set using either file: or package: URIs for packages.
Additional minor changes:
- Sorted list of Symbols in symbols.h by name
- Added Symbol::PackageScheme() to symbol list

Change-Id: I2f739bfb5c8cbbe1e318614124695ae45dee4f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98043
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-03-27 20:38:20 +00:00
Alexander Markov
994f535e03 [vm/bytecode/compiler] Remove excessive stack overflow checks when inlining
Megamorphic benchmark in bytecode/JIT-only mode:

Before:
MegaNeverOverridden(RunTime): 1847.3550369344412 us.
MegaNeverOverriddenIndirect(RunTime): 2054.2040605749485 us.
MegaOnlyOverriddenOnceIndirect(RunTime): 3444.1204027538724 us.
MegaFieldIndirect(RunTime): 2334.6812497082847 us.
MegaFieldHasGetterOnceIndirect(RunTime): 3212.210929373997 us.

After:
MegaNeverOverridden(RunTime): 1393.4616984679665 us.
MegaNeverOverriddenIndirect(RunTime): 1363.8226980231766 us.
MegaOnlyOverriddenOnceIndirect(RunTime): 2814.319476793249 us.
MegaFieldIndirect(RunTime): 1893.1759697256387 us.
MegaFieldHasGetterOnceIndirect(RunTime): 2782.111602225313 us.


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

Change-Id: Ibb73c1339f5b8f859531c8ed29aca4054d733ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97843
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-03-27 17:46:40 +00:00
Ryan Macnak
b7a5e478bb [vm, service] Allow choice of tags and code-verus-function when getting profile samples as timeline events.
Change-Id: Ie0cf3d43d5ccc748216ba2b45a9466ce60dcf239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97176
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-03-26 22:52:40 +00:00
Ross Wang
0e485045d4 Deflake socket reads on Fuchsia
Handles a case where a socket may be signalled with 0 available bytes to read,
where we would never resubscribe to the socket for reading.

Change-Id: If9662873ac862bee749ccc7f0ce4b4370b639680
Bug: https://fuchsia.atlassian.net/browse/DX-710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97783
Commit-Queue: Zach Anderson <zra@google.com>
Auto-Submit: Ross Wang <rosswang@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-03-26 22:28:50 +00:00
Keerti Parthasarathy
57321c1590 Revert "[vm/kernel] Index all source and line starts before using them"
This reverts commit a7ab99dd84.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm/kernel] Index all source and line starts before using them
> 
> By indexing all sources in a concatenated dill file and then using that
> index to find the sources and line starts we can fix missing information
> (leading to crashes when collecting coverage) in for instance circular
> instances.
> 
> Change-Id: I454cff57f84f21de72f6486e1cecf15d1389a498
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96901
> Commit-Queue: Jens Johansen <jensj@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

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

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

Change-Id: Iea75c9dd56e74fa0e98c90ea6841ed66b39d40cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97941
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-03-26 22:13:10 +00:00
Alexander Markov
61f0f5bc43 [vm/bytecode] Declare members in bytecode
This change replaces kernel AST declarations of fields and functions
with bytecode declarations.

Size of dilp files is reduced by 11-12%.

Startup latency:
Time to the first full frame: 1.945s -> 1.687s
FinalizeClass: 554ms -> 277ms
FinishClassLoading: 296ms -> 156ms

There are following regressions in bytecode mode, which will be fixed
in future:

* dart:mirrors are not supported yet (implementation of mirrors relies
  on reading kernel AST in certain cases).

  As the result, lib_2/mirrors/* tests fail.

* native extensions are not supported yet (annotations on libraries
  and classes in AST are cleaned up as they could reference members
  which are now removed from AST).

  As the result, standalone_2/entrypoints_verification_test test fails.

* language_2/spread_collections/const_error_test/* tests fail
  due to https://github.com/dart-lang/sdk/issues/36286.

Change-Id: I5130f401fd7b84038b136136e7ccc1a6e51b6cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97561
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-26 21:40:10 +00:00
Ben Konyi
432e5faeda [VM / Service] Update core library source loading to use resolved_url
Source URIs for the core libraries in kernel take the form of
`org-dartlang-sdk://'. Previously, we had to do some manual
modifications to the URI stored by script objects which pointed to core
library scripts as they were often replaced with `dart:*` of being an
actual URI. Now that we have resolved_uri() in Script, we can use this
method to get the `org-dartlang-sdk://` URI and avoid the brittle
hacking of URIs.

For example, the resolved URI for the 'dart:io' script is
`org-dartlang-sdk:///sdk/lib/io/io.dart`.

Change-Id: I8e9f590be8e4b50d1476fc06a5c3928e63bef3b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97660
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-26 01:56:15 +00:00
Stevie Strickland
8e0bb64bd1 [gardening] Mark reloaded files as other resources.
This way, they'll be copied to the output directory and
can be loaded appropriately by the reload test.

This fixes https://github.com/dart-lang/sdk/issues/35506.

Change-Id: Id297703679068ae674b93b6adf0015bb966a6e33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97512
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-03-25 18:18:51 +00:00
Matthew Dempsky
a0e0a7a150 [vm] Delete disallowed constructors/operators
This allows the compiler to emit better errors. It also allows the
compiler to detect when a class accidentally references its own
supposedly disallowed constructors/operators (e.g., see dartutils.cc).

Notably, this exposes a number of private member variables that are
unused, but some that are used only in certain build configurations.
It would arguably be better to only define the variables when they're
needed, but that's deferred to a subsequent CL.

Change-Id: I5d0e6697eebebc9321fae1ff49cc68caf557b903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97175
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-23 00:52:41 +00:00
Alexander Aprelev
59b8a9c4bb [vm] Free readonly header bit so it can be used for other uses.
This is reland of https://dart-review.googlesource.com/c/sdk/+/97340 rebased on top of removal of GraphMarked bit, which was not compatible with this ReadOnly->InVMIsolateHeap change(due to how write-pages are not covered by Contains check)

Change-Id: I34c6421afb4baeafa5a449787020dab9fa800d05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97545
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-03-22 23:46:51 +00:00
asiva
1bab46b06f [vm] Remove support for '-c', '--checked' flags and '--enable-checked-mode'
1. Remove support for the following flags '-c', '--checked' and '--enable-checked-mode'
2. Cleanup some of the tests and test scripts where these options were being passed.

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

Change-Id: I4d8aa0d14bd054cfba08d78a411a0df4fc829df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97550
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-22 17:08:56 +00:00
Liam Appelbe
c614b99ae1 [vm] Load kernel service from ABI versioned dill file
Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: I7122e8f0c8841be462e0fa0b28a75ef693d85d20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97260
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-22 16:14:16 +00:00
Alexander Aprelev
7e170b351d [vm] Add whitespace before parenthesis.
Follow-up to https://dart-review.googlesource.com/c/sdk/+/97560.

Change-Id: I83cc296238f33ec1c58994393c1b416976ff383a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97564
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-03-22 15:08:04 +00:00
Alexander Aprelev
2631fdf8cf [vm] Reclaim GraphMarked bit.
Use ObjectIdTable for object graph walk instead of tagging object by header bit.

Change-Id: I1e7f2e733253e714c680b7d459a4c4e1711448e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97560
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-03-22 14:47:05 +00:00
Kevin Moore
a447b36280 convert: remove private typedefs
Change-Id: Ie97da6a9347b6c3a96ae5854c8b7d6ba1be0dba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97354
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2019-03-22 14:27:25 +00:00
Stevie Strickland
81b984d735 [gardening] Fix up name detection in isolate tests.
This change addresses the test failures seen in
https://github.com/dart-lang/sdk/issues/36232.

Change-Id: I062669c07f4963291450b35a46fb73256505c706
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97220
Auto-Submit: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-03-22 09:24:33 +00:00
Ryan Macnak
298dacfef5 [vm] Avoid main thread compilation of implicit accessors.
Main thread compilations: 337 functions / 87.8 ms -> 111 functions / 45.5ms

Change-Id: I64ed6c2aca98c0b3849a9142d698a8a94ed418cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97405
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-03-21 20:18:32 +00:00
Régis Crelier
c403804d9c [vm/interpreter] Take arg desc into consideration when resolving call method in invoke field dispatchers.
Add regression test.
This fixes issue 36084.
Issue 36293 filed against ddc, which fails on the new test.

Change-Id: I1112572d72671fbc1d78a768ee85affff41951a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97142
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-03-21 18:51:22 +00:00
Liam Appelbe
9622562482 Make _cancelWakeup a no-op if _sendPort is null
This seems to fix the issue, but it's a flaky crash so it's hard to 100% verify.

Bug: https://github.com/dart-lang/sdk/issues/33838
Bug: https://github.com/flutter/devtools/issues/337
Change-Id: Ic037a94cfb9fe7da319d7d4b20e3a3efd0c7289f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97541
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-03-21 18:15:27 +00:00
Alexander Markov
8f827aef4f [vm/bytecode] Recognize identical() in bytecode flow graph builder
This optimization is performed in AST-based flow graph builder and
it is needed for optimizer to constant fold certain things
(e.g. testing endianness in typed data getters).

Replicating it in bytecode flow graph builder to keep parity with
AST-based flow graph builder.

Bug: FL-203.
Change-Id: Id28bcccc75c5d5184801574dbe10b74b86711d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97400
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-03-21 18:07:47 +00:00
Martin Kustermann
cabaa78cc5 [VM] Generalize generic bounds check elimination
When eliminating bounds checks using loop information the length of
GenericBoundsCheckInstr is directly compared to the loop bound.

Instead we should compare the original definitions, ignoring any
boxing/unboxing. This allows the elimination of more bounds checks.

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

Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try, vm-dartkb-linux-debug-x64-try, vm-dartkb-linux-release-x64-try, vm-kernel-asan-linux-release-x64-try, vm-kernel-checked-linux-release-x64-try, vm-kernel-linux-debug-ia32-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-debug-x64-try, vm-kernel-linux-product-x64-try, vm-kernel-linux-release-ia32-try, vm-kernel-linux-release-simarm-try, vm-kernel-linux-release-simarm64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-linux-release-x64-try, vm-kernel-optcounter-threshold-linux-release-ia32-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try, vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-obfuscate-linux-release-x64-try, vm-kernel-precomp-win-release-simarm64-try, vm-kernel-precomp-win-release-x64-try, vm-kernel-reload-linux-debug-x64-try, vm-kernel-reload-linux-release-x64-try, vm-kernel-reload-rollback-linux-debug-x64-try, vm-kernel-reload-rollback-linux-release-x64-try, vm-kernel-win-debug-ia32-try, vm-kernel-win-debug-x64-try, vm-kernel-win-product-x64-try, vm-kernel-win-release-ia32-try, vm-kernel-win-release-x64-try
Change-Id: Ie10880f833f3b55d0804a03c4be9bd9d1ad52f66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97331
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-21 14:29:08 +00:00
Martin Kustermann
16eefa4b75 [VM] Infer ranges for truncating divisions with positive divisor & Fix missing deopt env bug
The truncating division can deopt if divisor is 0, so we have to inform
the compiler that we need a deoptimization environment.

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

Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try, vm-dartkb-linux-debug-x64-try, vm-dartkb-linux-release-x64-try, vm-kernel-asan-linux-release-x64-try, vm-kernel-checked-linux-release-x64-try, vm-kernel-linux-debug-ia32-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-debug-x64-try, vm-kernel-linux-product-x64-try, vm-kernel-linux-release-ia32-try, vm-kernel-linux-release-simarm-try, vm-kernel-linux-release-simarm64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-linux-release-x64-try, vm-kernel-optcounter-threshold-linux-release-ia32-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try, vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-obfuscate-linux-release-x64-try, vm-kernel-precomp-win-release-simarm64-try, vm-kernel-precomp-win-release-x64-try, vm-kernel-reload-linux-debug-x64-try, vm-kernel-reload-linux-release-x64-try, vm-kernel-reload-rollback-linux-debug-x64-try, vm-kernel-reload-rollback-linux-release-x64-try, vm-kernel-win-debug-ia32-try, vm-kernel-win-debug-x64-try, vm-kernel-win-product-x64-try, vm-kernel-win-release-ia32-try, vm-kernel-win-release-x64-try
Change-Id: I10d52ca68198f20362008d4c1ad4a2736ac2d425
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97330
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-03-21 14:13:44 +00:00
Jens Johansen
a7ab99dd84 [vm/kernel] Index all source and line starts before using them
By indexing all sources in a concatenated dill file and then using that
index to find the sources and line starts we can fix missing information
(leading to crashes when collecting coverage) in for instance circular
instances.

Change-Id: I454cff57f84f21de72f6486e1cecf15d1389a498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96901
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-21 12:05:15 +00:00
Alexander Aprelev
34af8b95e5 Revert "[vm] Free readonly header bit so it can be used for other uses."
This reverts commit 59931e3340 as it
breaks jitk and optcounter bots.

Change-Id: If87ce52ac3d4015608436bfd7ee661ea1414dc7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97480
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-03-21 06:23:50 +00:00
Alexander Aprelev
59931e3340 [vm] Free readonly header bit so it can be used for other uses.
Rely on vm_isolate()->heap()->Contains() instead of header bit check.

Change-Id: Ibf66b9910aea5003dd3dee539704deeb72c61ada
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97340
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-21 00:02:56 +00:00
Aart Bik
e3d6fc974f [dart/vm] fix off-by-a-lot error in DAG test
Rationale:
The constant evaluator deals with two sorts of
offsets, the true offset into the kernel data,
and the offset of a constant relative to the
start of the constant table (compensated for a
variable-size int prefix at the true base).
The DAG test was comparing the latter against
the former (which was always true, since the
true offsets are much larger). This fixes
this omission.

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

Change-Id: I71f37bfb2bd3432e52d5086e89a62115f0cacacd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97421
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-03-20 23:15:46 +00:00
Alexander Markov
973a4d0b2e [vm] Drop 'testonly = true' from gen_kernel_bytecode_dill GN rule
Since https://dart-review.googlesource.com/c/sdk/+/96540
dart_kernel_platform_cc depends on gen_kernel_bytecode_dill, so
gen_kernel_bytecode_dill is no longer "testonly".

When trying to use latest Dart SDK in Fuchsia, fx set complains:

ERROR at //third_party/dart/runtime/bin/BUILD.gn:647:1: Test-only dependency not allowed.
source_set("dart_kernel_platform_cc") {
^--------------------------------------
//third_party/dart/runtime/bin:dart_kernel_platform_cc
which is NOT marked testonly can't depend on
//third_party/dart/runtime/bin:gen_kernel_bytecode_dill
which is marked testonly. Only targets with "testonly = true"
can depend on other test-only targets.

Change-Id: Ibbf44f1edee690a8c4ccba714f55aa11a7020b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97440
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-03-20 22:30:45 +00:00
Zichang Guo
b10ac42527 [VM] Parentenvironment for Macos and Android
Follwed by https://dart-review.googlesource.com/c/sdk/+/96147. Macos and andriod
also have the same problem.

Bug: https://github.com/dart-lang/sdk/issues/36132
Change-Id: I455e806c082b6eeb7abb25b99fe20e9d11b1a486
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97403
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-03-20 21:29:03 +00:00
Zichang Guo
9f00d1b384 [VM] Ensure Top level class is finalized for loadedscripts in library
The breakpoints sent from IDE will be checked with existing scripts.
Because the loadedscripts() doesn't contain the scripts info for part/part of.
Then the breakpoint will be considerred as a latent breakpoint and didn't get
resolved later. The solution is to finalize the toplevel class before loadedscripts()
uses Dictionary iterator.

Bug: https://github.com/dart-lang/sdk/issues/35859
Change-Id: I90b67ee9e9e6afe2556ca806cdd87eb5661304a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97402
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-03-20 20:52:53 +00:00
Régis Crelier
137171af71 [VM runtime] Disable dual mapping code in AOT runtime (fixes #36260).
Change-Id: I16058ab405536d94aafc169e6494c0a841fce3dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97347
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-20 19:23:38 +00:00
Samir Jindel
d14dfc5d8a [vm] Support FFI on ARM64 and Android.
Change-Id: I33f3fb1dbf5a4aee4eaea08d0ca51b60114c8680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97109
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-03-20 17:45:23 +00:00
Samir Jindel
b032f1b284 [vm] Support FFI on 32-bit Intel.
Change-Id: I08acf6ef00e899f95dbaf2de36f1aea5e6e7ea3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97108
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-03-20 17:45:23 +00:00
Ryan Macnak
a2d7227a76 [vm] Never give DBC instructions executable permissions.
Bug: https://github.com/flutter/flutter/issues/29022
Change-Id: I8f264ffca79d7684643d74033e2cd79f2b2f35a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97275
Reviewed-by: Régis Crelier <regis@google.com>
2019-03-20 16:13:55 +00:00
Samir Jindel
5e9df35a57 [vm/ffi] Correctly sign- or zero-extend arguments and return values from native code.
Bugs fixed: dartbug.com/36122

Change-Id: Id64429b8e808356ab19b96ef6faf48577ae962db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96946
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-03-20 13:27:25 +00:00
Martin Kustermann
def9671d32 [VM/SIMDBC] Add simdbc64 bytecodes to allow LoadIndexed/StoreIndexed to work on untagged arrays
Issue https://github.com/dart-lang/sdk/issues/35154

Change-Id: I86db977ce6c618fbbff6186cd75c8dc84546f6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97302
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-20 11:23:35 +00:00
Jens Johansen
58882ffdd4 VM reads import uri if kernel binary version >= 22
This CL also includes a service test for setting
a breakpoint in a part file from a package.

Fixes #35859.

Change-Id: I0199006a87746dc1c27721ba0d51e502e76cb107
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97104
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-03-20 09:39:33 +00:00
Jens Johansen
e9e0daee5c Add importUri and fileUri to Source.
This will enable the VM to map URIs to package-URIs to solve problems
such as https://github.com/dart-lang/sdk/issues/35859

Change-Id: I15520325a5b81a99a7e3f56c2e35fd775d9da946
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96905
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-03-20 08:44:33 +00:00
Ryan Macnak
565e56dba6 [vm] Reduce cost of allocation tracing.
Remove separate table for predefined classes. The original allocation stats CL had this separate to allow directly embedding the table address into code, but we no longer embed addresses to support AppAOT and AppJIT.

Change-Id: Ida3d0764ac8ff179c0541ee73a3283c9c50affab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97286
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-19 22:46:59 +00:00
Liam Appelbe
89f00ab25f Add a build rule for bytecode version of kernel_service.dill
Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: Ifc95ff270c33cce13699bda23c1b7c8fb6139e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96835
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-19 21:29:29 +00:00
Ryan Macnak
fadf9b5fb3 [vm] Account for direct code calls from unoptimized code for --reused_instructions.
For example, constructors directly reference an allocation stub.

Change-Id: I5779c476c7721d2cc4b6ceb9348a1ffeaa5e082d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97272
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-19 21:28:19 +00:00