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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>