[vm/ffi] Array accesses & asTypedList both require static calls #51976
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-ffi
P3
A lower priority bug or feature request
triaged
Issue has been triaged by sub team
type-performance
Issue relates to performance or code size
Ideally these three functions should generate the same IL:
IL as of
Dart SDK version: 3.0.0-400.0.dev (dev) (Sun Apr 2 19:08:38 2023 -0700) on "linux_x64"
Pointer<OAM>
:Pointer<Uint64> + asTypedList
:Pointer<Uint64>
:The issues stem from lack of inlining for struct getters & setters, asTypedList, and Uint64Array operator[]. Ideally the object allocations and bounds checks can be dropped once the compiler is able to see through them. Not a VM expert, but I was thinking that there could be a graph intrinsic in dart:_internal that can output a GenericCheckBound instruction, which could then be used in ffi_patch to make the resulting IL for Uint64Array operator[] smaller.
cc @dcharkes
The text was updated successfully, but these errors were encountered: