Commit graph

400 commits

Author SHA1 Message Date
Ryan Macnak 2d00818aef [dartfuzz] Don't try to use FFI on simriscv.
TEST=dartfuzz
Bug: https://github.com/dart-lang/sdk/issues/49472
Change-Id: Ib3dc89b969197a8d27c330dfbcd4029dbf9dd22e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251848
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-07-25 16:48:13 +00:00
Konstantin Shcheglov 4f787e4a09 Stop using DartType.displayName, regenerate.
Preparation for https://dart-review.googlesource.com/c/sdk/+/251783

Is this tool still used? I noticed that even when I re-generated
with a clean workspace, it still had a lot of changes.

Change-Id: I901ada1e6ad1d989b15882d9cf8ef83762fa8828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251784
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-07-19 23:50:24 +00:00
Ryan Macnak 89e43f0406 [dartfuzz] Regenerate type and API tables.
This picks up changes to the core libraries since the last time the tables were regenerated.

TEST=dartfuzz
Change-Id: I01a844a53835a9b6ab964f09e28733fc6ee995e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251846
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-07-18 21:22:56 +00:00
Daco Harkes a37502c1b8 [misc] Cleanup stale todos
TEST=tests/ffi

Change-Id: Iae97f62b1adb8dbe99ad075dfe750604db0de62c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249301
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-06-28 16:02:53 +00:00
Ahmed Ashour 85700570f6 Fix typos
Fixes #49241

TEST=ci

Change-Id: I6117bf816fc8c4613cce66927f952fef75632725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248120
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-15 11:08:28 +00:00
Nate Bosch 6ebd2633cd Use any deps for all unpublished packages
It should not be necessary to ever run `pub get` for a package which is
not published. All packages used in the SDK are controlled by a single
package config, so it's not necessary to declare versions or paths for
any packages.

Remove all dependency overrides.

R=devoncarew@google.com

Change-Id: Icb328813b471f35ee4c99995f4e90aac4d8ed438
Tested: Covered by existing static analysis.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244767
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2022-05-17 01:22:25 +00:00
Devon Carew 9f398fd728 move runtime/tools/wiki/xref_extractor to package:lints
Change-Id: Ifdf6419bf42baa4dc6df1b4e140e6239d379fe36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240916
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-19 15:39:57 +00:00
Devon Carew 8cc43aebcb Move runtime/tools/dartfuzz to package:lints.
Change-Id: I55cb7c3a832879202d9be225dcfdce3a12e25487
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241149
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-04-18 22:17:50 +00:00
Daco Harkes 5ca6eec782 [vm/ffi] Add Since annotations to dart:ffi
Closes: https://github.com/dart-lang/sdk/issues/48711

Change-Id: Iac0bcecdf81b02bcb2feb746aa94a1bef6caf600
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240045
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-04-12 11:06:21 +00:00
Ryan Macnak ea0c27523a [build] Extend bin_to_coff.py to support ARM and ARM64.
TEST=local
Bug: https://github.com/dart-lang/sdk/issues/47824
Change-Id: I9e15bb538e63ee16a2646c78fb786e135d1184ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240441
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-06 22:21:07 +00:00
Ryan Macnak a48d05c8f9 [vm] Add build-time option to use absl mutexes in place of pthread mutexes.
TEST=ci, cbuild
Bug: b/220994782
Change-Id: Id1a15d0d9fcef192847b25a2549730eb1014a99e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236760
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-03-10 23:48:05 +00:00
Konstantin Shcheglov 7039c5dc0c Replace using deprecated CompilationUnit.types with classes.
Change-Id: Ieb95799a0e0afa8d1d2da01e6050d675a2cb92e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235402
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-04 19:18:45 +00:00
Siva Annamalai 2e731c540a Revert "[tools] Replace the Chromium binary size tool, which no longer works."
This reverts commit e32d98cd06.

Reason for revert: Dart rolls into the engine are failing because there are references to run_binary_size_analysis in the "Upload artifacts android-arm64-release" step of the build

Original change's description:
> [tools] Replace the Chromium binary size tool, which no longer works.
>
> Change-Id: Id84717e21a129a392d3bc4e9b4cce84dfb4771e1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231066
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Change-Id: Ibfbdf1e0a970ad7fae9ec1d39d24722647b38730
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231600
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-02-04 02:11:06 +00:00
Ryan Macnak e32d98cd06 [tools] Replace the Chromium binary size tool, which no longer works.
Change-Id: Id84717e21a129a392d3bc4e9b4cce84dfb4771e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231066
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-02-02 17:22:38 +00:00
Ryan Macnak 04ba20aa98 [vm] Support RISC-V.
Implements a backend targeting RV32GC and RV64GC, based on Linux standardizing around GC. The assembler is written to make it easy to disable usage of C, but because the sizes of some instruction sequences are compile-time constants, an additional build configuration would need to be defined to make use of it.

The assembler and disassembler cover every RV32/64GC instruction. The simulator covers all instructions except accessing CSRs and the floating point state accessible through such, include accrued exceptions and dynamic rounding mode.

Quirks:
  - RISC-V is a compare-and-branch architecture, but some existing "architecture-independent" parts of the Dart compiler assume a condition code architecture. To avoid rewriting these parts, we use a peephole in the assembler to map to compare-and-branch. See Assembler::BranchIf. Luckily nothing depended on taking multiple branches on the same condition code set.
  - There are no hardware overflow checks, so we must use Hacker's Delight style software checks. Often these are very cheap: if the sign of one operand is known, a single branch is needed.
  - The ranges of RISC-V branches and jumps are such that we use 3 levels of generation for forward branches, instead of the 2 levels of near and far branches used on ARM[64]. Nearly all code is handled by the first two levels with 20-bits of range, with enormous regex matchers triggering the third level that uses aupic+jalr to get 32-bits of range.
  - For PC-relative calls in AOT, we always generate auipc+jalr pairs with 32-bits of range, so we never generate trampolines.
  - Only a subset of registers are available in some compressed instructions, so we assign the most popular uses to these registers. In particular, THR, TMP[2], CODE and PP. This has the effect of assigning CODE and PP to volatile registers in the C calling convention, whereas they are assigned preserved registers on the other architectures. As on ARM64, PP is untagged; this is so short indices can be accessed with a compressed instruction.
  - There are no push or pop instructions, so combining pushes and pops is preferred so we can update SP once.
  - The C calling convention has a strongly aligned stack, but unlike on ARM64 we don't need to use an alternate stack pointer. The author ensured language was added to the RISC-V psABI making the OS responsible for realigning the stack pointer for signal handlers, allowing Dart to leave the stack pointer misaligned from the C calling convention's point of view until a foreign call.
  - We don't bother with the link register tracking done on ARM[64]. Instead we make use of an alternate link register to avoid inline spilling in the write barrier.

Unimplemented:
 - non-trivial FFI cases
 - Compressed pointers - No intention to implement.
 - Unboxed SIMD - We might make use of the V extension registers when the V extension is ratified.
 - BigInt intrinsics

TEST=existing tests for IL level, new tests for assembler/disassembler/simulator
Bug: https://github.com/dart-lang/sdk/issues/38587
Bug: https://github.com/dart-lang/sdk/issues/48164
Change-Id: I991d1df4be5bf55efec5371b767b332d37dfa3e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217289
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-01-20 00:57:57 +00:00
Alexander Markov bd555f2760 Cleanup remaining uses of --no-use-vfp option
This is the follow-up to https://dart-review.googlesource.com/c/sdk/+/223740
where --[no-]use-vfp option was removed.

TEST=ci

Change-Id: Id013d3395374b69cbc7f759bf2a39508aec77be0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225600
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-12-23 16:41:45 +00:00
Gabriel Terwesten 02549a8bce [vm/ffi] Optimize Pointer<T>.asTypedList()
This change refactors `_asExternalTypedData` into multiple functions,
which are data type specific, e.g `_asExternalTypedDataInt8`.
These functions are implemented as recognized methods.
Argument checks have previously been performed in the removed
runtime entry implementation of `_asExternalTypedData.` These are
now handled in Dart.

TEST=tests/ffi/external_typed_data_test.dart

Closes https://github.com/dart-lang/sdk/issues/39843

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

GitOrigin-RevId: 65763bddd06c633583b4adbf920c32c5a7a3720f
Change-Id: I703b350d89004ebe36e70eaa44dda1d9ebb050c7
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,app-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221360
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-11-29 17:38:04 +00:00
Konstantin Shcheglov 3f6815a9e6 Stop using getResolvedLibrary2 in dartfuzz.
Change-Id: I1023be7cc595398748a4862f3dc181b32466275a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218584
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-30 01:22:31 +00:00
Daco Harkes 757c2b82ce [vm/ffi] Add Bool
This CL adds the `Bool` `NativeType` with support for loading/storing
from `Pointer<Bool>`, `Array<Bool>`, and `Struct` and `Union` fields,
and support for passing booleans through FFI calls and callbacks.

The assumption is that `bool` is always treated as `uint8_t` in the
native ABIs. Including: (1) whether there can be garbage in the upper
bytes in CPU registers, (2) stack alignment, and (3) alignment in
compounds.

The conversion from `bool` to `uint8_t` is implemented as follows:
- bool to int: `value ? 1 : 0`
- int to bool: `value != 0`
The conversion is implemented in Dart in patch files for memory loads
and stores (pointer, array, and struct fields) and kernel_to_il for
FFI call and callback arguments and return value.

TEST=runtime/vm/compiler/ffi/native_type_vm_test.cc
TEST=tests/ffi/bool_test.dart
TEST=tests/ffi/function_callbacks_structs_by_value_generated_test.dart
TEST=tests/ffi/function_structs_by_value_generated_test.dart

Closes: https://github.com/dart-lang/sdk/issues/36855

Change-Id: I75d100340ba41771abfb41c598ca92066a89370b
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-ffi-android-debug-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-ffi-android-debug-arm64c-try,vm-kernel-mac-release-arm64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-android-release-arm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216900
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-10-18 10:44:11 +00:00
Robert Nystrom 3ac34f791d Change references to "dartfmt" in runtime and tools to "dart format".
In Dart 2.15, we're removing "dartfmt" in favor of "dart format", so I'm
going through and fixing all the dangling references to the old name.

TEST=Only changing tools

Change-Id: I83a5c00be925fdb536014a47dff2b488ed9f478b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215186
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-10-01 18:16:27 +00:00
Robert Nystrom d1383452cc Change "dartfmt" to "dart format" in FFI tools.
Change-Id: I9fe047c79ec79728f26184ee2cf69c7776099568
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215185
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-10-01 05:56:55 +00:00
Alexander Markov 72ff129797 [vm/dartfuzz] Handle StackOverflowError similarly to OutOfMemoryError
Fixes https://github.com/dart-lang/sdk/issues/47295

Change-Id: I5bd46069aa3d8cb49c9df0a53f1da136019661af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214740
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-09-27 21:34:53 +00:00
Alexander Thomas 637fb323d9 [vm] Use UTF-8 to read files in *_layering_check.py
Some files in runtime/ are UTF-8 encoded, e.g.:
runtime/vm/unicode_test.cc

Change-Id: Ie71fd46fb66fe793742dbf8a6645b8402956ab77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214381
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-24 09:50:27 +00:00
Alexander Aprelev d46f474d79 [dartfuzz] Fix time units in 'Isolate busy' message
Change-Id: I3d14763a2607ef47a51883a2acaf7545e63358ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213964
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-09-20 22:04:15 +00:00
Ryan Macnak 5ac413a05f [dartfuzz] Avoid more compile-time errors.
Avoid `throw null`.
Avoid `map[key] += value`.

Split printing globals into separate statements to make reducing failures easier.

TEST=dartfuzz
Change-Id: I8e2172827439a16c42546df23c7669decff53fa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208481
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-08-31 23:11:26 +00:00
Ryan Macnak 7b0b8658d8 [dartfuzz] Revert change to dartfuzz_test that made a compile-time error in both runs count as a divergence.
This partially reverts 1ce169d940.

Change-Id: I2d7e6ea442d9d81a9b3b892359db24f0dc48a81f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208360
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-07-29 16:33:39 +00:00
Konstantin Shcheglov a9618ac795 Make ResolvedLibraryResult.element/units non-nullable.
Change-Id: Ie20c2363b43555573843c038c15c0d55bcf39579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206563
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-12 20:48:37 +00:00
Ryan Macnak 77487355b7 [graphexplorer] Support Dart heap snapshot format and merged dominators.
Change-Id: I492b7662054c64030d36aba2e236aea4127101ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205200
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-07-07 15:44:22 +00:00
Zach Anderson f407419d0a [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_
This relands https://dart-review.googlesource.com/c/sdk/+/205633
but without renaming TARGET_OS_IPHONE to DART_TARGET_OS_IPHONE.
It also changes uses of TARGET_OS_IOS to
DART_TARGET_OS_MACOS_IOS to be consistent with the rest of the
VM.

TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.

Change-Id: Ie775c19dd23cfdf5f65e5ebc6ee4ec3a561676fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205860
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-02 19:06:45 +00:00
Slava Egorov 42164cc140 Revert "[vm] Prefix HOST_OS_* and TARGET_OS_* with DART_"
This reverts commit aa9201b76b.

Reason for revert: blocks G3 roll (b/192627187)

Original change's description:
> [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
>
> TargetConditionals.h for XCode 13 defines several
> TARGET_OS_* preprocessor symbols that confuse the
> Dart build. There is probably a more targeted fix
> for this, but renaming the symbols that Dart uses
> will also prevent this problem if more symbols
> are added to the platform headers in the future.
>
> See: https://github.com/dart-lang/sdk/issues/46499
>
> TEST=It builds.
> Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: Ib06ca418c7e9d3b4df62c72c033cd39f462f7667
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205790
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-07-02 14:02:02 +00:00
Zach Anderson aa9201b76b [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.
Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-07-02 06:02:48 +00:00
Ryan Macnak e2da2e21ca [build] Use .incbin to avoid horrible Clang assembler performance.
TEST=build
Change-Id: I46f8a5ef019d0afbf0de27533cd3f387ccdcbb54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205380
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-06-30 21:23:04 +00:00
Ryan Macnak 1ce169d940 [dartfuzz] Update generation to account for nullability.
Also fix bug where dartfuzz did not recognize and if without an else can fall through.

TEST=dartfuzz
Change-Id: I063a0315a0f3d8e2f7ae92dc81f3ef9feff49cb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204923
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-06-29 18:06:48 +00:00
Ryan Macnak fb5465c624 [vm] Remove unused compilation and type-feedback traces.
Reduces VM code size by about 33k.

TEST=ci
Change-Id: Ifc74284fa69fe209ebf12566ca81bda765f19057
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202863
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-06-21 23:47:50 +00:00
Konstantin Shcheglov ea358c3e56 Fix most lints in generated code, ignore some.
Change-Id: I8cbec49d99db9477fcfd761c150d28401863828b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-14 19:48:48 +00:00
Konstantin Shcheglov d4aef249b4 Fix using deprecated AnalysisSession APIs in dartfuzz.
Change-Id: I1d4ae47de90aa1465b009960e75de68ab3a9a317
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-05-14 17:12:38 +00:00
Konstantin Shcheglov ca8ea7b331 Fix most pedantic lints in dartfuzz.
There is a lot of violations in the generated code.
Will fix it separately.

Also, there are more deprecated package:analyzer API usage.
Will fix it separately.

Change-Id: Ib2ead22925df9a5012cd331c0fb5cf62946561bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-14 16:17:19 +00:00
Vyacheslav Egorov c6f69d8829 [runtime/tools] Fix clang-tidy invocation
c++17 should be passed to -std=... and not to -x option.

Change-Id: I13e21d0ec98bcebe2ca537903e1bd399e287852a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198401
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-05-06 09:04:22 +00:00
Alexander Thomas b5c63ce757 [infra] Migrate scripts to python3
* Migrate to python3; drop python support.
* Update Windows toolchain support.
* Remove some unused methods.
* Python 2.7 is still needed on Windows.
* Update gsutil to a version that supports python3.

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

TEST=Manually tested common user journeys.

Change-Id: I663a22b237a548bb82dc2e601e399e3bc3649211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192182
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-15 10:10:20 +00:00
Tess Strickland 8abbd1cfd2 [runtime/tools] Specify C++17 when running clang tidy.
Change-Id: I3545b1b5a7e205632cfda39e480119678264539d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195063
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-04-13 09:44:08 +00:00
Ryan Macnak a4fa50892d [dartfuzz] Add compressed pointer modes.
Change-Id: I2a3b3ae6c5d903e654ec73d5fc7f285f4fa73b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193082
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-29 15:56:21 +00:00
Ryan Macnak fa900734e2 [dartfuzz] Opt out of NNBD.
Currently all programs generated by Dart fuzz have NNBD errors.

Change-Id: I6f55447ad4c2986ae4ffceff8c88ba263d40e280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193081
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-25 20:06:40 +00:00
Vyacheslav Egorov fa12114202 [vm] Remove traces of LLVM backend
The code has been dead for quite some time.

TEST=ci

Change-Id: Iddcb63e14e9e4d95230f006ac05da64f444f0712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190024
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-03-09 20:37:20 +00:00
Daco Harkes d45fd0f9d5 [vm/ffi] Support inline arrays in Structs
Adds support for single dimension inline arrays in structs. Multi-
dimensional arrays will be supported in a future CL.

This CL adds:
- CFE static error checks for inline arrays.
- CFE transformations for inline arrays.
- VM consumption of inline array fields for NativeType.
- Test generator support for inline arrays + generated tests.

Previous CLs added support for inline arrays in:
- analyzer https://dart-review.googlesource.com/c/sdk/+/183684
  - updated in this CL to new API.
- ABI calculation https://dart-review.googlesource.com/c/sdk/+/183682

Closes: https://github.com/dart-lang/sdk/issues/35763

Open issue: https://github.com/dart-lang/sdk/issues/45101

CFE transformations are tested with expectation files:
TEST=pkg/front_end/testcases/(.*)/ffi_struct_inline_array.dart

Trampolines and CArray API are tested with end-to-end Dart tests:
TEST=tests/ffi(_2)/(.*)by_value(.*)test.dart
TEST=tests/ffi(_2)/inline_array_test.dart

Compile-time errors (both CFE and analyzer) are tested in:
TEST=tests/ffi(_2)/vmspecific_static_checks_test.dart

Change-Id: I014c0e4153f1b885638adce80de6ab3cac8e6bb2
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183640
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-24 13:02:45 +00:00
Daco Harkes 9f96aeda6f [test/ffi] Add C++ unit tests for all target ABIs
This CL introduces unit tests for the Native* classes in compiler/ffi
that can run for all supported target ABIs on any host architecture.

The unit tests are compiled for all target ABIs with
`tools/build.py run_ffi_unit_tests` and run for all target ABIs with
`tools/test.py ffi_unit`.

The unit test and tested code do not conceptually depend on having a
DartVM. The tests are compiled with a custom `dart::Zone` and
`platform/`. This enables compiling for all `TARGET_ARCH_*` and
`TARGET_OS_*` on any host, and running unit tests for all target ABIs
on any host.

Because the `run_ffi_unit_tests` executables do not include the DartVM
their build is quick (<10seconds) and they are small (~6MB) when
compared to `run_vm_tests` (~250MB).

The tests are added to the existing FFI QEMU bot to prevent adding an
extra bot which would add checkout overhead.

The unit tests themselves are set up to be fairly similar to vm/cc
tests. The only difference is the NativeCallingConvention tests which
are set up with `.expect` files for easy inspection and updating.

TEST=runtime/vm/compiler/ffi/native_calling_convention_test.cc
TEST=runtime/vm/compiler/ffi/native_location_test.cc
TEST=runtime/vm/compiler/ffi/native_type_test.cc

Change-Id: I7b8bf4de9ef070e7546472217e571a60362b9639
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171725
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-11-16 16:10:55 +00:00
Robert Nystrom 0e88702d1b Opt the verbose_gc_to_bmu tool out of null safety.
Change-Id: I67ee7afa11366ebe0a299ba5ed06047fe38e6605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167864
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-10-16 00:18:31 +00:00
Alexander Markov 07a2e99c68 Remove bytecode modes from DartFuzz
Change-Id: Ied5b9ec9c0f326b62df456dce810fcdcb0a4f4d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167841
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-15 19:01:37 +00:00
Leaf Petersen 745f112ef6 Opt out some files from null safety.
Opt an initial batch of files under samples, samples-dev,
utils, and runtime/tools/dartfuzz out of null safety in preparation
for switching the flag on by default.

Change-Id: Icdfd52a5a969e678a7205903332f73fe3841c223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166960
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2020-10-12 22:15:42 +00:00
Martin Kustermann 39577ea564 [vm] Remove (unused & deprecated) --package-root parameter from VM binaries and from tests (Platform.packageRoot always returns null)
Closes https://github.com/dart-lang/sdk/issues/41245

Change-Id: Idd7526199b4c2479297c58b05bc13efcb79d01e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152321
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-06-24 18:17:53 +00:00
pq 5619ec500e prefer “exclude” language for excluded entities
See for example:

* https://9to5google.com/2020/06/12/google-android-chrome-blacklist-blocklist-more-inclusive/
* https://thenextweb.com/dd/2020/06/15/github-plans-to-replace-racially-insensitive-terms-like-master-and-whitelist/


Change-Id: I51fe56bb7a09c5cc3280119e2c121aac86e44f8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151303
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-06-15 18:48:06 +00:00