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