I've got two questions regarding instrinsics for J...
# compiler
l
I've got two questions regarding instrinsics for JVM targets: 1. Is there a way to get rid of all usages of
kotlin/jvm/Intrinsics
? `-Xno-call-assertions -Xno-param-assertions -Xno-receiver-assertions `do not cover checks on casts and equality check intrinsics in some places. 2. Has there been any consideration or is it already possible to tell the compiler to use intrinsics that work without the stdlib -
java.lang.Objects
comes to mind?
e
they can be stripped out with tools like proguard or r8, e.g. https://github.com/ephemient/utf-8b/blob/main/proguard-rules.txt#L11-L14 it may change the behavior of the code though, if NPEs get thrown on use instead of at entry
I guess you could try a simple bytecode transform to replace intrinsic null checks with Objects.requireNonNull? I don't know of any existing conversation around that
l
Thanks! I was almost done setting up R8 but then remembered that Java 24 came with the new ClassFile API. Nothing too fancy, but it was surprisingly straightforward. 🙂 https://github.com/Osmerion/Omittable/commit/4b88b572c03238df90549a3b24214a0c424c9fff