dart-sdk/tests/ffi_2
Daco Harkes f21b7cafbc [vm/ffi] Adds param number in trampoline null error
Before: `NoSuchMethodError: The method 'FfiTrampoline' was called on
null.`
After: `Invalid argument(s): argument value for ':ffi_param2' is null`.

Makes the ArgumentNullError RTE lookup the name of the argument in the
code source map when reporting a null argument.

Makes the FFI call arguments and FFI callbacks use kArgumentError
instead of the default kNoSuchMethod so that we target this RTE instead.

This changes the Error type from `NoSuchMethodError` to `ArgumentError`.
Because `Error`s should not be caught [1], this is fine.

Since FFI trampolines are created from type arguments, the arguments do
not have names. The arguments are assigned names programmatically. See
the related bug.

Also, this CL cleans up the SourcePosition of the `CheckNullOptimized`,
it was never passed.

[1] https://dart.dev/guides/language/effective-dart/usage#dont-explicitly-catch-error-or-types-that-implement-it

TEST=tests/ffi/function_test.dart

Closes: https://github.com/dart-lang/sdk/issues/47094
Bug: https://github.com/dart-lang/sdk/issues/36780

Change-Id: I15e7de4d026e034bde0eda3ba7fe3785f0da5057
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,app-kernel-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212462
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-09-04 07:22:03 +00:00
..
aliasing_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
all_positive.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
allocator_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
analysis_options.yaml
callback_tests_utils.dart [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
calloc_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
coordinate.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
data_not_asan_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
data_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
dylib_isolates_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
dylib_utils.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
expando_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
extension_methods_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
external_typed_data_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
ffi_2.status [vm/concurrency] Enable more isolate tests, remove outdated TODOs, fix 2 tests 2021-07-16 07:51:58 +00:00
ffi_test_helpers.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
function_callbacks_many_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
function_callbacks_structs_by_value_generated_test.dart [vm/ffi] Update tests to cover MacOS arm64 after-struct alignment 2021-06-11 12:00:26 +00:00
function_callbacks_structs_by_value_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
function_callbacks_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
function_callbacks_very_many_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
function_structs_by_value_generated_test.dart [vm/ffi] Update tests to cover MacOS arm64 after-struct alignment 2021-06-11 12:00:26 +00:00
function_structs_test.dart [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
function_test.dart [vm/ffi] Adds param number in trampoline null error 2021-09-04 07:22:03 +00:00
function_very_many_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
hardfp_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
has_symbol_test.dart [vm/ffi] Add providesSymbol to DynamicLibrary 2021-06-02 16:01:43 +00:00
inline_array_multi_dimensional_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
inline_array_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
native_effect_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
negative_function_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
null_regress_39068_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
null_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
prepare_flutter_bundle.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_37254_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_39044_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_39063_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_39885_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_40537_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_43016_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_43693_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_44985_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_44986_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45189_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45198_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45507_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45988_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46004_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46085_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46127_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_flutter79441_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_jump_to_frame_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
sizeof_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
snapshot_test.dart [vm] Remove --experimental-enable-isolate-groups-jit, only guard via --enable-isolate-groups 2021-07-16 09:13:28 +00:00
stacktrace_regress_37910_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
structs_nested_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
structs_packed_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
structs_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
unaligned_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
variance_function_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
very_large_struct.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_dynamic_library_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_enable_ffi_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_exit_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_negative_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_test.dart [vm] Remove --experimental-enable-isolate-groups-jit, only guard via --enable-isolate-groups 2021-07-16 09:13:28 +00:00
vmspecific_function_gc_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_function_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_handle_dynamically_linked_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_handle_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_highmem_32bit_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_leaf_call_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
vmspecific_null_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_object_gc_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_37100_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_37511_callbacks_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_regress_37511_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_regress_37780_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_38993_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_send_port_id_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_static_checks_test.dart [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
vmspecific_variance_function_checks_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00