bde9578a39
Introduces the class `_Compound extends NativeType`, for sharing between `Struct` and `Union`. Does minimal changes to CFE and IL construction. Follow up refactor CLs rename everything. Bug: https://github.com/dart-lang/sdk/issues/38491 tools/test.py ffi ffi_2 TEST=tests/ffi(_2)/(.*)by_value_(*.)_test.dart Change-Id: I276ceb9249c20bd331c2f8b6ef64e35acb525e9c Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194765 Reviewed-by: Aske Simon Christensen <askesc@google.com>
44 lines
2.2 KiB
Plaintext
44 lines
2.2 KiB
Plaintext
library;
|
|
import self as self;
|
|
import "dart:ffi" as ffi;
|
|
import "dart:core" as core;
|
|
|
|
import "dart:ffi";
|
|
import "package:ffi/ffi.dart";
|
|
|
|
class Coordinate extends ffi::Struct {
|
|
@#C1
|
|
field core::double* x = null;
|
|
@#C1
|
|
field core::double* y = null;
|
|
field ffi::Pointer<self::Coordinate*>* next = null;
|
|
static factory allocate(ffi::Allocator* allocator, core::double* x, core::double* y, ffi::Pointer<self::Coordinate*>* next) → self::Coordinate* {
|
|
return let final self::Coordinate* #t1 = ffi::StructPointer|get#ref<self::Coordinate*>(ffi::AllocatorAlloc|call<self::Coordinate*>(allocator)) in block {
|
|
#t1.{self::Coordinate::x} = x;
|
|
#t1.{self::Coordinate::y} = y;
|
|
#t1.{self::Coordinate::next} = next;
|
|
} =>#t1;
|
|
}
|
|
abstract member-signature get _typedDataBase() → core::Object*; -> ffi::_Compound::_typedDataBase
|
|
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
|
|
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
|
|
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
|
|
abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
|
|
abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
|
|
abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
|
|
abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
|
|
abstract member-signature method toString() → core::String*; -> core::Object::toString
|
|
abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
|
|
abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
|
|
}
|
|
static method main() → dynamic {}
|
|
|
|
constants {
|
|
#C1 = ffi::Double {}
|
|
}
|
|
|
|
|
|
Constructor coverage from constants:
|
|
org-dartlang-testcase:///ffi_sample.dart:
|
|
- Double. (from org-dartlang-sdk:///sdk/lib/ffi/native_type.dart:122:9)
|