dart-sdk/tests/ffi/ffi.status

119 lines
8.4 KiB
Plaintext
Raw Normal View History

# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
function_callbacks_structs_by_value_test: Pass, Slow # https://dartbug.com/47304 https://dartbug.com/45007
function_structs_by_value_generated_args_leaf_test: Pass, Slow # https://dartbug.com/47303 https://dartbug.com/45007
function_structs_by_value_generated_args_test: Pass, Slow # https://dartbug.com/47303 https://dartbug.com/45007
function_structs_by_value_generated_ret_arg_leaf_test: Pass, Slow # https://dartbug.com/47303 https://dartbug.com/45007
function_structs_by_value_generated_ret_arg_test: Pass, Slow # https://dartbug.com/47303 https://dartbug.com/45007
function_structs_by_value_generated_ret_leaf_test: Pass, Slow # https://dartbug.com/47303 https://dartbug.com/45007
function_structs_by_value_generated_ret_test: Pass, Slow # https://dartbug.com/47303 https://dartbug.com/45007
[ $builder_tag == optimization_counter_threshold ]
aliasing_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_callbacks_structs_by_value_generated_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_callbacks_structs_by_value_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_callbacks_very_many_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_structs_by_value_generated_args_leaf_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_structs_by_value_generated_args_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_structs_by_value_generated_ret_arg_leaf_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_structs_by_value_generated_ret_arg_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_structs_by_value_generated_ret_leaf_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_structs_by_value_generated_ret_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
function_very_many_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
hardfp_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
regress_43016_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
structs_nnbd_workaround_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
structs_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
variance_function_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
vmspecific_function_gc_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
vmspecific_function_test: SkipByDesign # Already has VMOptions=--optimization-counter-threshold
[ $compiler == app_jitk ]
native_assets/asset_*: SkipByDesign # Only intended to run from source. https://dartbug.com/51266
native_assets/infer_native_assets_yaml_*: SkipByDesign # Only intended to run from source. https://dartbug.com/51265
vmspecific_leaf_call_test: Skip # https://dartbug.com/46125: Snapshot fails to generate.
[ $mode == debug ]
function_callbacks_structs_by_value_generated_test: Pass, Slow
[ $mode == product ]
regress_47594_test: Skip # Profiler is not available in Product.
[vm/ffi] Update inner pointer accesses in IL FFI loads and stores via structs can have a TypedData as receiver, so this CL updates those loads to `kMayBeInnerPointer`. This CL adds an IL test to verify that for `Pointer` loads the untagged value is treated correctly as `kCannotBeInnerPointer`. (And adds some prefer-inline pragmas to make some common operations be inlined to avoid allocating `Pointer` objects.) This CL updates the load in the FFI closures to use a load-field. This can also potentially enable not allocating a pointer object when this closure is inlined. TEST=tests/ffi/unwrap_typeddata_generated_test.dart TEST=tests/ffi CoreLibraryReviewExempt: Only adding some pragmas. Change-Id: If687e54c676f275cc849b3fed526a13766ab331a Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349241 Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-02-01 18:28:53 +00:00
[ $nnbd == weak ]
vmspecific_pointer_load_il_test: SkipByDesign # Unsound NNBD boxes things because of nulls.
[ $system == android ]
*: Pass, Slow # https://github.com/dart-lang/sdk/issues/38489
regress_47594_test: Skip # DartDev is not available on Android.
[vm] Implement `NativeFinalizer` This CL implements `NativeFinalizer` in the GC. `FinalizerEntry`s are extended to track `external_size` and in which `Heap::Space` the finalizable value is. On attaching a native finalizer, the external size is added to the relevant heap. When the finalizable value is promoted from new to old space, the external size is promoted as well. And when a native finalizer is run or is detached, the external size is removed from the relevant heap again. In contrast to Dart `Finalizer`s, `NativeFinalizer`s are run on isolate shutdown. When the `NativeFinalizer`s themselves are collected, the finalizers are not run. Users should stick the native finalizer in a global variable to ensure finalization. We will revisit this design when we add send and exit support, because there is a design space to explore what to do in that case. This current solution promises the least to users. In this implementation native finalizers have a Dart entry to clean up the entries from the `all_entries` field of the finalizer. We should consider using another data structure that avoids the need for this Dart entry. See the TODO left in the code. Bug: https://github.com/dart-lang/sdk/issues/47777 TEST=runtime/tests/vm/dart(_2)/isolates/fast_object_copy_test.dart TEST=runtime/vm/object_test.cc TEST=tests/ffi(_2)/vmspecific_native_finalizer_* Change-Id: I8f594c80c3c344ad83e1f2de10de028eb8456121 Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64c-try,dart-sdk-mac-arm64-try,vm-kernel-mac-release-arm64-try,pkg-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-nnbd-win-release-ia32-try,vm-ffi-android-debug-arm-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,benchmark-linux-try,flutter-frontend-try,pkg-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236320 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-03-26 09:41:21 +00:00
vmspecific_native_finalizer_isolate_groups_test: Skip # SpawnUri not available on Android tester.
[vm/ffi] Update inner pointer accesses in IL FFI loads and stores via structs can have a TypedData as receiver, so this CL updates those loads to `kMayBeInnerPointer`. This CL adds an IL test to verify that for `Pointer` loads the untagged value is treated correctly as `kCannotBeInnerPointer`. (And adds some prefer-inline pragmas to make some common operations be inlined to avoid allocating `Pointer` objects.) This CL updates the load in the FFI closures to use a load-field. This can also potentially enable not allocating a pointer object when this closure is inlined. TEST=tests/ffi/unwrap_typeddata_generated_test.dart TEST=tests/ffi CoreLibraryReviewExempt: Only adding some pragmas. Change-Id: If687e54c676f275cc849b3fed526a13766ab331a Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349241 Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-02-01 18:28:53 +00:00
[ $system == fuchsia ]
async_void_function_callbacks_test/*: Skip # Test harness doesn't support multitest with Fuchsia
ffi_induce_a_crash_test/*: Skip # Test harness doesn't support multitest with Fuchsia
function_callbacks_many_test/*: Skip # Test harness doesn't support multitest with Fuchsia
function_callbacks_structs_by_value_generated_test/*: Skip # Test harness doesn't support multitest with Fuchsia
function_callbacks_structs_by_value_native_callable_generated_test/*: Skip # Test harness doesn't support multitest with Fuchsia
function_callbacks_subtype_test/*: Skip # Test harness doesn't support multitest with Fuchsia
native_assets/*: Skip # Source not available in the emulator
static_checks/*: SkipByDesign # Expecting compile time failures in multi tests doesn't work on the Fuchsia test runner.
unaligned_test/*: Skip # Test harness doesn't support multitest with Fuchsia
vmspecific_enable_ffi_test/*: Skip # Test harness doesn't support multitest with Fuchsia
vmspecific_function_callbacks_exit_test/*: Skip # Test harness doesn't support multitest with Fuchsia
vmspecific_highmem_32bit_test/*: Skip # Test harness doesn't support multitest with Fuchsia
vmspecific_leaf_call_test/*: Skip # Test harness doesn't support multitest with Fuchsia
[vm/ffi] Update inner pointer accesses in IL FFI loads and stores via structs can have a TypedData as receiver, so this CL updates those loads to `kMayBeInnerPointer`. This CL adds an IL test to verify that for `Pointer` loads the untagged value is treated correctly as `kCannotBeInnerPointer`. (And adds some prefer-inline pragmas to make some common operations be inlined to avoid allocating `Pointer` objects.) This CL updates the load in the FFI closures to use a load-field. This can also potentially enable not allocating a pointer object when this closure is inlined. TEST=tests/ffi/unwrap_typeddata_generated_test.dart TEST=tests/ffi CoreLibraryReviewExempt: Only adding some pragmas. Change-Id: If687e54c676f275cc849b3fed526a13766ab331a Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349241 Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-02-01 18:28:53 +00:00
vmspecific_pointer_load_il_test: SkipByDesign # Not bloating the Fuchsia test package with package:vm/testing/il_matchers.dart
[ $system == windows ]
regress_47594_test: Skip # DynamicLibrary.process() is not available on Windows.
[ $qemu ]
native_assets/*: SkipByDesign # Only intended to run on host oses with AOT binaries available, not available on QEMU.
[vm/ffi] `FfiNative` assets Adds support for `asset: 'asset-id'` in `FfiNative`s. Symbols in assets are resolved by 1. the provided [asset] (the bulk of this CL), 2. the native resolver set with `Dart_SetFfiNativeResolver` in `dart_api.h` (old behavior), and 3. the current process. Symbols in assets are resolved by the Dart VM through the mapping provided in the `vm:ffi:native_assets` library: ``` @pragma('vm:ffi:native-assets', { "linux_x64": { "<asset1>": [ "absolute", "<absolute-path>" ], "<asset2>": [ "relative", "<relative-path>" ], "<asset3>": [ "system", "<system-path>" ], "<asset4>": [ "process", ], "<asset5>": [ "executable", ], } }) library; ``` There are 5 asset path types. Symbols resolved in these asset types are resolved as follows. A. Absolute paths are dlopened, after which the symbol is looked up. B. Relative paths are resolved relative to `Platform.script.uri`, and dlopened, after which the symbol is looked up. C. System paths are treated as absolute paths. (But we might explicitly try to use `PATH` in the future.) D. Symbols looked up in Process assets are looked up in the current process. E. Symbols looked up in Executable assets are looked up in the current executable. The native assets mapping can be provided in three ways. X. In the invocation to `gen_kernel` with the `--native-assets` argument. This uses the gen_kernel entry point for compiling kernel. Y. By placing a `native_assets.yaml` next to the `package_config.json` used by the isolate group. This works for `dart <source file>` and `Isolate.spawnUri(<dart source file>)`. This uses the kernel_service entry point for compiling kernel. Z. By sending a String containing the native assets mapping when invoking the kernel_service directly from within the VM. Currently, only used for unit tests. TEST=tests/ffi/native_assets/asset_*_test.dart (X) TEST=tests/ffi/native_assets/infer_native_assets_yaml_*.dart (Y) TEST=runtime/vm/ffi/native_assets_test.cc (Z) The library is synthesized from yaml in pkg:vm as AST. Design doc: go/dart-native-assets Bug: https://github.com/dart-lang/sdk/issues/49803 Change-Id: I8bf7000bfcc03b362948efd3baf168838948e6b9 Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-precomp-nnbd-mac-release-arm64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264842 Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-01-18 21:08:38 +00:00
[ $simulator ]
*: Skip # FFI not yet supported on the arm simulator.
[ $compiler != dart2analyzer && $compiler != fasta && $runtime != dart_precompiled && $runtime != vm ]
*: SkipByDesign # FFI is a VM-only feature. (This test suite is part of the default set.)
[vm/ffi] Convert Objects to Dart_Handles in FFI calls This includes support for calling Dart_PropagateError in native code when doing FFI calls, and catching uncaught exceptions with Dart_IsError when doing FFI callbacks. The support for Dart_PropagateError adds a catch entry to the FFI trampoline, which prevents inlining these trampolines in AOT. This regresses the FfiCall benchmarks by 1-2% in AOT. In addition, Dart_PropagateError requires maintaining a bit whether we entered native/VM code from generated code through FFI or not. That way we can do the proper transition on the exception path. When entering generated code, we store this bit on the stack, right after the entry frame. Design: http://go/dart-ffi-handles Issue: https://github.com/dart-lang/sdk/issues/36858 Issue: https://github.com/dart-lang/sdk/issues/41319 Change-Id: Idfd7ff69132fb29cc730931a4113d914d4437396 Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145591 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-12 11:14:22 +00:00
[ $compiler == dartkp && $system == windows ]
vmspecific_ffi_native_handles_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
vmspecific_ffi_native_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
vmspecific_function_gc_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
[vm/ffi] Convert Objects to Dart_Handles in FFI calls This includes support for calling Dart_PropagateError in native code when doing FFI calls, and catching uncaught exceptions with Dart_IsError when doing FFI callbacks. The support for Dart_PropagateError adds a catch entry to the FFI trampoline, which prevents inlining these trampolines in AOT. This regresses the FfiCall benchmarks by 1-2% in AOT. In addition, Dart_PropagateError requires maintaining a bit whether we entered native/VM code from generated code through FFI or not. That way we can do the proper transition on the exception path. When entering generated code, we store this bit on the stack, right after the entry frame. Design: http://go/dart-ffi-handles Issue: https://github.com/dart-lang/sdk/issues/36858 Issue: https://github.com/dart-lang/sdk/issues/41319 Change-Id: Idfd7ff69132fb29cc730931a4113d914d4437396 Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145591 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-12 11:14:22 +00:00
vmspecific_handle_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
vmspecific_object_gc_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
vmspecific_regress_37100_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
vmspecific_regress_37511_callbacks_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
vmspecific_regress_37511_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
vmspecific_regress_37780_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
vmspecific_regress_51794_test: SkipByDesign # Symbols are not exposed on purpose and are not linked in Windows Precompiled. dartbug.com/40579
[vm/ffi] Convert Objects to Dart_Handles in FFI calls This includes support for calling Dart_PropagateError in native code when doing FFI calls, and catching uncaught exceptions with Dart_IsError when doing FFI callbacks. The support for Dart_PropagateError adds a catch entry to the FFI trampoline, which prevents inlining these trampolines in AOT. This regresses the FfiCall benchmarks by 1-2% in AOT. In addition, Dart_PropagateError requires maintaining a bit whether we entered native/VM code from generated code through FFI or not. That way we can do the proper transition on the exception path. When entering generated code, we store this bit on the stack, right after the entry frame. Design: http://go/dart-ffi-handles Issue: https://github.com/dart-lang/sdk/issues/36858 Issue: https://github.com/dart-lang/sdk/issues/41319 Change-Id: Idfd7ff69132fb29cc730931a4113d914d4437396 Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145591 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-12 11:14:22 +00:00
# These tests trigger and catch an abort (intentionally) and terminate the VM.
# They're incompatible with ASAN because not all memory is freed when aborting and
# with AppJit because the abort the VM before it can generate a snapshot.
[ $compiler == app_jitk || $sanitizer == asan ]
vmspecific_function_callbacks_exit_test: SkipByDesign
[ $compiler == dart2analyzer || $compiler == fasta ]
vmspecific_enable_ffi_test: SkipByDesign # This is a check for VM only.
[vm/ffi] ABI-specific integers This CL adds support for users defining integers which are mapped to differing sizes and signedness based on the application binary interface the Dart VM is running on. Notable implementation design decisions: - ABIs are open world, so that adding an ABI to the Dart VM does not break existing definitions. Thus, we only figure out in the VM that we're missing a mapping. We throw compile-time errors. - In AOT, these show up in the precompilation step. - In JIT, these show up as `_CompileTimeError` at runtime. Note that these can be caught. So in subsequent compilation steps we need to ensure that we also throw the same compile-time error. - We match on the call-sites (streaming_flowgraph_builder) rather than method bodies (kernel_to_il) of AbiSpecific loads and stores so that we can compile for the int-size of the call site. API design decisions: https://github.com/dart-lang/sdk/issues/42563#issuecomment-981774001 Closes: https://github.com/dart-lang/sdk/issues/42563 TEST=tests/ffi_2/abi_*_test.dart TEST=tests/ffi/function_*_generated_test.dart TEST=tests/ffi/vmspecific_static_checks_test.dart Change-Id: I8c8df36fab939b6fb614c5f1ee8e1bf46b6e9521 Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,benchmark-linux-try,dart-sdk-linux-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-fuchsia-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64c-try,vm-kernel-mac-debug-x64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221501 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-12-16 22:07:00 +00:00
[vm/ffi] `FfiNative` assets Adds support for `asset: 'asset-id'` in `FfiNative`s. Symbols in assets are resolved by 1. the provided [asset] (the bulk of this CL), 2. the native resolver set with `Dart_SetFfiNativeResolver` in `dart_api.h` (old behavior), and 3. the current process. Symbols in assets are resolved by the Dart VM through the mapping provided in the `vm:ffi:native_assets` library: ``` @pragma('vm:ffi:native-assets', { "linux_x64": { "<asset1>": [ "absolute", "<absolute-path>" ], "<asset2>": [ "relative", "<relative-path>" ], "<asset3>": [ "system", "<system-path>" ], "<asset4>": [ "process", ], "<asset5>": [ "executable", ], } }) library; ``` There are 5 asset path types. Symbols resolved in these asset types are resolved as follows. A. Absolute paths are dlopened, after which the symbol is looked up. B. Relative paths are resolved relative to `Platform.script.uri`, and dlopened, after which the symbol is looked up. C. System paths are treated as absolute paths. (But we might explicitly try to use `PATH` in the future.) D. Symbols looked up in Process assets are looked up in the current process. E. Symbols looked up in Executable assets are looked up in the current executable. The native assets mapping can be provided in three ways. X. In the invocation to `gen_kernel` with the `--native-assets` argument. This uses the gen_kernel entry point for compiling kernel. Y. By placing a `native_assets.yaml` next to the `package_config.json` used by the isolate group. This works for `dart <source file>` and `Isolate.spawnUri(<dart source file>)`. This uses the kernel_service entry point for compiling kernel. Z. By sending a String containing the native assets mapping when invoking the kernel_service directly from within the VM. Currently, only used for unit tests. TEST=tests/ffi/native_assets/asset_*_test.dart (X) TEST=tests/ffi/native_assets/infer_native_assets_yaml_*.dart (Y) TEST=runtime/vm/ffi/native_assets_test.cc (Z) The library is synthesized from yaml in pkg:vm as AST. Design doc: go/dart-native-assets Bug: https://github.com/dart-lang/sdk/issues/49803 Change-Id: I8bf7000bfcc03b362948efd3baf168838948e6b9 Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-precomp-nnbd-mac-release-arm64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264842 Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-01-18 21:08:38 +00:00
[ $compiler == dartk || $system == android ]
native_assets/asset_*: SkipByDesign # Only intended to run on host oses with AOT binaries available.
[ $compiler == dartkp || $system == android ]
native_assets/infer_native_assets_yaml_*: SkipByDesign # Only intended to run from source.
[vm/ffi] ABI-specific integers This CL adds support for users defining integers which are mapped to differing sizes and signedness based on the application binary interface the Dart VM is running on. Notable implementation design decisions: - ABIs are open world, so that adding an ABI to the Dart VM does not break existing definitions. Thus, we only figure out in the VM that we're missing a mapping. We throw compile-time errors. - In AOT, these show up in the precompilation step. - In JIT, these show up as `_CompileTimeError` at runtime. Note that these can be caught. So in subsequent compilation steps we need to ensure that we also throw the same compile-time error. - We match on the call-sites (streaming_flowgraph_builder) rather than method bodies (kernel_to_il) of AbiSpecific loads and stores so that we can compile for the int-size of the call site. API design decisions: https://github.com/dart-lang/sdk/issues/42563#issuecomment-981774001 Closes: https://github.com/dart-lang/sdk/issues/42563 TEST=tests/ffi_2/abi_*_test.dart TEST=tests/ffi/function_*_generated_test.dart TEST=tests/ffi/vmspecific_static_checks_test.dart Change-Id: I8c8df36fab939b6fb614c5f1ee8e1bf46b6e9521 Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,benchmark-linux-try,dart-sdk-linux-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-fuchsia-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-linux-debug-x64c-try,vm-kernel-mac-debug-x64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221501 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-12-16 22:07:00 +00:00
[ $compiler == dartkp || $arch == arm64 && $system == fuchsia ]
abi_specific_int_incomplete_jit_test: SkipByDesign # Only intended to run in JIT mode.
[ $compiler != dartkp || $arch == arm64 && $system == fuchsia ]
abi_specific_int_incomplete_aot_test: SkipByDesign # Only intended to run in AOT mode.
[ $runtime == dart_precompiled || $runtime == vm ]
callback_unwind_error_test: Crash # https://github.com/dart-lang/sdk/issues/39487
[ $sanitizer == asan || $sanitizer == msan || $sanitizer == tsan ]
data_not_asan_test: SkipByDesign # This test tries to allocate too much memory on purpose.