Fuchsia OS is making a change in the serving sequence for component
startup, to avoid a race condition in which clients attempt to connect
to services that are not yet exposed but will be.
This change is needed for a smooth transition to that new API. The
Fuchsia SDK change has already rolled to Dart.
See: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=50758
Change-Id: Ib1249dcf771e99f542343328918ae55497ddaf71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
This allows the program to get at the singleton component context
for the currently running component. The component context can
be meaningfully instantiated only once; and since dart doesn't
have a predefined way to wire platform-specific values into
platform-specific code, we instantiate a singleton here, so all
code that is interested can use it.
The users of this functionality will be the dart and flutter
fuchsia runners. See issue
https://github.com/dart-lang/sdk/issues/41523 for details.
Tested:
manual compile for fuchsia, check behavior.
Change-Id: Ib4e15af376ecb932c2d2b28d6f099383d53ccc84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136524
Commit-Queue: Filip Filmar <fmil@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit 898b080d09.
Reason for revert: Seems to cause crashes in g3, see b/153524644.
Original change's description:
> Reland "[vm, gc] Parallel scavenge."
>
> Remove header access from typed data case in RawObject::HeapSizeFromClass.
>
> Address data race between visiting remembered cards and allocating new large pages for promotion.
>
> Change-Id: I92cc4604ed38ab8f42b87b140a26a8118e7030d4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142565
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
TBR=kustermann@google.com,aam@google.com,rmacnak@google.com,asiva@google.com
Change-Id: I3ef7bd5c3d0ca575f33cf5f712f58476037d2d90
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142861
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Remove header access from typed data case in RawObject::HeapSizeFromClass.
Address data race between visiting remembered cards and allocating new large pages for promotion.
Change-Id: I92cc4604ed38ab8f42b87b140a26a8118e7030d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142565
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This reverts commit 9209f522d6.
Reason for revert: Flaky analyzer crashes
Original change's description:
> [vm, gc] Parallel scavenge.
>
> Run N tasks that compete to copy or promote survivors. Installation of the forwarding pointer uses a CAS.
> Tasks do not share the list of copied objects to be processed.
> Tasks do share the list of promoted objects to be processed.
> Divide the freelist in N copies. Each scavenger task uses one without locking. The sweeper inserts into the freelists round-robin.
>
> Change-Id: I54c7839ac5f15829462b3be7cf8c9635c01b785f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135962
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=kustermann@google.com,aam@google.com,rmacnak@google.com,asiva@google.com
Change-Id: I0d97b8d9148b2a81cabafde4602512e423eba223
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142554
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Run N tasks that compete to copy or promote survivors. Installation of the forwarding pointer uses a CAS.
Tasks do not share the list of copied objects to be processed.
Tasks do share the list of promoted objects to be processed.
Divide the freelist in N copies. Each scavenger task uses one without locking. The sweeper inserts into the freelists round-robin.
Change-Id: I54c7839ac5f15829462b3be7cf8c9635c01b785f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135962
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL fix an assertion inside Serializer::WriteInstructions
that was always failing in debug mode AOT 32-bit platforms
which used to happen when Utils::IsUint was called with a
signed type value was being passed.
It also fixes a bug that happens on some architectures that do not
support atomic unaligned load operations of 64-bit values.
Change-Id: Ic26cdeabccb55fcda5257da00f13dc400fa37e9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136228
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This is a Dart-tailored implementation of the "row-displacement
dispatch table" technique for closed-world instance calls:
All interface targets in the program are grouped into selectors such
that all targets that could potentially be called from the same call
site have the same selector (currently just grouped by name).
Each selector is assigned a selector offset such that offset + classid
is unique for all selector/classid combinations where the class
implements the selector.
At every instance call site that has an interface target (i.e. where
the static type of the receiver is not dynamic), the selector offset +
receiver classid is computed and used as index into a global table of
entry points.
If the receiver can be null (as determined by the front-end TFA and the
VM type propagation), a null check is inserted before the call.
An arguments descriptor is provided (only) for selectors that need it
(those which have type parameters or optional/named parameters).
The dispatch table calls don't need the monomorphic entry code, so for
functions that are only called via dispatch table calls (i.e. never
called dynamically), the monomorphic entry code is left out.
Some future improvements to the table dispatch implementation are
mentioned in https://github.com/dart-lang/sdk/issues/40188
The table dispatch flag is disabled by default in this commit. A
separate commit enables the flag.
Change-Id: Ic2911742b4a2c9a8d3bc7df60605454cbe4c0714
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126648
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This reverts commit 9eb531bde4.
Reason for revert: Bots are red. Some tests are failing.
https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-obfuscate-linux-release-x64/6039https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-android-release-arm_x64/957
Original change's description:
> [vm] Add support for real unboxed floating point fields in AOT
>
> Non-nullable floating point fields (double, Float32x4, Float64x2)
> are fully unboxed in their classes.
>
> A bitmap for each class was added to the shared class table in order to keep
> track of the pointers of the classes. Since all classes in Flutter Gallery
> have less than 64 fields, the bitmap is represented by a 64 bit integer and
> fields whose offset is more than 64 words are not unboxed.
>
> The instance sizes and field offsets might change between target and host
> in cross-compilation, since the number of words used to store unboxed fields
> may differ.
>
> dart-aot Xeon
>
> SplayLatency -4.62%
> SplayHarderLatency -4.17%
> NavierStokes -2.20%
> Tracer 8.72%
> ParticleSystemPaint 2.90%
> NBodySIMD 8.35%
> NBody 25.59%
>
> With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:
>
> flutter arm-v8:
>
> gallery total size: -1%
>
> matrix_utils_transform_rect_perspective -16.70% (less is better)
> matrix_utils_transform_rect_affine -31.82% (less is better)
> matrix_utils_transform_point_perspective -24.90% (less is better)
> matrix_utils_transform_point_affine) -27.26% (less is better)
> rrect_contains_bench -4.719% (less is better)
>
> Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
> Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>
TBR=kustermann@google.com,rmacnak@google.com,sjindel@google.com,victoragnez@google.com
Change-Id: Ic73858f6adb7f55c4129d4f46ff4731b378cb634
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134020
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
Non-nullable floating point fields (double, Float32x4, Float64x2)
are fully unboxed in their classes.
A bitmap for each class was added to the shared class table in order to keep
track of the pointers of the classes. Since all classes in Flutter Gallery
have less than 64 fields, the bitmap is represented by a 64 bit integer and
fields whose offset is more than 64 words are not unboxed.
The instance sizes and field offsets might change between target and host
in cross-compilation, since the number of words used to store unboxed fields
may differ.
dart-aot Xeon
SplayLatency -4.62%
SplayHarderLatency -4.17%
NavierStokes -2.20%
Tracer 8.72%
ParticleSystemPaint 2.90%
NBodySIMD 8.35%
NBody 25.59%
With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:
flutter arm-v8:
gallery total size: -1%
matrix_utils_transform_rect_perspective -16.70% (less is better)
matrix_utils_transform_rect_affine -31.82% (less is better)
matrix_utils_transform_point_perspective -24.90% (less is better)
matrix_utils_transform_point_affine) -27.26% (less is better)
rrect_contains_bench -4.719% (less is better)
Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
This reverts commit 5f81efb4a3.
Reason for revert: 3xH bot is green again.
Original change's description:
> Revert "[vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object."
>
> This reverts commit ab2026af45.
>
> Reason for revert: Flutter 3xH is broken on Golem.
>
> Original change's description:
> > [vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object.
> >
> > Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
> > Flutter Gallery ARMv7: -0.7% total, -1.2% instructions
> >
> > There are some performance regressions, in four categories:
> >
> > 1. Arithmetic on num types (e.g. MinLib, MaxLib):
> > We believe arithmetic on num types is rare in practice, and can be optimized later
> > by specializing the call-sites.
> >
> > 2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
> > These (and similar benchmarks) are written in a very untyped style, which is not
> > representative of Dart 2 style. We've confirmed that the regressions disappear if
> > the benchmarks are annotated with appropriate types.
> >
> > 3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
> > DeltaBlue uses string interpolation in one place, so the toString() method in the
> > string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
> > string interpolation is used much more frequently and with different types, so it's very
> > unlikely that this call would be monomorphic. When string interpolation is removed, there's
> > a remaining 1.3% regression on DeltaBlue which is not yet accounted for.
> >
> > 4. Noisy benchmarks
> > The remaining regressions are on benchmarks which show frequent jitter historically.
> >
> > There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
> > many of them, look at the graphs).
> >
> > For the reasons above, we believe the regressions justified by the code size improvement.
> >
> > Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
> > Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
> > Commit-Queue: Samir Jindel <sjindel@google.com>
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
> > Reviewed-by: Martin Kustermann <kustermann@google.com>
>
> TBR=kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,sjindel@google.com
>
> Change-Id: I411aae4b230f2a08146ad3bf3e7a10aa6592db0e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131660
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>
TBR=kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,sjindel@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I36e4e9d598033fcc934c2cdf5b061aa11255d3b2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131837
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
This reverts commit ab2026af45.
Reason for revert: Flutter 3xH is broken on Golem.
Original change's description:
> [vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object.
>
> Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
> Flutter Gallery ARMv7: -0.7% total, -1.2% instructions
>
> There are some performance regressions, in four categories:
>
> 1. Arithmetic on num types (e.g. MinLib, MaxLib):
> We believe arithmetic on num types is rare in practice, and can be optimized later
> by specializing the call-sites.
>
> 2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
> These (and similar benchmarks) are written in a very untyped style, which is not
> representative of Dart 2 style. We've confirmed that the regressions disappear if
> the benchmarks are annotated with appropriate types.
>
> 3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
> DeltaBlue uses string interpolation in one place, so the toString() method in the
> string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
> string interpolation is used much more frequently and with different types, so it's very
> unlikely that this call would be monomorphic. When string interpolation is removed, there's
> a remaining 1.3% regression on DeltaBlue which is not yet accounted for.
>
> 4. Noisy benchmarks
> The remaining regressions are on benchmarks which show frequent jitter historically.
>
> There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
> many of them, look at the graphs).
>
> For the reasons above, we believe the regressions justified by the code size improvement.
>
> Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
> Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,sjindel@google.com
Change-Id: I411aae4b230f2a08146ad3bf3e7a10aa6592db0e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131660
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
Flutter Gallery ARMv7: -0.7% total, -1.2% instructions
There are some performance regressions, in four categories:
1. Arithmetic on num types (e.g. MinLib, MaxLib):
We believe arithmetic on num types is rare in practice, and can be optimized later
by specializing the call-sites.
2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
These (and similar benchmarks) are written in a very untyped style, which is not
representative of Dart 2 style. We've confirmed that the regressions disappear if
the benchmarks are annotated with appropriate types.
3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
DeltaBlue uses string interpolation in one place, so the toString() method in the
string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
string interpolation is used much more frequently and with different types, so it's very
unlikely that this call would be monomorphic. When string interpolation is removed, there's
a remaining 1.3% regression on DeltaBlue which is not yet accounted for.
4. Noisy benchmarks
The remaining regressions are on benchmarks which show frequent jitter historically.
There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
many of them, look at the graphs).
For the reasons above, we believe the regressions justified by the code size improvement.
Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Removes an unnecessary change to the names of type testing stubs that
allowed name collisions to happen.
Old commit message:
The flag can be used when creating AOT snapshots. The resulting file can be
used with package:vm/dwarf/convert.dart to convert DWARF-based stack traces
to stack traces with function, file, and line number information.
Currently the saved file will be an ELF file with DWARF debugging information,
but this is subject to change in the future. To avoid being affected by any
changes in format, read the DWARF information from the file using
Dwarf.fromFile() in package:vm/dwarf/dwarf.dart.
Also adds --dwarf-stack-traces to the VM global flag list, so its value at
compilation will be read out of snapshots by the precompiled runtime.
Fixes https://github.com/dart-lang/sdk/issues/39512, which was due to
a missing compiler::target:: prefix for Instructions::HeaderSize() in
BlobImageWriter::WriteText().
Exposes the information suggested in
https://github.com/dart-lang/sdk/issues/39490 so that package:vm/dwarf
can appropriately convert absolute PC addresses to the correct virtual
address for a given DWARF line number program.
Bug: https://github.com/dart-lang/sdk/issues/35851
Change-Id: I6723449dceb0b89c054a1f1e70e7acd7749baf14
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128730
Reviewed-by: Martin Kustermann <kustermann@google.com>
REASON: the first commit in the chain contains a change that breaks internal
Flutter roll due to duplicated symbols for type testing stubs in assembly
snapshots.
Revert "[vm/compiler] Add --save-debugging-info flag to gen_snapshot."
This reverts commit c2b6c2e1db.
Revert "[vm] De-obfuscate function and file names in DWARF sections."
This reverts commit 4b8fd3c412.
Revert "[vm] Add docs for DWARF stack traces and related tools/libraries."
This reverts commit 5543e5ceb8.
Revert "[vm] Weaken dwarf_stack_trace expected stack trace."
This reverts commit 5824d3ed53.
Change-Id: I95ecd16fe493f61ae761dabfdd91a6ec0c2f0ca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128776
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
The flag can be used when creating AOT snapshots. The resulting file can be
used with package:vm/dwarf/convert.dart to convert DWARF-based stack traces
to stack traces with function, file, and line number information.
Currently the saved file will be an ELF file with DWARF debugging information,
but this is subject to change in the future. To avoid being affected by any
changes in format, read the DWARF information from the file using
Dwarf.fromFile() in package:vm/dwarf/dwarf.dart.
Also adds --dwarf-stack-traces to the VM global flag list, so its value at
compilation will be read out of snapshots by the precompiled runtime.
Fixes https://github.com/dart-lang/sdk/issues/39512, which was due to
a missing compiler::target:: prefix for Instructions::HeaderSize() in
BlobImageWriter::WriteText().
Exposes the information suggested in
https://github.com/dart-lang/sdk/issues/39490 so that package:vm/dwarf
can appropriately convert absolute PC addresses to the correct virtual
address for a given DWARF line number program.
Bug: https://github.com/dart-lang/sdk/issues/35851
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I80d900fd9e5f1e2399ad3f2fd25c85131a7ea43c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121857
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Loading of appended snapshots used to try read the executable itself
via arg[0] which holds the "path" to the executable.
However, when the executable is being invoked via PATH the "path"
can be just the name of the executable with no actual path.
This would cause the file reading to fail to find the file and
therefore fail to read.
This in turn caused standalone executables to fail to run when invoked
via PATH.
Bug: https://github.com/dart-lang/sdk/issues/38912
Change-Id: I08501661441db90ce6cff96a9337a5770ec3524d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121853
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The function was broken on arm64 due to incorrect
mask calculation (based on the target ISA).
Change-Id: Ib5c26bf4c7b901ae27f2a0580c4f88b2b7952212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121709
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Rationale:
Useful in the future when compiler wants to constant fold
operations related to leading/trailing/counting (non)zeros.
https://github.com/dart-lang/sdk/issues/38346
Change-Id: I158aca125d3a15019af20ca7c2a516b74e4d84c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119920
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Rationale:
Useful to implement the simulator, but also useful
in the future when compiler wants to constant fold
operations related to bit reversal.
https://github.com/dart-lang/sdk/issues/38346
Change-Id: I2f09ba6b1897202b5c07a2cff771afd7bbc99495
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119703
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Fuchsia is about to turn on ShadowCallStack for ARM64. Once this is enabled, we need to treat R18 like a preserved register. Generated Dart has not accessed this register because it is reserved on iOS, and in the absence of Dart exceptions this would be sufficient for us to be ShadowCallStack compatible. However, our exception handling mechanism jumps past all the C++ frames between the Dart exit frame and Exceptions::JumpToFrame, skipping code that would pop from R18.
Add save/restore of R18 in the invocation stubs, and restore of R18 in the jump stub. The latter prevents the ShadowCallStack from overflowing for code that has lots of exceptions without a native call.
Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=37449
Change-Id: I2ce6e46624c8d72507e7afa7a44839b1f0def556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119481
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Also switch some CQ bots using blobs to ELF. Once all embedders have migrated, we will remove blobs
support entirely.
Change-Id: Ie5e8c1187ad6c1af362b5715daafd3641bc8cc0e
Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm-try,vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-android-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116620
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Currently this only supports functions that take and return numeric
types. Byte arrays, and callbacks will come later, in a separate
wrapper package.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I7bb82be83cbbb6062736b3e958f89d021f1af4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114586
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Adds support for:
AssertBoolean
InstanceCall
Also handles deserializing of TypeRefs and
serialization/deserialization of non-megamorphic
ICData.
Results from compiling hello world program:
* Early round trip:
* Contains unhandled instructions: 2469
* Failed during deserialization: 9
* Successful round trips: 1772
* Late round trip:
* Contains unhandled instructions: 2892
* Failed during deserialization: 11
* Successful round trips: 1268
Deserialization failure reasons:
* Early round trip:
* no handling for local functions: 9
* Late round trip:
* no handling for local functions: 6
* out of range index for pushed argument: 5
(see https://github.com/dart-lang/sdk/issues/38354)
Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I7a3731d4cc3df0bfa1e270adbdfc2faddd110af0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115219
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
How cmath is included changes whether the symbols are in the std:: namespace or not. This changes it back to how we have it everywhere in the codebase: math.h
Follow up of https://dart-review.googlesource.com/c/sdk/+/115707/
Change-Id: I383c1e9de0434d1367dfdb6302a8fb6db2c3062c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115920
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Rationale:
Mostly an AOT 64-bit improvement of DIV and MOV by constant
on X64_64. Also a few minor supporting optimizations
that were missed. With unit tests.
https://github.com/dart-lang/sdk/issues/37789
Change-Id: I2f12d6a24bbe983324521d7d4d778f20b34d18a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114901
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Now that MSVC 2013 is required (commit f4824d3), we can simply use C99
headers that are provided [1]. This means we can rely on <stdint.h> to
provide intXX_t and uintXX_t types, and <inttypes.h> to provide PRIxx
macros.
[1] https://devblogs.microsoft.com/cppblog/c99-library-support-in-visual-studio-2013/
Change-Id: I0cc707907f8aca05ae543188cc01e6c50d517f5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107839
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
It seems safe to assume that <math.h> works on all supported platforms
now.
Change-Id: Iffb6618f6035c8cc10657c55ccc3ca7cd5d9525c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107825
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Google has required MSVC 2013 since Q2 2015, and Chromium has required
MSVC 2015 since Dec 2016. It seems safe for Dart to assume MSVC 2013.
Change-Id: I2ad2549d70b0a96085aa96e90ef15ad4c7b7acb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107062
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Rationale:
Runtime dispatch on various target functions.
Also adds new target function (which found an
issue) and prepares Dart VM setup.
https://github.com/dart-lang/sdk/issues/36818
Change-Id: I80e2d567087b435404331e2539f2cda19cadb04e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100989
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Rationale:
Ensuring capacity computation was off by one (due to trailing '\0')
if the initial buffer size was zero. Granted, this can only happen
after a Steal(), but since API did not exclude reuse after this
operation, it is better to just handle this than crash.
https://github.com/dart-lang/sdk/issues/36818
Change-Id: I4e404c4361da03e24364280fb01a308fbf7ace6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100991
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.
This adds support for the following features:
* Interpreting patterns as Unicode patterns instead of
BMP patterns
* the dotAll flag (`/s`) for changing the behavior
of '.' to also match line terminators
* Escapes for character classes described by Unicode
property groups (e.g., \p{Greek} to match all Greek
characters, or \P{Greek} for all non-Greek characters).
The following TC39 proposals describe some of the added features:
* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes
These additional changes are included:
* Extends named capture group names to include the full
range of identifier characters supported by ECMAScript,
not just ASCII.
* Changing the RegExp interface to return RegExpMatch
objects, not Match objects, so that downcasting is
not necessary to use named capture groups from Dart
**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.
Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
This reverts commit 5ebb640a67.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> [vm] Finish adding support for ECMAScript 2018 features.
>
> This work pulls in v8 support for these features with
> appropriate changes for Dart and closes
> https://github.com/dart-lang/sdk/issues/34935.
>
> This adds support for the following features:
>
> * Interpreting patterns as Unicode patterns instead of
> BMP patterns
> * the dotAll flag (`/s`) for changing the behavior
> of '.' to also match line terminators
> * Escapes for character classes described by Unicode
> property groups (e.g., \p{Greek} to match all Greek
> characters, or \P{Greek} for all non-Greek characters).
>
> The following TC39 proposals describe some of the added features:
>
> * https://github.com/tc39/proposal-regexp-dotall-flag
> * https://github.com/tc39/proposal-regexp-unicode-property-escapes
>
> These additional changes are included:
>
> * Extends named capture group names to include the full
> range of identifier characters supported by ECMAScript,
> not just ASCII.
> * Changing the RegExp interface to return RegExpMatch
> objects, not Match objects, so that downcasting is
> not necessary to use named capture groups from Dart
>
> **Note**: The changes to the RegExp interface are a
> breaking change for implementers of the RegExp interface.
> Current users of the RegExp interface (i.e., code using Dart
> RegExp objects) will not be affected.
>
> Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
> Commit-Queue: Stevie Strickland <sstrickl@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=lrn@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sstrickl@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I1eda0fee4fd9e94df095944049833a67b07277e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100560
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.
This adds support for the following features:
* Interpreting patterns as Unicode patterns instead of
BMP patterns
* the dotAll flag (`/s`) for changing the behavior
of '.' to also match line terminators
* Escapes for character classes described by Unicode
property groups (e.g., \p{Greek} to match all Greek
characters, or \P{Greek} for all non-Greek characters).
The following TC39 proposals describe some of the added features:
* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes
These additional changes are included:
* Extends named capture group names to include the full
range of identifier characters supported by ECMAScript,
not just ASCII.
* Changing the RegExp interface to return RegExpMatch
objects, not Match objects, so that downcasting is
not necessary to use named capture groups from Dart
**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.
Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change some static_libraries to source_sets to make ODR violations link-time errors.
This is needed to enable (stop suppressing) -fvisibility=hidden in Fuchsia product builds.
Change-Id: I699cec8d4b516beab9cebf9db0a522a7ff99e004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99822
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Refactoring motivation: go/dart-simulated-ffi
* template Location and PairLocation with <dart::Register, dart::FpuRegister> or <dart::host::Register, dart::host::FpuRegister>
* move RegisterName and FpuRegisterName from assembler to constants
* move methods that are only implemented by Location and not HostLocation out of Location
Change-Id: Ie9aa2dae63380da0cbfb15eacc440537fbed48f8
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-precomp-win-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98845
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Since COMPILE_ASSERT was originally authored, we have moved to requiring C++11 support.
Change-Id: I8cd5f720d2350cb28d0363fbd9399c4f864d66d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99104
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@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>
Detect both at compile time and runtime for memfd_create support and disable
dual code mapping if not available.
Change-Id: I6908e6c116a60218bb5002378470011dfe76a257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96845
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Internal builds in Google are catching this as an error.
I'm guarding it because I assume we might support building using other
compilers.
Change-Id: I665099cace9c6a40d737c471dd1b0fdb326fea39
Reviewed-on: https://dart-review.googlesource.com/c/91162
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
* Type arguments are moved to global object table (and de-duplicated).
* Finalize non-recursive generic types at bytecode generation time.
* Constants are moved to global object table (and de-duplicated).
* ICData creation is avoided for direct calls.
* Interface calls reference target member instead of selector name.
Size of a dilp files: 17868K => 15896K (-11%).
Change-Id: I0c9bf338137a0fae6ed90ab6b125ed2b24a1a8ad
Reviewed-on: https://dart-review.googlesource.com/c/91108
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
This includes both interpreted and compiled bytecode.
Change-Id: I6309ec4f0687f68caf6260cc57dacf94f027177d
Reviewed-on: https://dart-review.googlesource.com/c/84481
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Background compiler expects to see fully initialized array when it
reads RawICData::ic_data_ array - which previously was not
guaranteed on architectures with weak memory model.
Fixes https://github.com/dart-lang/sdk/issues/34999
Change-Id: Ie9544d7fc4683fb5cb145aa1a572e8939bd8dc13
Reviewed-on: https://dart-review.googlesource.com/c/82442
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
As the interpreter matures it will hopefully be merged into the regular
jit configuration, but for now we make a separate configuration for it.
Change-Id: Ie287ffccadbf34243d64d90ee43cf5d429966082
Reviewed-on: https://dart-review.googlesource.com/69420
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
When logical expression is evaluated in the control context (e.g. if (cond) { ... })
avoid materializing a boolean value and then dispatching on it. Instead connect
true and false successors directly to then and else branches.
This CL also improves IL generated when logical expression is evaluated for value
(e.g. x = (cond)): we similarly avoid materializing intermediate results and also
avoid comparisons that are not needed, e.g. when evaluating x = A && B we construct
graph x = A ? B : false, instead of x = A ? (B == true ? true : false) : false style
of graph.
Change-Id: I204d414cc6751949641b6c46423a6319f6e2d89b
Reviewed-on: https://dart-review.googlesource.com/67562
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Tighten some sequences in the write barrier stub.
Change-Id: Ib3657b9b582082137d17e86135200444172f428a
Reviewed-on: https://dart-review.googlesource.com/60820
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This fixes an issue when a program got loaded via dill, a function
with a try-catch got optimized and the exception/stacktrace variables
got captured.
Change-Id: Icb8ea5f3557080f8274f7db2af09e33154820e5b
Reviewed-on: https://dart-review.googlesource.com/55721
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit 23b4a505ec.
Reason for revert: The language_2/custom_await_stack_trace_test started failing.
Original change's description:
> Reland "[VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables"
>
> This fixes an issue when a program got loaded via dill, a function
> with a try-catch got optimized and the exception/stacktrace variables
> got captured.
>
> Change-Id: Icb626965019b248afe3b72a6679c5049ea7b7b00
> Reviewed-on: https://dart-review.googlesource.com/55681
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>
TBR=vegorov@google.com,kustermann@google.com
Change-Id: Ic825c1e3ed14c731da1d43aa6f27d37ed5d36b4c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/55720
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This fixes an issue when a program got loaded via dill, a function
with a try-catch got optimized and the exception/stacktrace variables
got captured.
Change-Id: Icb626965019b248afe3b72a6679c5049ea7b7b00
Reviewed-on: https://dart-review.googlesource.com/55681
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This reverts commit 3531af383e.
Reason for revert: Caused many buildbot failures.
Original change's description:
> [VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables
>
> This fixes an issue when a program got loaded via dill, a function
> with a try-catch got optimized.
>
> Change-Id: I98b2a4aaa7e5472f3e37fd71c1276079102b0142
> Reviewed-on: https://dart-review.googlesource.com/54021
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,kustermann@google.com
Change-Id: If4b80128525754d30cec680ad5ff6bc4035296bd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/55422
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This fixes an issue when a program got loaded via dill, a function
with a try-catch got optimized.
Change-Id: I98b2a4aaa7e5472f3e37fd71c1276079102b0142
Reviewed-on: https://dart-review.googlesource.com/54021
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Not fully working yet, only x64, no gc, no frame walking, etc...
Change-Id: I4d8357f6d46371bf21c3d54266cfe26163e3c8dc
Reviewed-on: https://dart-review.googlesource.com/50021
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Simplify by no longer using the signed unboxed int32 type on
64 bit platforms.
R=vegorov@google.com
Change-Id: Ic8eab7308f2ce01e5618344f50f72b95ce13a0dc
Reviewed-on: https://dart-review.googlesource.com/52762
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This change enables building a gen_snapshot that targets Fuchsia during
an SDK build that targets the host (Mac, Linux).
Change-Id: I4cfbcbe4e26e4be7108fc40c96122fe9a2fb4c19
Reviewed-on: https://dart-review.googlesource.com/48683
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Since the kernel reading helpers have been extended to not only work
with a kernel blob in C heap, but also work based on a [TypedData]
buffer in the VM heap, access to the [TypedData] buffer is on the hot
path now.
This hot path is slowing things down considerably, in particular due
to NoSafepoingScope's.
This CL removes a critical NoSafepoingScope when accessing the
[TypedData] in read-only mode. It also allows passing in the [Thread]
directly, to avoid TLS lookups.
Issue https://github.com/dart-lang/sdk/issues/32603
Change-Id: I91955bea5cd4eddbbd21c5d3bc6813504c2cece9
Reviewed-on: https://dart-review.googlesource.com/47222
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
(Strip out platform dill files and the kernel service dill file from a
product build)
After fixing the issue of using 'is_product' which is not present in the
flutter build environment.
Change-Id: I49dd68e63b1f6d7ac0981b28bf2b08618551ae2e
Reviewed-on: https://dart-review.googlesource.com/44024
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This reverts commit 92b5bf86a1.
Reason for revert: this breaks Flutter engine build because is_product is not defined.
Original change's description:
> Strip out platform dill files and the kernel service dill file from
> a product build.
> They only need to run a self contained '.dill' file as their application.
>
> Change-Id: I9a2566b9e552a7aef4ebf52c2ecb664088ad030c
> Reviewed-on: https://dart-review.googlesource.com/43497
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Chandra <sivachandra@google.com>
TBR=zra@google.com,sivachandra@google.com,asiva@google.com
Change-Id: Id55a3f749290813aba479cc705c6065b75a0ac9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/43980
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
a product build.
They only need to run a self contained '.dill' file as their application.
Change-Id: I9a2566b9e552a7aef4ebf52c2ecb664088ad030c
Reviewed-on: https://dart-review.googlesource.com/43497
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Chandra <sivachandra@google.com>
Be careful to free external data when reading or writing a message is interrupted, or releasing messaging without reading on shutdown.
Bug: https://github.com/dart-lang/sdk/issues/31959
Change-Id: Ia39acb9ca0e27cf9e8b83961741e5949b5930266
Reviewed-on: https://dart-review.googlesource.com/41561
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This CL corrects handling of overflows in range analysis to
account for wrap-around (which happens with new integer semantics).
* If there is an overflow while doing computations in range
analysis, the resulting range is approximated as full int64 range.
* For symbolic range boundaries 'symbol + offset', offset is checked
to stay within [kMinInt64 - kSmiMin, kMaxInt64 - kSmiMax] in order
to guarantee that overflow doesn't occur.
Issue: https://github.com/dart-lang/sdk/issues/31920
Change-Id: I2c16adbe3597e9b718ed2f6ce7210426fcc9e6a6
Reviewed-on: https://dart-review.googlesource.com/39423
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit 2d4c606e63.
The fix for the debug buildbot breakage now consists of skipping wide to utf8 conversion
altogether, instead move uri to path conversion directly into newly added File::OpenUri method.
Change-Id: Id3d7457d6a6b5045e5f38678548f4d7bed6d2c43
Reviewed-on: https://dart-review.googlesource.com/39801
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
This reverts commit d78a41e0ee.
Revert "Fix length for WideToUTF8 conversion in UriToPath"
This reverts commit 011e1cc1c5.
Change-Id: I36140426a474962f77605e1aed6ddfd158bd064a
Reviewed-on: https://dart-review.googlesource.com/39480
Reviewed-by: Alexander Aprelev <aam@google.com>
This reverts commit 12759870a4.
Reason for revert: Broke many bots.
Original change's description:
> [VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables
>
> This fixes an issue when a program got loaded via dill, a function
> with a try-catch got optimized and the exception/stacktrace variables
> got captured.
>
> Change-Id: Ia6b62f2a0986c78b90afe7fae25025ca4e5b09db
> Reviewed-on: https://dart-review.googlesource.com/35182
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,kustermann@google.com
Change-Id: I2ec7b4bea401e6d5665f6e789eb8e241b99db7b3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/36200
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This fixes an issue when a program got loaded via dill, a function
with a try-catch got optimized and the exception/stacktrace variables
got captured.
Change-Id: Ia6b62f2a0986c78b90afe7fae25025ca4e5b09db
Reviewed-on: https://dart-review.googlesource.com/35182
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit adf04d0ac6.
The original change used macros from stdint.h and it failed build on
the linux sdk bot:
https://uberchromegw.corp.google.com/i/client.dart/builders/dart-sdk-linux-be/builds/17348
In the newer version, constants from runtime/platform/globals.h are used
instead of the macros from stdint.h. Constants for int8 have been added as
they were not present already.
Change-Id: Ia4f27613fa5dca2cd6dbfeb37715ea70a85cec95
Reviewed-on: https://dart-review.googlesource.com/25083
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
This fixes some incorrect asserts that were breaking the debug bots.
The original revision is available in Patchset 1.
This reverts commit 26735519cb.
Bug:
Change-Id: Ifa599b7bff752dec4c505e10fd6db206e1abd977
Reviewed-on: https://dart-review.googlesource.com/23820
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
This reverts commit f13f772bb2.
Reason for revert: dartk(p)-strong debug mode is completely broken
because we convert int values non-representable as Smi to Smi, which
triggers that assert. The code that does tagging checks that
Untag(Tag(x)) == x, however for our purposes this identity does not
need to hold because we only care about lower bits and ignore the sign.
Reverting to restore green-ness of DEBUG builds.
TBR=sjindel@google.com
Bug:
Change-Id: Id436cbe000d6dec8db3469070ed531327cc82d89
Reviewed-on: https://dart-review.googlesource.com/23661
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
R=vegorov@google.com
This removes the IA32 disassembler and uses the X64 disassembler for
both variants. Instructions that were in the IA32 assembler, but not
supported by the X64 disassembler have been added. It also adds some
regression tests for a lot of the disassembler output.
Bug:
Change-Id: I243abbb04c3a77810ce96ca74f7f42a5a1aea0cf
Reviewed-on: https://dart-review.googlesource.com/22982
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
The revision begins the implementation of:
https://docs.google.com/document/d/1KK8b6kzr0pQev5YNftSZhN3M6I8HcvOJwJ6U-cW4nfw/edit?ts=5a05b3e9#heading=h.7j21arix8p2
* The ArgumentsDescriptor is updated to hold a bitvector for positional arguments.
* The kernel flowgraph builder is updated to calculate the appropriate bits from
the interface target and pass them through the ArgumentsDescriptor
for regular MethodInvocations.
Bug:
Change-Id: I1cd9f43f697df1dd4f36103bbdfc0ba000125c02
Reviewed-on: https://dart-review.googlesource.com/21541
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
R=rmacnak@google.com
Also some minor cleanup in the way we encode ARM instructions.
I'll be needing these for 32 bit Smis on ARM64.
Bug:
Change-Id: I5f515590375a2c6ad11bc6f1a80a4f8e27cd82b4
Reviewed-on: https://dart-review.googlesource.com/20668
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Add missing rename of CountOneBits in ARM assembler.
Change-Id: I735da06343248573a1b049109ebc2bf0d1634960
Reviewed-on: https://dart-review.googlesource.com/18504
Reviewed-by: Zach Anderson <zra@google.com>
This is a baby-step towards building an SDK targeting the host arch
during a cross-build. This will require a similar update to the use
of dart_config in the Flutter engine at //flutter/lib/io/BUILD.gn:19.
Change-Id: I8b871cceb53038cab8407264664c5ce545e6e010
Reviewed-on: https://dart-review.googlesource.com/17523
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This CL restores disassembler in precompiled mode after it was removed
in 8cb752f73b.
Without disassembler observatory is not able to show assembly code
in 'flutter run --profile' mode.
This CL also pulls BufferFormatter out of il_printer.h/.cc as it is also
used in disassembler.
Change-Id: I098ddb8d8f5a2426028c1f467d58e5c2d6a82d21
Reviewed-on: https://dart-review.googlesource.com/7486
Reviewed-by: Zach Anderson <zra@google.com>
Avoids string copies in C++ and map copies in Dart.
Also remove some vestiages of removed feature that allowed an embedder to add pre-encoded events to the timeline.
Change-Id: I962a67093ba461c991d9169b0391c44af1d489db
Bug: https://github.com/dart-lang/sdk/issues/30787
Reviewed-on: https://dart-review.googlesource.com/6762
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reapply 3d4838fc70 with the following
modifications:
* define PRIX64 to fix compilation errors on Windows;
* add and use short form format specifiers PX and PX64 to make it
uniform with other format specifiers.
Original review: https://codereview.chromium.org/2987183002
Description of the original CL:
Until this change, implementation of Dart_IntegerToHexCString()
always created Bigint objects and used Bigint::ToHexCString() to do
the work.
In --limit-ints-to-64-bits mode (with Dart integers limited to 64
bits) Bigints are banned and should not be used.
This CL revises Dart_IntegerToHexCString implementation to avoid
creating Bigint objects for Smi and Mint arguments, so it would
work in --limit-ints-to-64-bits mode.
Also, this CL adds test case to lock down the behavior of
Dart_IntegerToHexCString.
R=zra@google.com
Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2985423002 .
This changeset revises --limit-ints-to-64-bits option to
change range of integers from unlimited to int64.
On overflow, integer arithmetic operations silently wrap around and
discard extra bits. No Bigints are allocated in case of overflow.
This changeset is the 1st part in the series of changes, it revises the implementation of integer arithmetic operations. More changes will follow.
R=regis@google.com, zra@google.com
Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2974633003 .
This moves the hash code into the header word for strings on 64 bit
platforms. With the old layout, 9 character strings became 48-byte
objects. With the new layout you have to go to 17 characters before
you are bumped from 4 to 6 words (32 to 48 bytes).
As a side effect, the class ID field is now 16 bits on all platforms
instead of having two different sizes, and the size field is 8 bits
on all platforms.
This also paves the way for moving the hash code for instance objects
into the header, so we won't need the side-lookup in the
hash-table-of-hash-codes on 64 bit platforms.
This is a reapplication of https://codereview.chromium.org/2893553002/
after issues were fixed in https://codereview.chromium.org/2888413002/
and https://codereview.chromium.org/2896583002/R=vegorov@google.com
BUG=
Review-Url: https://codereview.chromium.org/2895183002 .
This moves the hash code into the header word for strings on 64 bit
platforms. With the old layout, 9 character strings became 48-byte
objects. With the new layout you have to go to 17 characters before
you are bumped from 4 to 6 words (32 to 48 bytes).
As a side effect, the class ID field is now 16 bits on all platforms
instead of having two different sizes, and the size field is 8 bits
on all platforms.
This also paves the way for moving the hash code for instance objects
into the header, so we won't need the side-lookup in the
hash-table-of-hash-codes on 64 bit platforms.
R=vegorov@google.com
BUG=
Review-Url: https://codereview.chromium.org/2893553002 .
If an Isolate touches the 'stdio' getter, a _NativeSocket with
attached finalizer is created for it. Previously, when such an
Isolate exited, the finalizer would close the underlying
file descriptor. This CL changes the finalizer for stdin such
that the native objects will be cleaned up, but the underlying
file descriptor will not be closed. The underlying file
descriptor will now only be closed if the stdin stream
subscription is explicitly canceled.
Accessing the stdin getter after the stream is explicitly
canceled will result in a FileSystemException.
See also: https://github.com/dart-lang/test/issues/583fixes#29229R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2791423002 .
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.
Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.
R=zra@google.com
Review-Url: https://codereview.chromium.org/2750843003 .
The way runtime/platform/hashmap.h:HashMap was implemented so far did not allow
deleting elements while iterating over the map. If one iterated like this
HashMap::Entry* cursor = map.Start();
while (cursor != NULL) {
if (cond) {
map.Remove(cursor->key, cursor->hash);
}
cursor = map.Next(cursor);
}
Then the iteration `cursor` will skip elements. This is due to the fact that
`HashMap::Remove()` is left-rotating elements in certain cases and
`HashMap::Next()` will unconditionally advance to the next position in the
backing store.
PROBLEM IS: There was existing code which did remove elements while iterating
over a HashMap.
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2533303005 .
We have a racy read of the object header in the stack frame walker
called from the profiler (in this case the gc marker is running at
the same time).
It is appropriate to avoid this even though we think the access is
safe as the objects are in old space and never forwarded and only
the mark bits are manipulated while marking
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2517473002 .
libdart_vm_nosnapshot should not include dart_maybe_precompiled_runtime_config.
DART_NOSNAPSHOT and DART_PRECOMPILED_RUNTIME are mutually exclusive configurations
add a meaningful check in the globals.h to catch this instead of cryptic compile
time errors.
R=kustermann@google.com
BUG=
Review URL: https://codereview.chromium.org/2515663002 .
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER
This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2450713004 .
- use attribute 'no msan' on NativeEntry::ReturnValueIsError function
as msan doesn't seem to track the return slot being set by a native
function
- vsnprintf seems to have issues with msan so unpoison the allocated
memory buffer everytime vsnprintf is used to suppress the error.
BUG=
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2383293003 .
- Conditionally remove fields of Code, Function and ICData that are not used in the AOT runtime.
- Don't include RawClosureData.context_scope_ in AOT snapshots.
- Remove parameter names not needed for method resolution.
- Remove parameter types not needed for function type tests.
- Deduplicate parameter name and parameter type lists.
- Shrink and share the initial MegamorphicCache table.
Flutter gallery (IsolateSnapshotReader event)
snapshot size 2731129 -> 2199999 (-19.4%)
initial heap 7899568 -> 5433176 (-31.2%)
R=fschneider@google.com
Review URL: https://codereview.chromium.org/2326483005 .
This CL adds targets to the GN build that build the standalone Dart VM
without the observatory, and with dart:io enabled but with most of the
functionality stubbed out as UNIMPLEMENTED(). It also adds a simple
eventhandler for Fuchsia for implementing Timers.
R=asiva@google.com, johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2168193002 .
This adds a GN target for the 'fuchsia_test' executable and teaches
the GN build about is_fuchsia. Key differences:
*) There's not currently a dart:io implementation for Fuchsia
*) Fuchsia's toolchain currently doesn't support (or need) ldl or lpthread
*) Fuchsia's buildconfig doesn't currently set the is_asan variable
Review URL: https://codereview.chromium.org/2149953003 .
Previously if one marker marked the weak property and another marker marked its key then the first marker might stop marking before it sees that the key was marked.
Here is a possible concurrent execution, assuming P is a WeakProperty and K is P.key:
(Marker A) (Marker B)
| |
[ mark property P ] |
| |
[ drain marking stack ] |
[ no more work to do ] |
| [ mark K ]
| [ draing marking stack ]
| [ no more work to do ]
| |
| |
... ...
| |
[Finalize] [Finalize]
|
[Clear P]
In this execution we end up clearing P even though P.key is marked.
To fix this issue without reintroducing central WeakProperty processing
we change the marking phase loop in such a way that markers consider the
marking done only if all of them agree that they have no more weak properties
with marked keys.
Essentially the marking loop now has a separate phase where all markers check
their pending weak properties. The decision to proceed to the next marking phase
(weak handles processing) is done in lock step using barrier - either all threads
advance to the next stage or one of the threads finds a weak property
with marked key and unmarked value and all threads resume marking.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org/2041413005 .
Allow controlling the target ABI by defining TARGET_ABI_IOS or TARGET_ABI_EABI. If neither is defined, default to the previous behavior.
Make Linux, Mac, Android and iOS agree on the value of PreferredCodeAlignment for all architectures.
BUG=http://dartbug.com/26464R=zra@google.com
Review URL: https://codereview.chromium.org/1982613003 .
1. Add "dart_runtime_mode" GN argument. This is an enum with three valid values: "release", "profile", and "develop".
*) "release" builds product precompiled-runtime.
*) "profile" builds non-product precompiled-runtime.
*) "develop" builds non-product non-precompiled-runtime.
2. Remove the redundant "dart_product" GN argument.
3. Kill all *precompiled_runtime static library variants and the related config.
4. Always include the precompiler in gen_snapshot.
5. Support multiple --embedder_entry_points_manifest arguments to gen_snapshot.
6. Update our test harness to use gen_snapshot and pass the same kinds of command line arguments the Flutter folks are using.
7. ASSERT that both DART_PRECOMPILED_RUNTIME and DART_PRECOMPILER are not set at the same time.
R=fschneider@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/1903583002 .
This fixes some flaky failures and timeouts on Windows in tests where
an ASSERT fails.
This change requires Using OS::Abort in platform/assert.cc so that the
flag disabling tls destructors can be set.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1572913002 .