blob: d8ba7e5655ef1bd29ff98e488d86fc0945f8fb8c [file] [log] [blame]
library #lib /*isNonNullableByDefault*/;
import self as self;
import "dart:ffi" as ffi;
import "dart:core" as core;
import "dart:typed_data" as typ;
import "dart:_internal" as _in;
import "dart:ffi";
@#C49
@#C56
class WChar extends ffi::AbiSpecificInteger /*hasConstConstructor*/ {
const constructor •() self::WChar
: super ffi::AbiSpecificInteger::•()
;
@#C59
static get #sizeOf() → core::int*
return #C61.{core::List::[]}(ffi::_abi()){(core::int) → core::int*};
}
@#C66
class WCharStruct extends ffi::Struct {
synthetic constructor •() self::WCharStruct
: super ffi::Struct::•()
;
constructor #fromTypedDataBase(core::Object #typedDataBase) → self::WCharStruct
: super ffi::Struct::_fromTypedDataBase(#typedDataBase)
;
@#C67
get a0() core::int
return ffi::_loadAbiSpecificInt<self::WChar>(this.{ffi::_Compound::_typedDataBase}{core::Object}, #C68.{core::List::[]}(ffi::_abi()){(core::int) → core::int*});
@#C67
set a0(core::int #externalFieldValue) → void
return ffi::_storeAbiSpecificInt<self::WChar>(this.{ffi::_Compound::_typedDataBase}{core::Object}, #C68.{core::List::[]}(ffi::_abi()){(core::int) → core::int*}, #externalFieldValue);
@#C67
get a1() core::int
return ffi::_loadAbiSpecificInt<self::WChar>(this.{ffi::_Compound::_typedDataBase}{core::Object}, #C61.{core::List::[]}(ffi::_abi()){(core::int) → core::int*});
@#C67
set a1(core::int #externalFieldValue) → void
return ffi::_storeAbiSpecificInt<self::WChar>(this.{ffi::_Compound::_typedDataBase}{core::Object}, #C61.{core::List::[]}(ffi::_abi()){(core::int) → core::int*}, #externalFieldValue);
@#C59
static get #sizeOf() → core::int*
return #C70.{core::List::[]}(ffi::_abi()){(core::int) → core::int*};
}
@#C75
class WCharArrayStruct extends ffi::Struct {
synthetic constructor •() self::WCharArrayStruct
: super ffi::Struct::•()
;
constructor #fromTypedDataBase(core::Object #typedDataBase) → self::WCharArrayStruct
: super ffi::Struct::_fromTypedDataBase(#typedDataBase)
;
@#C76
get a0() ffi::Array<self::WChar>
return new ffi::Array::_<self::WChar>( block {
core::Object #typedDataBase = this.{ffi::_Compound::_typedDataBase}{core::Object};
core::int #offset = #C68.{core::List::[]}(ffi::_abi()){(core::int) → core::int*};
} =>#typedDataBase is ffi::Pointer<dynamic> ?{core::Object} ffi::_fromAddress<self::WChar>(#typedDataBase.{ffi::Pointer::address}{core::int}.{core::num::+}(#offset){(core::num) core::num}) : let typ::TypedData #typedData = _in::unsafeCast<typ::TypedData>(#typedDataBase) in #typedData.{typ::TypedData::buffer}{typ::ByteBuffer}.{typ::ByteBuffer::asUint8List}(#typedData.{typ::TypedData::offsetInBytes}{core::int}.{core::num::+}(#offset){(core::num) → core::num}, #C80.{core::List::[]}(ffi::_abi()){(core::int) → core::int*}){([core::int, core::int?]) → typ::Uint8List}, #C71, #C81);
@#C76
set a0(ffi::Array<self::WChar> #externalFieldValue) → void
return ffi::_memCopy(this.{ffi::_Compound::_typedDataBase}{core::Object}, #C68.{core::List::[]}(ffi::_abi()){(core::int) → core::int*}, #externalFieldValue.{ffi::Array::_typedDataBase}{core::Object}, #C1, #C80.{core::List::[]}(ffi::_abi()){(core::int) → core::int*});
@#C59
static get #sizeOf() → core::int*
return #C80.{core::List::[]}(ffi::_abi()){(core::int) → core::int*};
}
class _DummyAllocator extends core::Object implements ffi::Allocator /*hasConstConstructor*/ {
const constructor •() self::_DummyAllocator
: super core::Object::•()
;
@#C82
method allocate<T extends ffi::NativeType>(core::int byteCount, {core::int? alignment = #C58}) → ffi::Pointer<self::_DummyAllocator::allocate::T> {
return ffi::Pointer::fromAddress<self::_DummyAllocator::allocate::T>(0);
}
@#C82
method free(ffi::Pointer<ffi::NativeType> pointer) void {}
}
static const field self::_DummyAllocator noAlloc = #C83;
static method main() void {
self::testSizeOf();
self::testStoreLoad();
self::testStoreLoadIndexed();
self::testStruct();
self::testInlineArray();
}
static method testSizeOf() void {
final core::int size = self::WChar::#sizeOf;
core::print(size);
}
static method testStoreLoad() void {
final ffi::Pointer<self::WChar> p = #C83.{ffi::Allocator::allocate}<self::WChar>(self::WChar::#sizeOf){(core::int, {alignment: core::int?}) → ffi::Pointer<self::WChar>};
ffi::_storeAbiSpecificInt<self::WChar>(p, #C1, 10);
core::print(ffi::_loadAbiSpecificInt<self::WChar>(p, #C1));
#C83.{self::_DummyAllocator::free}(p){(ffi::Pointer<ffi::NativeType>) → void};
}
static method testStoreLoadIndexed() void {
final ffi::Pointer<self::WChar> p = #C83.{ffi::Allocator::allocate}<self::WChar>(2.{core::num::*}(self::WChar::#sizeOf){(core::num) → core::num}){(core::int, {alignment: core::int?}) → ffi::Pointer<self::WChar>};
ffi::_storeAbiSpecificIntAtIndex<self::WChar>(p, 0, 10);
ffi::_storeAbiSpecificIntAtIndex<self::WChar>(p, 1, 3);
core::print(ffi::_loadAbiSpecificIntAtIndex<self::WChar>(p, 0));
core::print(ffi::_loadAbiSpecificIntAtIndex<self::WChar>(p, 1));
#C83.{self::_DummyAllocator::free}(p){(ffi::Pointer<ffi::NativeType>) → void};
}
static method testStruct() void {
final ffi::Pointer<self::WCharStruct> p = #C83.{ffi::Allocator::allocate}<self::WCharStruct>(self::WCharStruct::#sizeOf){(core::int, {alignment: core::int?}) → ffi::Pointer<self::WCharStruct>};
new self::WCharStruct::#fromTypedDataBase(p!).{self::WCharStruct::a0} = 1;
core::print(new self::WCharStruct::#fromTypedDataBase(p!).{self::WCharStruct::a0}{core::int});
new self::WCharStruct::#fromTypedDataBase(p!).{self::WCharStruct::a0} = 2;
core::print(new self::WCharStruct::#fromTypedDataBase(p!).{self::WCharStruct::a0}{core::int});
#C83.{self::_DummyAllocator::free}(p){(ffi::Pointer<ffi::NativeType>) → void};
}
static method testInlineArray() void {
final ffi::Pointer<self::WCharArrayStruct> p = #C83.{ffi::Allocator::allocate}<self::WCharArrayStruct>(self::WCharArrayStruct::#sizeOf){(core::int, {alignment: core::int?}) → ffi::Pointer<self::WCharArrayStruct>};
final ffi::Array<self::WChar> array = new self::WCharArrayStruct::#fromTypedDataBase(p!).{self::WCharArrayStruct::a0}{ffi::Array<self::WChar>};
for (core::int i = 0; i.{core::num::<}(100){(core::num) core::bool}; i = i.{core::num::+}(1){(core::num) core::int}) {
ffi::_storeAbiSpecificIntAtIndex<self::WChar>(array.{ffi::Array::_typedDataBase}{core::Object}, i, i);
}
for (core::int i = 0; i.{core::num::<}(100){(core::num) core::bool}; i = i.{core::num::+}(1){(core::num) core::int}) {
core::print(ffi::_loadAbiSpecificIntAtIndex<self::WChar>(array.{ffi::Array::_typedDataBase}{core::Object}, i));
}
#C83.{self::_DummyAllocator::free}(p){(ffi::Pointer<ffi::NativeType>) → void};
}
constants {
#C1 = 0
#C2 = "android"
#C3 = ffi::_OS {index:#C1, _name:#C2}
#C4 = "arm"
#C5 = ffi::_Architecture {index:#C1, _name:#C4}
#C6 = ffi::Abi {_os:#C3, _architecture:#C5}
#C7 = ffi::Uint32 {}
#C8 = 1
#C9 = "arm64"
#C10 = ffi::_Architecture {index:#C8, _name:#C9}
#C11 = ffi::Abi {_os:#C3, _architecture:#C10}
#C12 = 2
#C13 = "ia32"
#C14 = ffi::_Architecture {index:#C12, _name:#C13}
#C15 = ffi::Abi {_os:#C3, _architecture:#C14}
#C16 = 3
#C17 = "x64"
#C18 = ffi::_Architecture {index:#C16, _name:#C17}
#C19 = ffi::Abi {_os:#C3, _architecture:#C18}
#C20 = "fuchsia"
#C21 = ffi::_OS {index:#C8, _name:#C20}
#C22 = ffi::Abi {_os:#C21, _architecture:#C10}
#C23 = ffi::Uint64 {}
#C24 = ffi::Abi {_os:#C21, _architecture:#C18}
#C25 = "ios"
#C26 = ffi::_OS {index:#C12, _name:#C25}
#C27 = ffi::Abi {_os:#C26, _architecture:#C5}
#C28 = ffi::Abi {_os:#C26, _architecture:#C10}
#C29 = ffi::Abi {_os:#C26, _architecture:#C18}
#C30 = "linux"
#C31 = ffi::_OS {index:#C16, _name:#C30}
#C32 = ffi::Abi {_os:#C31, _architecture:#C5}
#C33 = ffi::Abi {_os:#C31, _architecture:#C10}
#C34 = ffi::Abi {_os:#C31, _architecture:#C14}
#C35 = ffi::Abi {_os:#C31, _architecture:#C18}
#C36 = 4
#C37 = "macos"
#C38 = ffi::_OS {index:#C36, _name:#C37}
#C39 = ffi::Abi {_os:#C38, _architecture:#C10}
#C40 = ffi::Abi {_os:#C38, _architecture:#C18}
#C41 = 5
#C42 = "windows"
#C43 = ffi::_OS {index:#C41, _name:#C42}
#C44 = ffi::Abi {_os:#C43, _architecture:#C10}
#C45 = ffi::Uint16 {}
#C46 = ffi::Abi {_os:#C43, _architecture:#C14}
#C47 = ffi::Abi {_os:#C43, _architecture:#C18}
#C48 = <ffi::Abi*, ffi::NativeType*>{#C6:#C7, #C11:#C7, #C15:#C7, #C19:#C7, #C22:#C23, #C24:#C7, #C27:#C7, #C28:#C7, #C29:#C7, #C32:#C7, #C33:#C7, #C34:#C7, #C35:#C7, #C39:#C7, #C40:#C7, #C44:#C45, #C46:#C45, #C47:#C45)
#C49 = ffi::AbiSpecificIntegerMapping {mapping:#C48}
#C50 = "vm:ffi:abi-specific-mapping"
#C51 = TypeLiteralConstant(ffi::Uint32)
#C52 = TypeLiteralConstant(ffi::Uint64)
#C53 = TypeLiteralConstant(ffi::Uint16)
#C54 = <core::Type?>[#C51, #C51, #C51, #C51, #C52, #C51, #C51, #C51, #C51, #C51, #C51, #C51, #C51, #C51, #C51, #C53, #C53, #C53]
#C55 = ffi::_FfiAbiSpecificMapping {nativeTypes:#C54}
#C56 = core::pragma {name:#C50, options:#C55}
#C57 = "vm:prefer-inline"
#C58 = null
#C59 = core::pragma {name:#C57, options:#C58}
#C60 = 8
#C61 = <core::int*>[#C36, #C36, #C36, #C36, #C60, #C36, #C36, #C36, #C36, #C36, #C36, #C36, #C36, #C36, #C36, #C12, #C12, #C12]
#C62 = "vm:ffi:struct-fields"
#C63 = TypeLiteralConstant(self::WChar)
#C64 = <core::Type>[#C63, #C63]
#C65 = ffi::_FfiStructLayout {fieldTypes:#C64, packing:#C58}
#C66 = core::pragma {name:#C62, options:#C65}
#C67 = self::WChar {}
#C68 = <core::int*>[#C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1, #C1]
#C69 = 16
#C70 = <core::int*>[#C60, #C60, #C60, #C60, #C69, #C60, #C60, #C60, #C60, #C60, #C60, #C60, #C60, #C60, #C60, #C36, #C36, #C36]
#C71 = 100
#C72 = ffi::_FfiInlineArray {elementType:#C63, length:#C71}
#C73 = <core::Type>[#C72]
#C74 = ffi::_FfiStructLayout {fieldTypes:#C73, packing:#C58}
#C75 = core::pragma {name:#C62, options:#C74}
#C76 = ffi::_ArraySize<ffi::NativeType*> {dimension1:#C71, dimension2:#C58, dimension3:#C58, dimension4:#C58, dimension5:#C58, dimensions:#C58}
#C77 = 400
#C78 = 800
#C79 = 200
#C80 = <core::int*>[#C77, #C77, #C77, #C77, #C78, #C77, #C77, #C77, #C77, #C77, #C77, #C77, #C77, #C77, #C77, #C79, #C79, #C79]
#C81 = <core::int*>[]
#C82 = core::_Override {}
#C83 = self::_DummyAllocator {}
}