blob: 91c4568a2287947ce540e7e867fbbca11d233e6a [file] [log] [blame]
library #lib;
import self as self;
import "dart:core" as core;
import "dart:ffi" as ffi;
import "dart:typed_data" as typ;
import "dart:ffi";
@#C6
final class Vec2d extends ffi::Struct {
synthetic constructor •() self::Vec2d
: super ffi::Struct::•()
;
constructor #fromTypedDataBase(synthesized core::Object #typedDataBase, synthesized core::int #offsetInBytes) → self::Vec2d
: super ffi::Struct::_fromTypedDataBase(#typedDataBase, #offsetInBytes)
;
constructor #fromTypedData(synthesized typ::TypedData #typedData, synthesized core::int #offset, synthesized core::int #sizeInBytes) → self::Vec2d
: super ffi::Struct::_fromTypedData(#typedData, #offset, #sizeInBytes)
;
@#C7
get x() core::double
return ffi::_loadDouble(this.{ffi::_Compound::_typedDataBase}{core::Object}, self::Vec2d::x#offsetOf.{core::num::+}(this.{ffi::_Compound::_offsetInBytes}{core::int}){(core::num) → core::num});
@#C7
set x(synthesized core::double #externalFieldValue) → void
return ffi::_storeDouble(this.{ffi::_Compound::_typedDataBase}{core::Object}, self::Vec2d::x#offsetOf.{core::num::+}(this.{ffi::_Compound::_offsetInBytes}{core::int}){(core::num) → core::num}, #externalFieldValue);
@#C7
get y() core::double
return ffi::_loadDouble(this.{ffi::_Compound::_typedDataBase}{core::Object}, self::Vec2d::y#offsetOf.{core::num::+}(this.{ffi::_Compound::_offsetInBytes}{core::int}){(core::num) → core::num});
@#C7
set y(synthesized core::double #externalFieldValue) → void
return ffi::_storeDouble(this.{ffi::_Compound::_typedDataBase}{core::Object}, self::Vec2d::y#offsetOf.{core::num::+}(this.{ffi::_Compound::_offsetInBytes}{core::int}){(core::num) → core::num}, #externalFieldValue);
@#C9
static get x#offsetOf() → core::int
return #C11.{core::List::[]}(ffi::_abi()){(core::int) → core::int};
@#C9
static get y#offsetOf() → core::int
return #C13.{core::List::[]}(ffi::_abi()){(core::int) → core::int};
@#C9
static get #sizeOf() → core::int
return #C15.{core::List::[]}(ffi::_abi()){(core::int) → core::int};
}
@#C20
final class MyUnion extends ffi::Union {
synthetic constructor •() self::MyUnion
: super ffi::Union::•()
;
constructor #fromTypedDataBase(synthesized core::Object #typedDataBase, synthesized core::int #offsetInBytes) → self::MyUnion
: super ffi::Union::_fromTypedDataBase(#typedDataBase, #offsetInBytes)
;
constructor #fromTypedData(synthesized typ::TypedData #typedData, synthesized core::int #offset, synthesized core::int #sizeInBytes) → self::MyUnion
: super ffi::Union::_fromTypedData(#typedData, #offset, #sizeInBytes)
;
get vector() self::Vec2d
return new self::Vec2d::#fromTypedDataBase(this.{ffi::_Compound::_typedDataBase}{core::Object}, self::MyUnion::vector#offsetOf.{core::num::+}(this.{ffi::_Compound::_offsetInBytes}{core::int}){(core::num) → core::num});
set vector(synthesized self::Vec2d #externalFieldValue) → void
return ffi::_memCopy(this.{ffi::_Compound::_typedDataBase}{core::Object}, self::MyUnion::vector#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}, #C15.{core::List::[]}(ffi::_abi()){(core::int) → core::int});
get indirectVector() ffi::Pointer<self::Vec2d>
return ffi::_loadPointer<self::Vec2d>(this.{ffi::_Compound::_typedDataBase}{core::Object}, self::MyUnion::indirectVector#offsetOf.{core::num::+}(this.{ffi::_Compound::_offsetInBytes}{core::int}){(core::num) → core::num});
set indirectVector(synthesized ffi::Pointer<self::Vec2d> #externalFieldValue) → void
return ffi::_storePointer<self::Vec2d>(this.{ffi::_Compound::_typedDataBase}{core::Object}, self::MyUnion::indirectVector#offsetOf.{core::num::+}(this.{ffi::_Compound::_offsetInBytes}{core::int}){(core::num) → core::num}, #externalFieldValue);
@#C9
static get vector#offsetOf() → core::int
return #C11.{core::List::[]}(ffi::_abi()){(core::int) → core::int};
@#C9
static get indirectVector#offsetOf() → core::int
return #C11.{core::List::[]}(ffi::_abi()){(core::int) → core::int};
@#C9
static get #sizeOf() → core::int
return #C15.{core::List::[]}(ffi::_abi()){(core::int) → core::int};
}
@#C26
static get aString() ffi::Pointer<ffi::Char>
return ffi::_loadPointer<ffi::Char>(ffi::Native::_addressOf<ffi::Pointer<ffi::Char>>(#C25), #C10);
static set aString(synthesized ffi::Pointer<ffi::Char> #externalFieldValue) → void
ffi::_storePointer<ffi::Char>(ffi::Native::_addressOf<ffi::Pointer<ffi::Char>>(#C25), #C10, #externalFieldValue);
@#C29
static get anInt() core::int
return ffi::_loadInt32(ffi::Native::_addressOf<ffi::Int32>(#C28), #C10);
static set anInt(synthesized core::int #externalFieldValue) → void
ffi::_storeInt32(ffi::Native::_addressOf<ffi::Int32>(#C28), #C10, #externalFieldValue);
@#C32
static get anotherInt() core::int
return ffi::_loadAbiSpecificInt<ffi::Int>(ffi::Native::_addressOf<ffi::Int>(#C31), #C10);
static set anotherInt(synthesized core::int #externalFieldValue) → void
ffi::_storeAbiSpecificInt<ffi::Int>(ffi::Native::_addressOf<ffi::Int>(#C31), #C10, #externalFieldValue);
@#C35
static get vector() self::Vec2d
return new self::Vec2d::#fromTypedDataBase(ffi::Native::_addressOf<self::Vec2d>(#C34), #C10);
@#C38
static get union() self::MyUnion
return new self::MyUnion::#fromTypedDataBase(ffi::Native::_addressOf<self::MyUnion>(#C37), #C10);
static set union(synthesized self::MyUnion #externalFieldValue) → void
ffi::_memCopy(ffi::Native::_addressOf<self::MyUnion>(#C37), #C10, #externalFieldValue.{ffi::_Compound::_typedDataBase}{core::Object}, #externalFieldValue.{ffi::_Compound::_offsetInBytes}{core::int}, self::MyUnion::#sizeOf);
@#C42
@#C45
static get manyNumbers() ffi::Array<ffi::Array<ffi::Array<ffi::Double>>>
return new ffi::Array::_<ffi::Array<ffi::Array<ffi::Double>>>(ffi::Native::_addressOf<ffi::Array<ffi::Array<ffi::Array<ffi::Double>>>>(#C44), #C10, #C39, #C46);
@#C42
static set manyNumbers(synthesized ffi::Array<ffi::Array<ffi::Array<ffi::Double>>> #externalFieldValue) → void
ffi::_memCopy(ffi::Native::_addressOf<ffi::Array<ffi::Array<ffi::Array<ffi::Double>>>>(#C44), #C10, #externalFieldValue.{ffi::_Compound::_typedDataBase}{core::Object}, #externalFieldValue.{ffi::_Compound::_offsetInBytes}{core::int}, #C48.{core::List::[]}(ffi::_abi()){(core::int) → core::int});
static method main() void {
core::print("first char of string: ${ffi::_loadAbiSpecificInt<ffi::Char>(self::aString, #C10)}");
core::print("global int: {${self::anInt}}");
self::aString = ffi::nullptr;
self::anInt = self::anInt.{core::num::+}(1){(core::num) core::int};
final self::Vec2d vec = self::vector;
core::print("(${vec.{self::Vec2d::x}{core::double}}, ${vec.{self::Vec2d::y}{core::double}})");
self::union.{self::MyUnion::indirectVector} = ffi::Native::_addressOf<self::Vec2d>(#C34);
core::print(ffi::Native::_addressOf<ffi::Int>(#C31));
core::print(ffi::Native::_addressOf<self::Vec2d>(#C34));
core::print(ffi::Native::_addressOf<self::MyUnion>(#C37));
final ffi::Array<ffi::Array<ffi::Array<ffi::Double>>> wholeArray = self::manyNumbers;
ffi::DoubleArray|[]=( block {
synthesized ffi::Array<dynamic> #array = ( block {
synthesized ffi::Array<dynamic> #array = wholeArray!;
synthesized core::int #index = 0!;
#array.{ffi::Array::_checkIndex}(#index){(core::int) → void};
synthesized core::int #singleElementSize = #C12;
synthesized core::int #elementSize = #singleElementSize.{core::num::*}(#array.{ffi::Array::_nestedDimensionsFlattened}{core::int}){(core::num) → core::num};
synthesized core::int #offset = #elementSize.{core::num::*}(#index){(core::num) → core::num};
} =>new ffi::Array::_<ffi::Array<ffi::Double>>(#array.{ffi::_Compound::_typedDataBase}{core::Object}, #array.{ffi::_Compound::_offsetInBytes}{core::int}.{core::num::+}(#offset){(core::num) → core::num}, #array.{ffi::Array::_nestedDimensionsFirst}{core::int}, #array.{ffi::Array::_nestedDimensionsRest}{core::List<core::int>}))!;
synthesized core::int #index = 1!;
#array.{ffi::Array::_checkIndex}(#index){(core::int) → void};
synthesized core::int #singleElementSize = #C12;
synthesized core::int #elementSize = #singleElementSize.{core::num::*}(#array.{ffi::Array::_nestedDimensionsFlattened}{core::int}){(core::num) → core::num};
synthesized core::int #offset = #elementSize.{core::num::*}(#index){(core::num) → core::num};
} =>new ffi::Array::_<ffi::Double>(#array.{ffi::_Compound::_typedDataBase}{core::Object}, #array.{ffi::_Compound::_offsetInBytes}{core::int}.{core::num::+}(#offset){(core::num) → core::num}, #array.{ffi::Array::_nestedDimensionsFirst}{core::int}, #array.{ffi::Array::_nestedDimensionsRest}{core::List<core::int>}), 2, 123.45);
self::manyNumbers = wholeArray;
ffi::DoubleArray|[]=( block {
synthesized ffi::Array<dynamic> #array = ( block {
synthesized ffi::Array<dynamic> #array = self::manyNumbers!;
synthesized core::int #index = 0!;
#array.{ffi::Array::_checkIndex}(#index){(core::int) → void};
synthesized core::int #singleElementSize = #C12;
synthesized core::int #elementSize = #singleElementSize.{core::num::*}(#array.{ffi::Array::_nestedDimensionsFlattened}{core::int}){(core::num) → core::num};
synthesized core::int #offset = #elementSize.{core::num::*}(#index){(core::num) → core::num};
} =>new ffi::Array::_<ffi::Array<ffi::Double>>(#array.{ffi::_Compound::_typedDataBase}{core::Object}, #array.{ffi::_Compound::_offsetInBytes}{core::int}.{core::num::+}(#offset){(core::num) → core::num}, #array.{ffi::Array::_nestedDimensionsFirst}{core::int}, #array.{ffi::Array::_nestedDimensionsRest}{core::List<core::int>}))!;
synthesized core::int #index = 0!;
#array.{ffi::Array::_checkIndex}(#index){(core::int) → void};
synthesized core::int #singleElementSize = #C12;
synthesized core::int #elementSize = #singleElementSize.{core::num::*}(#array.{ffi::Array::_nestedDimensionsFlattened}{core::int}){(core::num) → core::num};
synthesized core::int #offset = #elementSize.{core::num::*}(#index){(core::num) → core::num};
} =>new ffi::Array::_<ffi::Double>(#array.{ffi::_Compound::_typedDataBase}{core::Object}, #array.{ffi::_Compound::_offsetInBytes}{core::int}.{core::num::+}(#offset){(core::num) → core::num}, #array.{ffi::Array::_nestedDimensionsFirst}{core::int}, #array.{ffi::Array::_nestedDimensionsRest}{core::List<core::int>}), 0, 54.321);
}
constants {
#C1 = "vm:ffi:struct-fields"
#C2 = TypeLiteralConstant(ffi::Double)
#C3 = <core::Type>[#C2, #C2]
#C4 = null
#C5 = ffi::_FfiStructLayout {fieldTypes:#C3, packing:#C4}
#C6 = core::pragma {name:#C1, options:#C5}
#C7 = ffi::Double {}
#C8 = "vm:prefer-inline"
#C9 = core::pragma {name:#C8, options:#C4}
#C10 = 0
#C11 = <core::int>[#C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10, #C10]
#C12 = 8
#C13 = <core::int>[#C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12, #C12]
#C14 = 16
#C15 = <core::int>[#C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14, #C14]
#C16 = TypeLiteralConstant(self::Vec2d)
#C17 = TypeLiteralConstant(ffi::Pointer<core::Object>)
#C18 = <core::Type>[#C16, #C17]
#C19 = ffi::_FfiStructLayout {fieldTypes:#C18, packing:#C4}
#C20 = core::pragma {name:#C1, options:#C19}
#C21 = "cfe:ffi:native-marker"
#C22 = "aString"
#C23 = "#lib"
#C24 = false
#C25 = ffi::Native<ffi::Pointer<ffi::Char>> {symbol:#C22, assetId:#C23, isLeaf:#C24}
#C26 = core::pragma {name:#C21, options:#C25}
#C27 = "anInt"
#C28 = ffi::Native<ffi::Int32> {symbol:#C27, assetId:#C23, isLeaf:#C24}
#C29 = core::pragma {name:#C21, options:#C28}
#C30 = "anotherInt"
#C31 = ffi::Native<ffi::Int> {symbol:#C30, assetId:#C23, isLeaf:#C24}
#C32 = core::pragma {name:#C21, options:#C31}
#C33 = "vector"
#C34 = ffi::Native<self::Vec2d> {symbol:#C33, assetId:#C23, isLeaf:#C24}
#C35 = core::pragma {name:#C21, options:#C34}
#C36 = "union"
#C37 = ffi::Native<self::MyUnion> {symbol:#C36, assetId:#C23, isLeaf:#C24}
#C38 = core::pragma {name:#C21, options:#C37}
#C39 = 1
#C40 = 2
#C41 = 3
#C42 = ffi::_ArraySize<ffi::NativeType> {dimension1:#C39, dimension2:#C40, dimension3:#C41, dimension4:#C4, dimension5:#C4, dimensions:#C4}
#C43 = "manyNumbers"
#C44 = ffi::Native<ffi::Array<ffi::Array<ffi::Array<ffi::Double>>>> {symbol:#C43, assetId:#C23, isLeaf:#C24}
#C45 = core::pragma {name:#C21, options:#C44}
#C46 = <core::int>[#C40, #C41]
#C47 = 48
#C48 = <core::int>[#C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47, #C47]
}