dcdfcc2b8d
This reverts commit1800039c2a. The changesfd2e9b9f1aandc20f9eaf6fare relanded as is. Reason for revert was fixed separately in https://dart-review.googlesource.com/c/sdk/+/341621 TEST=ci CoreLibraryReviewExempt: Implementation change only. Issue: https://github.com/dart-lang/sdk/issues/54172 Issue: https://github.com/dart-lang/sdk/issues/39692 Change-Id: I1a2324768502e5ffbce328127938c0d3c96c38ba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341642 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
64 lines
2.7 KiB
Plaintext
64 lines
2.7 KiB
Plaintext
library #lib;
|
|
import self as self;
|
|
import "dart:ffi" as ffi;
|
|
import "dart:core" as core;
|
|
import "dart:_internal" as _in;
|
|
|
|
import "dart:ffi";
|
|
|
|
static method testVoidNoArg() → dynamic {
|
|
final ffi::Pointer<ffi::NativeFunction<() → ffi::Void>> pointer = ffi::Pointer::fromAddress<ffi::NativeFunction<() → ffi::Void>>(3735928559);
|
|
final () → void function = block {
|
|
synthesized ffi::Pointer<ffi::NativeFunction<() → ffi::Void>> #ffiTarget0 = pointer;
|
|
@#C4
|
|
function #ffiClosure0() → void {
|
|
return ffi::_ffiCall<void>(#ffiTarget0);
|
|
}
|
|
} =>#ffiClosure0;
|
|
function(){() → void};
|
|
}
|
|
static method testIntInt() → dynamic {
|
|
final ffi::Pointer<ffi::NativeFunction<(ffi::Int64) → ffi::Int32>> pointer = ffi::Pointer::fromAddress<ffi::NativeFunction<(ffi::Int64) → ffi::Int32>>(3735928559);
|
|
final (core::int) → core::int function = block {
|
|
synthesized ffi::Pointer<ffi::NativeFunction<(ffi::Int64) → ffi::Int32>> #ffiTarget1 = pointer;
|
|
@#C6
|
|
function #ffiClosure1(core::int arg1) → core::int {
|
|
_in::_nativeEffect(arg1);
|
|
return ffi::_ffiCall<core::int>(#ffiTarget1);
|
|
}
|
|
} =>#ffiClosure1;
|
|
return function(42){(core::int) → core::int};
|
|
}
|
|
static method testLeaf5Args() → dynamic {
|
|
final ffi::Pointer<ffi::NativeFunction<(ffi::Int32, ffi::Int32, ffi::Int32, ffi::Int32, ffi::Int32) → ffi::Int32>> pointer = ffi::Pointer::fromAddress<ffi::NativeFunction<(ffi::Int32, ffi::Int32, ffi::Int32, ffi::Int32, ffi::Int32) → ffi::Int32>>(3735928559);
|
|
final (core::int, core::int, core::int, core::int, core::int) → core::int function = block {
|
|
synthesized ffi::Pointer<ffi::NativeFunction<(ffi::Int32, ffi::Int32, ffi::Int32, ffi::Int32, ffi::Int32) → ffi::Int32>> #ffiTarget2 = pointer;
|
|
@#C9
|
|
function #ffiClosure2(core::int arg1, core::int arg2, core::int arg3, core::int arg4, core::int arg5) → core::int {
|
|
_in::_nativeEffect(arg1);
|
|
_in::_nativeEffect(arg2);
|
|
_in::_nativeEffect(arg3);
|
|
_in::_nativeEffect(arg4);
|
|
_in::_nativeEffect(arg5);
|
|
return ffi::_ffiCall<core::int>(#ffiTarget2);
|
|
}
|
|
} =>#ffiClosure2;
|
|
return function(1, 2, 3, 4, 5){(core::int, core::int, core::int, core::int, core::int) → core::int};
|
|
}
|
|
static method main() → void {
|
|
self::testVoidNoArg();
|
|
self::testIntInt();
|
|
self::testLeaf5Args();
|
|
}
|
|
constants {
|
|
#C1 = "vm:ffi:call-closure"
|
|
#C2 = false
|
|
#C3 = ffi::_FfiCall<() → ffi::Void> {isLeaf:#C2}
|
|
#C4 = core::pragma {name:#C1, options:#C3}
|
|
#C5 = ffi::_FfiCall<(ffi::Int64) → ffi::Int32> {isLeaf:#C2}
|
|
#C6 = core::pragma {name:#C1, options:#C5}
|
|
#C7 = true
|
|
#C8 = ffi::_FfiCall<(ffi::Int32, ffi::Int32, ffi::Int32, ffi::Int32, ffi::Int32) → ffi::Int32> {isLeaf:#C7}
|
|
#C9 = core::pragma {name:#C1, options:#C8}
|
|
}
|