dart-lang / native

Dart packages related to FFI and native assets bundling.
BSD 3-Clause "New" or "Revised" License
82 stars 27 forks source link

☂️ Consider making certain JNI routines leaf functions #1106

Open HosseinYousefi opened 3 weeks ago

HosseinYousefi commented 3 weeks ago

For some of the routines, we can generate both the normal and the leaf versions, and call each one depending on the situation. For example Set<PrimitiveType>ArrayRegion could be fast depending on the length of the region, maybe it makes sense to conditionally call one or the other based on this.

Candidates:

For jnigen, users should be able to specify if a method is leaf or not, this can be done as a part of jnigen transformation. However simply:

cc/ @dcharkes