Definition: Intrinsic
Intrinsic methods in Java are ones that have a native implementation by default in the JDK. They will have a Java version but most of the time it will get inlined and and the intrinsic implementation will be called instead.
Note that what methods are made intrinsic may depend on the platform.
Examples of Intrinsic methods include Math functions (sin, cos, min, max). The full list is here.
Example
Code:
We run this method with the following jvm flags:
-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining
In the output we see the following:
@ 97 java.lang.Math::max (11 bytes) (intrinsic)
Woohoo! It got inlined with the intrinsic code.
No comments:
Post a Comment